From 52cef119864adf6e75ed22876d095f540f5da3d9 Mon Sep 17 00:00:00 2001 From: Syping Date: Sun, 26 Aug 2018 22:42:36 +0200 Subject: [PATCH] improved function naming --- src/luaengineapp/edit.lua | 10 +++++----- src/luaenginegui/luaengine/LuaEngineGui.cpp | 6 ++---- src/luaenginegui/luaengine/LuaEngineGui.h | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/luaengineapp/edit.lua b/src/luaengineapp/edit.lua index 1aa8788..2f239df 100644 --- a/src/luaengineapp/edit.lua +++ b/src/luaengineapp/edit.lua @@ -30,23 +30,23 @@ function main() local menuBar = createMenuBar(mainWindow) local menuFile = createMenu("&File", menuBar) local menuEntryNew = createMenuEntry("&New", menuFile) - setKeySequence(menuEntryNew, "Ctrl+N") + setMenuShortcut(menuEntryNew, "Ctrl+N") connect(menuEntryNew, "triggered()", "editorNew") local menuEntryOpen = createMenuEntry("&Open...", menuFile) - setKeySequence(menuEntryOpen, "Ctrl+O") + setMenuShortcut(menuEntryOpen, "Ctrl+O") connect(menuEntryOpen, "triggered()", "editorOpen") local menuEntrySave = createMenuEntry("&Save...", menuFile) - setKeySequence(menuEntrySave, "Ctrl+S") + setMenuShortcut(menuEntrySave, "Ctrl+S") connect(menuEntrySave, "triggered()", "editorSave") local menuEntrySaveAs = createMenuEntry("Save &as...", menuFile) connect(menuEntrySaveAs, "triggered()", "editorSaveAs") createMenuSeparator(menuFile) local menuEntryExit = createMenuEntry("&Exit", menuFile) - setKeySequence(menuEntryExit, "Alt+F4") + setMenuShortcut(menuEntryExit, "Alt+F4") connect(menuEntryExit, "triggered()", "editorClose") local menuHelp = createMenu("&Help", menuBar) local menuEntryAbout = createMenuEntry("&About LE Text Editor", menuHelp) - setKeySequence(menuEntryAbout, "Ctrl+P") + setMenuShortcut(menuEntryAbout, "Ctrl+P") connect(menuEntryAbout, "triggered()", "editorAboutBox") textEditor = createPlainTextEdit("", mainWidget) diff --git a/src/luaenginegui/luaengine/LuaEngineGui.cpp b/src/luaenginegui/luaengine/LuaEngineGui.cpp index 2782e5b..851f23a 100644 --- a/src/luaenginegui/luaengine/LuaEngineGui.cpp +++ b/src/luaenginegui/luaengine/LuaEngineGui.cpp @@ -99,9 +99,6 @@ void LuaEngineGui::pushClass(lua_State *L_p) // Line Edit pushFunction(L_p, "createLineEdit", createLineEdit); - // Key Sequence - pushFunction(L_p, "setKeySequence", setKeySequence); - // Main Window pushFunction(L_p, "createMainWindow", createMainWindow); pushFunction(L_p, "createCentralWidget", createCentralWidget); @@ -111,6 +108,7 @@ void LuaEngineGui::pushClass(lua_State *L_p) pushFunction(L_p, "createMenuBar", createMenuBar); pushFunction(L_p, "createMenuEntry", createMenuEntry); pushFunction(L_p, "createMenuSeparator", createMenuSeparator); + pushFunction(L_p, "setMenuShortcut", setMenuShortcut); // Plain Text Edit pushFunction(L_p, "createPlainTextEdit", createPlainTextEdit); @@ -326,7 +324,7 @@ int LuaEngineGui::setLayoutMargins(lua_State *L_p) return 0; } -int LuaEngineGui::setKeySequence(lua_State *L_p) +int LuaEngineGui::setMenuShortcut(lua_State *L_p) { if (getArgumentCount(L_p) >= 2) { void *pointer = getPointer(L_p, 1); diff --git a/src/luaenginegui/luaengine/LuaEngineGui.h b/src/luaenginegui/luaengine/LuaEngineGui.h index 7e95639..7ba2504 100644 --- a/src/luaenginegui/luaengine/LuaEngineGui.h +++ b/src/luaenginegui/luaengine/LuaEngineGui.h @@ -36,7 +36,7 @@ public: static int executeWidget(lua_State *L_p); static int showWidget(lua_State *L_p); static int setLayoutMargins(lua_State *L_p); - static int setKeySequence(lua_State *L_p); + static int setMenuShortcut(lua_State *L_p); static int setWidgetFixedSize(lua_State *L_p); static int setWidgetLayout(lua_State *L_p); static int setWidgetText(lua_State *L_p);