diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2006-03-05 15:50:27 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2006-03-05 15:50:27 +0000 |
| commit | 323ac4a566f7c1ea9006eaf58eae915fac00071b (patch) | |
| tree | 8c658f272df37796d12a4aa848af8e460b7aad53 /lib/python/Screens | |
| parent | f4e9150aa736c1b7e7465a19da9355c3b8d56c6f (diff) | |
| download | enigma2-323ac4a566f7c1ea9006eaf58eae915fac00071b.tar.gz enigma2-323ac4a566f7c1ea9006eaf58eae915fac00071b.zip | |
adding the image upgrade wizard
can backup settings to hdd, cf, usb or (in the future) a given path
recognizes the backup after flashing the image automatically and asks the user, if it should restore the settings
guides the user through the upgrade process
Diffstat (limited to 'lib/python/Screens')
| -rw-r--r-- | lib/python/Screens/ImageWizard.py | 50 | ||||
| -rw-r--r-- | lib/python/Screens/Makefile.am | 2 |
2 files changed, 51 insertions, 1 deletions
diff --git a/lib/python/Screens/ImageWizard.py b/lib/python/Screens/ImageWizard.py new file mode 100644 index 00000000..f96ddadc --- /dev/null +++ b/lib/python/Screens/ImageWizard.py @@ -0,0 +1,50 @@ +from Wizard import Wizard, wizardManager + +from Components.config import configElementBoolean, config +from Components.Pixmap import * + +from LanguageSelection import LanguageSelection +from Tools.Directories import fileExists + +import os + +backupfile = "backupenigma2settings.tar" + +def checkConfigBackup(): + paths = ['/media/hdd/', '/media/cf/'] + for x in paths: + if fileExists(x + backupfile): + return x + return None + +if checkConfigBackup() is None: + backupAvailable = 0 +else: + backupAvailable = 1 + +class ImageWizard(Wizard): + skin = """ + <screen position="0,0" size="720,576" title="Welcome..." flags="wfNoBorder"> + <widget name="text" position="50,100" size="440,250" font="Regular;23" /> + <widget name="list" position="50,350" zPosition="1" size="440,200" /> + <widget name="config" position="50,350" zPosition="1" size="440,200" transparent="1" scrollbarMode="showOnDemand" /> + </screen>""" + + def __init__(self, session): + self.xmlfile = "imagewizard.xml" + + Wizard.__init__(self, session, showSteps=False, showStepSlider=False, showList=True, showConfig=True) + + def markDone(self): + pass + +wizardManager.registerWizard(ImageWizard, backupAvailable) + +def doBackup(path): + os.system('tar cvpf ' + path + backupfile + ' /etc/enigma2') + +def doRestore(path): + os.system('cd / && tar xvpf ' + path + backupfile + ' etc/enigma2') + + +
\ No newline at end of file diff --git a/lib/python/Screens/Makefile.am b/lib/python/Screens/Makefile.am index d917eb39..7a30e88a 100644 --- a/lib/python/Screens/Makefile.am +++ b/lib/python/Screens/Makefile.am @@ -9,4 +9,4 @@ install_PYTHON = \ AudioSelection.py InfoBarGenerics.py HelpMenu.py Wizard.py __init__.py \ Dish.py SubserviceSelection.py LanguageSelection.py StartWizard.py \ TutorialWizard.py PluginBrowser.py MinuteInput.py Scart.py PVRState.py \ - Console.py InputBox.py ChoiceBox.py SimpleSummary.py + Console.py InputBox.py ChoiceBox.py SimpleSummary.py ImageWizard.py |
