prepare to add updateText function

This commit is contained in:
arcan1s
2014-05-24 14:15:48 +04:00
parent 23cd74132a
commit 7c5e02217b
8 changed files with 40 additions and 9 deletions

View File

@ -109,6 +109,8 @@ class pyTextWidget(plasmascript.Applet):
QObject.connect(self.ptmActions['ksysguard'], SIGNAL("triggered(bool)"), self.runKsysguard)
self.ptmActions['readme'] = QAction(i18n("Show README"), self)
QObject.connect(self.ptmActions['readme'], SIGNAL("triggered(bool)"), self.showReadme)
self.ptmActions['update'] = QAction(i18n("Update text"), self)
QObject.connect(self.ptmActions['update'], SIGNAL("triggered(bool)"), self.updateText)
def contextualActions(self):
@ -116,6 +118,7 @@ class pyTextWidget(plasmascript.Applet):
contextMenu = []
contextMenu.append(self.ptmActions['ksysguard'])
contextMenu.append(self.ptmActions['readme'])
contextMenu.append(self.ptmActions['update'])
return contextMenu
@ -147,6 +150,10 @@ class pyTextWidget(plasmascript.Applet):
os.system("kioclient exec " + str(filePath) + " &")
def updateText(self):
"""function to force update text"""
# internal functions
def addDiskDevice(self, sourceName):
diskRegexp = QRegExp("disk/(?:md|sd|hd)[a-z|0-9]_.*/Rate/(?:rblk)")