get rid of unneede global keywords
[vuplus_dvbapp] / mytest.py
index 5bc0891..7d87a9c 100644 (file)
--- a/mytest.py
+++ b/mytest.py
@@ -387,7 +387,7 @@ class VolumeControl:
                                self.muteDialog.hide()
                                self.volumeDialog.setValue(vol)
 
-from Screens.Standby import Standby, TryQuitMainloop, inTryQuitMainloop
+import Screens.Standby
 
 class PowerKey:
        """ PowerKey stuff - handles the powerkey press and powerkey release actions"""
@@ -398,7 +398,7 @@ class PowerKey:
                self.powerKeyTimer.timeout.get().append(self.powertimer)
                globalActionMap.actions["powerdown"]=self.powerdown
                globalActionMap.actions["powerup"]=self.powerup
-               self.standbyblocked = 0
+               self.standbyblocked = 1
 #              self["PowerKeyActions"] = HelpableActionMap(self, "PowerKeyActions",
                        #{
                                #"powerdown": self.powerdown,
@@ -409,9 +409,8 @@ class PowerKey:
 
        def powertimer(self):   
                print "PowerOff - Now!"
-               global inTryQuitMainloop
-               if not inTryQuitMainloop:
-                       self.session.open(TryQuitMainloop, 1)
+               if not Screens.Standby.inTryQuitMainloop:
+                       self.session.open(Screens.Standby.TryQuitMainloop, 1)
        
        def powerdown(self):
                self.standbyblocked = 0
@@ -424,8 +423,8 @@ class PowerKey:
                        self.standby()
 
        def standby(self):
-               if self.session.current_dialog and self.session.current_dialog.ALLOW_SUSPEND:
-                       self.session.open(Standby)
+               if not Screens.Standby.inStandby and self.session.current_dialog and self.session.current_dialog.ALLOW_SUSPEND:
+                       self.session.open(Screens.Standby.Standby)
 
 from Screens.Scart import Scart