From bce291362914ca2b1101ec3503ccc89c001e7bcb Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Mon, 28 Apr 2008 23:35:46 +0000 Subject: default wizard beware: could overwrite some of your data in /etc/enigma2. add config.misc.defaultchosen=false to /etc/enigma2/settings to prevent this. --- lib/python/Screens/DefaultWizard.py | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 lib/python/Screens/DefaultWizard.py (limited to 'lib/python/Screens/DefaultWizard.py') diff --git a/lib/python/Screens/DefaultWizard.py b/lib/python/Screens/DefaultWizard.py new file mode 100644 index 00000000..5d274b0e --- /dev/null +++ b/lib/python/Screens/DefaultWizard.py @@ -0,0 +1,49 @@ +from Wizard import Wizard, wizardManager +from Tools.Directories import crawlDirectory, resolveFilename, SCOPE_DEFAULTDIR + +from Components.Pixmap import Pixmap, MovingPixmap +from Components.config import config, ConfigBoolean, configfile +from Components.DreamInfoHandler import DreamInfoHandler, InfoHandler, InfoHandlerParseError +import os + +config.misc.defaultchosen = ConfigBoolean(default = True) + +import xml.sax + +class DefaultWizard(Wizard, DreamInfoHandler): + def __init__(self, session): + DreamInfoHandler.__init__(self, self.statusCallback) + self.directory = resolveFilename(SCOPE_DEFAULTDIR) + self.xmlfile = "defaultwizard.xml" + + Wizard.__init__(self, session, showSteps = False) + self["wizard"] = Pixmap() + self["rc"] = MovingPixmap() + self["arrowdown"] = MovingPixmap() + self["arrowup"] = MovingPixmap() + self["arrowup2"] = MovingPixmap() + + def markDone(self): + config.misc.defaultchosen.value = 0 + config.misc.defaultchosen.save() + configfile.save() + + def statusCallback(self, status, progress): + print "statusCallback:", status, progress + if status == DreamInfoHandler.STATUS_DONE: + self["text"].setText(_("Finished")) + self.markDone() + os.system("killall -9 enigma2") + + def listDefaults(self): + self.packageslist = [] + self.fillPackagesList() + list = [] + for x in range(len(self.packageslist)): + list.append((self.packageslist[x][0]["attributes"]["name"], str(x))) + print "defaults list:", list + return list + + def selectionMade(self, index): + print "selected:", index + self.installPackage(int(index)) \ No newline at end of file -- cgit v1.2.3