diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2008-04-28 23:35:46 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2008-04-28 23:35:46 +0000 |
| commit | bce291362914ca2b1101ec3503ccc89c001e7bcb (patch) | |
| tree | a0383eb85b98f5844db719fd0d591466a2e2ed04 /lib/python/Screens | |
| parent | 8da594660701d8cfc7e9a656fa0d2683287757ef (diff) | |
| download | enigma2-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')
| -rw-r--r-- | lib/python/Screens/DefaultWizard.py | 49 | ||||
| -rw-r--r-- | lib/python/Screens/Makefile.am | 5 | ||||
| -rw-r--r-- | lib/python/Screens/StartWizard.py | 4 |
3 files changed, 54 insertions, 4 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 diff --git a/lib/python/Screens/Makefile.am b/lib/python/Screens/Makefile.am index dd3baf08..b5068a76 100644 --- a/lib/python/Screens/Makefile.am +++ b/lib/python/Screens/Makefile.am @@ -12,5 +12,6 @@ install_PYTHON = \ Console.py InputBox.py ChoiceBox.py SimpleSummary.py ImageWizard.py \ TimerSelection.py PictureInPicture.py TimeDateInput.py \ SubtitleDisplay.py SubservicesQuickzap.py ParentalControlSetup.py NumericalTextInputHelpDialog.py \ - SleepTimerEdit.py Ipkg.py RdsDisplay.py Globals.py \ - SessionGlobals.py LocationBox.py WizardLanguage.py TaskView.py + SleepTimerEdit.py Ipkg.py RdsDisplay.py Globals.py DefaultWizard.py \ + SessionGlobals.py LocationBox.py WizardLanguage.py TaskView.py + diff --git a/lib/python/Screens/StartWizard.py b/lib/python/Screens/StartWizard.py index 7f64624e..95fc24d1 100644 --- a/lib/python/Screens/StartWizard.py +++ b/lib/python/Screens/StartWizard.py @@ -5,7 +5,7 @@ from Components.Pixmap import Pixmap, MovingPixmap from Components.config import config, ConfigBoolean, configfile from LanguageSelection import LanguageSelection -#from DefaultWizard import DefaultWizard +from DefaultWizard import DefaultWizard config.misc.firstrun = ConfigBoolean(default = True) config.misc.languageselected = ConfigBoolean(default = True) @@ -26,5 +26,5 @@ class StartWizard(WizardLanguage): configfile.save() wizardManager.registerWizard(LanguageSelection, config.misc.languageselected.value, priority = 5) -#wizardManager.registerWizard(DefaultWizard, config.misc.defaultchosen.value) +wizardManager.registerWizard(DefaultWizard, config.misc.defaultchosen.value, priority = 1) wizardManager.registerWizard(StartWizard, config.misc.firstrun.value, priority = 20) |
