From 5b2a0bab5da65abd84e180af0b6c4a6185cc8d93 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 10 Jul 2019 12:27:05 +0300 Subject: fixes #1943 (after loading plugins via Plugin Updater checkboxes aren't set correctly in Options - Plugins) --- src/mir_app/src/pluginopts.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp index 226fe9a9b2..20e766e75a 100644 --- a/src/mir_app/src/pluginopts.cpp +++ b/src/mir_app/src/pluginopts.cpp @@ -142,8 +142,6 @@ static BOOL dialogListPlugins(WIN32_FIND_DATA *fd, wchar_t *path, WPARAM, LPARAM else if (isPluginOnWhiteList(fd->cFileName)) { if (!dat->bRequiresRestart) dat->bWasChecked = true; - if (hInst) - pCtrl->SetItemState(dat->iRow, 0x2000, LVIS_STATEIMAGEMASK); } if (dat->iRow != -1) { @@ -310,15 +308,20 @@ public: m_plugList.SetExtendedListViewStyleEx(0, LVS_EX_SUBITEMIMAGES | LVS_EX_CHECKBOXES | LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT); - // scan the plugin dir for plugins, cos + // scan the plugin dir for plugins arPluginList.destroy(); m_szFilter.Empty(); enumPlugins(dialogListPlugins, (WPARAM)m_hwnd, (LPARAM)&m_plugList); + // some plugins could be just loaded by Plugin Updater, load them first for (auto &it : arPluginList) if (!it->bWasLoaded && it->bWasChecked && !it->hInst) - if (LoadPluginDynamically(it)) - m_plugList.SetItemState(it->iRow, 0x2000, LVIS_STATEIMAGEMASK); + LoadPluginDynamically(it); + + // set checkboxes for all loaded plugins + for (auto &it : arPluginList) + if (isPluginOnWhiteList(it->fileName) && it->hInst) + m_plugList.SetItemState(it->iRow, 0x2000, LVIS_STATEIMAGEMASK); // sort out the headers m_plugList.SetColumnWidth(0, LVSCW_AUTOSIZE); // dll name -- cgit v1.2.3