From 606cd0bbb91f1e3de1976964bf972ee6a59f08ea Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 8 Sep 2016 00:09:52 +0200 Subject: [PATCH] lua: add pin-input; set lua api version to 1.58 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/53ca5de35eaa4b0f00a325d5f01449738a16fd11 Author: vanhofen Date: 2016-09-08 (Thu, 08 Sep 2016) Origin message was: ------------------ - lua: add pin-input; set lua api version to 1.58 ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_stringinput.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 86e7fdc8a..8688d8b3e 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 57 +#define LUA_API_VERSION_MINOR 58 diff --git a/src/gui/lua/lua_stringinput.cpp b/src/gui/lua/lua_stringinput.cpp index e61264b50..90e3023ed 100644 --- a/src/gui/lua/lua_stringinput.cpp +++ b/src/gui/lua/lua_stringinput.cpp @@ -90,8 +90,17 @@ int CLuaInstStringInput::StringInputExec(lua_State *L) lua_Integer sms = 0; tableLookup(L, "sms", sms); + lua_Integer pin = 0; + tableLookup(L, "pin", pin); + + if (sms && pin) + dprintf(DEBUG_NORMAL, "[CLuaInstance][%s - %d]: 'sms' AND 'pin' is defined! 'pin' will be prefered.\n", __func__, __LINE__); + CStringInput *i; - if (sms) + if (pin) + i = new CPINInput(name, &value, size, + NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, valid_chars.c_str(), NULL); + else if (sms) i = new CStringInputSMS(name, &value, size, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, valid_chars.c_str(), NULL, icon.c_str()); else