summaryrefslogtreecommitdiff
path: root/plugins/MirLua/Modules
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2016-06-24 17:43:57 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2016-06-24 17:43:57 +0000
commitee37779cc2bdb12315b962af3df2501fdcc68089 (patch)
treeacffa7bb1c61394af0deadc7382a3780af0263ad /plugins/MirLua/Modules
parent1664b4b774a97119c71a334916778d8ee2883fba (diff)
temporary revert
git-svn-id: http://svn.miranda-ng.org/main/trunk@17032 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/Modules')
-rw-r--r--plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp b/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp
index 004eee6b87..de2fbdc021 100644
--- a/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp
+++ b/plugins/MirLua/Modules/m_msg_buttonsbar/src/main.cpp
@@ -36,14 +36,14 @@ static int lua_AddButton(lua_State *L)
{
if (lua_type(L, 1) != LUA_TTABLE)
{
- lua_pushboolean(L, false);
+ lua_pushlightuserdata(L, 0);
return 1;
}
- BBButton *bbb = MakeBBButton(L);
+ BBButton* bbb = MakeBBButton(L);
INT_PTR res = CallService(MS_BB_ADDBUTTON, 0, (LPARAM)bbb);
- lua_pushboolean(L, !res);
+ lua_pushinteger(L, res);
return 1;
}
@@ -52,14 +52,14 @@ static int lua_ModifyButton(lua_State *L)
{
if (lua_type(L, 1) != LUA_TTABLE)
{
- lua_pushboolean(L, false);
+ lua_pushlightuserdata(L, 0);
return 1;
}
- BBButton *bbb = MakeBBButton(L);
+ BBButton* bbb = MakeBBButton(L);
INT_PTR res = CallService(MS_BB_MODIFYBUTTON, 0, (LPARAM)bbb);
- lua_pushboolean(L, !res);
+ lua_pushinteger(L, res);
mir_free(bbb->pszModuleName);
mir_free(bbb->ptszTooltip);
@@ -70,15 +70,14 @@ static int lua_ModifyButton(lua_State *L)
static int lua_RemoveButton(lua_State *L)
{
- ptrA module(mir_utf8decodeA(luaL_checkstring(L, 1)));
- int buttonId = luaL_checkinteger(L, 2);
+ ptrA szModuleName(mir_utf8decodeA(luaL_checkstring(L, 1)));
BBButton mbb = { sizeof(BBButton) };
- mbb.pszModuleName = module;
- mbb.dwButtonID = buttonId;
+ mbb.pszModuleName = szModuleName;
+ mbb.dwButtonID = luaL_checkinteger(L, 2);
- INT_PTR res = CallService(MS_BB_REMOVEBUTTON, 0, (LPARAM)&mbb);
- lua_pushboolean(L, !res);
+ INT_PTR res = ::CallService(MS_BB_REMOVEBUTTON, 0, (LPARAM)&mbb);
+ lua_pushinteger(L, res);
return 1;
}