So i have my plugin code that performs an update (doesnt matter what) as per below...
my plugin.py file creates an instance of myUpdater class. The screen appears correctly, the progress bar increments correctly, but how do I prevent the spinner. I guess the core system detects that the thread is taking longer than "expected" so displays the spinner. Indeed, the enigma2 output log confirms this when running enigma2 from the command line interactively rather than a service.
from Screens.Screen import Screen
from Components.Label import Label
from Components.ProgressBar import ProgressBarfrom Components.ActionMap import ActionMap
class myUpdater(Screen):
skin = """
<screen position="center,center" size="840,160" flags="wfNoBorder" backgroundColor="background"><widget name="status" position="20,10" size="800,70" transparent="1" font="RegularLight;46" foregroundColor="foreground" backgroundColor="background" valign="center" halign="left" noWrap="1" />
<widget name="progress" position="0,88" size="840,6" transparent="1" alphatest="blend" pixmap="MetrixFullHD/white.png" borderWidth="0" /><widget name="key_red" position="20,100" size="10,60" backgroundColor="red" />
<widget name="key_green" position="20,100" size="10,60" backgroundColor="green" /></screen>
"""
def __init__(self, session):
Screen.__init__(self, session)
self["key_red"] = Label()
self["key_red"].hide()self["key_green"] = Label()
self["key_green"].show()self["actions"] = ActionMap(["OkCancelActions","ColorActions"],
{
"ok": self.ok,"cancel": self.exit,
"green": self.startUpdate,"red": self.stopUpdate
}, -1)self["status"] = Label(_("Press green to start update!"))
self["progress"] = ProgressBar()
self["progress"].hide()
def ok(self):
self.close()
def exit(self):
self.close()
def startUpdate(self):
self["key_red"].show()
self["key_green"].hide()self["status"].setText(_("Updating......"))
...
... some code ....
...
setProgress(20)
...
... some code ....
...
setProgress(40)
...
... some code ....
...
setProgress(60)
...
... and so on...
def setProgress(self,val):
self["progress"].setValue(val)
self["progress"].show()