summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/stdclist/res/resource.rc27
-rw-r--r--src/core/stdclist/src/resource.h1
-rw-r--r--src/mir_app/res/resource.rc22
-rw-r--r--src/mir_app/src/clui.cpp26
4 files changed, 46 insertions, 30 deletions
diff --git a/src/core/stdclist/res/resource.rc b/src/core/stdclist/res/resource.rc
index 4e32d4bcf2..0b367c5e78 100644
--- a/src/core/stdclist/res/resource.rc
+++ b/src/core/stdclist/res/resource.rc
@@ -347,33 +347,6 @@ IDC_HYPERLINKHAND CURSOR "hyperlin.cur"
IDC_DROP CURSOR "dragcopy.cur"
IDC_DROPUSER CURSOR "dropuser.cur"
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDR_CLISTMENU MENU
-BEGIN
- POPUP "&Main menu"
- BEGIN
- MENUITEM SEPARATOR
- MENUITEM "E&xit", ID_ICQ_EXIT
- END
- POPUP "&Status"
- BEGIN
- MENUITEM "&Offline\tCtrl+0", ID_STATUS_OFFLINE, CHECKED
- MENUITEM "On&line\tCtrl+1", ID_STATUS_ONLINE
- MENUITEM "&Away\tCtrl+2", ID_STATUS_AWAY
- MENUITEM "&Not available\tCtrl+3", ID_STATUS_NA
- MENUITEM "Occ&upied\tCtrl+4", ID_STATUS_OCCUPIED
- MENUITEM "&Do not disturb\tCtrl+5", ID_STATUS_DND
- MENUITEM "&Free for chat\tCtrl+6", ID_STATUS_FREECHAT
- MENUITEM "&Invisible\tCtrl+7", ID_STATUS_INVISIBLE
- MENUITEM "On the &phone\tCtrl+8", ID_STATUS_ONTHEPHONE
- MENUITEM "Out to &lunch\tCtrl+9", ID_STATUS_OUTTOLUNCH
- END
-END
-
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/stdclist/src/resource.h b/src/core/stdclist/src/resource.h
index f9c37606a3..2bb3c4ef25 100644
--- a/src/core/stdclist/src/resource.h
+++ b/src/core/stdclist/src/resource.h
@@ -5,7 +5,6 @@
#define IDD_OPT_CLIST 126
#define IDC_DROP 183
#define IDD_OPT_HOTKEY 184
-#define IDR_CLISTMENU 199
#define IDC_HYPERLINKHAND 214
#define IDC_DROPUSER 215
#define IDD_OPT_CLUI 218
diff --git a/src/mir_app/res/resource.rc b/src/mir_app/res/resource.rc
index cc030252d6..f0f22abf34 100644
--- a/src/mir_app/res/resource.rc
+++ b/src/mir_app/res/resource.rc
@@ -1298,6 +1298,28 @@ BEGIN
END
END
+IDR_CLISTMENU MENU
+BEGIN
+ POPUP "&Main menu"
+ BEGIN
+ MENUITEM SEPARATOR
+ MENUITEM "E&xit", ID_ICQ_EXIT
+ END
+ POPUP "&Status"
+ BEGIN
+ MENUITEM "&Offline\tCtrl+0", ID_STATUS_OFFLINE, CHECKED
+ MENUITEM "On&line\tCtrl+1", ID_STATUS_ONLINE
+ MENUITEM "&Away\tCtrl+2", ID_STATUS_AWAY
+ MENUITEM "&Not available\tCtrl+3", ID_STATUS_NA
+ MENUITEM "Occ&upied\tCtrl+4", ID_STATUS_OCCUPIED
+ MENUITEM "&Do not disturb\tCtrl+5", ID_STATUS_DND
+ MENUITEM "&Free for chat\tCtrl+6", ID_STATUS_FREECHAT
+ MENUITEM "&Invisible\tCtrl+7", ID_STATUS_INVISIBLE
+ MENUITEM "On the &phone\tCtrl+8", ID_STATUS_ONTHEPHONE
+ MENUITEM "Out to &lunch\tCtrl+9", ID_STATUS_OUTTOLUNCH
+ END
+END
+
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp
index 568586b417..0805220825 100644
--- a/src/mir_app/src/clui.cpp
+++ b/src/mir_app/src/clui.cpp
@@ -63,8 +63,10 @@ static int CluiModulesLoaded(WPARAM, LPARAM)
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_SUBMENU;
+
mii.hSubMenu = Menu_GetMainMenu();
SetMenuItemInfo(g_clistApi.hMenuMain, 0, TRUE, &mii);
+
mii.hSubMenu = Menu_GetStatusMenu();
SetMenuItemInfo(g_clistApi.hMenuMain, 1, TRUE, &mii);
}
@@ -85,6 +87,20 @@ static int CluiIconsChanged(WPARAM, LPARAM)
return 0;
}
+static int CluiLangpackChanged(WPARAM, LPARAM)
+{
+ if (g_clistApi.hMenuMain) {
+ RemoveMenu(g_clistApi.hMenuMain, 0, MF_BYPOSITION);
+ RemoveMenu(g_clistApi.hMenuMain, 0, MF_BYPOSITION);
+ DestroyMenu(g_clistApi.hMenuMain);
+ }
+
+ g_clistApi.hMenuMain = LoadMenuA(g_plugin.getInst(), MAKEINTRESOURCEA(IDR_CLISTMENU));
+ TranslateMenu(g_clistApi.hMenuMain);
+ SetMenu(g_clistApi.hwndContactList, g_clistApi.hMenuMain);
+ return 0;
+}
+
static HGENMENU hRenameMenuItem;
static int MenuItem_PreBuild(WPARAM, LPARAM)
@@ -265,7 +281,6 @@ int LoadCLUIModule(void)
wndclass.hIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA, true);
wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
- wndclass.lpszMenuName = MAKEINTRESOURCE(IDR_CLISTMENU);
wndclass.lpszClassName = _T(MIRANDACLASS);
wndclass.hIconSm = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
RegisterClassEx(&wndclass);
@@ -303,16 +318,21 @@ int LoadCLUIModule(void)
g_clistApi.pfnOnCreateClc();
+ HookEvent(ME_LANGPACK_CHANGED, CluiLangpackChanged);
+ CluiLangpackChanged(0, 0);
+
PostMessage(g_clistApi.hwndContactList, M_RESTORESTATUS, 0, 0);
int state = db_get_b(0, "CList", "State", SETTING_STATE_NORMAL);
- g_clistApi.hMenuMain = GetMenu(g_clistApi.hwndContactList);
+
if (!db_get_b(0, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
SetMenu(g_clistApi.hwndContactList, nullptr);
+
if (state == SETTING_STATE_NORMAL)
ShowWindow(g_clistApi.hwndContactList, SW_SHOW);
else if (state == SETTING_STATE_MINIMIZED)
ShowWindow(g_clistApi.hwndContactList, SW_SHOWMINIMIZED);
+
SetWindowPos(g_clistApi.hwndContactList,
db_get_b(0, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST,
0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
@@ -1030,6 +1050,8 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
RemoveMenu(g_clistApi.hMenuMain, 0, MF_BYPOSITION);
RemoveMenu(g_clistApi.hMenuMain, 0, MF_BYPOSITION);
+ DestroyMenu(g_clistApi.hMenuMain);
+ g_clistApi.hMenuMain = nullptr;
if (g_clistApi.hwndStatus) {
DestroyWindow(g_clistApi.hwndStatus);