From 09bce81d5eae2a46dd039e9fa14290c77685d637 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 6 Dec 2017 20:06:44 +0300 Subject: fixes #1054 (StatusManager cannot enable/disable modules "on the fly") --- plugins/StatusManager/src/main.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'plugins/StatusManager/src/main.cpp') diff --git a/plugins/StatusManager/src/main.cpp b/plugins/StatusManager/src/main.cpp index e1cdb19222..7e5b41fd5d 100644 --- a/plugins/StatusManager/src/main.cpp +++ b/plugins/StatusManager/src/main.cpp @@ -62,7 +62,6 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) MUUID Interfaces[2] = {0}; MUUID miidAutoAway = MIID_AUTOAWAY; - MUUID* GetInterfaces(void) { if (IsSubPluginEnabled(AAAMODULENAME)) @@ -75,8 +74,11 @@ extern "C" __declspec(dllexport) MUUID* MirandaInterfaces = GetInterfaces(); ///////////////////////////////////////////////////////////////////////////////////////// // plugin's entry point +bool g_bMirandaLoaded = false; + int OnModulesLoaded(WPARAM, LPARAM) { + g_bMirandaLoaded = true; HookEvent(ME_OPT_INITIALISE, CSubPluginsOptionsDlg::OnOptionsInit); return 0; } @@ -96,7 +98,6 @@ extern "C" int __declspec(dllexport) Load(void) StartupStatusLoad(); if (IsSubPluginEnabled(AAAMODULENAME)) AdvancedAutoAwayLoad(); - return 0; } @@ -105,9 +106,11 @@ extern "C" int __declspec(dllexport) Load(void) extern "C" int __declspec(dllexport) Unload(void) { - KeepStatusUnload(); - StartupStatusUnload(); - AdvancedAutoAwayUnload(); - + if (IsSubPluginEnabled(KSMODULENAME)) + KeepStatusUnload(); + if (IsSubPluginEnabled(SSMODULENAME)) + StartupStatusUnload(); + if (IsSubPluginEnabled(AAAMODULENAME)) + AdvancedAutoAwayUnload(); return 0; } -- cgit v1.2.3