mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 23:47:20 +00:00
added support of text update contextual action
This commit is contained in:
parent
7c5e02217b
commit
62164f8229
@ -75,9 +75,6 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
"""function to initializate widget"""
|
"""function to initializate widget"""
|
||||||
self._name = str(self.package().metadata().pluginName())
|
self._name = str(self.package().metadata().pluginName())
|
||||||
self.setupVar()
|
self.setupVar()
|
||||||
# actions
|
|
||||||
self.createActions()
|
|
||||||
|
|
||||||
|
|
||||||
self.dataengine = dataengine.DataEngine(self)
|
self.dataengine = dataengine.DataEngine(self)
|
||||||
self.reinit = reinit.Reinit(self, self.ptm['defaults'])
|
self.reinit = reinit.Reinit(self, self.ptm['defaults'])
|
||||||
@ -100,6 +97,9 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
(not os.path.exists("/usr" + "/share/apps/plasma_applet_pytextmonitor/plasma_applet_pytextmonitor.notifyrc"))):
|
(not os.path.exists("/usr" + "/share/apps/plasma_applet_pytextmonitor/plasma_applet_pytextmonitor.notifyrc"))):
|
||||||
self.createNotifyrc(kdehome)
|
self.createNotifyrc(kdehome)
|
||||||
|
|
||||||
|
# actions
|
||||||
|
self.createActions()
|
||||||
|
|
||||||
|
|
||||||
# context menu
|
# context menu
|
||||||
def createActions(self):
|
def createActions(self):
|
||||||
@ -110,7 +110,12 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
self.ptmActions['readme'] = QAction(i18n("Show README"), self)
|
self.ptmActions['readme'] = QAction(i18n("Show README"), self)
|
||||||
QObject.connect(self.ptmActions['readme'], SIGNAL("triggered(bool)"), self.showReadme)
|
QObject.connect(self.ptmActions['readme'], SIGNAL("triggered(bool)"), self.showReadme)
|
||||||
self.ptmActions['update'] = QAction(i18n("Update text"), self)
|
self.ptmActions['update'] = QAction(i18n("Update text"), self)
|
||||||
QObject.connect(self.ptmActions['update'], SIGNAL("triggered(bool)"), self.updateText)
|
QObject.connect(self.ptmActions['update'], SIGNAL("triggered(bool)"),
|
||||||
|
self.ptm['dataengine']['ext'], SLOT("forceImmediateUpdateOfAllVisualizations()"))
|
||||||
|
QObject.connect(self.ptmActions['update'], SIGNAL("triggered(bool)"),
|
||||||
|
self.ptm['dataengine']['system'], SLOT("forceImmediateUpdateOfAllVisualizations()"))
|
||||||
|
QObject.connect(self.ptmActions['update'], SIGNAL("triggered(bool)"),
|
||||||
|
self.ptm['dataengine']['time'], SLOT("forceImmediateUpdateOfAllVisualizations()"))
|
||||||
|
|
||||||
|
|
||||||
def contextualActions(self):
|
def contextualActions(self):
|
||||||
@ -150,10 +155,6 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
os.system("kioclient exec " + str(filePath) + " &")
|
os.system("kioclient exec " + str(filePath) + " &")
|
||||||
|
|
||||||
|
|
||||||
def updateText(self):
|
|
||||||
"""function to force update text"""
|
|
||||||
|
|
||||||
|
|
||||||
# internal functions
|
# internal functions
|
||||||
def addDiskDevice(self, sourceName):
|
def addDiskDevice(self, sourceName):
|
||||||
diskRegexp = QRegExp("disk/(?:md|sd|hd)[a-z|0-9]_.*/Rate/(?:rblk)")
|
diskRegexp = QRegExp("disk/(?:md|sd|hd)[a-z|0-9]_.*/Rate/(?:rblk)")
|
||||||
|
Loading…
Reference in New Issue
Block a user