X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/bba4dec6bbe08a1f0c0c2b73c4b8e62aa8ded2df..ae12f5e4894a65289aeafd97931e1651939bf8b1:/lib/python/Screens/Satconfig.py diff --git a/lib/python/Screens/Satconfig.py b/lib/python/Screens/Satconfig.py index e24e4636..156f7780 100644 --- a/lib/python/Screens/Satconfig.py +++ b/lib/python/Screens/Satconfig.py @@ -5,15 +5,17 @@ from Components.ActionMap import ActionMap from Components.ConfigList import ConfigListScreen from Components.MenuList import MenuList from Components.NimManager import nimmanager -from Components.config import getConfigListEntry, config, ConfigNothing, ConfigSelection, updateConfigElement +from Components.config import getConfigListEntry, config, ConfigNothing, ConfigSelection, updateConfigElement,\ + ConfigSatlist 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": @@ -145,6 +147,8 @@ class NimSetup(Screen, ConfigListScreen): currSat = self.nimConfig.advanced.sat[cur_orb_pos] self.fillListWithAdvancedSatEntrys(currSat) self.have_advanced = True + if self.nim.description == "Alps BSBE2" and config.usage.setup_level.index >= 2: # expert + self.list.append(getConfigListEntry(_("Tone Amplitude"), self.nimConfig.toneAmplitude)) elif self.nim.isCompatible("DVB-C"): self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode) self.list.append(self.configMode) @@ -343,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): @@ -372,19 +377,21 @@ 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) - self["actions"] = ActionMap(["SetupActions"], + self["actions"] = ActionMap(["SetupActions", "SatlistShortcutAction"], { "ok": self.keySave, "cancel": self.keyCancel, + "nothingconnected": self.nothingConnectedShortcut }, -2) self.slotid = slotid @@ -401,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 @@ -420,7 +433,12 @@ 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: + self["config"].getCurrent()[1].setValue("3601") + self["config"].invalidateCurrent() class NimSelection(Screen): def __init__(self, session):