From ce09a6d8185f0d9ee8c2b67969aed25e5a29eebe Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 20 Mar 2021 18:50:20 +0300 Subject: code cleaning --- plugins/MirLua/src/options.cpp | 31 ++++--------------------------- plugins/MirLua/src/options.h | 4 ---- 2 files changed, 4 insertions(+), 31 deletions(-) (limited to 'plugins/MirLua/src') 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); }; -- cgit v1.2.3