add a global ActionMap
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Sun, 15 Jan 2006 22:55:59 +0000 (22:55 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Sun, 15 Jan 2006 22:55:59 +0000 (22:55 +0000)
make volumeActions global

GlobalActions.py [new file with mode: 0644]
data/keymap.xml
data/skin.xml
lib/python/Screens/InfoBarGenerics.py

diff --git a/GlobalActions.py b/GlobalActions.py
new file mode 100644 (file)
index 0000000..4c5d05d
--- /dev/null
@@ -0,0 +1,4 @@
+from Components.ActionMap import ActionMap
+
+globalActionMap = ActionMap( ["GlobalActions"] )
+globalActionMap.execBegin()
index b7ea52b..39ded6a 100644 (file)
                <key id="KEY_GREEN" mapto="subserviceSelection" flags="m" />
        </map>
 
                <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" />
                <key id="KEY_VOLUMEUP" mapto="volumeUp" flags="mr" />
                <key id="KEY_VOLUMEDOWN" mapto="volumeDown" flags="mr" />
                <key id="KEY_MUTE" mapto="volumeMute" flags="mr" />
index a9398fd..bac9742 100644 (file)
                <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="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" />
                        <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>
                        <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">
                        <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">
index de12c09..a627cdb 100644 (file)
@@ -38,20 +38,21 @@ from Components.config import config, currentConfigSelectionElement
 # hack alert!
 from Menu import MainMenu, mdom
 
 # 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"""
 class InfoBarVolumeControl:
        """Volume control, handles volUp, volDown, volMute actions and display 
        a corresponding dialog"""
+
        def __init__(self):
        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)))
 
                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)
 
                self.volumeDialog = self.session.instantiateDialog(Volume)
                self.muteDialog = self.session.instantiateDialog(Mute)