From 24530a6c60ad35a103aa323f0010adf066d5781f Mon Sep 17 00:00:00 2001 From: acid-burn Date: Thu, 1 Oct 2009 16:02:58 +0200 Subject: SystemPlugins/SoftwareManager:- move buttons to the top and replace all Labels where possible through StaticText for better skinability - change some label descriptions - minor fixes --- .../SystemPlugins/SoftwareManager/BackupRestore.py | 73 +++++++++++----------- 1 file changed, 37 insertions(+), 36 deletions(-) (limited to 'lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py') diff --git a/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py b/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py index 3925fc44..5ae46b60 100755 --- a/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py +++ b/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py @@ -4,6 +4,7 @@ from Screens.Console import Console from Components.ActionMap import ActionMap, NumberActionMap from Components.Pixmap import Pixmap from Components.Label import Label +from Components.Sources.StaticText import StaticText from Components.MenuList import MenuList from Components.config import getConfigListEntry, configfile, ConfigSelection, ConfigSubsection, ConfigText, ConfigLocations from Components.config import config @@ -34,7 +35,7 @@ def getBackupFilename(): class BackupScreen(Screen, ConfigListScreen): skin = """ - + """ @@ -62,7 +63,7 @@ class BackupScreen(Screen, ConfigListScreen): self.setWindowTitle() def setWindowTitle(self): - self.setTitle(_("Backup running...")) + self.setTitle(_("Backup is running...")) def doBackup(self): try: @@ -76,14 +77,14 @@ class BackupScreen(Screen, ConfigListScreen): remove(self.newfilename) rename(self.fullbackupfilename,self.newfilename) if self.finished_cb: - self.session.openWithCallback(self.finished_cb, Console, title = _("Backup running"), cmdlist = ["tar -czvf " + self.fullbackupfilename + " " + self.backupdirs],finishedCallback = self.backupFinishedCB,closeOnSuccess = True) + self.session.openWithCallback(self.finished_cb, Console, title = _("Backup is running..."), cmdlist = ["tar -czvf " + self.fullbackupfilename + " " + self.backupdirs],finishedCallback = self.backupFinishedCB,closeOnSuccess = True) else: - self.session.open(Console, title = _("Backup running"), cmdlist = ["tar -czvf " + self.fullbackupfilename + " " + self.backupdirs],finishedCallback = self.backupFinishedCB, closeOnSuccess = True) + self.session.open(Console, title = _("Backup is running..."), cmdlist = ["tar -czvf " + self.fullbackupfilename + " " + self.backupdirs],finishedCallback = self.backupFinishedCB, closeOnSuccess = True) except OSError: if self.finished_cb: - self.session.openWithCallback(self.finished_cb, MessageBox, _("Sorry your backup destination is not writeable.\nPlease choose an other one."), MessageBox.TYPE_INFO) + self.session.openWithCallback(self.finished_cb, MessageBox, _("Sorry your backup destination is not writeable.\nPlease choose an other one."), MessageBox.TYPE_INFO, timeout = 10 ) else: - self.session.openWithCallback(self.backupErrorCB,MessageBox, _("Sorry your backup destination is not writeable.\nPlease choose an other one."), MessageBox.TYPE_INFO) + self.session.openWithCallback(self.backupErrorCB,MessageBox, _("Sorry your backup destination is not writeable.\nPlease choose an other one."), MessageBox.TYPE_INFO, timeout = 10 ) def backupFinishedCB(self,retval = None): self.close(True) @@ -98,21 +99,21 @@ class BackupScreen(Screen, ConfigListScreen): class BackupSelection(Screen): skin = """ - - - - - - - - - """ + + + + + + + + + """ def __init__(self, session): Screen.__init__(self, session) - self["key_red"] = Label(_("Cancel")) - self["key_green"] = Label(_("Save")) - self["key_yellow"] = Label() + self["key_red"] = StaticText(_("Cancel")) + self["key_green"] = StaticText(_("Save")) + self["key_yellow"] = StaticText() self.selectedFiles = config.plugins.configurationbackup.backupdirs.value defaultDir = '/' @@ -143,7 +144,7 @@ class BackupSelection(Screen): self.selectionChanged() def setWindowTitle(self): - self.setTitle(_("Select files/folders to backup...")) + self.setTitle(_("Select files/folders to backup")) def selectionChanged(self): current = self["checkList"].getCurrent()[0] @@ -186,23 +187,23 @@ class BackupSelection(Screen): class RestoreMenu(Screen): skin = """ - - - - - - - - + + + + + + + + """ def __init__(self, session, plugin_path): Screen.__init__(self, session) self.skin_path = plugin_path - self["canceltext"] = Label(_("Cancel")) - self["restoretext"] = Label(_("Restore")) - self["deletetext"] = Label(_("Delete")) + self["key_red"] = StaticText(_("Cancel")) + self["key_green"] = StaticText(_("Restore")) + self["key_yellow"] = StaticText(_("Delete")) self.sel = [] self.val = [] @@ -232,7 +233,7 @@ class RestoreMenu(Screen): self.setWindowTitle() def setWindowTitle(self): - self.setTitle(_("Restore backups...")) + self.setTitle(_("Restore backups")) def fill_list(self): @@ -277,7 +278,7 @@ class RestoreMenu(Screen): class RestoreScreen(Screen, ConfigListScreen): skin = """ - + """ @@ -285,7 +286,7 @@ class RestoreScreen(Screen, ConfigListScreen): Screen.__init__(self, session) self.session = session self.runRestore = runRestore - self["actions"] = ActionMap(["WizardActions", "DirectionActions"], + self["actions"] = ActionMap(["WizardActions", "DirectionActions"], { "ok": self.close, "back": self.close, @@ -305,13 +306,13 @@ class RestoreScreen(Screen, ConfigListScreen): self.setWindowTitle() def setWindowTitle(self): - self.setTitle(_("Restore running...")) + self.setTitle(_("Restore is running...")) def doRestore(self): if self.finished_cb: - self.session.openWithCallback(self.finished_cb, Console, title = _("Restore running"), cmdlist = ["tar -xzvf " + self.fullbackupfilename + " -C /", "killall -9 enigma2"]) + self.session.openWithCallback(self.finished_cb, Console, title = _("Restore is running..."), cmdlist = ["tar -xzvf " + self.fullbackupfilename + " -C /", "killall -9 enigma2"]) else: - self.session.open(Console, title = _("Restore running"), cmdlist = ["tar -xzvf " + self.fullbackupfilename + " -C /", "killall -9 enigma2"]) + self.session.open(Console, title = _("Restore is running..."), cmdlist = ["tar -xzvf " + self.fullbackupfilename + " -C /", "killall -9 enigma2"]) def backupFinishedCB(self,retval = None): self.close(True) -- cgit v1.2.3 From 8b9b6e0b8e78557a6d7fba7fcb5b0d4052f3838a Mon Sep 17 00:00:00 2001 From: acid-burn Date: Fri, 2 Oct 2009 17:13:27 +0200 Subject: SystemPlugins/SoftwareManager: - add timeout to MessageBox - reset /proc/stb/vmpeg/0/dst* to defaults after a restore so enigma doesnt restart in pip mode if pip was enabled --- .../Plugins/SystemPlugins/SoftwareManager/BackupRestore.py | 8 ++++++-- lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py | 12 ++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py') diff --git a/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py b/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py index 5ae46b60..871f0a30 100755 --- a/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py +++ b/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py @@ -309,10 +309,14 @@ class RestoreScreen(Screen, ConfigListScreen): self.setTitle(_("Restore is running...")) def doRestore(self): + if path.exists("/proc/stb/vmpeg/0/dst_width"): + restorecmdlist = ["tar -xzvf " + self.fullbackupfilename + " -C /", "echo 0 > /proc/stb/vmpeg/0/dst_height", "echo 0 > /proc/stb/vmpeg/0/dst_left", "echo 0 > /proc/stb/vmpeg/0/dst_top", "echo 0 > /proc/stb/vmpeg/0/dst_width", "killall -9 enigma2"] + else: + restorecmdlist = ["tar -xzvf " + self.fullbackupfilename + " -C /", "killall -9 enigma2"] if self.finished_cb: - self.session.openWithCallback(self.finished_cb, Console, title = _("Restore is running..."), cmdlist = ["tar -xzvf " + self.fullbackupfilename + " -C /", "killall -9 enigma2"]) + self.session.openWithCallback(self.finished_cb, Console, title = _("Restore is running..."), cmdlist = restorecmdlist) else: - self.session.open(Console, title = _("Restore is running..."), cmdlist = ["tar -xzvf " + self.fullbackupfilename + " -C /", "killall -9 enigma2"]) + self.session.open(Console, title = _("Restore is running..."), cmdlist = restorecmdlist) def backupFinishedCB(self,retval = None): self.close(True) diff --git a/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py b/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py index 6254c6c2..c10a7e5f 100755 --- a/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py +++ b/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py @@ -164,13 +164,13 @@ class UpdatePluginMenu(Screen): if os_path.exists(self.fullbackupfilename): self.session.openWithCallback(self.startRestore, MessageBox, _("Are you sure you want to restore your Enigma2 backup?\nEnigma2 will restart after the restore")) else: - self.session.open(MessageBox, _("Sorry no backups found!"), MessageBox.TYPE_INFO) + self.session.open(MessageBox, _("Sorry no backups found!"), MessageBox.TYPE_INFO, timeout = 10) elif (current == "ipkg-install"): try: from Plugins.Extensions.MediaScanner.plugin import main main(self.session) except: - self.session.open(MessageBox, _("Sorry MediaScanner is not installed!"), MessageBox.TYPE_INFO) + self.session.open(MessageBox, _("Sorry MediaScanner is not installed!"), MessageBox.TYPE_INFO, timeout = 10) elif (current == "advanced"): self.session.open(UpdatePluginMenu, 1) elif self.menu == 1: @@ -215,13 +215,13 @@ class UpdatePluginMenu(Screen): if (os_path.exists(self.backuppath) == False): makedirs(self.backuppath) except OSError: - self.session.open(MessageBox, _("Sorry, your backup destination is not writeable.\n\nPlease choose another one."), MessageBox.TYPE_INFO) + self.session.open(MessageBox, _("Sorry, your backup destination is not writeable.\n\nPlease choose another one."), MessageBox.TYPE_INFO, timeout = 10) def backupDone(self,retval = None): if retval is True: - self.session.open(MessageBox, _("Backup done."), MessageBox.TYPE_INFO) + self.session.open(MessageBox, _("Backup done."), MessageBox.TYPE_INFO, timeout = 10) else: - self.session.open(MessageBox, _("Backup failed."), MessageBox.TYPE_INFO) + self.session.open(MessageBox, _("Backup failed."), MessageBox.TYPE_INFO, timeout = 10) def startRestore(self, ret = False): if (ret == True): @@ -961,7 +961,7 @@ class PluginManager(Screen, DreamInfoHandler): if (os_path.exists(detailsfile) == True): self.session.openWithCallback(self.detailsClosed, PluginDetails, self.skin_path, current) else: - self.session.open(MessageBox, _("Sorry, no Details available!"), MessageBox.TYPE_INFO) + self.session.open(MessageBox, _("Sorry, no Details available!"), MessageBox.TYPE_INFO, timeout = 10) elif self.currList == "category": self.prepareInstall() if len(self.cmdList): -- cgit v1.2.3