X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FPlugins%2FSystemPlugins%2FSoftwareManager%2Fplugin.py;h=090faf2035f837d72a0f8416ad552c87319bb3e1;hp=b3a0a17a1d8b56ea69a3136d3444de1c2af34143;hb=HEAD;hpb=0c417aee83bac3ab0a70d5e0b3360d18b3663a23 diff --git a/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py b/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py index b3a0a17..090faf2 100644 --- a/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py +++ b/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py @@ -43,10 +43,10 @@ from SoftwareTools import iSoftwareTools config.plugins.configurationbackup = ConfigSubsection() config.plugins.configurationbackup.backuplocation = ConfigText(default = '/media/hdd/', visible_width = 50, fixed_size = False) -config.plugins.configurationbackup.backupdirs = ConfigLocations(default=[eEnv.resolve('${sysconfdir}/enigma2/'), '/etc/network/interfaces', '/etc/wpa_supplicant.conf', '/etc/resolv.conf', '/etc/default_gw', '/etc/hostname']) +config.plugins.configurationbackup.backupdirs = ConfigLocations(default=[eEnv.resolve('${sysconfdir}/enigma2/'), '/etc/network/interfaces', '/etc/wpa_supplicant.conf', '/etc/wpa_supplicant.ath0.conf', '/etc/wpa_supplicant.wlan0.conf', '/etc/resolv.conf', '/etc/default_gw', '/etc/hostname']) -config.plugins.SoftwareManager = ConfigSubsection() -config.plugins.SoftwareManager.overwriteConfigFiles = ConfigSelection( +config.plugins.softwaremanager = ConfigSubsection() +config.plugins.softwaremanager.overwriteConfigFiles = ConfigSelection( [ ("Y", _("Yes, always")), ("N", _("No, never")), @@ -125,11 +125,11 @@ class UpdatePluginMenu(Screen): self.backupdirs = ' '.join( config.plugins.configurationbackup.backupdirs.value ) if self.menu == 0: print "building menu entries" - self.list.append(("install-extensions", _("Manage extensions"), _("\nManage extensions or plugins for your Dreambox" ) + self.oktext, None)) - self.list.append(("software-update", _("Software update"), _("\nOnline update of your Dreambox software." ) + self.oktext, None)) - self.list.append(("software-restore", _("Software restore"), _("\nRestore your Dreambox with a new firmware." ) + self.oktext, None)) - self.list.append(("system-backup", _("Backup system settings"), _("\nBackup your Dreambox settings." ) + self.oktext + "\n\n" + self.infotext, None)) - self.list.append(("system-restore",_("Restore system settings"), _("\nRestore your Dreambox settings." ) + self.oktext, None)) + self.list.append(("install-extensions", _("Manage extensions"), _("\nManage extensions or plugins for your STB" ) + self.oktext, None)) + self.list.append(("software-update", _("Software update"), _("\nOnline update of your STB software." ) + self.oktext, None)) + self.list.append(("software-restore", _("Software restore"), _("\nRestore your STB with a new firmware." ) + self.oktext, None)) + self.list.append(("system-backup", _("Backup system settings"), _("\nBackup your STB settings." ) + self.oktext + "\n\n" + self.infotext, None)) + self.list.append(("system-restore",_("Restore system settings"), _("\nRestore your STB settings." ) + self.oktext, None)) self.list.append(("ipkg-install", _("Install local extension"), _("\nScan for local extensions and install them." ) + self.oktext, None)) for p in plugins.getPlugins(PluginDescriptor.WHERE_SOFTWAREMANAGER): if p.__call__.has_key("SoftwareSupported"): @@ -230,7 +230,7 @@ class UpdatePluginMenu(Screen): currentEntry = current[0] if self.menu == 0: if (currentEntry == "software-update"): - self.session.openWithCallback(self.runUpgrade, MessageBox, _("Do you want to update your Dreambox?")+"\n"+_("\nAfter pressing OK, please wait!")) + self.session.openWithCallback(self.runUpgrade, MessageBox, _("Do you want to update your STB?")+"\n"+_("\nAfter pressing OK, please wait!")) elif (currentEntry == "software-restore"): self.session.open(ImageWizard) elif (currentEntry == "install-extensions"): @@ -365,7 +365,7 @@ class SoftwareManagerSetup(Screen, ConfigListScreen): def createSetup(self): self.list = [ ] - self.overwriteConfigfilesEntry = getConfigListEntry(_("Overwrite configuration files ?"), config.plugins.SoftwareManager.overwriteConfigFiles) + self.overwriteConfigfilesEntry = getConfigListEntry(_("Overwrite configuration files ?"), config.plugins.softwaremanager.overwriteConfigFiles) self.list.append(self.overwriteConfigfilesEntry) self["config"].list = self.list self["config"].l.setSeperation(400) @@ -489,7 +489,6 @@ class SoftwareManagerInfo(Screen): self.list = [] backupfiles = config.plugins.configurationbackup.backupdirs.value for entry in backupfiles: - print entry self.list.append((entry,)) self['list'].setList(self.list) @@ -569,6 +568,7 @@ class PluginManager(Screen, DreamInfoHandler): self.currentSelectedIndex = None self.currentSelectedPackage = None self.saved_currentSelectedPackage = None + self.restartRequired = False self.onShown.append(self.setWindowTitle) self.onLayoutFinish.append(self.getUpdateInfos) @@ -892,6 +892,8 @@ class PluginManager(Screen, DreamInfoHandler): self.package = iSoftwareTools.packageDetails[0] if self.package[0].has_key("attributes"): self.attributes = self.package[0]["attributes"] + if self.attributes.has_key("needsRestart"): + self.restartRequired = True if self.attributes.has_key("package"): self.packagefiles = self.attributes["package"] if plugin[1] == 'installed': @@ -924,11 +926,11 @@ class PluginManager(Screen, DreamInfoHandler): def runExecuteFinished(self): self.reloadPluginlist() - restartRequired = plugins.restartRequired - if restartRequired: - self.session.openWithCallback(self.ExecuteReboot, MessageBox, _("Install or remove finished.") +" "+_("Do you want to reboot your Dreambox?"), MessageBox.TYPE_YESNO) + if plugins.restartRequired or self.restartRequired: + self.session.openWithCallback(self.ExecuteReboot, MessageBox, _("Install or remove finished.") +" "+_("Do you want to reboot your STB?"), MessageBox.TYPE_YESNO) else: self.selectedFiles = [] + self.restartRequired = False self.detailsClosed(True) def ExecuteReboot(self, result): @@ -936,6 +938,7 @@ class PluginManager(Screen, DreamInfoHandler): quitMainloop(3) else: self.selectedFiles = [] + self.restartRequired = False self.detailsClosed(True) def reloadPluginlist(self): @@ -1011,7 +1014,7 @@ class PluginManagerInfo(Screen): elif cmd == 2: info = args['package'] else: - info = _("Dreambox software because updates are available.") + info = _("STB software because updates are available.") self.list.append(self.buildEntryComponent(action,info)) self['list'].setList(self.list) @@ -1174,7 +1177,7 @@ class PluginDetails(Screen, DreamInfoHandler): self.package = self.packageDetails[0] if self.package[0].has_key("attributes"): self.attributes = self.package[0]["attributes"] - + self.restartRequired = False self.cmdList = [] self.oktext = _("\nAfter pressing OK, please wait!") self.picload = ePicLoad() @@ -1272,20 +1275,22 @@ class PluginDetails(Screen, DreamInfoHandler): def go(self): if self.attributes.has_key("package"): self.packagefiles = self.attributes["package"] + if self.attributes.has_key("needsRestart"): + self.restartRequired = True self.cmdList = [] if self.pluginstate in ('installed', 'remove'): if self.packagefiles: for package in self.packagefiles[:]: self.cmdList.append((IpkgComponent.CMD_REMOVE, { "package": package["name"] })) - if len(self.cmdList): - self.session.openWithCallback(self.runRemove, MessageBox, _("Do you want to remove the package:\n") + self.pluginname + "\n" + self.oktext) + if len(self.cmdList): + self.session.openWithCallback(self.runRemove, MessageBox, _("Do you want to remove the package:\n") + self.pluginname + "\n" + self.oktext) else: if iSoftwareTools.NetworkConnectionAvailable: if self.packagefiles: for package in self.packagefiles[:]: self.cmdList.append((IpkgComponent.CMD_INSTALL, { "package": package["name"] })) - if len(self.cmdList): - self.session.openWithCallback(self.runUpgrade, MessageBox, _("Do you want to install the package:\n") + self.pluginname + "\n" + self.oktext) + if len(self.cmdList): + self.session.openWithCallback(self.runUpgrade, MessageBox, _("Do you want to install the package:\n") + self.pluginname + "\n" + self.oktext) def runUpgrade(self, result): if result: @@ -1293,9 +1298,8 @@ class PluginDetails(Screen, DreamInfoHandler): def runUpgradeFinished(self): self.reloadPluginlist() - restartRequired = plugins.restartRequired - if restartRequired: - self.session.openWithCallback(self.UpgradeReboot, MessageBox, _("Installation finished.") +" "+_("Do you want to reboot your Dreambox?"), MessageBox.TYPE_YESNO) + if plugins.restartRequired or self.restartRequired: + self.session.openWithCallback(self.UpgradeReboot, MessageBox, _("Installation finished.") +" "+_("Do you want to reboot your STB?"), MessageBox.TYPE_YESNO) else: self.close(True) def UpgradeReboot(self, result): @@ -1374,7 +1378,7 @@ class UpdatePlugin(Screen): self.updating = True self.activityTimer.start(100, False) self.package.setText(_("Package list update")) - self.status.setText(_("Upgrading Dreambox... Please wait")) + self.status.setText(_("Upgrading STB... Please wait")) self.ipkg.startCmd(IpkgComponent.CMD_UPDATE) else: self.package.setText(_("Your network is not working. Please try again.")) @@ -1414,8 +1418,8 @@ class UpdatePlugin(Screen): self.status.setText(_("Configuring")) elif event == IpkgComponent.EVENT_MODIFIED: - if config.plugins.SoftwareManager.overwriteConfigFiles.value in ("N", "Y"): - self.ipkg.write(True and config.plugins.SoftwareManager.overwriteConfigFiles.value) + if config.plugins.softwaremanager.overwriteConfigFiles.value in ("N", "Y"): + self.ipkg.write(True and config.plugins.softwaremanager.overwriteConfigFiles.value) else: self.session.openWithCallback( self.modificationCallback, @@ -1439,11 +1443,11 @@ class UpdatePlugin(Screen): else: self.activityTimer.stop() self.activityslider.setValue(0) - error = _("your dreambox might be unusable now. Please consult the manual for further assistance before rebooting your dreambox.") + error = _("your STB might be unusable now. Please consult the manual for further assistance before rebooting your STB.") if self.packages == 0: error = _("No packages were upgraded yet. So you can check your network and try again.") if self.updating: - error = _("Your dreambox isn't connected to the internet properly. Please check it and try again.") + error = _("Your STB isn't connected to the internet properly. Please check it and try again.") self.status.setText(_("Error") + " - " + error) #print event, "-", param pass @@ -1454,7 +1458,7 @@ class UpdatePlugin(Screen): def exit(self): if not self.ipkg.isRunning(): if self.packages != 0 and self.error == 0: - self.session.openWithCallback(self.exitAnswer, MessageBox, _("Upgrade finished.") +" "+_("Do you want to reboot your Dreambox?")) + self.session.openWithCallback(self.exitAnswer, MessageBox, _("Upgrade finished.") +" "+_("Do you want to reboot your STB?")) else: self.close() else: @@ -1577,8 +1581,9 @@ class IPKGSource(Screen): else: self["text"] = Input(text, maxSize=False, visible_width = 55, type=Input.TEXT) - self["actions"] = NumberActionMap(["WizardActions", "InputActions", "TextEntryActions", "KeyboardInputActions","ShortcutActions"], + self["actions"] = NumberActionMap(["WizardActions", "InputActions", "TextEntryActions", "KeyboardInputActions","ShortcutActions", "InputAsciiActions"], { + "gotAsciiCode": self.gotAsciiCode, "ok": self.go, "back": self.close, "red": self.close, @@ -1603,6 +1608,9 @@ class IPKGSource(Screen): self.onLayoutFinish.append(self.layoutFinished) + def gotAsciiCode(self): + self["text"].handleAscii(getPrevAsciiCode()) + def layoutFinished(self): self.setWindowTitle() self["text"].right() @@ -1724,7 +1732,13 @@ class PacketManager(Screen, NumericalTextInput): self.setNextIdx(keyvalue[0]) def keyGotAscii(self): - keyvalue = unichr(getPrevAsciiCode()).encode("utf-8") + from Components.config import getCharValue + unichar = getCharValue(getPrevAsciiCode()) + if unichar is None: + return + if len(str(unichar)) > 1: + return + keyvalue = unichar.encode("utf-8") if len(keyvalue) == 1: self.setNextIdx(keyvalue[0]) @@ -1812,7 +1826,7 @@ class PacketManager(Screen, NumericalTextInput): self.session.openWithCallback(self.runRemoveFinished, Ipkg, cmdList = self.cmdList) def runRemoveFinished(self): - self.session.openWithCallback(self.RemoveReboot, MessageBox, _("Remove finished.") +" "+_("Do you want to reboot your Dreambox?"), MessageBox.TYPE_YESNO) + self.session.openWithCallback(self.RemoveReboot, MessageBox, _("Remove finished.") +" "+_("Do you want to reboot your STB?"), MessageBox.TYPE_YESNO) def RemoveReboot(self, result): if result is None: @@ -1834,7 +1848,7 @@ class PacketManager(Screen, NumericalTextInput): self.session.openWithCallback(self.runUpgradeFinished, Ipkg, cmdList = self.cmdList) def runUpgradeFinished(self): - self.session.openWithCallback(self.UpgradeReboot, MessageBox, _("Upgrade finished.") +" "+_("Do you want to reboot your Dreambox?"), MessageBox.TYPE_YESNO) + self.session.openWithCallback(self.UpgradeReboot, MessageBox, _("Upgrade finished.") +" "+_("Do you want to reboot your STB?"), MessageBox.TYPE_YESNO) def UpgradeReboot(self, result): if result is None: