summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-27 19:28:09 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-27 19:28:09 +0000
commit03df9032e2b6248fed2bcf1e6d40fbfba4581779 (patch)
tree29275137a963939beed2b788ade711ef131f4a3c
parent68677c938c33f5d60ad800e0872d824918d56243 (diff)
minor menu related fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@14420 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-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
-rw-r--r--protocols/FacebookRM/src/proto.cpp6
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp3
-rw-r--r--protocols/Tlen/src/tlen.cpp11
-rw-r--r--src/core/stdhelp/src/help.cpp3
14 files changed, 214 insertions, 250 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;
}
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index df22c38441..38a70354a5 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -41,13 +41,7 @@ FacebookProto::FacebookProto(const char* proto_name, const TCHAR* username) :
// Initialize random seed for this client
facy.random_ = ::time(NULL) + PtrToUint(&facy);
- m_hMenuRoot = m_hMenuServicesRoot = m_hStatusMind = NULL;
-
- m_invisible = false;
- m_signingOut = false;
m_enableChat = DEFAULT_ENABLE_CHATS;
- m_idleTS = 0;
- m_pingTS = 0;
// Load custom locale, if set
ptrA locale(getStringA(FACEBOOK_KEY_LOCALE));
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index 4c2091eb02..027890622f 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -288,19 +288,20 @@ void g_MenuInit(void)
g_hMenuDirectPresence[0] = Menu_AddContactMenuItem(&mi);
mi.flags |= CMIF_TCHAR;
+ mi.hParentMenu = g_hMenuDirectPresence[0];
for (int i = 0; i < _countof(PresenceModeArray); i++) {
char buf[] = "Jabber/DirectPresenceX";
buf[_countof(buf) - 2] = '0' + i;
mi.pszService = buf;
mi.name.t = pcli->pfnGetStatusModeDescription(PresenceModeArray[i].mode, 0);
mi.position = -1999901000;
- mi.hParentMenu = g_hMenuDirectPresence[0];
mi.icolibItem = Skin_LoadIcon(PresenceModeArray[i].icon);
g_hMenuDirectPresence[i + 1] = Menu_AddContactMenuItem(&mi);
CreateServiceFunctionParam(mi.pszService, JabberMenuHandleDirectPresence, PresenceModeArray[i].mode);
}
mi.flags &= ~(CMIF_TCHAR);
+ mi.hParentMenu = NULL;
// Resource selector
mi.pszService = "Jabber/ResourceSelectorDummySvc";
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp
index 660967c6c3..9476cb3f37 100644
--- a/protocols/Tlen/src/tlen.cpp
+++ b/protocols/Tlen/src/tlen.cpp
@@ -287,11 +287,12 @@ void TlenProtocol::initMenuItems()
mi.pszService = text;
hMenuInbox = Menu_AddMainMenuItem(&mi);
+ // contact menu items
mi.hParentMenu = NULL;
// "Send picture"
mi.pszService = "/SendPicture";
- CreateProtoService(pSvcName, &TlenProtocol::ContactMenuHandleSendPicture);
+ CreateProtoService(mi.pszService, &TlenProtocol::ContactMenuHandleSendPicture);
mi.name.a = LPGEN("Send picture");
mi.position = -2000019030;
mi.icolibItem = GetIconHandle(IDI_IMAGE);
@@ -299,7 +300,7 @@ void TlenProtocol::initMenuItems()
// "Invite to MUC"
mi.pszService = "/ContactMenuMUC";
- CreateProtoService(pSvcName, &TlenProtocol::MUCContactMenuHandleMUC);
+ CreateProtoService(mi.pszService, &TlenProtocol::MUCContactMenuHandleMUC);
mi.name.a = LPGEN("Multi-User Conference");
mi.position = -2000019020;
mi.icolibItem = GetIconHandle(IDI_MUC);
@@ -307,7 +308,7 @@ void TlenProtocol::initMenuItems()
// "Invite to voice chat"
mi.pszService = "/ContactMenuVoice";
- CreateProtoService(pSvcName, &TlenProtocol::VoiceContactMenuHandleVoice);
+ CreateProtoService(mi.pszService, &TlenProtocol::VoiceContactMenuHandleVoice);
mi.name.a = LPGEN("Voice Chat");
mi.position = -2000019010;
mi.icolibItem = GetIconHandle(IDI_VOICE);
@@ -315,7 +316,7 @@ void TlenProtocol::initMenuItems()
// "Request authorization"
mi.pszService = "/RequestAuth";
- CreateProtoService(pSvcName, &TlenProtocol::ContactMenuHandleRequestAuth);
+ CreateProtoService(mi.pszService, &TlenProtocol::ContactMenuHandleRequestAuth);
mi.name.a = LPGEN("Request authorization");
mi.position = -2000001001;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
@@ -323,7 +324,7 @@ void TlenProtocol::initMenuItems()
// "Grant authorization"
mi.pszService = "/GrantAuth";
- CreateProtoService(pSvcName, &TlenProtocol::ContactMenuHandleGrantAuth);
+ CreateProtoService(mi.pszService, &TlenProtocol::ContactMenuHandleGrantAuth);
mi.name.a = LPGEN("Grant authorization");
mi.position = -2000001000;
mi.icolibItem = Skin_GetIconHandle(SKINICON_AUTH_GRANT);
diff --git a/src/core/stdhelp/src/help.cpp b/src/core/stdhelp/src/help.cpp
index d134d9fc26..300082ee57 100644
--- a/src/core/stdhelp/src/help.cpp
+++ b/src/core/stdhelp/src/help.cpp
@@ -74,8 +74,9 @@ int LoadHelpModule(void)
CreateServiceFunction("Help/BugCommand", BugCommand);
CLISTMENUITEM mi = { 0 };
- mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
mi.hParentMenu = Menu_CreateRoot(MO_MAIN, LPGENT("&Help"), 2000090000);
+
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
mi.position = 2000090000;
mi.name.a = LPGEN("&About...");
mi.pszService = "Help/AboutCommand";