24 # Start-Of-Header |
24 # Start-Of-Header |
25 name = "MQTT Monitor Plugin" |
25 name = "MQTT Monitor Plugin" |
26 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
26 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
27 autoactivate = True |
27 autoactivate = True |
28 deactivateable = True |
28 deactivateable = True |
29 version = "1.1.2" |
29 version = "1.2.0" |
30 className = "MqttMonitorPlugin" |
30 className = "MqttMonitorPlugin" |
31 packageName = "MqttMonitor" |
31 packageName = "MqttMonitor" |
32 shortDescription = "Plug-in implementing a tool to connect to a MQTT broker" |
32 shortDescription = "Plug-in implementing a tool to connect to a MQTT broker" |
33 longDescription = ( |
33 longDescription = ( |
34 """Plug-in implementing a tool to connect to a MQTT broker, subscribe""" |
34 """Plug-in implementing a tool to connect to a MQTT broker, subscribe""" |
128 error = self.tr("The 'paho-mqtt' package is not available.") |
128 error = self.tr("The 'paho-mqtt' package is not available.") |
129 return None, False |
129 return None, False |
130 |
130 |
131 from MqttMonitor.MqttMonitorWidget import MqttMonitorWidget |
131 from MqttMonitor.MqttMonitorWidget import MqttMonitorWidget |
132 |
132 |
133 self.__widget = MqttMonitorWidget(self) |
133 try: |
|
134 usesDarkPalette = e5App().usesDarkPalette() |
|
135 except AttributeError: |
|
136 from PyQt5.QtGui import QPalette |
|
137 palette = self.palette() |
|
138 lightness = palette.color(QPalette.Window).lightness() |
|
139 usesDarkPalette = lightness <= 128 |
|
140 if usesDarkPalette: |
|
141 iconSuffix = "dark" |
|
142 else: |
|
143 iconSuffix = "light" |
|
144 |
|
145 self.__widget = MqttMonitorWidget(self, iconSuffix) |
134 self.__ui.addSideWidget( |
146 self.__ui.addSideWidget( |
135 self.__ui.RightSide, self.__widget, |
147 self.__ui.RightSide, self.__widget, |
136 UI.PixmapCache.getIcon( |
148 UI.PixmapCache.getIcon( |
137 os.path.join("MqttMonitor", "icons", "mqtt22.png")), |
149 os.path.join("MqttMonitor", "icons", |
|
150 "mqtt22-{0}".format(iconSuffix))), |
138 self.tr("MQTT Monitor")) |
151 self.tr("MQTT Monitor")) |
139 |
152 |
140 self.__activateAct = E5Action( |
153 self.__activateAct = E5Action( |
141 self.tr('MQTT Monitor'), |
154 self.tr('MQTT Monitor'), |
142 self.tr('M&QTT Monitor'), |
155 self.tr('M&QTT Monitor'), |