diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index b225476b6..3e4f07604 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -741,6 +741,9 @@ ledcontroler.off LED1 & LED2 aus ledcontroler.on.all LED1 & LED2 an ledcontroler.on.led1 LED1 an ledcontroler.on.led2 LED2 an +lua.function_deprecated1 Achtung! +lua.function_deprecated2 Die Funktion +lua.function_deprecated3 ist veraltet,\n bitte nutzen Sie mainmenu.audioplayer Audioplayer mainmenu.channels Kanalliste mainmenu.clearsectionsd Lösche EPG Cache diff --git a/data/locale/english.locale b/data/locale/english.locale index 4c08276d9..d91d5a4c1 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -741,6 +741,9 @@ ledcontroler.off Led1 & Led2 off ledcontroler.on.all Led1 & Led2 on ledcontroler.on.led1 Led1 on ledcontroler.on.led2 Led2 on +lua.function_deprecated1 Attention! +lua.function_deprecated2 Function +lua.function_deprecated3 is deprecated,\n please use mainmenu.audioplayer Audioplayer mainmenu.channels Channels mainmenu.clearsectionsd Clear EPG Cache diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 68a36e80a..66dd47a0d 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -307,6 +307,18 @@ CLuaInstance::~CLuaInstance() } } +void CLuaInstance::functionDeprecated(lua_State *L, const char* oldFunc, const char* newFunc) +{ + lua_Debug ar; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + printf("[Lua Script] \33[1;31m%s\33[0m %s \33[33m%s\33[0m %s \33[1;33m%s\33[0m.\n (%s:%d)\n", + g_Locale->getText(LOCALE_LUA_FUNCTION_DEPRECATED1), + g_Locale->getText(LOCALE_LUA_FUNCTION_DEPRECATED2), oldFunc, + g_Locale->getText(LOCALE_LUA_FUNCTION_DEPRECATED3), newFunc, + ar.short_src, ar.currentline); +} + #define SET_VAR1(NAME) \ lua_pushinteger(lua, NAME); \ lua_setglobal(lua, #NAME); diff --git a/src/gui/luainstance.h b/src/gui/luainstance.h index 388e2b427..c40e3d6d5 100644 --- a/src/gui/luainstance.h +++ b/src/gui/luainstance.h @@ -161,6 +161,8 @@ private: lua_State* lua; void registerFunctions(); + static void functionDeprecated(lua_State *L, const char* oldFunc, const char* newFunc); + static int NewWindow(lua_State *L); static int PaintBox(lua_State *L); static int PaintIcon(lua_State *L); diff --git a/src/system/locals.h b/src/system/locals.h index 2ac9d7fd0..e52de6d83 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -768,6 +768,9 @@ typedef enum LOCALE_LEDCONTROLER_ON_ALL, LOCALE_LEDCONTROLER_ON_LED1, LOCALE_LEDCONTROLER_ON_LED2, + LOCALE_LUA_FUNCTION_DEPRECATED1, + LOCALE_LUA_FUNCTION_DEPRECATED2, + LOCALE_LUA_FUNCTION_DEPRECATED3, LOCALE_MAINMENU_AUDIOPLAYER, LOCALE_MAINMENU_CHANNELS, LOCALE_MAINMENU_CLEARSECTIONSD, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index f2369d4a4..e7cad05c9 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -768,6 +768,9 @@ const char * locale_real_names[] = "ledcontroler.on.all", "ledcontroler.on.led1", "ledcontroler.on.led2", + "lua.function_deprecated1", + "lua.function_deprecated2", + "lua.function_deprecated3", "mainmenu.audioplayer", "mainmenu.channels", "mainmenu.clearsectionsd",