From d42c7e8e98191d2e0f17aff78074e76710e704d1 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Fri, 10 Mar 2006 20:57:09 +0000 Subject: [PATCH] add parameter to Console screen to set the console window title --- .../SystemPlugins/ConfigurationBackup/plugin.py | 10 +++++----- .../Plugins/SystemPlugins/SoftwareUpdate/plugin.py | 2 +- lib/python/Screens/Console.py | 10 ++++++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py index 8f0f37a0..5bffb71c 100644 --- a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py +++ b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py @@ -135,16 +135,16 @@ class BackupSetup(Screen): self.path = BackupPath[str(currentConfigSelectionElement(config.backup.location))] if currentConfigSelectionElement(config.backup.type) == "full": print "Backup Mode: Full" - self.session.open(Console, ["Backup running", "tar -czvf " + self.path + "/" + str(dt) + "_full_backup.tar.gz /etc/"]) + self.session.open(Console, title = "Backup running", cmdlist = ["tar -czvf " + self.path + "/" + str(dt) + "_full_backup.tar.gz /etc/"]) if currentConfigSelectionElement(config.backup.type) == "settings": print "Backup Mode: Settings" - self.session.open(Console, ["Backup running", "tar -czvf " + self.path + "/" + str(dt) + "_settings_backup.tar.gz /etc/enigma2/"]) + self.session.open(Console, title = "Backup running", cmdlist = ["tar -czvf " + self.path + "/" + str(dt) + "_settings_backup.tar.gz /etc/enigma2/"]) if currentConfigSelectionElement(config.backup.type) == "var": print "Backup Mode: var" - self.session.open(Console, ["Backup running", "tar -czvf " + self.path + "/" + str(dt) + "_var_backup.tar.gz /var/"]) + self.session.open(Console, title = "Backup running", cmdlist = [ "tar -czvf " + self.path + "/" + str(dt) + "_var_backup.tar.gz /var/"]) if currentConfigSelectionElement(config.backup.type) == "skin": print "Backup Mode: skin" - self.session.open(Console, ["Backup running", "tar -czvf " + self.path + "/" + str(dt) + "_skin_backup.tar.gz /usr/share/enigma2/"]) + self.session.open(Console, title ="Backup running", cmdlist = [ "tar -czvf " + self.path + "/" + str(dt) + "_skin_backup.tar.gz /usr/share/enigma2/"]) else: self.session.open(MessageBox, _("Sorry your Backup destination does not exist\n\nPlease choose an other one."), MessageBox.TYPE_INFO) @@ -213,7 +213,7 @@ class RestoreMenu(Screen): def startRestore(self, ret = False): if (ret == True): self.exe = True - self.session.open(Console, ["Restore running", "tar -xzvf " + self.path + "/" + self.sel + " -C /", "killall enigma2"]) + self.session.open(Console, title = "Restore running", cmdlist = ["tar -xzvf " + self.path + "/" + self.sel + " -C /", "killall enigma2"]) def Exit(self): self.close() diff --git a/lib/python/Plugins/SystemPlugins/SoftwareUpdate/plugin.py b/lib/python/Plugins/SystemPlugins/SoftwareUpdate/plugin.py index af4d8982..c0649b13 100644 --- a/lib/python/Plugins/SystemPlugins/SoftwareUpdate/plugin.py +++ b/lib/python/Plugins/SystemPlugins/SoftwareUpdate/plugin.py @@ -59,7 +59,7 @@ class UpdatePluginMenu(Screen): self.session.open(MessageBox, _("Function not yet implemented"), MessageBox.TYPE_ERROR) def runUpgrade(self, result): if result: - self.session.open(Console, ["ipkg update", "ipkg upgrade -force-defaults -force-overwrite"]) + self.session.open(Console, title = "Upgrade running...", cmdlist = ["ipkg update", "ipkg upgrade -force-defaults -force-overwrite"]) class IPKGSource(Screen): skin = """ diff --git a/lib/python/Screens/Console.py b/lib/python/Screens/Console.py index 82fc8d1c..98c373d5 100644 --- a/lib/python/Screens/Console.py +++ b/lib/python/Screens/Console.py @@ -10,7 +10,7 @@ class Console(Screen): """ - def __init__(self, session, args = None): + def __init__(self, session, title = "Console", cmdlist = None): self.skin = Console.skin Screen.__init__(self, session) @@ -23,7 +23,10 @@ class Console(Screen): "down": self["text"].pageDown }, -1) - self.cmdlist = args + self.cmdlist = cmdlist + self.newtitle = title + + self.onShown.append(self.updateTitle) self.container = eConsoleAppContainer() self.run = 0 @@ -31,6 +34,9 @@ class Console(Screen): self.container.dataAvail.get().append(self.dataAvail) self.onLayoutFinish.append(self.startRun) # dont start before gui is finished + def updateTitle(self): + self.setTitle(self.newtitle) + def startRun(self): self["text"].setText(_("Execution Progress:") + "\n\n") print "Console: executing in run", self.run, " the command:", self.cmdlist[self.run] -- 2.30.2