summaryrefslogtreecommitdiff
path: root/plugins/NotesAndReminders
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-28 10:02:17 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-28 10:02:17 +0000
commit3fa621ffde27485da36638442224b37ade3ee8f3 (patch)
tree26ed5cecad483bc7372f6ca05395048e9d178a9d /plugins/NotesAndReminders
parent24415c15d859a94a34a2b575af74336a9aff5f45 (diff)
menu fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@14423 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NotesAndReminders')
-rw-r--r--plugins/NotesAndReminders/src/main.cpp39
1 files changed, 21 insertions, 18 deletions
diff --git a/plugins/NotesAndReminders/src/main.cpp b/plugins/NotesAndReminders/src/main.cpp
index 7a0489fc49..14d765bd0b 100644
--- a/plugins/NotesAndReminders/src/main.cpp
+++ b/plugins/NotesAndReminders/src/main.cpp
@@ -174,6 +174,18 @@ static void InitServices()
CreateServiceFunction(MODULENAME"/OpenTriggeredReminder",OpenTriggeredReminder);
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static void addMenuItem(CLISTMENUITEM &mi)
+{
+ if (g_AddContListMI) {
+ HGENMENU save = mi.hParentMenu; mi.hParentMenu = NULL;
+ Menu_AddContactMenuItem(&mi);
+ mi.hParentMenu = save;
+ }
+ Menu_AddMainMenuItem(&mi);
+}
+
int OnModulesLoaded(WPARAM wparam, LPARAM lparam)
{
// register fonts and hotkeys
@@ -184,64 +196,56 @@ int OnModulesLoaded(WPARAM wparam, LPARAM lparam)
// register menus
CLISTMENUITEM mi = { 0 };
- mi.hParentMenu = Menu_CreateRoot(MO_MAIN, LPGENT("Notes && Reminders"), 1600000000);
+ mi.hParentMenu = Menu_CreateRoot(MO_MAIN, (TCHAR*)LPGENW("Notes && Reminders"), 1600000000);
mi.flags = CMIF_TCHAR;
mi.position = 1600000000;
mi.icolibItem = iconList[2].hIcolib;
mi.name.t = LPGENT("New &Note");
mi.pszService = MODULENAME"/MenuCommandAddNew";
- if (g_AddContListMI) Menu_AddContactMenuItem(&mi);
- Menu_AddMainMenuItem(&mi);
+ addMenuItem(mi);
mi.position = 1600000001;
mi.icolibItem = iconList[0].hIcolib;
mi.name.t = LPGENT("New &Reminder");
mi.pszService = MODULENAME"/MenuCommandNewReminder";
- if (g_AddContListMI) Menu_AddContactMenuItem(&mi);
- Menu_AddMainMenuItem(&mi);
+ addMenuItem(mi);
mi.position = 1600100000;
mi.icolibItem = iconList[3].hIcolib;
mi.name.t = LPGENT("&Show / Hide Notes");
mi.pszService = MODULENAME"/MenuCommandShowHide";
- if (g_AddContListMI) Menu_AddContactMenuItem(&mi);
- Menu_AddMainMenuItem(&mi);
+ addMenuItem(mi);
mi.position = 1600100001;
mi.icolibItem = iconList[13].hIcolib;
mi.name.t = LPGENT("Vie&w Notes");
mi.pszService = MODULENAME"/MenuCommandViewNotes";
- if (g_AddContListMI) Menu_AddContactMenuItem(&mi);
- Menu_AddMainMenuItem(&mi);
+ addMenuItem(mi);
mi.position = 1600100002;
mi.icolibItem = iconList[1].hIcolib;
mi.name.t = LPGENT("&Delete All Notes");
mi.pszService = MODULENAME"/MenuCommandDeleteAll";
- if (g_AddContListMI) Menu_AddContactMenuItem(&mi);
- Menu_AddMainMenuItem(&mi);
+ addMenuItem(mi);
mi.position = 1600100003;
mi.icolibItem = iconList[11].hIcolib;
mi.name.t = LPGENT("&Bring All to Front");
mi.pszService = MODULENAME"/MenuCommandBringAllFront";
- if (g_AddContListMI) Menu_AddContactMenuItem(&mi);
- Menu_AddMainMenuItem(&mi);
+ addMenuItem(mi);
mi.position = 1600200000;
mi.icolibItem = iconList[6].hIcolib;
mi.name.t = LPGENT("&View Reminders");
mi.pszService = MODULENAME"/MenuCommandViewReminders";
- if (g_AddContListMI) Menu_AddContactMenuItem(&mi);
- Menu_AddMainMenuItem(&mi);
+ addMenuItem(mi);
mi.position = 1600200001;
mi.icolibItem = iconList[5].hIcolib;
mi.name.t = LPGENT("D&elete All Reminders");
mi.pszService = MODULENAME"/MenuCommandDeleteReminders";
- if (g_AddContListMI) Menu_AddContactMenuItem(&mi);
- Menu_AddMainMenuItem(&mi);
+ addMenuItem(mi);
// register misc
hkOptInit = HookEvent(ME_OPT_INITIALISE, OnOptInitialise);
@@ -253,7 +257,6 @@ int OnModulesLoaded(WPARAM wparam, LPARAM lparam)
CreateMsgWindow();
LoadNotes(TRUE);
LoadReminders();
-
return 0;
}