summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-06-11 10:32:31 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-06-11 10:32:31 +0000
commitea10fa390a8ca647ada27173ec5d375b8a597aa2 (patch)
tree634f8a6dea0dcca7b373fcd4e0ce1fc02dfaf0e6
parentba33f8bbdd9a2d8c6f45454e2174770f444ffa2f (diff)
MirLua: tuneup debug console
git-svn-id: http://svn.miranda-ng.org/main/trunk@14114 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/MirLua/docs/examples/database.lua2
-rw-r--r--plugins/MirLua/src/m_icolib.cpp2
-rw-r--r--plugins/MirLua/src/main.cpp15
3 files changed, 11 insertions, 8 deletions
diff --git a/plugins/MirLua/docs/examples/database.lua b/plugins/MirLua/docs/examples/database.lua
index 42625a4f64..33b6863322 100644
--- a/plugins/MirLua/docs/examples/database.lua
+++ b/plugins/MirLua/docs/examples/database.lua
@@ -26,3 +26,5 @@ if db.GetContactSetting(nil, 'MirLua', 'testByte') then
-- @param module The name of section
-- @param setting The name of setting
db.DeleteContactSetting(nil, 'MirLua', 'testString');
+
+db.WriteContactSetting(nil, 'MirLua', 'ShowConsole', 1)
diff --git a/plugins/MirLua/src/m_icolib.cpp b/plugins/MirLua/src/m_icolib.cpp
index cc8808aa0e..a1e1a35d24 100644
--- a/plugins/MirLua/src/m_icolib.cpp
+++ b/plugins/MirLua/src/m_icolib.cpp
@@ -12,7 +12,7 @@ static int lua_AddIcon(lua_State *L)
si.flags = SIDF_PATH_TCHAR;
si.pszName = iconName;
si.description.a = (char*)lua_tostring(L, 2);
- si.section.a = lua_isnone(L, 3) ? "MirLua" : (char*)lua_tostring(L, 3);
+ si.section.a = lua_isnone(L, 3) ? MODULE : (char*)lua_tostring(L, 3);
si.defaultFile.t = filePath;
si.iDefaultIndex = -IDI_ICON;
diff --git a/plugins/MirLua/src/main.cpp b/plugins/MirLua/src/main.cpp
index 36c64e2572..ae95013c1a 100644
--- a/plugins/MirLua/src/main.cpp
+++ b/plugins/MirLua/src/main.cpp
@@ -72,15 +72,16 @@ extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
-#ifdef _DEBUG
- if (AllocConsole())
+ if (db_get_b(NULL, MODULE, "ShowConsole", 0))
{
- freopen("CONOUT$", "wt", stdout);
- hConsole = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL);
- SetConsoleTitle(_T("MirLua Console"));
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED);
+ if (AllocConsole())
+ {
+ freopen("CONOUT$", "wt", stdout);
+ hConsole = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL);
+ SetConsoleTitle(_T("MirLua Console"));
+ SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED);
+ }
}
-#endif
mLua = new CMLua();