diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-23 17:01:36 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-23 17:01:36 +0300 |
commit | 6f8261af4b1a79411f9a22585814141ac7b85c2b (patch) | |
tree | e462edc6cb68a036e2e348389abb3e58afd54902 | |
parent | 6a6b08bfbdc3d77874b72ccb4b99cc50c6b8397b (diff) |
fixes #1194 (Import: no main menu item until manual plugin off->on)
-rw-r--r-- | plugins/Import/src/main.cpp | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/plugins/Import/src/main.cpp b/plugins/Import/src/main.cpp index d6c7389699..d1d8447521 100644 --- a/plugins/Import/src/main.cpp +++ b/plugins/Import/src/main.cpp @@ -83,16 +83,24 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_IMPORT static int ModulesLoaded(WPARAM, LPARAM)
{
- if (db_get_b(NULL, IMPORT_MODULE, IMP_KEY_FR, 0))
- return 0;
-
- // Only autorun import wizard if at least one protocol is installed
- int nProtocols = 0;
- PROTOACCOUNT **ppProtos = nullptr;
- Proto_EnumAccounts(&nProtocols, &ppProtos);
- if (nProtocols > 0) {
- CallService(IMPORT_SERVICE, 0, 0);
- db_set_b(NULL, IMPORT_MODULE, IMP_KEY_FR, 1);
+ // menu item
+ CMenuItem mi;
+ SET_UID(mi, 0x20ffaf55, 0xafa0, 0x4da3, 0xa9, 0x46, 0x20, 0x51, 0xa0, 0x24, 0xb, 0x41);
+ mi.hIcolibItem = GetIconHandle(IDI_IMPORT);
+ mi.name.a = LPGEN("&Import...");
+ mi.position = 500050000;
+ mi.pszService = IMPORT_SERVICE;
+ Menu_AddMainMenuItem(&mi);
+
+ if (!db_get_b(NULL, IMPORT_MODULE, IMP_KEY_FR, 0)) {
+ // Only autorun import wizard if at least one protocol is installed
+ int nProtocols = 0;
+ PROTOACCOUNT **ppProtos = nullptr;
+ Proto_EnumAccounts(&nProtocols, &ppProtos);
+ if (nProtocols > 0) {
+ CallService(IMPORT_SERVICE, 0, 0);
+ db_set_b(NULL, IMPORT_MODULE, IMP_KEY_FR, 1);
+ }
}
return 0;
}
@@ -150,15 +158,6 @@ extern "C" __declspec(dllexport) int Load(void) CreateServiceFunction(MS_IMPORT_RUN, CustomImport);
RegisterIcons();
- // menu item
- CMenuItem mi;
- SET_UID(mi, 0x20ffaf55, 0xafa0, 0x4da3, 0xa9, 0x46, 0x20, 0x51, 0xa0, 0x24, 0xb, 0x41);
- mi.hIcolibItem = GetIconHandle(IDI_IMPORT);
- mi.name.a = LPGEN("&Import...");
- mi.position = 500050000;
- mi.pszService = IMPORT_SERVICE;
- Menu_AddMainMenuItem(&mi);
-
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
HookEvent(ME_SYSTEM_OKTOEXIT, OnExit);
|