summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp6
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp3
-rw-r--r--plugins/DbEditorPP/src/main.cpp6
-rw-r--r--plugins/FTPFileYM/src/ftpfile.cpp4
-rw-r--r--plugins/ListeningTo/src/listeningto.cpp1
-rw-r--r--plugins/NewsAggregator/Src/Menus.cpp3
-rw-r--r--plugins/Non-IM Contact/src/main.cpp1
-rw-r--r--plugins/Ping/src/pingthread.cpp58
-rw-r--r--plugins/Popup/src/main.cpp8
-rw-r--r--plugins/UserInfoEx/src/mir_menuitems.cpp351
10 files changed, 204 insertions, 237 deletions
diff --git a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
index ca7f000fbc..24cf7b4f08 100644
--- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
@@ -1494,19 +1494,18 @@ static int CLUIFramesLoadMainMenu()
cont.MainMenuItem = Menu_AddMainMenuItem(&mi);
// create frames menu
+ mi.hParentMenu = cont.MainMenuItem;
int separator = 3000200000;
for (int i = 0; i < g_nFramesCount; i++) {
mi.icolibItem = g_pfwFrames[i].TitleBar.hicon;
mi.flags = CMIF_TCHAR;
- mi.position = separator;
- mi.hParentMenu = cont.MainMenuItem;
+ mi.position = separator++;
mi.name.t = g_pfwFrames[i].TitleBar.tbname ? g_pfwFrames[i].TitleBar.tbname : g_pfwFrames[i].name;
mi.pszService = 0;
g_pfwFrames[i].MenuHandles.MainMenuItem = Menu_AddMainMenuItem(&mi);
CLUIFramesCreateMenuForFrame(g_pfwFrames[i].id, g_pfwFrames[i].MenuHandles.MainMenuItem, separator, true);
CLUIFramesModifyMainMenuItems(g_pfwFrames[i].id, 0);
CallService(MS_CLIST_FRAMEMENUNOTIFY, (WPARAM)g_pfwFrames[i].id, (LPARAM)g_pfwFrames[i].MenuHandles.MainMenuItem);
- separator++;
}
separator += 100000;
@@ -1515,7 +1514,6 @@ static int CLUIFramesLoadMainMenu()
mi.icolibItem = NULL;
mi.flags = 0;
mi.position = separator++;
- mi.hParentMenu = cont.MainMenuItem;
mi.name.a = LPGEN("Show all frames");
mi.pszService = MS_CLIST_FRAMES_SHOWALLFRAMES;
Menu_AddMainMenuItem(&mi);
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
index e3e2986474..d22724ac95 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
@@ -1346,12 +1346,12 @@ static int CLUIFramesLoadMainMenu()
cont.MainMenuItem = Menu_AddMainMenuItem(&mi);
// create frames menu
+ mi.hParentMenu = cont.MainMenuItem;
int separator = (int)3000200000;
for (int i = 0; i < nFramescount; i++) {
mi.icolibItem = Frames[i].TitleBar.hicon;
mi.flags = CMIF_TCHAR;
mi.position = separator;
- mi.hParentMenu = cont.MainMenuItem;
mi.name.t = Frames[i].TitleBar.tbname ? Frames[i].TitleBar.tbname : Frames[i].name;
mi.pszService = 0;
Frames[i].MenuHandles.MainMenuItem = Menu_AddMainMenuItem(&mi);
@@ -1367,7 +1367,6 @@ static int CLUIFramesLoadMainMenu()
mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
mi.flags = 0;
mi.position = separator++;
- mi.hParentMenu = cont.MainMenuItem;
mi.name.a = LPGEN("Show all frames");
mi.pszService = MS_CLIST_FRAMES_SHOWALLFRAMES;
Menu_AddMainMenuItem(&mi);
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp
index c887ddb809..ab44b2f97e 100644
--- a/plugins/DbEditorPP/src/main.cpp
+++ b/plugins/DbEditorPP/src/main.cpp
@@ -115,15 +115,14 @@ int ModulesLoaded(WPARAM, LPARAM)
// Register menu item
CLISTMENUITEM mi = { 0 };
mi.hParentMenu = Menu_CreateRoot(MO_MAIN, LPGENT("Database"), 1900000001);
+
mi.position = 1900000001;
mi.icolibItem = GetIcoLibHandle(ICO_DBE_BUTT);
mi.name.a = modFullname;
mi.pszService = "DBEditorpp/MenuCommand";
Menu_AddMainMenuItem(&mi);
- memset(&mi, 0, sizeof(mi));
- mi.position = 1900000001;
- mi.flags = 0;
+ mi.hParentMenu = NULL;
mi.icolibItem = GetIcoLibHandle(ICO_REGUSER);
mi.name.a = LPGEN("Open user tree in DBE++");
mi.pszService = "DBEditorpp/MenuCommand";
@@ -156,7 +155,6 @@ int ModulesLoaded(WPARAM, LPARAM)
if (bServiceMode)
CallService("DBEditorpp/MenuCommand", 0, 0);
-
return 0;
}
diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp
index ed5185dd71..90029b8159 100644
--- a/plugins/FTPFileYM/src/ftpfile.cpp
+++ b/plugins/FTPFileYM/src/ftpfile.cpp
@@ -114,9 +114,7 @@ void InitMenuItems()
mir_sntprintf(stzName, _countof(stzName), TranslateT("FTP Server %d"), i + 1);
mi.flags = CMIF_TCHAR;
- mi.hParentMenu = 0;
- if (opt.bUseSubmenu)
- mi.hParentMenu = hMenu;
+ mi.hParentMenu = (opt.bUseSubmenu) ? hMenu : 0;
mi.icolibItem = iconList[i].hIcolib;
hSubMenu[i] = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp
index 76de84c315..d1d7cc45c4 100644
--- a/plugins/ListeningTo/src/listeningto.cpp
+++ b/plugins/ListeningTo/src/listeningto.cpp
@@ -301,7 +301,6 @@ int ModulesLoaded(WPARAM, LPARAM)
hMainMenuGroup = Menu_AddMainMenuItem(&mi);
mi.hParentMenu = hMainMenuGroup;
- // mi.popupPosition = 500080000; !!!!!!!!!!!!!!!
mi.position = 0;
mi.pszService = MS_LISTENINGTO_MAINMENU;
mi.icolibItem = NULL;
diff --git a/plugins/NewsAggregator/Src/Menus.cpp b/plugins/NewsAggregator/Src/Menus.cpp
index 97a8d72adc..209e55bc19 100644
--- a/plugins/NewsAggregator/Src/Menus.cpp
+++ b/plugins/NewsAggregator/Src/Menus.cpp
@@ -62,6 +62,7 @@ void InitMenu()
// adding contact menu items
mi.hParentMenu = NULL;
mi.position = -0x7FFFFFFA;
+
mi.icolibItem = GetIconHandle("checkfeed");
mi.name.t = LPGENT("Check feed");
mi.pszService = MS_NEWSAGGREGATOR_CHECKFEED;
@@ -72,4 +73,4 @@ void InitMenu()
hService2[6] = Menu_AddContactMenuItem(&mi, MODULE);
Menu_ModifyItem(hService2[0], NULL, GetIconHandle(db_get_b(NULL, MODULE, "AutoUpdate", 1) ? "enabled" : "disabled"));
-} \ No newline at end of file
+}
diff --git a/plugins/Non-IM Contact/src/main.cpp b/plugins/Non-IM Contact/src/main.cpp
index d3fb864733..c14f80d8f1 100644
--- a/plugins/Non-IM Contact/src/main.cpp
+++ b/plugins/Non-IM Contact/src/main.cpp
@@ -178,7 +178,6 @@ extern "C" __declspec(dllexport) int Load()
Menu_AddContactMenuItem(&mi, MODNAME);
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
-
return 0;
}
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp
index b4cd9b967f..272326edee 100644
--- a/plugins/Ping/src/pingthread.cpp
+++ b/plugins/Ping/src/pingthread.cpp
@@ -1003,36 +1003,34 @@ void InitList()
else ShowWindow(hpwnd, SW_SHOW);
}
- {
- font_id.cbSize = sizeof(FontIDT);
- mir_tstrncpy(font_id.group, LPGENT("Ping"), _countof(font_id.group));
- mir_tstrncpy(font_id.name, LPGENT("List"), _countof(font_id.name));
- mir_strncpy(font_id.dbSettingsGroup, "PING", _countof(font_id.dbSettingsGroup));
- mir_strncpy(font_id.prefix, "Font", _countof(font_id.prefix));
- mir_tstrncpy(font_id.backgroundGroup, _T("Ping"), _countof(font_id.backgroundGroup));
- mir_tstrncpy(font_id.backgroundName, _T("Background"), _countof(font_id.backgroundName));
- font_id.order = 0;
- font_id.flags = FIDF_DEFAULTVALID;
- font_id.deffontsettings.charset = DEFAULT_CHARSET;
- font_id.deffontsettings.size = -14;
- font_id.deffontsettings.style = 0;
- font_id.deffontsettings.colour = RGB(255, 255, 255);
- mir_tstrncpy(font_id.deffontsettings.szFace, _T("Tahoma"), _countof(font_id.deffontsettings.szFace));
-
- FontRegisterT(&font_id);
-
- bk_col_id.cbSize = sizeof(ColourIDT);
- mir_tstrncpy(bk_col_id.group, _T("Ping"), _countof(bk_col_id.group));
- mir_tstrncpy(bk_col_id.name, _T("Background"), _countof(bk_col_id.name));
- mir_strncpy(bk_col_id.dbSettingsGroup, "PING", _countof(bk_col_id.dbSettingsGroup));
- mir_strncpy(bk_col_id.setting, "BgColor", _countof(bk_col_id.setting));
- bk_col_id.defcolour = RGB(0, 0, 0);
- ColourRegisterT(&bk_col_id);
-
- HookEvent(ME_FONT_RELOAD, ReloadFont);
-
- ReloadFont(0, 0);
- }
+ font_id.cbSize = sizeof(FontIDT);
+ mir_tstrncpy(font_id.group, LPGENT("Ping"), _countof(font_id.group));
+ mir_tstrncpy(font_id.name, LPGENT("List"), _countof(font_id.name));
+ mir_strncpy(font_id.dbSettingsGroup, "PING", _countof(font_id.dbSettingsGroup));
+ mir_strncpy(font_id.prefix, "Font", _countof(font_id.prefix));
+ mir_tstrncpy(font_id.backgroundGroup, _T("Ping"), _countof(font_id.backgroundGroup));
+ mir_tstrncpy(font_id.backgroundName, _T("Background"), _countof(font_id.backgroundName));
+ font_id.order = 0;
+ font_id.flags = FIDF_DEFAULTVALID;
+ font_id.deffontsettings.charset = DEFAULT_CHARSET;
+ font_id.deffontsettings.size = -14;
+ font_id.deffontsettings.style = 0;
+ font_id.deffontsettings.colour = RGB(255, 255, 255);
+ mir_tstrncpy(font_id.deffontsettings.szFace, _T("Tahoma"), _countof(font_id.deffontsettings.szFace));
+
+ FontRegisterT(&font_id);
+
+ bk_col_id.cbSize = sizeof(ColourIDT);
+ mir_tstrncpy(bk_col_id.group, _T("Ping"), _countof(bk_col_id.group));
+ mir_tstrncpy(bk_col_id.name, _T("Background"), _countof(bk_col_id.name));
+ mir_strncpy(bk_col_id.dbSettingsGroup, "PING", _countof(bk_col_id.dbSettingsGroup));
+ mir_strncpy(bk_col_id.setting, "BgColor", _countof(bk_col_id.setting));
+ bk_col_id.defcolour = RGB(0, 0, 0);
+ ColourRegisterT(&bk_col_id);
+
+ HookEvent(ME_FONT_RELOAD, ReloadFont);
+
+ ReloadFont(0, 0);
start_ping_thread();
}
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp
index 0a2619e581..6d32a12e4f 100644
--- a/plugins/Popup/src/main.cpp
+++ b/plugins/Popup/src/main.cpp
@@ -192,17 +192,17 @@ void InitMenuItems(void)
// Add item to main menu
mi.hParentMenu = (HGENMENU)hMenuRoot;
- CreateServiceFunction(MENUCOMMAND_SVC, svcEnableDisableMenuCommand);
- mi.name.t = PopupOptions.ModuleIsEnabled ? LPGENT("Disable Popups") : LPGENT("Enable Popups");
mi.pszService = MENUCOMMAND_SVC;
+ CreateServiceFunction(mi.pszService, svcEnableDisableMenuCommand);
+ mi.name.t = PopupOptions.ModuleIsEnabled ? LPGENT("Disable Popups") : LPGENT("Enable Popups");
hMenuItem = Menu_AddMainMenuItem(&mi);
// Popup History
- CreateServiceFunction(MENUCOMMAND_HISTORY, svcShowHistory);
+ mi.pszService = MENUCOMMAND_HISTORY;
+ CreateServiceFunction(mi.pszService, svcShowHistory);
mi.position = 1000000000;
mi.name.t = LPGENT("Popup History");
mi.icolibItem = IcoLib_GetIcon(ICO_HISTORY, 0);
- mi.pszService = MENUCOMMAND_HISTORY;
hMenuItemHistory = Menu_AddMainMenuItem(&mi);
}
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp
index 925fdcf23f..4a5d161909 100644
--- a/plugins/UserInfoEx/src/mir_menuitems.cpp
+++ b/plugins/UserInfoEx/src/mir_menuitems.cpp
@@ -174,105 +174,97 @@ void RebuildMain()
// support new genmenu style
CLISTMENUITEM mi = { 0 };
- switch (flag)
- {
- case 3:
- //cascade off
- mhRoot = mhExIm = NULL;
- hMenuItem[item++] = NULL;
- break;
- case 5:
- //cascade all
- mi.position = 500050000;
- mi.icolibItem = IcoLib_GetIcon(ICO_COMMON_MAIN);
- mi.name.a = MODULELONGNAME;
- mhRoot = Menu_AddMainMenuItem(&mi);
- hMenuItem[item++] = mhRoot;
- mhExIm = mhRoot;
- break;
- case 9:
- //cascade Ex/Import
- mi.position = 500050000;
- mi.icolibItem = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
- mi.name.a = LPGEN("Export/import contact");
- mhExIm = Menu_AddMainMenuItem(&mi);
- hMenuItem[item++] = mhExIm;
- mhRoot = NULL;
- break;
- default:
- //disable Menue
- return;
- }
-
- // details dialog
- {
- mi.hParentMenu = mhRoot;
- mi.pszService = MS_USERINFO_SHOWDIALOG;
- mi.name.a = LPGEN("View/change my &details...");
+ switch (flag) {
+ case 3:
+ //cascade off
+ mhRoot = mhExIm = NULL;
+ hMenuItem[item++] = NULL;
+ break;
+ case 5:
+ //cascade all
mi.position = 500050000;
mi.icolibItem = IcoLib_GetIcon(ICO_COMMON_MAIN);
- hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
+ mi.name.a = MODULELONGNAME;
+ mhRoot = Menu_AddMainMenuItem(&mi);
+ hMenuItem[item++] = mhRoot;
+ mhExIm = mhRoot;
+ break;
+ case 9:
+ //cascade Ex/Import
+ mi.position = 500050000;
+ mi.icolibItem = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
+ mi.name.a = LPGEN("Export/import contact");
+ mhExIm = Menu_AddMainMenuItem(&mi);
+ hMenuItem[item++] = mhExIm;
+ mhRoot = NULL;
+ break;
+ default:
+ //disable Menue
+ return;
}
- // VCard's Ex/Import menuitems
- { mi.hParentMenu = mhExIm;
+ // details dialog
+ mi.hParentMenu = mhRoot;
+ mi.pszService = MS_USERINFO_SHOWDIALOG;
+ mi.name.a = LPGEN("View/change my &details...");
+ mi.position = 500050000;
+ mi.icolibItem = IcoLib_GetIcon(ICO_COMMON_MAIN);
+ hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
- // Export
- mi.pszService = MS_USERINFO_VCARD_EXPORTALL;
- mi.name.a = LPGEN("Export all contacts");
- mi.position = 500150000;
- mi.icolibItem = IcoLib_GetIcon(ICO_BTN_EXPORT);
- hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
+ // VCard's Ex/Import menuitems
+ mi.hParentMenu = mhExIm;
- // Import
- mi.pszService = MS_USERINFO_VCARD_IMPORTALL;
- mi.name.a = LPGEN("Import all contacts");
- mi.position = 500151000;
- mi.icolibItem = IcoLib_GetIcon(ICO_BTN_IMPORT);
- hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
- }
+ // Export
+ mi.pszService = MS_USERINFO_VCARD_EXPORTALL;
+ mi.name.a = LPGEN("Export all contacts");
+ mi.position = 500150000;
+ mi.icolibItem = IcoLib_GetIcon(ICO_BTN_EXPORT);
+ hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
- mi.hParentMenu = mhRoot;
+ // Import
+ mi.pszService = MS_USERINFO_VCARD_IMPORTALL;
+ mi.name.a = LPGEN("Import all contacts");
+ mi.position = 500151000;
+ mi.icolibItem = IcoLib_GetIcon(ICO_BTN_IMPORT);
+ hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
// reminder
- {
- const BYTE bRemindMenus =
- db_get_b(NULL, MODNAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED) &&
- db_get_b(NULL, MODNAME, SET_REMIND_MENUENABLED, DEFVAL_REMIND_MENUENABLED);
- if (bRemindMenus) {
- // make backup of each protocol based birthday
- mi.pszService = MS_USERINFO_REMINDER_AGGRASIVEBACKUP;
- mi.name.a = LPGEN("Backup birthdays");
- mi.position = 500253000;
- mi.icolibItem = IcoLib_GetIcon(ICO_BTN_BDAY_BACKUP);
- hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
- // Check anniversaries
- mi.pszService = MS_USERINFO_REMINDER_CHECK;
- mi.name.a = LPGEN("Check anniversaries");
- mi.position = 500251000;
- mi.icolibItem = IcoLib_GetIcon(ICO_BTN_SEARCH);
- hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
- }
- else {
- hMenuItem[item++] = NULL;
- hMenuItem[item++] = NULL;
- }
- // Refresh Contact Details
- mi.pszService = MS_USERINFO_REFRESH;
- mi.name.a = LPGEN("Refresh contact details");
- mi.position = 500254000;
- mi.icolibItem = IcoLib_GetIcon(ICO_BTN_UPDATE);
+ mi.hParentMenu = mhRoot;
+ const BYTE bRemindMenus =
+ db_get_b(NULL, MODNAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED) &&
+ db_get_b(NULL, MODNAME, SET_REMIND_MENUENABLED, DEFVAL_REMIND_MENUENABLED);
+ if (bRemindMenus) {
+ // make backup of each protocol based birthday
+ mi.pszService = MS_USERINFO_REMINDER_AGGRASIVEBACKUP;
+ mi.name.a = LPGEN("Backup birthdays");
+ mi.position = 500253000;
+ mi.icolibItem = IcoLib_GetIcon(ICO_BTN_BDAY_BACKUP);
hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
+ // Check anniversaries
+ mi.pszService = MS_USERINFO_REMINDER_CHECK;
+ mi.name.a = LPGEN("Check anniversaries");
+ mi.position = 500251000;
+ mi.icolibItem = IcoLib_GetIcon(ICO_BTN_SEARCH);
+ hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
+ }
+ else {
+ hMenuItem[item++] = NULL;
+ hMenuItem[item++] = NULL;
}
+ // Refresh Contact Details
+ mi.pszService = MS_USERINFO_REFRESH;
+ mi.name.a = LPGEN("Refresh contact details");
+ mi.position = 500254000;
+ mi.icolibItem = IcoLib_GetIcon(ICO_BTN_UPDATE);
+ hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
+
// anniversary list
- {
- mi.pszService = MS_USERINFO_REMINDER_LIST;
- mi.name.a = LPGEN("Anniversary list");
- mi.position = 500252000;
- mi.icolibItem = IcoLib_GetIcon(ICO_COMMON_ANNIVERSARY);
- hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
- }
+ mi.pszService = MS_USERINFO_REMINDER_LIST;
+ mi.name.a = LPGEN("Anniversary list");
+ mi.position = 500252000;
+ mi.icolibItem = IcoLib_GetIcon(ICO_COMMON_ANNIVERSARY);
+ hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
}
/**
@@ -343,22 +335,21 @@ void RebuildGroup()
}
// VCard's Ex/Import menuitems
- { mi.hParentMenu = mhExIm;
+ mi.hParentMenu = mhExIm;
- // Export
- mi.pszService = MS_USERINFO_VCARD_EXPORTALL;
- mi.name.a = LPGEN("Export all contacts");
- mi.position = 250200;
- mi.icolibItem = IcoLib_GetIcon(ICO_BTN_EXPORT);
- hMenuItem[item++] = Menu_AddGroupMenuItem(0, &mi);
+ // Export
+ mi.pszService = MS_USERINFO_VCARD_EXPORTALL;
+ mi.name.a = LPGEN("Export all contacts");
+ mi.position = 250200;
+ mi.icolibItem = IcoLib_GetIcon(ICO_BTN_EXPORT);
+ hMenuItem[item++] = Menu_AddGroupMenuItem(0, &mi);
- // Import
- mi.pszService = MS_USERINFO_VCARD_IMPORTALL;
- mi.name.a = LPGEN("Import all contacts");
- mi.position = 250300;
- mi.icolibItem = IcoLib_GetIcon(ICO_BTN_IMPORT);
- hMenuItem[item++] = Menu_AddGroupMenuItem(0, &mi);
- }
+ // Import
+ mi.pszService = MS_USERINFO_VCARD_IMPORTALL;
+ mi.name.a = LPGEN("Import all contacts");
+ mi.position = 250300;
+ mi.icolibItem = IcoLib_GetIcon(ICO_BTN_IMPORT);
+ hMenuItem[item++] = Menu_AddGroupMenuItem(0, &mi);
}
/******************************
@@ -402,59 +393,57 @@ void RebuildSubGroup()
mi.pszService = text;
char* tDest = text + mir_strlen(text);
- switch (flag)
- {
- case 3:
- //cascade off
- mhRoot = mhExIm = NULL;
- hMenuItem[item++] = NULL;
- break;
- case 5:
- //cascade all
- mi.position = 1050000;
- mi.icolibItem = IcoLib_GetIcon(ICO_COMMON_MAIN);
- mi.name.a = MODULELONGNAME;
- mhRoot = Menu_AddSubGroupMenuItem(0, &mi);
- hMenuItem[item++] = mhRoot;
- mhExIm = mhRoot;
- break;
- case 9:
- //cascade Ex/Import
- mi.position = 1050100;
- mi.icolibItem = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
- mi.name.a = LPGEN("Export/import group");
- mhExIm = Menu_AddSubGroupMenuItem(0, &mi);
- hMenuItem[item++] = mhExIm;
- mhRoot = NULL;
- break;
- default:
- //disable Menue
- return;
+ switch (flag) {
+ case 3:
+ //cascade off
+ mhRoot = mhExIm = NULL;
+ hMenuItem[item++] = NULL;
+ break;
+ case 5:
+ //cascade all
+ mi.position = 1050000;
+ mi.icolibItem = IcoLib_GetIcon(ICO_COMMON_MAIN);
+ mi.name.a = MODULELONGNAME;
+ mhRoot = Menu_AddSubGroupMenuItem(0, &mi);
+ hMenuItem[item++] = mhRoot;
+ mhExIm = mhRoot;
+ break;
+ case 9:
+ //cascade Ex/Import
+ mi.position = 1050100;
+ mi.icolibItem = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
+ mi.name.a = LPGEN("Export/import group");
+ mhExIm = Menu_AddSubGroupMenuItem(0, &mi);
+ hMenuItem[item++] = mhExIm;
+ mhRoot = NULL;
+ break;
+ default:
+ //disable Menue
+ return;
}
// VCard's Ex/Import menuitems
- { mi.hParentMenu = mhExIm;
+ mi.hParentMenu = mhExIm;
- // Export
- mir_strcpy(tDest, "/ExportGroup"); //mi.pszService
- if (!ServiceExists(mi.pszService)) CreateServiceFunction(mi.pszService, svcExIm_Group_Service);
- mi.name.a = mhExIm != NULL ? LPGEN("&Export") : LPGEN("&Export group");
- mi.position = 1050200;
- mi.icolibItem = IcoLib_GetIcon(ICO_BTN_EXPORT);
- gmp.lParam=0;
- gmp.wParam=TRUE;
- hMenuItem[item++] = Menu_AddSubGroupMenuItem(&gmp, &mi);
+ // Export
+ mir_strcpy(tDest, "/ExportGroup"); //mi.pszService
+ if (!ServiceExists(mi.pszService)) CreateServiceFunction(mi.pszService, svcExIm_Group_Service);
+ mi.name.a = mhExIm != NULL ? LPGEN("&Export") : LPGEN("&Export group");
+ mi.position = 1050200;
+ mi.icolibItem = IcoLib_GetIcon(ICO_BTN_EXPORT);
+ gmp.lParam=0;
+ gmp.wParam=TRUE;
+ hMenuItem[item++] = Menu_AddSubGroupMenuItem(&gmp, &mi);
- // Import
- mir_strcpy(tDest, "/ImportGroup"); //mi.pszService
- if (!ServiceExists(mi.pszService)) CreateServiceFunction(mi.pszService, svcExIm_Group_Service);
- mi.name.a = mhExIm != NULL ? LPGEN("&Import") : LPGEN("&Import group");
- mi.position = 1050300;
- mi.icolibItem = IcoLib_GetIcon(ICO_BTN_IMPORT);
- gmp.lParam=0;
- gmp.wParam=FALSE;
- hMenuItem[item++] = Menu_AddSubGroupMenuItem(&gmp, &mi);
- }
+ // Import
+ mir_strcpy(tDest, "/ImportGroup"); //mi.pszService
+ if (!ServiceExists(mi.pszService)) CreateServiceFunction(mi.pszService, svcExIm_Group_Service);
+ mi.name.a = mhExIm != NULL ? LPGEN("&Import") : LPGEN("&Import group");
+ mi.position = 1050300;
+ mi.icolibItem = IcoLib_GetIcon(ICO_BTN_IMPORT);
+ gmp.lParam=0;
+ gmp.wParam=FALSE;
+ hMenuItem[item++] = Menu_AddSubGroupMenuItem(&gmp, &mi);
}
/******************************
@@ -476,15 +465,10 @@ void RebuildSubGroup()
INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam)
{
const BYTE mItems = 3; // menuitems to create
- int flag = 0;
BYTE item = 0;
- PROTOACCOUNT* pAccountName = NULL;
int mProtoCount = pcli->menuProtoCount;
- HGENMENU mhRoot = NULL;
- HGENMENU mhExIm = NULL;
-
// on call by hook or first start
if (!lParam || !hMenuItemAccount) {
size_t sizeNew = mItems * mProtoCount * sizeof(HGENMENU);
@@ -493,13 +477,11 @@ INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam)
memset(hMenuItemAccount, 0, sizeNew);
}
// on options change
- else {
- // delete all MenuItems backward (first item second group)
+ else // delete all MenuItems backward (first item second group)
RemoveMenuItems (hMenuItemAccount, mItems * mProtoCount);
- }
// load options
- flag = db_get_b(NULL, MODNAME, SET_MI_ACCOUNT, MCAS_NOTINITIATED);
+ int flag = db_get_b(NULL, MODNAME, SET_MI_ACCOUNT, MCAS_NOTINITIATED);
if (flag == MCAS_NOTINITIATED){
flag = MCAS_EXIMPORT|TRUE;
db_set_b(NULL, MODNAME, SET_MI_ACCOUNT, flag);
@@ -507,19 +489,18 @@ INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam)
// loop for all account names
for (int i = 0; i < mProtoCount; i++) {
-
// set all bytes 0 to avoid problems
item = 0;
- mhRoot = 0;
- mhRoot = pcli->menuProtos[i].pMenu;
- if ( mhRoot == NULL )
+ HGENMENU mhRoot = pcli->menuProtos[i].pMenu, mhExIm;
+ if (mhRoot == NULL)
break;
- pAccountName = Proto_GetAccount(pcli->menuProtos[i].szProto);
+
+ PROTOACCOUNT *pAccountName = Proto_GetAccount(pcli->menuProtos[i].szProto);
// create service name main (account module name) and set pointer to end it
char text[ 200 ];
- mir_strcpy( text, pcli->menuProtos[i].szProto);
+ mir_strcpy(text, pcli->menuProtos[i].szProto);
CLISTMENUITEM mi = { 0 };
mi.pszService = text;
@@ -530,14 +511,14 @@ INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam)
switch (flag) {
case 3:
- //cascade off
+ // cascade off
mhExIm = mhRoot;
// seperator
mi.position = 50100;
hMenuItemAccount[mItems*i + item++] = Menu_AddStatusMenuItem(&mi);
break;
case 5:
- //cascade all
+ // cascade all
mi.position = 50100;
mi.icolibItem = IcoLib_GetIcon(ICO_COMMON_MAIN);
mi.name.a = MODULELONGNAME;
@@ -546,7 +527,7 @@ INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam)
mhExIm = mhRoot;
break;
case 9:
- //cascade Ex/Import
+ // cascade Ex/Import
mi.position = 50100;
mi.icolibItem = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
mi.name.a = LPGEN("Export/import");
@@ -555,35 +536,32 @@ INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam)
mhExIm = mhRoot;
break;
default:
- //disable Menue
+ // disable Menue
return 0;
}
// VCard's Ex/Import menuitems
- {
- mi.hParentMenu = mhExIm;
-
- // Export
- mir_strcpy(tDest, "/ExportAccount"); //mi.pszService
- if (!ServiceExists(mi.pszService)) CreateServiceFunction(mi.pszService, svcExIm_Account_Service);
- mi.name.a = LPGEN("&Export xml");
- mi.position = 50200;
- mi.icolibItem = IcoLib_GetIcon(ICO_BTN_EXPORT);
- hMenuItemAccount[mItems*i + item++] = Menu_AddStatusMenuItem(&mi);
+ mi.hParentMenu = mhExIm;
- // Import
- mir_strcpy(tDest, "/ImportAccount"); //mi.pszService
- if (!ServiceExists(mi.pszService)) CreateServiceFunction(mi.pszService, svcExIm_Account_Service);
- mi.name.a = LPGEN("&Import xml");
- mi.position = 50300;
- mi.icolibItem = IcoLib_GetIcon(ICO_BTN_IMPORT);
- hMenuItemAccount[mItems*i + item++] = Menu_AddStatusMenuItem(&mi);
- }
+ // Export
+ mir_strcpy(tDest, "/ExportAccount");
+ CreateServiceFunction(mi.pszService, svcExIm_Account_Service);
+ mi.name.a = LPGEN("&Export xml");
+ mi.position = 50200;
+ mi.icolibItem = IcoLib_GetIcon(ICO_BTN_EXPORT);
+ hMenuItemAccount[mItems*i + item++] = Menu_AddStatusMenuItem(&mi);
+
+ // Import
+ mir_strcpy(tDest, "/ImportAccount");
+ CreateServiceFunction(mi.pszService, svcExIm_Account_Service);
+ mi.name.a = LPGEN("&Import xml");
+ mi.position = 50300;
+ mi.icolibItem = IcoLib_GetIcon(ICO_BTN_IMPORT);
+ hMenuItemAccount[mItems*i + item++] = Menu_AddStatusMenuItem(&mi);
}
return 0;
}
-
void RebuildMenu()
{
RebuildMain();
@@ -591,5 +569,4 @@ void RebuildMenu()
RebuildGroup();
RebuildSubGroup();
RebuildAccount(NULL, 1);
- return;
}