summaryrefslogtreecommitdiff
path: root/plugins/StatusManager/src/main.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-12-06 20:06:44 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-12-06 20:06:44 +0300
commit09bce81d5eae2a46dd039e9fa14290c77685d637 (patch)
tree00d3a8332aff9d667d385eaaeb078de4edc441b4 /plugins/StatusManager/src/main.cpp
parent5a16d189158c71db28c481a44706c73c83fd6e76 (diff)
fixes #1054 (StatusManager cannot enable/disable modules "on the fly")
Diffstat (limited to 'plugins/StatusManager/src/main.cpp')
-rw-r--r--plugins/StatusManager/src/main.cpp15
1 files changed, 9 insertions, 6 deletions
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;
}