summaryrefslogtreecommitdiffstats
path: root/gui/pages.cpp
diff options
context:
space:
mode:
authorthat <github@that.at>2016-01-05 23:29:30 +0100
committerthat <github@that.at>2016-01-07 22:30:39 +0100
commit8834a0ffc0be61218ab86bf209cb6cd53a18a565 (patch)
tree1229c2413a373d799831f4e9c6ebe087c4c53fb5 /gui/pages.cpp
parentFix translation spellings (diff)
downloadandroid_bootable_recovery-8834a0ffc0be61218ab86bf209cb6cd53a18a565.tar
android_bootable_recovery-8834a0ffc0be61218ab86bf209cb6cd53a18a565.tar.gz
android_bootable_recovery-8834a0ffc0be61218ab86bf209cb6cd53a18a565.tar.bz2
android_bootable_recovery-8834a0ffc0be61218ab86bf209cb6cd53a18a565.tar.lz
android_bootable_recovery-8834a0ffc0be61218ab86bf209cb6cd53a18a565.tar.xz
android_bootable_recovery-8834a0ffc0be61218ab86bf209cb6cd53a18a565.tar.zst
android_bootable_recovery-8834a0ffc0be61218ab86bf209cb6cd53a18a565.zip
Diffstat (limited to '')
-rw-r--r--gui/pages.cpp30
1 files changed, 10 insertions, 20 deletions
diff --git a/gui/pages.cpp b/gui/pages.cpp
index 4a65c69e4..c097c39bd 100644
--- a/gui/pages.cpp
+++ b/gui/pages.cpp
@@ -584,15 +584,13 @@ int Page::NotifyKey(int key, bool down)
{
std::vector<ActionObject*>::reverse_iterator iter;
- // Don't try to handle a lack of handlers
- if (mActions.size() == 0)
- return 1;
-
int ret = 1;
// We work backwards, from top-most element to bottom-most element
for (iter = mActions.rbegin(); iter != mActions.rend(); iter++)
{
ret = (*iter)->NotifyKey(key, down);
+ if (ret == 0)
+ return 0;
if (ret < 0) {
LOGERR("An action handler has returned an error\n");
ret = 1;
@@ -601,22 +599,18 @@ int Page::NotifyKey(int key, bool down)
return ret;
}
-int Page::NotifyKeyboard(int key)
+int Page::NotifyCharInput(int ch)
{
std::vector<InputObject*>::reverse_iterator iter;
- // Don't try to handle a lack of handlers
- if (mInputs.size() == 0)
- return 1;
-
// We work backwards, from top-most element to bottom-most element
for (iter = mInputs.rbegin(); iter != mInputs.rend(); iter++)
{
- int ret = (*iter)->NotifyKeyboard(key);
+ int ret = (*iter)->NotifyCharInput(ch);
if (ret == 0)
return 0;
else if (ret < 0)
- LOGERR("A keyboard handler has returned an error");
+ LOGERR("A char input handler has returned an error");
}
return 1;
}
@@ -625,10 +619,6 @@ int Page::SetKeyBoardFocus(int inFocus)
{
std::vector<InputObject*>::reverse_iterator iter;
- // Don't try to handle a lack of handlers
- if (mInputs.size() == 0)
- return 1;
-
// We work backwards, from top-most element to bottom-most element
for (iter = mInputs.rbegin(); iter != mInputs.rend(); iter++)
{
@@ -1155,12 +1145,12 @@ int PageSet::NotifyKey(int key, bool down)
return (mCurrentPage ? mCurrentPage->NotifyKey(key, down) : -1);
}
-int PageSet::NotifyKeyboard(int key)
+int PageSet::NotifyCharInput(int ch)
{
if (!mOverlays.empty())
- return mOverlays.back()->NotifyKeyboard(key);
+ return mOverlays.back()->NotifyCharInput(ch);
- return (mCurrentPage ? mCurrentPage->NotifyKeyboard(key) : -1);
+ return (mCurrentPage ? mCurrentPage->NotifyCharInput(ch) : -1);
}
int PageSet::SetKeyBoardFocus(int inFocus)
@@ -1654,9 +1644,9 @@ int PageManager::NotifyKey(int key, bool down)
return (mCurrentSet ? mCurrentSet->NotifyKey(key, down) : -1);
}
-int PageManager::NotifyKeyboard(int key)
+int PageManager::NotifyCharInput(int ch)
{
- return (mCurrentSet ? mCurrentSet->NotifyKeyboard(key) : -1);
+ return (mCurrentSet ? mCurrentSet->NotifyCharInput(ch) : -1);
}
int PageManager::SetKeyBoardFocus(int inFocus)