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 b7ea52b2f9a40b13b9f9364b9aea3743174afc9e..39ded6a8dd3b5e78a1dbac04bab768cace832e90 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 a9398fd7bc77e158d7ee28d573c739fc6333fd9c..bac9742a9dda5b58a79596c1c573062922698099 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 de12c093a7a01ac73605ab9f1429a356ec1fa906..a627cdb43f2a7c786f38592c41e4cab13ec85df8 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)