- lua: add pin-input; set lua api version to 1.58

This commit is contained in:
svenhoefer
2016-09-08 00:09:52 +02:00
parent f101655e19
commit 80d1e9b6cf
2 changed files with 11 additions and 2 deletions

View File

@@ -4,4 +4,4 @@
* to luainstance.h changes * to luainstance.h changes
*/ */
#define LUA_API_VERSION_MAJOR 1 #define LUA_API_VERSION_MAJOR 1
#define LUA_API_VERSION_MINOR 57 #define LUA_API_VERSION_MINOR 58

View File

@@ -90,8 +90,17 @@ int CLuaInstStringInput::StringInputExec(lua_State *L)
lua_Integer sms = 0; lua_Integer sms = 0;
tableLookup(L, "sms", sms); 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; 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, i = new CStringInputSMS(name, &value, size,
NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, valid_chars.c_str(), NULL, icon.c_str()); NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, valid_chars.c_str(), NULL, icon.c_str());
else else