mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 23:47:20 +00:00
+ added double click event
* fix yet anoter plasma crash
This commit is contained in:
parent
c4312b4d63
commit
96329d3598
Binary file not shown.
@ -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
|
||||
|
@ -51,13 +51,18 @@ 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"""
|
||||
self.netdev = "lo"
|
||||
@ -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('<font color="red">ERROR</font>')
|
||||
|
@ -277,7 +277,13 @@ class Reinit():
|
||||
self.parent.resize(10,10)
|
||||
|
||||
# create dataengines
|
||||
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()
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user