aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2009-12-30 17:35:27 +0100
committerghost <andreas.monzner@multimedia-labs.de>2009-12-30 17:35:27 +0100
commit9a387d949dc2188928fbc19e6cf73da0041dd102 (patch)
treea26478a76d7bcd40d4deb29ef7a53e4ef93c79a9
parent699e95c18614b5e6c659a82ae955be6c3920f6e5 (diff)
parent4e67809b69b2688c138a47cd0d19337c054c0f6f (diff)
downloadenigma2-9a387d949dc2188928fbc19e6cf73da0041dd102.tar.gz
enigma2-9a387d949dc2188928fbc19e6cf73da0041dd102.zip
Merge branch 'bug_293_indicate_unhandled_key' into experimental
-rwxr-xr-xdata/skin_default.xml4
-rwxr-xr-xdata/skin_default/Makefile.am1
-rw-r--r--data/skin_default/unhandled-key.pngbin0 -> 1335 bytes
-rw-r--r--lib/actions/action.cpp2
-rw-r--r--lib/python/Screens/InfoBar.py6
-rw-r--r--lib/python/Screens/InfoBarGenerics.py41
-rwxr-xr-xlib/python/Screens/Makefile.am2
-rw-r--r--lib/python/Screens/UnhandledKey.py7
8 files changed, 57 insertions, 6 deletions
diff --git a/data/skin_default.xml b/data/skin_default.xml
index 7aaff38f..85c4016a 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 &gt; 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 15f4a54f..9e9b7cd4 100755
--- a/data/skin_default/Makefile.am
+++ b/data/skin_default/Makefile.am
@@ -51,6 +51,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
new file mode 100644
index 00000000..8e543498
--- /dev/null
+++ b/data/skin_default/unhandled-key.png
Binary files differ
diff --git a/lib/actions/action.cpp b/lib/actions/action.cpp
index 0eb4cdb1..a2d85ffd 100644
--- a/lib/actions/action.cpp
+++ b/lib/actions/action.cpp
@@ -208,7 +208,7 @@ void eActionMap::keyPressed(const std::string &device, int key, int flags)
}
} else
{
- eDebug("wildcard.");
+// eDebug("wildcard.");
ePyObject pArgs = PyTuple_New(2);
PyTuple_SET_ITEM(pArgs, 0, PyInt_FromLong(key));
PyTuple_SET_ITEM(pArgs, 1, PyInt_FromLong(flags));
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 d2c5a795..8c96c76b 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()