Merge commit 'origin/bug_202_networkconfig_cleanup' into experimental
[enigma2.git] / lib / python / Plugins / SystemPlugins / TempFanControl / plugin.py
index 22332620db3c830630e1c843211924495e699971..38e343f9c818e84fd4baee4007b0dcbeee7884a2 100644 (file)
@@ -12,7 +12,7 @@ from Components.FanControl import fancontrol
 
 class TempFanControl(Screen, ConfigListScreen):
        skin = """
-               <screen position="90,100" size="550,420" title="Fan Control" >
+               <screen position="90,100" size="570,420" title="Fan Control" >
                        <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
                        <ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" />
                        <ePixmap pixmap="skin_default/buttons/yellow.png" position="280,0" size="140,40" alphatest="on" />
@@ -22,7 +22,7 @@ class TempFanControl(Screen, ConfigListScreen):
                        <widget source="yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#a08500" transparent="1" />
                        <widget source="blue" render="Label" position="420,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#18188b" transparent="1" />
                        
-                       <widget name="config" position="10,50" size="500,90" scrollbarMode="showOnDemand" />
+                       <widget name="config" position="10,50" size="550,90" scrollbarMode="showOnDemand" />
                        
                        <widget source="SensorTempText0" render="Label" position="10,150" zPosition="1" size="90,40" font="Regular;20" halign="left" valign="top" backgroundColor="#9f1313" transparent="1" />
                        <widget source="SensorTemp0" render="Label" position="100,150" zPosition="1" size="100,20" font="Regular;19" halign="right">
@@ -138,18 +138,26 @@ class TempFanControl(Screen, ConfigListScreen):
                }, -1)
                
        def save(self):
-               fancontrol.getConfig(0).vlt.save()
-               fancontrol.getConfig(0).pwm.save()
+               for count in range(fancontrol.getFanCount()):
+                       fancontrol.getConfig(count).vlt.save()
+                       fancontrol.getConfig(count).pwm.save()
                self.close()
                
        def revert(self):
-               fancontrol.getConfig(0).vlt.load()
-               fancontrol.getConfig(0).pwm.load()
+               for count in range(fancontrol.getFanCount()):
+                       fancontrol.getConfig(count).vlt.load()
+                       fancontrol.getConfig(count).pwm.load()
                self.close()
-
+               
 def main(session, **kwargs):
        session.open(TempFanControl)
 
+def startMenu(menuid):
+       if menuid != "system":
+               return []
+       
+       return [(_("Temperature and Fan control"), main, "tempfancontrol", 80)]
+
 def Plugins(**kwargs):
-       return PluginDescriptor(name = "Temperature and Fan control", description = _("Temperature and Fan control"), where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc = main)
+       return PluginDescriptor(name = "Temperature and Fan control", description = _("Temperature and Fan control"), where = PluginDescriptor.WHERE_MENU, fnc = startMenu)
        
\ No newline at end of file