Rotorposition - display parameters moved into menu
authorims <ims21@users.sourceforge.net>
Thu, 2 Apr 2015 06:19:55 +0000 (08:19 +0200)
committerlittlesat <littlesat99@yahoo.com>
Thu, 2 Apr 2015 09:34:18 +0000 (11:34 +0200)
Signed-off-by: littlesat <littlesat99@yahoo.com>

lib/python/Components/Converter/RotorPosition.py
lib/python/Components/UsageConfig.py

index d64ad94..206b18a 100644 (file)
@@ -13,26 +13,20 @@ class RotorPosition(Converter, object):
 
        def __init__(self, type):
                Converter.__init__(self, type)
-               if type == "WithText":
-                       self.type = self.WITH_TEXT
-               if type == "TunerName":
-                       self.type = self.TUNER_NAME
-               else:
-                       self.type = self.DEFAULT
                self.LastRotorPos = config.misc.lastrotorposition.value
                config.misc.lastrotorposition.addNotifier(self.forceChanged, initial_call=False)
                config.misc.showrotorposition.addNotifier(self.show_hide, initial_call=False)
 
        @cached
        def getText(self):
-               if config.misc.showrotorposition.value:
+               if config.misc.showrotorposition.value != "no":
                        self.LastRotorPos = config.misc.lastrotorposition.value
                        (rotor, tuner) = self.isMotorizedTuner()
                        if rotor:
                                self.actualizeCfgLastRotorPosition()
-                               if self.type == self.WITH_TEXT:
+                               if config.misc.showrotorposition.value == "withtext":
                                        return _("Rotor: ") + orbpos(config.misc.lastrotorposition.value)
-                               if self.type == self.TUNER_NAME:
+                               if config.misc.showrotorposition.value == "tunername":
                                        active_tuner = self.getActiveTuner()
                                        if tuner != active_tuner:
                                                return _("%s:%s") % ("\c0000?0?0" + chr(ord("A")+ tuner), "\c00?0?0?0" + orbpos(config.misc.lastrotorposition.value))
index db3de0c..1ed1d54 100644 (file)
@@ -12,7 +12,7 @@ import time
 def InitUsageConfig():
        config.usage = ConfigSubsection()
        config.usage.showdish = ConfigYesNo(default = True)
-       config.misc.showrotorposition = ConfigYesNo(default = False)
+       config.misc.showrotorposition = ConfigSelection(default = "no", choices = [("no", _("no")), ("yes", _("yes")), ("withtext", _("with text")), ("tunername", _("with tuner name"))])
        config.usage.multibouquet = ConfigYesNo(default = True)
 
        config.usage.alternative_number_mode = ConfigYesNo(default = False)