diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2009-12-30 17:11:58 +0100 |
|---|---|---|
| committer | thedoc <thedoc@atom.(none)> | 2010-01-01 15:25:47 +0100 |
| commit | d711c0e93592fa1e1df0fde808fe2bed39687421 (patch) | |
| tree | deb42d56031bbeea23ab3120bcac459da9dd2410 | |
| parent | eaa0490b6cbc0a6db1482e744f988bd5a28f7944 (diff) | |
| download | enigma2-d711c0e93592fa1e1df0fde808fe2bed39687421.tar.gz enigma2-d711c0e93592fa1e1df0fde808fe2bed39687421.zip | |
show a short symbol when a unhandled key is pressed
this fixes bug #293
| -rwxr-xr-x | data/skin_default.xml | 4 | ||||
| -rw-r--r-- | data/skin_default/Makefile.am | 1 | ||||
| -rw-r--r-- | data/skin_default/unhandled-key.png | bin | 0 -> 1335 bytes | |||
| -rw-r--r-- | lib/python/Screens/InfoBar.py | 6 | ||||
| -rw-r--r-- | lib/python/Screens/InfoBarGenerics.py | 41 | ||||
| -rwxr-xr-x | lib/python/Screens/Makefile.am | 2 | ||||
| -rw-r--r-- | lib/python/Screens/UnhandledKey.py | 7 |
7 files changed, 56 insertions, 5 deletions
diff --git a/data/skin_default.xml b/data/skin_default.xml index 71f579cb..bf21b715 100755 --- a/data/skin_default.xml +++ b/data/skin_default.xml @@ -253,6 +253,10 @@ self.instance.move(ePoint((720-wsizex)/2, (576-wsizey)/(count > 7 and 2 or 3) <screen name="Dish" flags="wfNoBorder" position="300,100" size="130,160" title="Dish" zPosition="100" backgroundColor="transparent"> <widget name="Dishpixmap" pixmap="skin_default/icons/dish.png" position="0,0" size="130,160" alphatest="off" /> </screen> + <!-- unhandled key pressed --> + <screen name="UnhandledKey" flags="wfNoBorder" position="620,50" size="34,45" title="UnhandledKey" zPosition="100" backgroundColor="transparent"> + <widget name="UnhandledKeyPixmap" pixmap="skin_default/unhandled-key.png" position="0,0" size="34,45" alphatest="off" /> + </screen> <!-- EPG Selection - Single --> <screen name="EPGSelection" position="center,center" size="560,430" title="EPG Selection"> <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" /> diff --git a/data/skin_default/Makefile.am b/data/skin_default/Makefile.am index e2d2abcc..3106af97 100644 --- a/data/skin_default/Makefile.am +++ b/data/skin_default/Makefile.am @@ -50,6 +50,7 @@ dist_install_DATA = \ sleeptimer.png \ timeline-now.png \ timeline.png \ + unhandled-key.png \ verticalline-plugins.png \ vkey_backspace.png \ vkey_bg.png \ diff --git a/data/skin_default/unhandled-key.png b/data/skin_default/unhandled-key.png Binary files differnew file mode 100644 index 00000000..8e543498 --- /dev/null +++ b/data/skin_default/unhandled-key.png diff --git a/lib/python/Screens/InfoBar.py b/lib/python/Screens/InfoBar.py index a15c7ac1..5b061245 100644 --- a/lib/python/Screens/InfoBar.py +++ b/lib/python/Screens/InfoBar.py @@ -12,7 +12,7 @@ profile("LOAD:InfoBarGenerics") from Screens.InfoBarGenerics import InfoBarShowHide, \ InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarRdsDecoder, \ InfoBarEPG, InfoBarSeek, InfoBarInstantRecord, \ - InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, \ + InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarUnhandledKey, \ InfoBarSubserviceSelection, InfoBarShowMovies, InfoBarTimeshift, \ InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView, \ InfoBarSummarySupport, InfoBarMoviePlayerSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, \ @@ -29,7 +29,7 @@ from Screens.HelpMenu import HelpableScreen class InfoBar(InfoBarBase, InfoBarShowHide, InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRdsDecoder, InfoBarInstantRecord, InfoBarAudioSelection, - HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, + HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarUnhandledKey, InfoBarSubserviceSelection, InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, InfoBarPiP, InfoBarPlugins, InfoBarSubtitleSupport, InfoBarServiceErrorPopupSupport, InfoBarJobman, @@ -52,7 +52,7 @@ class InfoBar(InfoBarBase, InfoBarShowHide, for x in HelpableScreen, \ InfoBarBase, InfoBarShowHide, \ InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRdsDecoder, \ - InfoBarInstantRecord, InfoBarAudioSelection, \ + InfoBarInstantRecord, InfoBarAudioSelection, InfoBarUnhandledKey, \ InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \ InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, \ InfoBarTeletextPlugin, InfoBarExtensions, InfoBarPiP, InfoBarSubtitleSupport, InfoBarJobman, \ diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index a3e56a40..c8aa00cb 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -26,13 +26,14 @@ from Screens.PictureInPicture import PictureInPicture from Screens.SubtitleDisplay import SubtitleDisplay from Screens.RdsDisplay import RdsInfoDisplay, RassInteractive from Screens.TimeDateInput import TimeDateInput +from Screens.UnhandledKey import UnhandledKey from ServiceReference import ServiceReference from Tools import Notifications from Tools.Directories import fileExists from enigma import eTimer, eServiceCenter, eDVBServicePMTHandler, iServiceInformation, \ - iPlayableService, eServiceReference, eEPGCache + iPlayableService, eServiceReference, eEPGCache, eActionMap from time import time, localtime, strftime from os import stat as os_stat @@ -47,6 +48,44 @@ class InfoBarDish: def __init__(self): self.dishDialog = self.session.instantiateDialog(Dish) +class InfoBarUnhandledKey: + def __init__(self): + self.unhandledKeyDialog = self.session.instantiateDialog(UnhandledKey) + self.hideTimer = eTimer() + self.hideTimer.callback.append(self.unhandledKeyDialog.hide) + self.checkUnusedTimer = eTimer() + self.checkUnusedTimer.callback.append(self.checkUnused) + self.onLayoutFinish.append(self.unhandledKeyDialog.hide) + eActionMap.getInstance().bindAction('', -0x7FFFFFFF, self.actionA) #highest prio + eActionMap.getInstance().bindAction('', 0x7FFFFFFF, self.actionB) #lowest prio + self.key = -1; + self.flags = 0; + self.uflags = 0; + + #this function is called on every keypress! + def actionA(self, key, flag): + if flag != 4: + if self.key != key: + if self.checkUnusedTimer.isActive(): + self.checkUnusedTimer.stop() + self.checkUnused() + self.key = key + self.flags = self.uflags = 0 + self.flags |= (1<<flag) + if flag == 1: # break + self.checkUnusedTimer.start(0, True) + return 0 + + #this function is only called when no other action has handled this key + def actionB(self, key, flag): + if flag != 4: + self.uflags |= (1<<flag) + + def checkUnused(self): + if self.flags == self.uflags: + self.unhandledKeyDialog.show() + self.hideTimer.start(2000, True) + class InfoBarShowHide: """ InfoBar show/hide control, accepts toggleShow and hide actions, might start fancy animations. """ diff --git a/lib/python/Screens/Makefile.am b/lib/python/Screens/Makefile.am index 585983c2..5457bf64 100755 --- a/lib/python/Screens/Makefile.am +++ b/lib/python/Screens/Makefile.am @@ -14,5 +14,5 @@ install_PYTHON = \ SubtitleDisplay.py SubservicesQuickzap.py ParentalControlSetup.py NumericalTextInputHelpDialog.py \ SleepTimerEdit.py Ipkg.py RdsDisplay.py Globals.py DefaultWizard.py \ SessionGlobals.py LocationBox.py WizardLanguage.py TaskView.py Rc.py VirtualKeyBoard.py \ - TextBox.py FactoryReset.py RecordPaths.py + TextBox.py FactoryReset.py RecordPaths.py UnhandledKey.py diff --git a/lib/python/Screens/UnhandledKey.py b/lib/python/Screens/UnhandledKey.py new file mode 100644 index 00000000..63bfed5b --- /dev/null +++ b/lib/python/Screens/UnhandledKey.py @@ -0,0 +1,7 @@ +from Screen import Screen +from Components.Pixmap import Pixmap + +class UnhandledKey(Screen): + def __init__(self, session): + Screen.__init__(self, session) + self["UnhandledKeyPixmap"] = Pixmap() |
