aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/keymap.xml2
-rw-r--r--lib/python/Screens/InfoBar.py10
-rw-r--r--lib/python/Screens/InfoBarGenerics.py36
-rw-r--r--lib/python/Screens/Standby.py2
-rw-r--r--mytest.py42
5 files changed, 50 insertions, 42 deletions
diff --git a/data/keymap.xml b/data/keymap.xml
index 8e3bf7da..2fa539b8 100644
--- a/data/keymap.xml
+++ b/data/keymap.xml
@@ -146,6 +146,8 @@
<key id="KEY_VOLUMEUP" mapto="volumeUp" flags="mr" />
<key id="KEY_VOLUMEDOWN" mapto="volumeDown" flags="mr" />
<key id="KEY_MUTE" mapto="volumeMute" flags="mr" />
+ <key id="KEY_POWER" mapto="powerdown" flags="m" />
+ <key id="KEY_POWER" mapto="powerup" flags="b" />
</map>
<map context="PowerKeyActions">
diff --git a/lib/python/Screens/InfoBar.py b/lib/python/Screens/InfoBar.py
index dfafc116..5aa1cd70 100644
--- a/lib/python/Screens/InfoBar.py
+++ b/lib/python/Screens/InfoBar.py
@@ -12,7 +12,7 @@ from Components.ServicePosition import ServicePosition, ServicePositionGauge
from Tools.Notifications import AddNotificationWithCallback
from Screens.InfoBarGenerics import InfoBarShowHide, \
- InfoBarPowerKey, InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, \
+ InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, \
InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarSeek, InfoBarInstantRecord, \
InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, \
InfoBarSubserviceSelection, InfoBarTuner, InfoBarShowMovies, InfoBarTimeshift, \
@@ -25,7 +25,7 @@ from enigma import *
import time
-class InfoBar(InfoBarShowHide, InfoBarPowerKey,
+class InfoBar(InfoBarShowHide,
InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG,
InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection,
HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
@@ -42,7 +42,7 @@ class InfoBar(InfoBarShowHide, InfoBarPowerKey,
})
for x in HelpableScreen, \
- InfoBarShowHide, InfoBarPowerKey, \
+ InfoBarShowHide, \
InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \
InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
@@ -66,7 +66,7 @@ class InfoBar(InfoBarShowHide, InfoBarPowerKey,
if service is not None:
self.session.open(MoviePlayer, service)
-class MoviePlayer(InfoBarShowHide, InfoBarPowerKey, \
+class MoviePlayer(InfoBarShowHide, \
InfoBarMenu, \
InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications,
InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView,
@@ -80,7 +80,7 @@ class MoviePlayer(InfoBarShowHide, InfoBarPowerKey, \
"leavePlayer": (self.leavePlayer, _("leave movie player..."))
})
- for x in HelpableScreen, InfoBarShowHide, InfoBarPowerKey, InfoBarMenu, \
+ for x in HelpableScreen, InfoBarShowHide, InfoBarMenu, \
InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, \
InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \
InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index 58321ac6..e96a034d 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -26,7 +26,6 @@ from Screens.EventView import EventViewEPGSelect, EventViewSimple
from Screens.InputBox import InputBox
from Screens.MessageBox import MessageBox
from Screens.MinuteInput import MinuteInput
-from Screens.Standby import Standby
from ServiceReference import ServiceReference
from Tools import Notifications
@@ -166,41 +165,6 @@ class NumberZap(Screen):
self.Timer.timeout.get().append(self.keyOK)
self.Timer.start(3000, True)
-class InfoBarPowerKey:
- """ PowerKey stuff - handles the powerkey press and powerkey release actions"""
-
- def __init__(self):
- self.powerKeyTimer = eTimer()
- self.powerKeyTimer.timeout.get().append(self.powertimer)
- self["PowerKeyActions"] = HelpableActionMap(self, "PowerKeyActions",
- {
- "powerdown": self.powerdown,
- "powerup": self.powerup,
- "discreteStandby": (self.standby, "Go standby"),
- "discretePowerOff": (self.quit, "Go to deep standby"),
- })
-
- def powertimer(self):
- print "PowerOff - Now!"
- self.quit()
-
- def powerdown(self):
- self.standbyblocked = 0
- self.powerKeyTimer.start(3000, True)
-
- def powerup(self):
- self.powerKeyTimer.stop()
- if self.standbyblocked == 0:
- self.standbyblocked = 1
- self.standby()
-
- def standby(self):
- self.session.open(Standby, self)
-
- def quit(self):
- # halt
- quitMainloop(1)
-
class InfoBarNumberZap:
""" Handles an initial number for NumberZapping """
def __init__(self):
diff --git a/lib/python/Screens/Standby.py b/lib/python/Screens/Standby.py
index 217f334c..7c06d79e 100644
--- a/lib/python/Screens/Standby.py
+++ b/lib/python/Screens/Standby.py
@@ -41,7 +41,7 @@ class Standby(Screen):
self["actions"] = ActionMap( [ "StandbyActions" ],
{
"power": self.Power
- })
+ }, -1)
#mute adc
self.setMute()
diff --git a/mytest.py b/mytest.py
index 41ce9c84..caad5206 100644
--- a/mytest.py
+++ b/mytest.py
@@ -311,6 +311,47 @@ class VolumeControl:
else:
self.muteDialog.hide()
+from Screens.Standby import Standby
+
+class PowerKey:
+ """ PowerKey stuff - handles the powerkey press and powerkey release actions"""
+
+ def __init__(self, session):
+ self.session = session
+ self.powerKeyTimer = eTimer()
+ self.powerKeyTimer.timeout.get().append(self.powertimer)
+ globalActionMap.actions["powerdown"]=self.powerdown
+ globalActionMap.actions["powerup"]=self.powerup
+
+# self["PowerKeyActions"] = HelpableActionMap(self, "PowerKeyActions",
+ #{
+ #"powerdown": self.powerdown,
+ #"powerup": self.powerup,
+ #"discreteStandby": (self.standby, "Go standby"),
+ #"discretePowerOff": (self.quit, "Go to deep standby"),
+ #})
+
+ def powertimer(self):
+ print "PowerOff - Now!"
+ self.quit()
+
+ def powerdown(self):
+ self.standbyblocked = 0
+ self.powerKeyTimer.start(3000, True)
+
+ def powerup(self):
+ self.powerKeyTimer.stop()
+ if self.standbyblocked == 0:
+ self.standbyblocked = 1
+ self.standby()
+
+ def standby(self):
+ self.session.open(Standby, self)
+
+ def quit(self):
+ # halt
+ quitMainloop(1)
+
def runScreenTest():
plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
@@ -342,6 +383,7 @@ def runScreenTest():
CONNECT(keyPressedSignal(), session.keyEvent)
vol = VolumeControl(session)
+ power = PowerKey(session)
runReactor()