configurable display rotor position in infobar
authorims <ims21@users.sourceforge.net>
Wed, 1 Apr 2015 21:22:32 +0000 (23:22 +0200)
committerlittlesat <littlesat99@yahoo.com>
Thu, 2 Apr 2015 09:34:13 +0000 (11:34 +0200)
Signed-off-by: littlesat <littlesat99@yahoo.com>

data/setup.xml
lib/python/Components/Converter/RotorPosition.py
lib/python/Components/UsageConfig.py

index 6e9b647..cdaf35e 100644 (file)
@@ -31,6 +31,7 @@
        <setup key="userinterface" title="User interface">
                <item level="0" text="Show animation while busy" description="Show busy indicator when the system is busy.">config.usage.show_spinner</item>
                <item level="1" text="Show positioner movement" description="Configure whether or not an icon should be shown when your motorized dish is moving.">config.usage.showdish</item>
+               <item level="1" text="Show positioner position" description="Configure whether or not an rotor position will be displayed on infobar">config.misc.showrotorposition</item>
                <item level="1" text="Enable multiple bouquets" description="When enabled, services may be grouped in multiple bouquets.">config.usage.multibouquet</item>
                <item level="1" text="Multi-EPG bouquet selection" description="Enable bouquet selection in multi-EPG">config.usage.multiepg_ask_bouquet</item>
                <item level="1" text="Alternative numbering mode" description="When enabled, channel numbering will start at '1' for each bouquet.">config.usage.alternative_number_mode</item>
index ccda648..d64ad94 100644 (file)
@@ -21,21 +21,23 @@ class RotorPosition(Converter, object):
                        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):
-               self.LastRotorPos = config.misc.lastrotorposition.value
-               (rotor, tuner) = self.isMotorizedTuner()
-               if rotor:
-                       self.actualizeCfgLastRotorPosition()
-                       if self.type == self.WITH_TEXT:
-                               return _("Rotor: ") + orbpos(config.misc.lastrotorposition.value)
-                       if self.type == self.TUNER_NAME:
-                               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))
-                               return ""
-                       return orbpos(config.misc.lastrotorposition.value)
+               if config.misc.showrotorposition.value:
+                       self.LastRotorPos = config.misc.lastrotorposition.value
+                       (rotor, tuner) = self.isMotorizedTuner()
+                       if rotor:
+                               self.actualizeCfgLastRotorPosition()
+                               if self.type == self.WITH_TEXT:
+                                       return _("Rotor: ") + orbpos(config.misc.lastrotorposition.value)
+                               if self.type == self.TUNER_NAME:
+                                       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))
+                                       return ""
+                               return orbpos(config.misc.lastrotorposition.value)
                return ""
 
        text = property(getText)
@@ -65,4 +67,7 @@ class RotorPosition(Converter, object):
 
        def forceChanged(self, configElement=None):
                if self.LastRotorPos != config.misc.lastrotorposition.value:
-                       Converter.changed(self, (self.CHANGED_ALL,))
\ No newline at end of file
+                       Converter.changed(self, (self.CHANGED_ALL,))
+
+       def show_hide(self, configElement=None):
+               Converter.changed(self, (self.CHANGED_ALL,))
\ No newline at end of file
index 2c9338e..db3de0c 100644 (file)
@@ -12,6 +12,7 @@ import time
 def InitUsageConfig():
        config.usage = ConfigSubsection()
        config.usage.showdish = ConfigYesNo(default = True)
+       config.misc.showrotorposition = ConfigYesNo(default = False)
        config.usage.multibouquet = ConfigYesNo(default = True)
 
        config.usage.alternative_number_mode = ConfigYesNo(default = False)