24 # Start-Of-Header |
22 # Start-Of-Header |
25 name = "MQTT Monitor Plugin" |
23 name = "MQTT Monitor Plugin" |
26 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
24 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
27 autoactivate = True |
25 autoactivate = True |
28 deactivateable = True |
26 deactivateable = True |
29 version = "1.2.3" |
27 version = "2.0.0" |
30 className = "MqttMonitorPlugin" |
28 className = "MqttMonitorPlugin" |
31 packageName = "MqttMonitor" |
29 packageName = "MqttMonitor" |
32 shortDescription = "Plug-in implementing a tool to connect to a MQTT broker" |
30 shortDescription = "Plug-in implementing a tool to connect to a MQTT broker" |
33 longDescription = ( |
31 longDescription = ( |
34 """Plug-in implementing a tool to connect to a MQTT broker, subscribe""" |
32 """Plug-in implementing a tool to connect to a MQTT broker, subscribe""" |
60 version = paho.mqtt.__version__ |
57 version = paho.mqtt.__version__ |
61 except ImportError: |
58 except ImportError: |
62 version = QCoreApplication.translate( |
59 version = QCoreApplication.translate( |
63 "MqttMonitorPlugin", "(package not available)") |
60 "MqttMonitorPlugin", "(package not available)") |
64 |
61 |
65 data = { |
62 return { |
66 "programEntry": False, |
63 "programEntry": False, |
67 "header": QCoreApplication.translate("MqttMonitorPlugin", "MQTT"), |
64 "header": QCoreApplication.translate("MqttMonitorPlugin", "MQTT"), |
68 "text": QCoreApplication.translate("MqttMonitorPlugin", "paho-mqtt"), |
65 "text": QCoreApplication.translate("MqttMonitorPlugin", "paho-mqtt"), |
69 "version": version, |
66 "version": version, |
70 } |
67 } |
71 |
|
72 return data |
|
73 |
68 |
74 |
69 |
75 def prepareUninstall(): |
70 def prepareUninstall(): |
76 """ |
71 """ |
77 Module function to prepare for an uninstallation. |
72 Module function to prepare for an uninstallation. |
136 from PyQt5.QtGui import QPalette |
131 from PyQt5.QtGui import QPalette |
137 palette = e5App().palette() |
132 palette = e5App().palette() |
138 lightness = palette.color(QPalette.Window).lightness() |
133 lightness = palette.color(QPalette.Window).lightness() |
139 usesDarkPalette = lightness <= 128 |
134 usesDarkPalette = lightness <= 128 |
140 if usesDarkPalette: |
135 if usesDarkPalette: |
141 iconSuffix = "dark" |
136 iconSuffix = "dark" |
142 else: |
137 else: |
143 iconSuffix = "light" |
138 iconSuffix = "light" |
144 |
139 |
145 self.__widget = MqttMonitorWidget(self, iconSuffix) |
140 self.__widget = MqttMonitorWidget(self, iconSuffix) |
146 self.__ui.addSideWidget( |
141 self.__ui.addSideWidget( |