diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-07-14 11:37:39 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-07-14 11:37:39 +0000 |
commit | a5983f7d5999e6488e4b21fb17fa1d7702ecfb03 (patch) | |
tree | 1efe77345af957e40fc9bdc90b3824903708a2fb /plugins/MirLua/src/mlua_options.cpp | |
parent | e13b6b468a19ab498231c338bdda07f7028fb1df (diff) |
MirLua: added single script reloading
git-svn-id: http://svn.miranda-ng.org/main/trunk@14557 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/mlua_options.cpp')
-rw-r--r-- | plugins/MirLua/src/mlua_options.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/plugins/MirLua/src/mlua_options.cpp b/plugins/MirLua/src/mlua_options.cpp index 9c59e246e3..caca892e48 100644 --- a/plugins/MirLua/src/mlua_options.cpp +++ b/plugins/MirLua/src/mlua_options.cpp @@ -65,6 +65,7 @@ void CLuaOptions::LoadScripts(const TCHAR *scriptDir, int iGroup) if (db_get_b(NULL, MODULE, _T2A(fd.cFileName), 1))
m_scripts.SetCheckState(iItem, TRUE);
m_scripts.SetItem(iItem, 1, _T(""), 0);
+ m_scripts.SetItem(iItem, 2, _T(""), 1);
}
} while (FindNextFile(hFind, &fd));
FindClose(hFind);
@@ -93,12 +94,13 @@ void CLuaOptions::OnInitDialog() m_scripts.SetExtendedListViewStyle(LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES | LVS_EX_INFOTIP);
m_scripts.EnableGroupView(TRUE);
- m_scripts.AddColumn(0, _T("Script"), 440);
+ m_scripts.AddColumn(0, _T("Script"), 420);
m_scripts.AddColumn(1, NULL, 32 - GetSystemMetrics(SM_CXVSCROLL));
+ m_scripts.AddColumn(2, NULL, 32 - GetSystemMetrics(SM_CXVSCROLL));
HIMAGELIST hImageList = m_scripts.CreateImageList(LVSIL_SMALL);
- HICON icon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_OPEN));
- ImageList_AddIcon(hImageList, icon);
+ ImageList_AddIcon(hImageList, LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_OPEN)));
+ ImageList_AddIcon(hImageList, LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_RELOAD)));
LoadScripts();
@@ -161,6 +163,16 @@ void CLuaOptions::OnScriptListClick(CCtrlListView::TEventInfo *evt) FoldersGetCustomPathT(g_hCustomFolderPath, path, _countof(path), VARST(CUSTOM_SCRIPTS_PATHT));
ShellExecute(m_hwnd, NULL, lvi.pszText, NULL, path, SW_SHOWNORMAL);
}
+ else if (lvi.iSubItem == 2)
+ {
+ TCHAR path[MAX_PATH];
+ if (lvi.iGroupId == 0)
+ FoldersGetCustomPathT(g_hCommonFolderPath, path, _countof(path), VARST(COMMON_SCRIPTS_PATHT));
+ else
+ FoldersGetCustomPathT(g_hCustomFolderPath, path, _countof(path), VARST(CUSTOM_SCRIPTS_PATHT));
+ mir_sntprintf(path, _T("%s\\%s"), path, lvi.pszText);
+ g_mLua->Reload(path);
+ }
mir_free(lvi.pszText);
}
|