mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 09:21:09 +02:00
CLuaInstance: Add function 'functionDeprecated()' for debug output...
...when a script function is deprecated.
Origin commit data
------------------
Branch: ni/coolstream
Commit: 5136563035
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2014-03-16 (Sun, 16 Mar 2014)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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,
|
||||
|
@@ -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",
|
||||
|
Reference in New Issue
Block a user