fixes bug #362
authorthedoc <thedoc@atom.(none)>
Fri, 1 Jan 2010 13:07:03 +0000 (14:07 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Wed, 6 Oct 2010 20:31:35 +0000 (22:31 +0200)
allow configuring short power button action to shutdown, standby, menu

data/setup.xml
lib/python/Components/UsageConfig.py
mytest.py

index b920edd669d6a7d958f7f7180a7bd770f8369119..f5dea734e2c77cab6c731cb3e0f0c737f77e981c 100755 (executable)
@@ -31,6 +31,7 @@
                        <item level="1" text="Change bouquets in quickzap">config.usage.quickzap_bouquet_change</item>
                        <item level="1" text="Alternative radio mode">config.usage.e1like_radio_mode</item>
                        <item level="1" text="Action on long powerbutton press">config.usage.on_long_powerpress</item>
                        <item level="1" text="Change bouquets in quickzap">config.usage.quickzap_bouquet_change</item>
                        <item level="1" text="Alternative radio mode">config.usage.e1like_radio_mode</item>
                        <item level="1" text="Action on long powerbutton press">config.usage.on_long_powerpress</item>
+                       <item level="1" text="Action on short powerbutton press">config.usage.on_short_powerpress</item>
                        <item level="0" text="Infobar timeout">config.usage.infobar_timeout</item>
                        <item level="1" text="12V output" requires="12V_Output">config.usage.output_12V</item>
                        <item level="0" text="Show event-progress in channel selection">config.usage.show_event_progress_in_servicelist</item>
                        <item level="0" text="Infobar timeout">config.usage.infobar_timeout</item>
                        <item level="1" text="12V output" requires="12V_Output">config.usage.output_12V</item>
                        <item level="0" text="Show event-progress in channel selection">config.usage.show_event_progress_in_servicelist</item>
index 572f47e0fab3b04b7885c657a775ab117e4cae3d..b86c1a13128fc1a3cd26351637f12f7423c275ca 100644 (file)
@@ -51,7 +51,14 @@ def InitUsageConfig():
 
        config.usage.on_long_powerpress = ConfigSelection(default = "show_menu", choices = [
                ("show_menu", _("show shutdown menu")),
 
        config.usage.on_long_powerpress = ConfigSelection(default = "show_menu", choices = [
                ("show_menu", _("show shutdown menu")),
-               ("shutdown", _("immediate shutdown")) ] )
+               ("shutdown", _("immediate shutdown")),
+               ("standby", _("Standby")) ] )
+       
+       config.usage.on_short_powerpress = ConfigSelection(default = "standby", choices = [
+               ("show_menu", _("show shutdown menu")),
+               ("shutdown", _("immediate shutdown")),
+               ("standby", _("Standby")) ] )
+
 
        config.usage.alternatives_priority = ConfigSelection(default = "0", choices = [
                ("0", "DVB-S/-C/-T"),
 
        config.usage.alternatives_priority = ConfigSelection(default = "0", choices = [
                ("0", "DVB-S/-C/-T"),
index 0b9be523af8f80b4a334b4854df03b0400238c6f..253ee16853a54272f7bee28871a6f709e42fa0b4 100755 (executable)
--- a/mytest.py
+++ b/mytest.py
@@ -365,9 +365,10 @@ class PowerKey:
        def powerlong(self):
                if Screens.Standby.inTryQuitMainloop or (self.session.current_dialog and not self.session.current_dialog.ALLOW_SUSPEND):
                        return
        def powerlong(self):
                if Screens.Standby.inTryQuitMainloop or (self.session.current_dialog and not self.session.current_dialog.ALLOW_SUSPEND):
                        return
+               self.doAction(action = config.usage.on_long_powerpress.value)
 
 
+       def doAction(self, action):
                self.standbyblocked = 1
                self.standbyblocked = 1
-               action = config.usage.on_long_powerpress.value
                if action == "shutdown":
                        self.shutdown()
                elif action == "show_menu":
                if action == "shutdown":
                        self.shutdown()
                elif action == "show_menu":
@@ -388,8 +389,7 @@ class PowerKey:
 
        def powerup(self):
                if self.standbyblocked == 0:
 
        def powerup(self):
                if self.standbyblocked == 0:
-                       self.standbyblocked = 1
-                       self.standby()
+                       self.doAction(action = config.usage.on_short_powerpress.value)
 
        def standby(self):
                if not Screens.Standby.inStandby and self.session.current_dialog and self.session.current_dialog.ALLOW_SUSPEND and self.session.in_exec:
 
        def standby(self):
                if not Screens.Standby.inStandby and self.session.current_dialog and self.session.current_dialog.ALLOW_SUSPEND and self.session.in_exec: