summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-03-31 20:02:02 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-03-31 20:02:07 +0300
commit388cd38ea9ad34804b92763706a581457610e6c9 (patch)
tree6b266876e0809b81f597504c1553455c9483dea9 /src
parentb5a35562213a8f93f2518af935a7144f92c72f00 (diff)
fixes #2802 (Options are duplicated after opening in account manager)
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/options.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp
index 962bc36b73..a0db563361 100644
--- a/src/mir_app/src/options.cpp
+++ b/src/mir_app/src/options.cpp
@@ -41,6 +41,7 @@ static class COptionsDlg *pOptionsDlg = nullptr;
// Thread for search keywords in dialogs
static BYTE bSearchState = 0; // 0 - not executed; 1 - in progress; 2 - completed;
+static bool bLoadingPrivateOptions = false;
static int FilterLoadProgress = 100;
struct OptionsPage : public OPTIONSDIALOGPAGE
@@ -1161,7 +1162,9 @@ void OpenAccountOptions(PROTOACCOUNT *pa)
return;
OptionsPageList arPages(1);
+ bLoadingPrivateOptions = true;
CallObjectEventHook(pa->ppro, hOptionsInitEvent, (WPARAM)&arPages, 0);
+ bLoadingPrivateOptions = false;
if (arPages.getCount() == 0)
return;
@@ -1244,7 +1247,7 @@ MIR_APP_DLL(int) Options_AddPage(WPARAM wParam, OPTIONSDIALOGPAGE *odp, HPLUGIN
if (pList != nullptr)
pList->insert(dst);
- if (pOptionsDlg)
+ if (pOptionsDlg && !bLoadingPrivateOptions)
pOptionsDlg->DynamicAddPage(dst);
return 0;
}
@@ -1267,8 +1270,10 @@ static INT_PTR OpenOptionsDialog(WPARAM, LPARAM)
static int OptDynamicLoadOptions(WPARAM, LPARAM hInstance)
{
+ bLoadingPrivateOptions = true;
OptionsPageList arPages(1);
CallPluginEventHook((HINSTANCE)hInstance, hOptionsInitEvent, (WPARAM)&arPages, 0);
+ bLoadingPrivateOptions = false;
return 0;
}