summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-23 19:23:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-23 19:23:04 +0300
commitbb5dfcb3c97622419bfd3bb4e3161489e361132e (patch)
treec3464f962ca8d8a3e0c5baf481cf83b3f04ab68e /plugins/Clist_modern
parent6f8261af4b1a79411f9a22585814141ac7b85c2b (diff)
fix for loading menus
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp5
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp64
-rw-r--r--plugins/Clist_modern/src/modern_clistmod.cpp9
3 files changed, 36 insertions, 42 deletions
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index e7bef1a7d9..fddd7390cc 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -42,6 +42,7 @@ static BOOL g_bSortTimerIsSet = FALSE;
static ClcContact *hitcontact = nullptr;
HANDLE hSkinFolder;
wchar_t SkinsFolder[MAX_PATH];
+void LoadFavoriteContactMenu();
int ReloadSkinFolder(WPARAM, LPARAM)
{
@@ -1553,6 +1554,10 @@ static int clcHookModulesLoaded(WPARAM, LPARAM)
wchar_t szMyPath[MAX_PATH];
GetModuleFileName(g_hInst, szMyPath, _countof(szMyPath));
+ // Menus
+ LoadFavoriteContactMenu();
+
+ // Icons
SKINICONDESC sid = {};
sid.defaultFile.w = szMyPath;
sid.flags = SIDF_PATH_UNICODE;
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp
index 9457dfb503..495d817f0a 100644
--- a/plugins/Clist_modern/src/modern_clistmenus.cpp
+++ b/plugins/Clist_modern/src/modern_clistmenus.cpp
@@ -24,33 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-int LoadFavoriteContactMenu();
-
#pragma hdrstop
-INT_PTR CloseAction(WPARAM, LPARAM)
-{
- g_CluiData.bSTATE = STATE_PREPARETOEXIT; // workaround for avatar service and other wich destroys service on OK_TOEXIT
-
- bool k;
- do {
- k = Miranda_OkToExit();
- }
- while (!k);
-
- if (k)
- DestroyWindow(pcli->hwndContactList);
-
- return 0;
-}
-
-int InitCustomMenus(void)
-{
- CreateServiceFunction("CloseAction", CloseAction);
- LoadFavoriteContactMenu();
- return 0;
-}
-
//////////////////////////////////////////////////////////////////////////
//
// FAVORITE CONTACT SYSTEM
@@ -116,14 +91,8 @@ INT_PTR FAV_ToggleShowOffline(WPARAM hContact, LPARAM)
return 0;
}
-int LoadFavoriteContactMenu()
+void LoadFavoriteContactMenu()
{
- Icon_Register(g_hInst, LPGEN("Contact list"), iconList, _countof(iconList));
-
- CreateServiceFunction(CLUI_FAVSETRATE, FAV_SetRate);
- CreateServiceFunction(CLUI_FAVTOGGLESHOWOFFLINE, FAV_ToggleShowOffline);
- HookEvent(ME_CLIST_PREBUILDCONTACTMENU, FAV_OnContactMenuBuild);
-
CMenuItem mi;
SET_UID(mi, 0xf99a2320, 0xc024, 0x48bd, 0x81, 0xf7, 0x9f, 0xa2, 0x5, 0xb0, 0x7f, 0xdc);
mi.name.w = FAVMENUROOTNAME;
@@ -148,11 +117,38 @@ int LoadFavoriteContactMenu()
mi.name.w = LPGENW("Show even if offline");
hShowIfOflineItem = Menu_AddContactMenuItem(&mi);
Menu_ConfigureItem(hShowIfOflineItem, MCI_OPT_EXECPARAM, _countof(rates) + 100000000);
- return 0;
}
-int UnloadFavoriteContactMenu()
+void UnloadFavoriteContactMenu()
{
Menu_RemoveItem(hFavoriteContactMenu); hFavoriteContactMenu = nullptr;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static INT_PTR CloseAction(WPARAM, LPARAM)
+{
+ g_CluiData.bSTATE = STATE_PREPARETOEXIT; // workaround for avatar service and other wich destroys service on OK_TOEXIT
+
+ bool k;
+ do {
+ k = Miranda_OkToExit();
+ } while (!k);
+
+ if (k)
+ DestroyWindow(pcli->hwndContactList);
+
+ return 0;
+}
+
+int InitCustomMenus(void)
+{
+ CreateServiceFunction("CloseAction", CloseAction);
+
+ Icon_Register(g_hInst, LPGEN("Contact list"), iconList, _countof(iconList));
+
+ CreateServiceFunction(CLUI_FAVSETRATE, FAV_SetRate);
+ CreateServiceFunction(CLUI_FAVTOGGLESHOWOFFLINE, FAV_ToggleShowOffline);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU, FAV_OnContactMenuBuild);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp
index b631469211..c977d85886 100644
--- a/plugins/Clist_modern/src/modern_clistmod.cpp
+++ b/plugins/Clist_modern/src/modern_clistmod.cpp
@@ -28,21 +28,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "modern_clui.h"
int OnLoadLangpack(WPARAM, LPARAM);
-int UnloadFavoriteContactMenu();
+void UnloadFavoriteContactMenu();
int CListMod_HideWindow();
-int AddMainMenuItem(WPARAM wParam, LPARAM lParam);
-int AddContactMenuItem(WPARAM wParam, LPARAM lParam);
void UninitCListEvents(void);
int ContactAdded(WPARAM wParam, LPARAM lParam);
-int GetContactDisplayName(WPARAM wParam, LPARAM lParam);
int CListOptInit(WPARAM wParam, LPARAM lParam);
int SkinOptInit(WPARAM wParam, LPARAM lParam);
-int ModernSkinOptInit(WPARAM wParam, LPARAM lParam);
-int EventsProcessContactDoubleClick(MCONTACT hContact);
-
-INT_PTR TrayIconPauseAutoHide(WPARAM wParam, LPARAM lParam);
// returns normal icon or combined with status overlay. Needs to be destroyed.