aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Screens/DefaultWizard.py
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2008-04-28 23:35:46 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2008-04-28 23:35:46 +0000
commitbce291362914ca2b1101ec3503ccc89c001e7bcb (patch)
treea0383eb85b98f5844db719fd0d591466a2e2ed04 /lib/python/Screens/DefaultWizard.py
parent8da594660701d8cfc7e9a656fa0d2683287757ef (diff)
downloadenigma2-bce291362914ca2b1101ec3503ccc89c001e7bcb.tar.gz
enigma2-bce291362914ca2b1101ec3503ccc89c001e7bcb.zip
default wizard
beware: could overwrite some of your data in /etc/enigma2. add config.misc.defaultchosen=false to /etc/enigma2/settings to prevent this.
Diffstat (limited to 'lib/python/Screens/DefaultWizard.py')
-rw-r--r--lib/python/Screens/DefaultWizard.py49
1 files changed, 49 insertions, 0 deletions
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