mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
CLuaInstance: Precise error message for obsolete hide() parameter
- Supplement for commit 75631a97f1
This commit is contained in:
@@ -152,7 +152,7 @@ int CLuaInstCCPicture::CCPictureHide(lua_State *L)
|
|||||||
bool tmp1 = false;
|
bool tmp1 = false;
|
||||||
std::string tmp2 = "false";
|
std::string tmp2 = "false";
|
||||||
if ((tableLookup(L, "no_restore", tmp1)) || (tableLookup(L, "no_restore", tmp2)))
|
if ((tableLookup(L, "no_restore", tmp1)) || (tableLookup(L, "no_restore", tmp2)))
|
||||||
printf("[%s:hide] Warning, obsolete parameter in use, please remove!\n", "cpicture");
|
obsoleteHideParameter(L);
|
||||||
|
|
||||||
if (D->parent) {
|
if (D->parent) {
|
||||||
D->cp->setPicture("");
|
D->cp->setPicture("");
|
||||||
|
@@ -177,7 +177,7 @@ int CLuaInstCCText::CCTextHide(lua_State *L)
|
|||||||
bool tmp1 = false;
|
bool tmp1 = false;
|
||||||
std::string tmp2 = "false";
|
std::string tmp2 = "false";
|
||||||
if ((tableLookup(L, "no_restore", tmp1)) || (tableLookup(L, "no_restore", tmp2)))
|
if ((tableLookup(L, "no_restore", tmp1)) || (tableLookup(L, "no_restore", tmp2)))
|
||||||
printf("[%s:hide] Warning, obsolete parameter in use, please remove!\n", "ctext");
|
obsoleteHideParameter(L);
|
||||||
|
|
||||||
if (D->parent) {
|
if (D->parent) {
|
||||||
D->ct->setText("", D->mode, g_Font[D->font_text]);
|
D->ct->setText("", D->mode, g_Font[D->font_text]);
|
||||||
|
@@ -200,7 +200,7 @@ int CLuaInstCCWindow::CCWindowHide(lua_State *L)
|
|||||||
bool tmp1 = false;
|
bool tmp1 = false;
|
||||||
std::string tmp2 = "false";
|
std::string tmp2 = "false";
|
||||||
if ((tableLookup(L, "no_restore", tmp1)) || (tableLookup(L, "no_restore", tmp2)))
|
if ((tableLookup(L, "no_restore", tmp1)) || (tableLookup(L, "no_restore", tmp2)))
|
||||||
printf("[%s:hide] Warning, obsolete parameter in use, please remove!\n", "cwindow");
|
obsoleteHideParameter(L);
|
||||||
|
|
||||||
D->w->hide();
|
D->w->hide();
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -84,6 +84,14 @@ void functionDeprecated(lua_State *L, const char* oldFunc, const char* newFunc)
|
|||||||
ar.short_src, ar.currentline);
|
ar.short_src, ar.currentline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void obsoleteHideParameter(lua_State *L)
|
||||||
|
{
|
||||||
|
lua_Debug ar;
|
||||||
|
lua_getstack(L, 1, &ar);
|
||||||
|
lua_getinfo(L, "Sl", &ar);
|
||||||
|
printf("\33[1;31m[Lua script warning]\33[0m %s:%d: Obsolete parameter for hide() in use, please remove!\n", ar.short_src, ar.currentline);
|
||||||
|
}
|
||||||
|
|
||||||
lua_Unsigned checkMagicMask(lua_Unsigned col)
|
lua_Unsigned checkMagicMask(lua_Unsigned col)
|
||||||
{
|
{
|
||||||
if ((col & MAGIC_MASK) == MAGIC_COLOR)
|
if ((col & MAGIC_MASK) == MAGIC_COLOR)
|
||||||
|
@@ -85,6 +85,7 @@ bool _luaL_checkbool(lua_State *L, int numArg);
|
|||||||
void paramBoolDeprecated(lua_State *L, const char* val);
|
void paramBoolDeprecated(lua_State *L, const char* val);
|
||||||
void paramDeprecated(lua_State *L, const char* oldParam, const char* newParam);
|
void paramDeprecated(lua_State *L, const char* oldParam, const char* newParam);
|
||||||
void functionDeprecated(lua_State *L, const char* oldFunc, const char* newFunc);
|
void functionDeprecated(lua_State *L, const char* oldFunc, const char* newFunc);
|
||||||
|
void obsoleteHideParameter(lua_State *L);
|
||||||
lua_Unsigned checkMagicMask(lua_Unsigned col);
|
lua_Unsigned checkMagicMask(lua_Unsigned col);
|
||||||
|
|
||||||
bool tableLookup(lua_State*, const char*, std::string&);
|
bool tableLookup(lua_State*, const char*, std::string&);
|
||||||
|
Reference in New Issue
Block a user