From 0ccdb951979ead80e9264233776b9147ff701fc7 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Wed, 24 Jun 2015 13:08:55 +0000 Subject: MirLua: options and log cosmetics git-svn-id: http://svn.miranda-ng.org/main/trunk@14362 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/mlua_options.cpp | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'plugins/MirLua/src/mlua_options.cpp') diff --git a/plugins/MirLua/src/mlua_options.cpp b/plugins/MirLua/src/mlua_options.cpp index 89fe72af98..bd8234ed9a 100644 --- a/plugins/MirLua/src/mlua_options.cpp +++ b/plugins/MirLua/src/mlua_options.cpp @@ -17,6 +17,18 @@ void CLuaOptions::CreateLink(CCtrlData& ctrl, const char *szSetting, TCHAR *szVa ctrl.CreateDbLink(MODULE, szSetting, szValue); } +int CLuaOptions::OnOptionsInit(WPARAM wParam, LPARAM) +{ + OPTIONSDIALOGPAGE odp = { 0 }; + odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE; + odp.ptszGroup = LPGENT("Scripts"); + odp.ptszTitle = _T("Lua"); + odp.pDialog = CLuaOptions::CreateOptionsPage(); + Options_AddPage(wParam, &odp); + + return 0; +} + void CLuaOptions::LoadScripts(const TCHAR *scriptDir, int iGroup) { TCHAR searchMask[MAX_PATH]; @@ -39,14 +51,8 @@ void CLuaOptions::LoadScripts(const TCHAR *scriptDir, int iGroup) } } -void CLuaOptions::OnInitDialog() +void CLuaOptions::LoadScripts() { - CDlgBase::OnInitDialog(); - - m_scripts.SetExtendedListViewStyle(LVS_EX_CHECKBOXES | LVS_EX_INFOTIP); - m_scripts.EnableGroupView(TRUE); - m_scripts.AddColumn(0, _T("Script"), 300); - TCHAR scriptDir[MAX_PATH], relativeScriptDir[MAX_PATH], header[MAX_PATH + 100]; FoldersGetCustomPathT(g_hCommonFolderPath, scriptDir, _countof(scriptDir), VARST(COMMON_SCRIPTS_PATHT)); PathToRelativeT(scriptDir, relativeScriptDir, NULL); @@ -59,6 +65,17 @@ void CLuaOptions::OnInitDialog() mir_sntprintf(header, _T("%s (%s)"), TranslateT("Custom scripts"), relativeScriptDir); m_scripts.AddGroup(1, header); LoadScripts(scriptDir, 1); +} + +void CLuaOptions::OnInitDialog() +{ + CDlgBase::OnInitDialog(); + + m_scripts.SetExtendedListViewStyle(LVS_EX_CHECKBOXES | LVS_EX_INFOTIP); + m_scripts.EnableGroupView(TRUE); + m_scripts.AddColumn(0, _T("Script"), 300); + + LoadScripts(); isScriptListInit = true; } @@ -102,5 +119,9 @@ INT_PTR CLuaOptions::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) void CLuaOptions::OnReload(CCtrlBase*) { + isScriptListInit = false; + m_scripts.DeleteAllItems(); + LoadScripts(); + isScriptListInit = true; g_mLua->Reload(); } \ No newline at end of file -- cgit v1.2.3