X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fpython%2FScreens%2FSatconfig.py;h=3de125b980d72e392665b9de4958992b35115cd1;hb=f439d95e68c5a31bf18b643916b60c272755d5a6;hp=d5249b99941512c0e27370b625b27e51b315b326;hpb=a8d991ca3b2f7cd9b85bd54ea4eaa661c06a3d71;p=vuplus_dvbapp diff --git a/lib/python/Screens/Satconfig.py b/lib/python/Screens/Satconfig.py index d5249b9..3de125b 100644 --- a/lib/python/Screens/Satconfig.py +++ b/lib/python/Screens/Satconfig.py @@ -10,11 +10,12 @@ from Components.config import getConfigListEntry, config, ConfigNothing, ConfigS from Components.Sources.List import List from Screens.MessageBox import MessageBox from Screens.ChoiceBox import ChoiceBox +from Screens.ServiceStopScreen import ServiceStopScreen from time import mktime, localtime from datetime import datetime -class NimSetup(Screen, ConfigListScreen): +class NimSetup(Screen, ConfigListScreen, ServiceStopScreen): def createSimpleSetup(self, list, mode): nim = self.nimConfig if mode == "single": @@ -57,7 +58,7 @@ class NimSetup(Screen, ConfigListScreen): def createConfigMode(self): if self.nim.isCompatible("DVB-S"): - choices = { "nothing": _("nothing connected"), + choices = { "nothing": _("not configured"), "simple": _("simple"), "advanced": _("advanced")} #if len(nimmanager.getNimListOfType(nimmanager.getNimType(self.slotid), exception = x)) > 0: @@ -346,6 +347,7 @@ class NimSetup(Screen, ConfigListScreen): new_configured_sats = nimmanager.getConfiguredSats() self.unconfed_sats = old_configured_sats - new_configured_sats self.satpos_to_remove = None + self.restoreService(_("Zap back to service before tuner setup?")) self.deleteConfirmed((None, "no")) def deleteConfirmed(self, confirmed): @@ -375,12 +377,13 @@ class NimSetup(Screen, ConfigListScreen): if confirmed[1] == "yestoall" or confirmed[1] == "notoall": self.deleteConfirmed(confirmed) break - if not self.satpos_to_remove: - self.close() def __init__(self, session, slotid): Screen.__init__(self, session) self.list = [ ] + + ServiceStopScreen.__init__(self) + self.stopService() ConfigListScreen.__init__(self, self.list) @@ -405,6 +408,12 @@ class NimSetup(Screen, ConfigListScreen): ConfigListScreen.keyRight(self) self.newConfig() + def keyCancel(self): + if self["config"].isChanged(): + self.session.openWithCallback(self.cancelConfirm, MessageBox, _("Really close without saving settings?")) + else: + self.restoreService(_("Zap back to service before tuner setup?")) + def saveAll(self): if self.nim.isCompatible("DVB-S"): # reset connectedTo to all choices to properly store the default value @@ -424,7 +433,7 @@ class NimSetup(Screen, ConfigListScreen): x[1].cancel() # we need to call saveAll to reset the connectedTo choices self.saveAll() - self.close() + self.restoreService(_("Zap back to service before tuner setup?")) def nothingConnectedShortcut(self): if type(self["config"].getCurrent()[1]) is ConfigSatlist: @@ -473,20 +482,28 @@ class NimSelection(Screen): "satposdepends": _("second cable of motorized LNB") } [nimConfig.configMode.value] text += " " + _("Tuner") + " " + ["A", "B", "C", "D"][int(nimConfig.connectedTo.value)] elif nimConfig.configMode.value == "nothing": - text = _("nothing connected") + text = _("not configured") elif nimConfig.configMode.value == "simple": if nimConfig.diseqcMode.value in ("single", "toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"): - text = _("Sats") + ": " + text = {"single": _("Single"), "toneburst_a_b": _("Toneburst A/B"), "diseqc_a_b": _("DiSEqC A/B"), "diseqc_a_b_c_d": _("DiSEqC A/B/C/D")}[nimConfig.diseqcMode.value] + "\n" + text += _("Sats") + ": " + satnames = [] if nimConfig.diseqcA.orbital_position != 3601: - text += nimmanager.getSatName(int(nimConfig.diseqcA.value)) + satnames.append(nimmanager.getSatName(int(nimConfig.diseqcA.value))) if nimConfig.diseqcMode.value in ("toneburst_a_b", "diseqc_a_b", "diseqc_a_b_c_d"): if nimConfig.diseqcB.orbital_position != 3601: - text += "," + nimmanager.getSatName(int(nimConfig.diseqcB.value)) + satnames.append(nimmanager.getSatName(int(nimConfig.diseqcB.value))) if nimConfig.diseqcMode.value == "diseqc_a_b_c_d": if nimConfig.diseqcC.orbital_position != 3601: - text += "," + nimmanager.getSatName(int(nimConfig.diseqcC.value)) + satnames.append(nimmanager.getSatName(int(nimConfig.diseqcC.value))) if nimConfig.diseqcD.orbital_position != 3601: - text += "," + nimmanager.getSatName(int(nimConfig.diseqcD.value)) + satnames.append(nimmanager.getSatName(int(nimConfig.diseqcD.value))) + if len(satnames) <= 2: + text += ", ".join(satnames) + elif len(satnames) > 2: + # we need a newline here, since multi content lists don't support automtic line wrapping + text += ", ".join(satnames[:2]) + ",\n" + text += " " + ", ".join(satnames[2:]) elif nimConfig.diseqcMode.value == "positioner": text = _("Positioner") + ":" if nimConfig.positionerMode.value == "usals":