summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/m_genmenu.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-06-28 20:57:04 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-06-28 20:57:04 +0000
commit7beb7bfa38534b47587d80b257fa90d2258eaa58 (patch)
tree950adb15bcbe1c76896706d24c964807c932907d /plugins/MirLua/src/m_genmenu.cpp
parent23af22967ac679d10ea565b69e6374443f01324e (diff)
MirLua: small fix for m_genmenu
git-svn-id: http://svn.miranda-ng.org/main/trunk@14434 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/m_genmenu.cpp')
-rw-r--r--plugins/MirLua/src/m_genmenu.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp
index 1d03263970..eabc1cef71 100644
--- a/plugins/MirLua/src/m_genmenu.cpp
+++ b/plugins/MirLua/src/m_genmenu.cpp
@@ -51,7 +51,7 @@ static int lua_AddMainMenuItem(lua_State *L)
mir_ptr<TMO_MenuItem> pmi(MakeMenuItem(L));
- HGENMENU res = Menu_AddMainMenuItem(pmi);
+ HGENMENU res = ::Menu_AddMainMenuItem(pmi);
lua_pushlightuserdata(L, res);
return 1;
@@ -67,7 +67,7 @@ static int lua_AddContactMenuItem(lua_State *L)
mir_ptr<TMO_MenuItem> pmi(MakeMenuItem(L));
- HGENMENU res = Menu_AddContactMenuItem(pmi);
+ HGENMENU res = ::Menu_AddContactMenuItem(pmi);
lua_pushlightuserdata(L, res);
return 1;
@@ -92,16 +92,13 @@ static int lua_AddTrayMenuItem(lua_State *L)
static int lua_ModifyMenuItem(lua_State *L)
{
HGENMENU hMenuItem = (HGENMENU)lua_touserdata(L, 1);
-
- if (lua_type(L, 2) != LUA_TTABLE)
- {
- lua_pushlightuserdata(L, 0);
- return 1;
- }
+ ptrT name(mir_utf8decodeT(luaL_checkstring(L, 2)));
+ HANDLE hIcolibItem = lua_touserdata(L, 3);
+ int flags = lua_tointeger(L, 4);
mir_ptr<TMO_MenuItem> pmi(MakeMenuItem(L));
- INT_PTR res = ::Menu_ModifyItem(hMenuItem, pmi->name.t, pmi->hIcolibItem, pmi->flags);
+ INT_PTR res = ::Menu_ModifyItem(hMenuItem, name, hIcolibItem, flags);
lua_pushinteger(L, res);
return 1;
}