summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-06-16 16:11:54 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-06-16 16:11:54 +0000
commitbb6a5d218c33b602617afdf79b9f21f936897d08 (patch)
tree21881c68545c4e9189cfb7aa566fc4e5440d5d25
parent35205b9114784ff8f9f40b04f9ec8e14a250e467 (diff)
MirLua: added ability to disable scripts
git-svn-id: http://svn.miranda-ng.org/main/trunk@14209 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/MirLua/src/main.cpp3
-rw-r--r--plugins/MirLua/src/mlua_options.cpp8
-rw-r--r--plugins/MirLua/src/mlua_options.h1
3 files changed, 8 insertions, 4 deletions
diff --git a/plugins/MirLua/src/main.cpp b/plugins/MirLua/src/main.cpp
index ce1fa50de9..35d572a4c7 100644
--- a/plugins/MirLua/src/main.cpp
+++ b/plugins/MirLua/src/main.cpp
@@ -56,7 +56,8 @@ void LoadScripts(const TCHAR *scriptDir)
{
mir_sntprintf(fullPath, _T("%s\\%s"), scriptDir, fd.cFileName);
PathToRelativeT(fullPath, path);
- mLua->Load(T2Utf(path));
+ if (db_get_b(NULL, MODULE, _T2A(fd.cFileName), 1))
+ mLua->Load(T2Utf(path));
}
} while (FindNextFile(hFind, &fd));
FindClose(hFind);
diff --git a/plugins/MirLua/src/mlua_options.cpp b/plugins/MirLua/src/mlua_options.cpp
index dae408ea64..63389ef54e 100644
--- a/plugins/MirLua/src/mlua_options.cpp
+++ b/plugins/MirLua/src/mlua_options.cpp
@@ -1,7 +1,7 @@
#include "stdafx.h"
-CLuaOptions::CLuaOptions(int idDialog)
- : CDlgBase(g_hInstance, idDialog), m_scripts(this, IDC_SCRIPTS)
+CLuaOptions::CLuaOptions(int idDialog) : CDlgBase(g_hInstance, idDialog),
+ m_scripts(this, IDC_SCRIPTS), isScriptListInit(false)
{
}
@@ -88,6 +88,7 @@ void CLuaOptions::OnInitDialog()
} while (FindNextFile(hFind, &fd));
FindClose(hFind);
}
+ isScriptListInit = true;
}
INT_PTR CLuaOptions::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
@@ -102,7 +103,8 @@ INT_PTR CLuaOptions::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
LPNMLISTVIEW pnmv = (LPNMLISTVIEW)lParam;
if (pnmv->uChanged & LVIF_STATE && pnmv->uNewState & LVIS_STATEIMAGEMASK)
{
- NotifyChange();
+ if (isScriptListInit)
+ NotifyChange();
}
}
}
diff --git a/plugins/MirLua/src/mlua_options.h b/plugins/MirLua/src/mlua_options.h
index 4fae51a1fc..edbb574a5c 100644
--- a/plugins/MirLua/src/mlua_options.h
+++ b/plugins/MirLua/src/mlua_options.h
@@ -4,6 +4,7 @@
class CLuaOptions : public CDlgBase
{
private:
+ bool isScriptListInit;
CCtrlListView m_scripts;
void LoadScripts(const TCHAR *scriptDir);