summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-03-20 18:50:20 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-03-20 18:50:20 +0300
commitce09a6d8185f0d9ee8c2b67969aed25e5a29eebe (patch)
treef902c3057bde9934885ac46b34ef7df1c0575f83 /plugins/MirLua/src
parente7fa95c0ba95d5c78582eb2e03d68d27048c1da4 (diff)
code cleaning
Diffstat (limited to 'plugins/MirLua/src')
-rw-r--r--plugins/MirLua/src/options.cpp31
-rw-r--r--plugins/MirLua/src/options.h4
2 files changed, 4 insertions, 31 deletions
diff --git a/plugins/MirLua/src/options.cpp b/plugins/MirLua/src/options.cpp
index a47ae51bd0..8eac5798e0 100644
--- a/plugins/MirLua/src/options.cpp
+++ b/plugins/MirLua/src/options.cpp
@@ -1,9 +1,8 @@
#include "stdafx.h"
-CMLuaOptionsMain::CMLuaOptionsMain(CMPlugin &plugin)
- : CDlgBase(plugin, IDD_OPTIONSMAIN),
+CMLuaOptionsMain::CMLuaOptionsMain(CMPlugin &plugin) :
+ CDlgBase(plugin, IDD_OPTIONSMAIN),
m_plugin(plugin),
- isScriptListInit(false),
m_popupOnError(this, IDC_POPUPONERROR),
m_popupOnObsolete(this, IDC_POPUPONOBSOLETE),
m_scriptsList(this, IDC_SCRIPTS),
@@ -47,7 +46,6 @@ bool CMLuaOptionsMain::OnInitDialog()
{
CDlgBase::OnInitDialog();
- m_scriptsList.SetSilent();
m_scriptsList.SetExtendedListViewStyle(LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES | LVS_EX_INFOTIP);
HIMAGELIST hImageList = m_scriptsList.CreateImageList(LVSIL_SMALL);
@@ -72,8 +70,6 @@ bool CMLuaOptionsMain::OnInitDialog()
m_scriptsList.AddColumn(3, nullptr, 36 - GetSystemMetrics(SM_CXVSCROLL));
LoadScripts();
-
- isScriptListInit = true;
return true;
}
@@ -90,25 +86,6 @@ bool CMLuaOptionsMain::OnApply()
return true;
}
-INT_PTR CMLuaOptionsMain::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch (msg) {
- case WM_NOTIFY:
- {
- LPNMHDR lpnmHdr = (LPNMHDR)lParam;
- if (lpnmHdr->idFrom == (UINT_PTR)m_scriptsList.GetCtrlId() && lpnmHdr->code == LVN_ITEMCHANGED) {
- LPNMLISTVIEW pnmv = (LPNMLISTVIEW)lParam;
- if (pnmv->uChanged & LVIF_STATE && pnmv->uNewState & LVIS_STATEIMAGEMASK) {
- if (isScriptListInit)
- NotifyChange();
- }
- }
- }
- break;
- }
- return CDlgBase::DlgProc(msg, wParam, lParam);
-}
-
void CMLuaOptionsMain::OnScriptListClick(CCtrlListView::TEventInfo *evt)
{
LVITEM lvi = {};
@@ -155,11 +132,11 @@ void CMLuaOptionsMain::OnScriptListClick(CCtrlListView::TEventInfo *evt)
void CMLuaOptionsMain::OnReload(CCtrlBase*)
{
- isScriptListInit = false;
+ m_scriptsList.SetSilent(true);
m_scriptsList.DeleteAllItems();
m_plugin.ReloadLuaScripts();
LoadScripts();
- isScriptListInit = true;
+ m_scriptsList.SetSilent(false);
}
/***********************************************/
diff --git a/plugins/MirLua/src/options.h b/plugins/MirLua/src/options.h
index 879f06b55a..f109f4f83d 100644
--- a/plugins/MirLua/src/options.h
+++ b/plugins/MirLua/src/options.h
@@ -5,8 +5,6 @@ class CMLuaOptionsMain : public CDlgBase
private:
CMPlugin &m_plugin;
- bool isScriptListInit;
-
CCtrlCheck m_popupOnError;
CCtrlCheck m_popupOnObsolete;
@@ -22,8 +20,6 @@ protected:
void OnScriptListClick(CCtrlListView::TEventInfo *evt);
void OnReload(CCtrlBase*);
- INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
-
public:
CMLuaOptionsMain(CMPlugin &plugin);
};