From 532de067edce9444b65b0d77bfaaaeb531334315 Mon Sep 17 00:00:00 2001 From: martii Date: Thu, 12 Dec 2013 08:24:24 +0100 Subject: [PATCH] gui/widget/stringinput: sms-input: cleanup last push, no binary change add timer to change to next field Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/365f3ea39500340a13956bbcc5da5ccfa3565669 Author: martii Date: 2013-12-12 (Thu, 12 Dec 2013) --- src/gui/widget/stringinput.cpp | 11 +++++++++++ src/gui/widget/stringinput.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index 59a5e8be8..de4dc5ac8 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -133,6 +133,8 @@ CStringInput::~CStringInput() if(head) { free(head); } + + g_RCInput->killTimer (smstimer); } #define CStringInputSMSButtonsCount 2 @@ -196,6 +198,7 @@ void CStringInput::init() x = getScreenStartX(width); y = getScreenStartY(height); selected = 0; + smstimer = 0; } void CStringInput::NormalKeyPressed(const neutrino_msg_t key) @@ -423,6 +426,12 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & ) if ( msg <= CRCInput::RC_MaxRC ) timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); + if ((msg == NeutrinoMessages::EVT_TIMER) && (data == smstimer)) + msg = CRCInput::RC_right; + + if (msg < CRCInput::RC_nokey) + g_RCInput->killTimer (smstimer); + if (msg==CRCInput::RC_left) { keyLeftPressed(); @@ -717,6 +726,8 @@ void CStringInputSMS::NormalKeyPressed(const neutrino_msg_t key) value[selected] = Chars[numericvalue][keyCounter]; last_digit = numericvalue; paintChar(selected); + g_RCInput->killTimer (smstimer); + smstimer = g_RCInput->addTimer(2*1000*1000); } else { diff --git a/src/gui/widget/stringinput.h b/src/gui/widget/stringinput.h index 47d5d692a..c7391dad3 100644 --- a/src/gui/widget/stringinput.h +++ b/src/gui/widget/stringinput.h @@ -51,6 +51,8 @@ class CStringInput : public CMenuTarget int lower_bound; int upper_bound; + uint32_t smstimer; + char * head; neutrino_locale_t name; neutrino_locale_t hint_1, hint_2;