diff --git a/py-text-monitor-1.3.4.plasmoid b/py-text-monitor-1.3.4.plasmoid index 7fa024c..f7100d6 100644 Binary files a/py-text-monitor-1.3.4.plasmoid and b/py-text-monitor-1.3.4.plasmoid differ diff --git a/source/contents/code/dataengine.py b/source/contents/code/dataengine.py index 5091ddd..9797dfc 100644 --- a/source/contents/code/dataengine.py +++ b/source/contents/code/dataengine.py @@ -61,7 +61,7 @@ class DataEngine: self.parent.systemmonitor.connectSource("network/interfaces/"+self.parent.netdev+"/receiver/data", self.parent, self.parent.interval) def dataUpdated(self, sourceName, data): - """function to refresh data""" + """function to update data""" try: if (sourceName == "system/uptime"): value = int(round(float(data[QString(u'value')]), 1)) @@ -231,5 +231,7 @@ class DataEngine: line = self.parent.hddtempFormat text = self.parent.formatLine.split('$LINE')[0] + line + self.parent.formatLine.split('$LINE')[1] self.parent.label_hddtemp.setText(text) + + self.parent.update() except: pass diff --git a/source/contents/code/main.py b/source/contents/code/main.py index a6aa783..90008e1 100644 --- a/source/contents/code/main.py +++ b/source/contents/code/main.py @@ -51,12 +51,17 @@ class pyTextWidget(plasmascript.Applet): def initTooltip(self): """function to create tooltip""" self.tooltip = Plasma.ToolTipContent() - self.tooltip.setMainText("PyTetMonitor") + self.tooltip.setMainText("PyTextMonitor") self.tooltip.setSubText('') Plasma.ToolTipManager.self().registerWidget(self.applet) # show tooltip #Plasma.ToolTipManager.self().setContent(self.applet, self.tooltip) + + def mouseDoubleClickEvent(self, event): + """function to doubleclick event""" + os.system("ksysguard") + def setupNetdev(self): """function to setup network device""" @@ -102,7 +107,7 @@ class pyTextWidget(plasmascript.Applet): self.timer.start() self.updateLabel() self.tooltip.setSubText('') - except Exception as (strerror): + except Exception as strerror: self.tooltip.setSubText(str(strerror)) self.label_error = Plasma.Label(self.applet) self.label_error.setText('ERROR') diff --git a/source/contents/code/reinit.py b/source/contents/code/reinit.py index 6d6e18f..0b0efac 100644 --- a/source/contents/code/reinit.py +++ b/source/contents/code/reinit.py @@ -277,7 +277,13 @@ class Reinit(): self.parent.resize(10,10) # create dataengines - self.parent.dataengine.connectToEngine() + label_start = True + while label_start: + try: + self.parent.dataengine.connectToEngine() + label_start = False + except: + pass self.parent.timer.setInterval(self.parent.interval) self.parent.startPolling() diff --git a/source/metadata.desktop b/source/metadata.desktop index 0e36a91..f2180cb 100644 --- a/source/metadata.desktop +++ b/source/metadata.desktop @@ -7,7 +7,7 @@ Icon=utilities-system-monitor X-Plasma-API=python X-Plasma-MainScript=code/main.py -X-Plasma-RequiredExtensions=FileDialog,LaunchApp,LocalIO +X-Plasma-RequiredExtensions=LaunchApp,LocalIO,FileDialog X-KDE-PluginInfo-Author=Evgeniy Alexeev aka arcanis X-KDE-PluginInfo-Email=esalexeev@gmail.com