Permalink
Browse files

add a global ActionMap

make volumeActions global
  • Loading branch information...
1 parent 2d5b15f commit 49b1d6023e84aa49b29bc0c0cd2e293b3a7e360c Andreas Monzner committed Jan 15, 2006
Showing with 15 additions and 11 deletions.
  1. +4 −0 GlobalActions.py
  2. +1 −1 data/keymap.xml
  3. +2 −3 data/skin.xml
  4. +8 −7 lib/python/Screens/InfoBarGenerics.py
View
@@ -0,0 +1,4 @@
+from Components.ActionMap import ActionMap
+
+globalActionMap = ActionMap( ["GlobalActions"] )
+globalActionMap.execBegin()
View
@@ -108,7 +108,7 @@
<key id="KEY_GREEN" mapto="subserviceSelection" flags="m" />
</map>
- <map context="InfobarVolumeActions">
+ <map context="GlobalActions">
<key id="KEY_VOLUMEUP" mapto="volumeUp" flags="mr" />
<key id="KEY_VOLUMEDOWN" mapto="volumeDown" flags="mr" />
<key id="KEY_MUTE" mapto="volumeMute" flags="mr" />
View
@@ -214,12 +214,11 @@
<screen name="MinuteInput" position="200,140" size="280,60" title="Seek">
<widget name="minutes" position="80,15" size="160,25" halign="right" font="Regular;23" />
</screen>
- <screen name="Volume" flags="wfNoBorder" position="450,50" size="180,60" title="Volume">
+ <screen name="Volume" flags="wfNoBorder" position="450,50" size="180,60" title="Volume" zPosition="99" >
<ePixmap position="0,0" zPosition="0" size="180,60" pixmap="/usr/share/enigma2/volumeslider-fs8.png" />
-
<widget name="Volume" zPosition="1" position="8,38" size="164,11" backgroundColor="dark" />
</screen>
- <screen name="Mute" flags="wfNoBorder" position="100,100" size="59,80" title="Mute">
+ <screen name="Mute" flags="wfNoBorder" position="100,100" size="59,80" title="Mute" zPosition="99" >
<ePixmap position="0,0" size="59,80" pixmap="/usr/share/enigma2/mute-fs8.png" />
</screen>
<screen name="Dish" flags="wfNoBorder" position="300,100" size="100,107" title="Dish">
@@ -38,20 +38,21 @@
# hack alert!
from Menu import MainMenu, mdom
+from GlobalActions import globalActionMap
+
class InfoBarVolumeControl:
"""Volume control, handles volUp, volDown, volMute actions and display
a corresponding dialog"""
+
def __init__(self):
+ global globalActionMap
+ globalActionMap.actions["volumeUp"]=self.volUp
+ globalActionMap.actions["volumeDown"]=self.volDown
+ globalActionMap.actions["volumeMute"]=self.volMute
+
config.audio = ConfigSubsection()
config.audio.volume = configElement("config.audio.volume", configSequence, [100], configsequencearg.get("INTEGER", (0, 100)))
- self["VolumeActions"] = ActionMap( ["InfobarVolumeActions"] ,
- {
- "volumeUp": self.volUp,
- "volumeDown": self.volDown,
- "volumeMute": self.volMute,
- })
-
self.volumeDialog = self.session.instantiateDialog(Volume)
self.muteDialog = self.session.instantiateDialog(Mute)

0 comments on commit 49b1d60

Please sign in to comment.