diff options
Diffstat (limited to 'lib/python')
| -rwxr-xr-x | lib/python/Components/Keyboard.py | 47 | ||||
| -rwxr-xr-x[-rw-r--r--] | lib/python/Components/Makefile.am | 3 | ||||
| -rwxr-xr-x[-rw-r--r--] | lib/python/Components/SetupDevices.py | 7 | ||||
| -rw-r--r-- | lib/python/Plugins/Extensions/DVDPlayer/plugin.py | 6 | ||||
| -rwxr-xr-x | lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py | 2 | ||||
| -rw-r--r-- | lib/python/Screens/EpgSelection.py | 12 | ||||
| -rw-r--r-- | lib/python/enigma_python.i | 10 |
7 files changed, 79 insertions, 8 deletions
diff --git a/lib/python/Components/Keyboard.py b/lib/python/Components/Keyboard.py new file mode 100755 index 00000000..820d1036 --- /dev/null +++ b/lib/python/Components/Keyboard.py @@ -0,0 +1,47 @@ +from Components.Console import Console +from os import listdir as os_listdir, path as os_path +from re import compile as re_compile + +class Keyboard: + def __init__(self): + self.keyboardmaps = [] + self.readKeyboardMapFiles() + + def readKeyboardMapFiles(self): + for keymapfile in os_listdir('/usr/share/keymaps/'): + if (keymapfile.endswith(".info")): + f = open('/usr/share/keymaps/' + keymapfile) + mapfile = None + mapname = None + for line in f: + m = re_compile('^\s*(\w+)\s*=\s*(.*)\s*$').match(line) + if m: + key, val = m.groups() + if key == 'kmap': + mapfile = val + if key == 'name': + mapname = val + if (mapfile is not None) and (mapname is not None): + self.keyboardmaps.append(( mapfile,mapname)) + f.close() + + if len(self.keyboardmaps) == 0: + self.keyboardmaps = [('dream-de.kmap', 'Dreambox Keyboard Deutsch'), ('eng.kmap', 'Keyboard English')] + + def activateKeyboardMap(self, index): + try: + keymap = self.keyboardmaps[index] + print "Activating keymap:",keymap[1] + keymappath = '/usr/share/keymaps/' + keymap[0] + if os_path.exists(keymappath): + Console().ePopen(("loadkmap < " + str(keymappath))) + except: + print "Selected keymap does not exist!" + + def getKeyboardMaplist(self): + return self.keyboardmaps + + def getDefaultKeyboardMap(self): + return 'eng.kmap' + +keyboard = Keyboard() diff --git a/lib/python/Components/Makefile.am b/lib/python/Components/Makefile.am index 67cec18d..85e4d3ec 100644..100755 --- a/lib/python/Components/Makefile.am +++ b/lib/python/Components/Makefile.am @@ -18,4 +18,5 @@ install_PYTHON = \ MultiContent.py MediaPlayer.py TunerInfo.py VideoWindow.py ChoiceList.py \ Element.py Playlist.py ParentalControl.py ParentalControlList.py \ Ipkg.py SelectionList.py Scanner.py SystemInfo.py DreamInfoHandler.py \ - Task.py language_cache.py Console.py ResourceManager.py TuneTest.py + Task.py language_cache.py Console.py ResourceManager.py TuneTest.py \ + Keyboard.py diff --git a/lib/python/Components/SetupDevices.py b/lib/python/Components/SetupDevices.py index 71fb1e47..b037ea77 100644..100755 --- a/lib/python/Components/SetupDevices.py +++ b/lib/python/Components/SetupDevices.py @@ -1,6 +1,7 @@ from config import config, ConfigSelection, ConfigSubsection, ConfigOnOff, ConfigText from Components.Timezones import timezones from Components.Language import language +from Components.Keyboard import keyboard def InitSetupDevices(): @@ -11,8 +12,12 @@ def InitSetupDevices(): config.timezone.val = ConfigSelection(default = timezones.getDefaultTimezone(), choices = timezones.getTimezoneList()) config.timezone.val.addNotifier(timezoneNotifier) + def keyboardNotifier(configElement): + keyboard.activateKeyboardMap(configElement.index) + config.keyboard = ConfigSubsection(); - config.keyboard.keymap = ConfigSelection(choices = [("en", _("English")), ("de",_("German"))]) + config.keyboard.keymap = ConfigSelection(default = keyboard.getDefaultKeyboardMap(), choices = keyboard.getKeyboardMaplist()) + config.keyboard.keymap.addNotifier(keyboardNotifier) def languageNotifier(configElement): language.activateLanguage(configElement.value) diff --git a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py index e77b8940..32e35933 100644 --- a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py @@ -502,8 +502,10 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP choices = [(_("Exit"), "exit"), (_("Continue playing"), "play")] if True or not self.physicalDVD: choices.insert(1,(_("Return to file browser"), "browser")) - if self.physicalDVD and not self.session.nav.getCurrentlyPlayingServiceReference().toString().endswith(harddiskmanager.getAutofsMountpoint(harddiskmanager.getCD())): - choices.insert(0,(_("Play DVD"), "playPhysical" )) + if self.physicalDVD: + cur = self.session.nav.getCurrentlyPlayingServiceReference() + if cur and not cur.toString().endswith(harddiskmanager.getAutofsMountpoint(harddiskmanager.getCD())): + choices.insert(0,(_("Play DVD"), "playPhysical" )) self.session.openWithCallback(self.exitCB, ChoiceBox, title=_("Leave DVD Player?"), list = choices) def sendKey(self, key): diff --git a/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py b/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py index 65361adf..3925fc44 100755 --- a/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py +++ b/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py @@ -244,7 +244,7 @@ class RestoreMenu(Screen): if (file.endswith(".tar.gz")): self.flist.append((file)) self.entry = True - self["filelist"].l.setList(self.flist) + self["filelist"].l.setList(self.flist) def KeyOk(self): if (self.exe == False) and (self.entry == True): diff --git a/lib/python/Screens/EpgSelection.py b/lib/python/Screens/EpgSelection.py index d09ed004..3dde7e22 100644 --- a/lib/python/Screens/EpgSelection.py +++ b/lib/python/Screens/EpgSelection.py @@ -6,6 +6,8 @@ from Components.Label import Label from Components.EpgList import EPGList, EPG_TYPE_SINGLE, EPG_TYPE_SIMILAR, EPG_TYPE_MULTI from Components.ActionMap import ActionMap from Components.TimerSanityCheck import TimerSanityCheck +from Components.Sources.ServiceEvent import ServiceEvent +from Components.Sources.Event import Event from Screens.TimerEdit import TimerSanityConflict from Screens.EventView import EventViewSimple from Screens.MessageBox import MessageBox @@ -33,6 +35,8 @@ class EPGSelection(Screen): self["key_red"] = Button("") self.closeRecursive = False self.saved_title = None + self["Service"] = ServiceEvent() + self["Event"] = Event() if isinstance(service, str) and eventid != None: self.type = EPG_TYPE_SIMILAR self["key_yellow"] = Button() @@ -153,6 +157,7 @@ class EPGSelection(Screen): l.moveToService(self.session.nav.getCurrentlyPlayingServiceReference()) elif self.type == EPG_TYPE_SINGLE: service = self.currentService + self["Service"].newService(service.ref) if self.saved_title is None: self.saved_title = self.instance.getTitle() title = self.saved_title + ' - ' + service.getServiceName() @@ -306,6 +311,7 @@ class EPGSelection(Screen): self.key_red_choice = self.EMPTY return event = cur[0] + self["Event"].newEvent(event) if self.type == EPG_TYPE_MULTI: count = self["list"].getCurrentChangeCount() if self.ask_time != -1: @@ -328,8 +334,12 @@ class EPGSelection(Screen): else: datestr = '%s %d.%d.'%(_("Today"), begTime[2], begTime[1]) self["date"].setText(datestr) + if cur[1] is None: + self["Service"].newService(None) + else: + self["Service"].newService(cur[1].ref) - if cur[1] is None or cur[1].getServiceName() == "": + if cur[1] is None or cur[1].getServiceName() == "": if self.key_green_choice != self.EMPTY: self["key_green"].setText("") self.key_green_choice = self.EMPTY diff --git a/lib/python/enigma_python.i b/lib/python/enigma_python.i index bdf1b144..fe0e71ec 100644 --- a/lib/python/enigma_python.i +++ b/lib/python/enigma_python.i @@ -262,7 +262,10 @@ RESULT SwigFromPython(ePtr<gPixmap> &result, PyObject *obj) res = 0; result = 0; - if (SWIG_Python_ConvertPtr(obj, (void **)&res, SWIGTYPE_p_ePtrTgPixmap_t, SWIG_POINTER_EXCEPTION | 0)) +#ifndef SWIGTYPE_p_ePtrT_gPixmap_t +#define SWIGTYPE_p_ePtrT_gPixmap_t SWIGTYPE_p_ePtrTgPixmap_t +#endif + if (SWIG_Python_ConvertPtr(obj, (void **)&res, SWIGTYPE_p_ePtrT_gPixmap_t, SWIG_POINTER_EXCEPTION | 0)) return -1; if (!res) return -1; @@ -277,7 +280,10 @@ PyObject *New_eServiceReference(const eServiceReference &ref) PyObject *New_iRecordableServicePtr(const ePtr<iRecordableService> &ptr) { ePtr<iRecordableService> *result = new ePtr<iRecordableService>(ptr); - return SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_ePtrTiRecordableService_t, 1); +#ifndef SWIGTYPE_p_ePtrT_iRecordableService_t +#define SWIGTYPE_p_ePtrT_iRecordableService_t SWIGTYPE_p_ePtrTiRecordableService_t +#endif + return SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_ePtrT_iRecordableService_t, 1); } %} |
