diff options
Diffstat (limited to 'src/core/stdmsg')
-rw-r--r-- | src/core/stdmsg/res/resource.rc | 4 | ||||
-rw-r--r-- | src/core/stdmsg/src/chat_manager.cpp | 4 | ||||
-rw-r--r-- | src/core/stdmsg/src/chat_window.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 17 | ||||
-rw-r--r-- | src/core/stdmsg/src/msglog.cpp | 3 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgoptions.cpp | 22 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgs.cpp | 21 | ||||
-rw-r--r-- | src/core/stdmsg/src/stdafx.h | 1 | ||||
-rw-r--r-- | src/core/stdmsg/src/tabs.cpp | 4 |
9 files changed, 37 insertions, 41 deletions
diff --git a/src/core/stdmsg/res/resource.rc b/src/core/stdmsg/res/resource.rc index dc3abac474..dbdc5bcf2b 100644 --- a/src/core/stdmsg/res/resource.rc +++ b/src/core/stdmsg/res/resource.rc @@ -46,8 +46,8 @@ BEGIN CONTROL "Show toolbar buttons on top row",IDC_SHOWBUTTONLINE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,192,137,10
CONTROL "Send message on double 'Enter'",IDC_SENDONDBLENTER,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,148,166,149,10
- CONTROL "Send message on 'Enter'",IDC_SENDONENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,148,179,152,10
+ "Button", BS_AUTORADIOBUTTON | WS_TABSTOP,148,166,149,10
+ CONTROL "Send message on 'Enter'",IDC_SENDONENTER,"Button", BS_AUTORADIOBUTTON | WS_TABSTOP,148,179,152,10
CONTROL "Show character count",IDC_CHARCOUNT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,148,192,149,10
LTEXT "Show warning when message has not been received after",IDC_STATIC,8,208,211,8
EDITTEXT IDC_SECONDS,223,206,25,12,ES_AUTOHSCROLL
diff --git a/src/core/stdmsg/src/chat_manager.cpp b/src/core/stdmsg/src/chat_manager.cpp index 7fc20d3af8..a4e4697f3e 100644 --- a/src/core/stdmsg/src/chat_manager.cpp +++ b/src/core/stdmsg/src/chat_manager.cpp @@ -160,7 +160,7 @@ static void RegisterFonts() { ColourIDW colourid = { sizeof(colourid) }; strncpy(colourid.dbSettingsGroup, CHAT_MODULE, sizeof(colourid.dbSettingsGroup)); - wcsncpy(colourid.group, LPGENW("Chat module"), _countof(colourid.group)); + wcsncpy(colourid.group, LPGENW("Message sessions") L"/" LPGENW("Chat module"), _countof(colourid.group)); strncpy(colourid.setting, "ColorLogBG", _countof(colourid.setting)); wcsncpy(colourid.name, LPGENW("Group chat log background"), _countof(colourid.name)); @@ -239,7 +239,7 @@ void Load_ChatModule() AddIcons(); RegisterFonts(); - CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Chat module"), FONTMODE_USE }; + CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Message sessions") L"/" LPGENW("Chat module"), FONTMODE_USE }; pci = Chat_GetInterface(&data); pci->OnCreateModule = OnCreateModule; diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index 55ca576727..4767d84312 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -850,7 +850,7 @@ LRESULT CChatRoomDlg::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) return TRUE; } } - // fall through + __fallthrough; case WM_LBUTTONDOWN: case WM_MBUTTONDOWN: diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 386552ee78..0a5ef46008 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -634,11 +634,12 @@ void CSrmmWindow::UpdateTitle() m_wStatus = db_get_w(m_hContact, m_szProto, "Status", ID_STATUS_OFFLINE);
wchar_t *contactName = Clist_GetContactDisplayName(m_hContact);
- wchar_t *szStatus = Clist_GetStatusModeDescription(m_szProto == nullptr ? ID_STATUS_OFFLINE : db_get_w(m_hContact, m_szProto, "Status", ID_STATUS_OFFLINE), 0);
if (g_dat.bUseStatusWinIcon)
mir_snwprintf(newtitle, L"%s - %s", contactName, TranslateT("Message session"));
- else
+ else {
+ wchar_t *szStatus = Clist_GetStatusModeDescription(m_szProto == nullptr ? ID_STATUS_OFFLINE : db_get_w(m_hContact, m_szProto, "Status", ID_STATUS_OFFLINE), 0);
mir_snwprintf(newtitle, L"%s (%s): %s", contactName, szStatus, TranslateT("Message session"));
+ }
m_wOldStatus = m_wStatus;
}
@@ -659,7 +660,7 @@ int CSrmmWindow::Resizer(UTILRESIZECONTROL *urc) switch (urc->wId) {
case IDC_SRMM_LOG:
if (!g_dat.bShowButtons)
- urc->rcItem.top = 22;
+ urc->rcItem.top = 2;
urc->rcItem.bottom = urc->dlgNewSize.cy - m_iSplitterY;
return RD_ANCHORX_WIDTH | RD_ANCHORY_TOP;
@@ -1035,8 +1036,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) Window_FreeIcon_IcoLib(m_pOwner->GetHwnd());
if (m_szProto) {
- WORD wStatus = db_get_w(m_hContact, m_szProto, "Status", ID_STATUS_OFFLINE);
- Window_SetProtoIcon_IcoLib(m_pOwner->GetHwnd(), m_szProto, wStatus);
+ Window_SetProtoIcon_IcoLib(m_pOwner->GetHwnd(), m_szProto, Contact_GetStatus(m_hContact));
break;
}
}
@@ -1084,13 +1084,16 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (LOWORD(wParam) != WA_ACTIVE)
break;
- SetFocus(m_message.GetHwnd());
- // fall through
+ __fallthrough;
+
case WM_MOUSEACTIVATE:
+ SetFocus(m_message.GetHwnd());
UpdateTitle();
UpdateLastMessage();
if (KillTimer(m_hwnd, TIMERID_FLASHWND))
FlashWindow(m_pOwner->GetHwnd(), FALSE);
+ if (g_dat.bUseStatusWinIcon)
+ SendMessage(m_hwnd, DM_UPDATEWINICON, 0, 0);
break;
case WM_CBD_LOADICONS:
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index dac3fdb793..b06bdb9b64 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -371,7 +371,8 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG }
}
dat->stage = STREAMSTAGE_TAIL;
- // fall through
+ __fallthrough;
+
case STREAMSTAGE_TAIL:
CreateRTFTail(dat->buf);
dat->stage = STREAMSTAGE_STOP;
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index 5f0e0823b2..5168b2933c 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -95,14 +95,14 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour) void RegisterSRMMFonts(void)
{
- char idstr[10];
-
FontIDW fontid = { sizeof(fontid) };
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID;
for (int i = 0; i < _countof(fontOptionsList); i++) {
strncpy_s(fontid.dbSettingsGroup, SRMMMOD, _TRUNCATE);
- wcsncpy_s(fontid.group, LPGENW("Message log"), _TRUNCATE);
+ wcsncpy_s(fontid.group, LPGENW("Message sessions") L"/" LPGENW("Message log"), _TRUNCATE);
wcsncpy_s(fontid.name, fontOptionsList[i].szDescr, _TRUNCATE);
+
+ char idstr[10];
mir_snprintf(idstr, "SRMFont%d", i);
strncpy_s(fontid.prefix, idstr, _TRUNCATE);
fontid.order = i;
@@ -115,7 +115,7 @@ void RegisterSRMMFonts(void) fontid.deffontsettings.style = fontOptionsList[i].defStyle;
wcsncpy_s(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _TRUNCATE);
fontid.deffontsettings.charset = MsgDlgGetFontDefaultCharset(fontOptionsList[i].szDefFace);
- wcsncpy_s(fontid.backgroundGroup, LPGENW("Message log"), _TRUNCATE);
+ wcsncpy_s(fontid.backgroundGroup, LPGENW("Message sessions") L"/" LPGENW("Message log"), _TRUNCATE);
wcsncpy_s(fontid.backgroundName, LPGENW("Background"), _TRUNCATE);
Font_RegisterW(&fontid);
}
@@ -125,7 +125,7 @@ void RegisterSRMMFonts(void) strncpy_s(colourid.setting, SRMSGSET_BKGCOLOUR, _TRUNCATE);
colourid.defcolour = SRMSGDEFSET_BKGCOLOUR;
wcsncpy_s(colourid.name, LPGENW("Background"), _TRUNCATE);
- wcsncpy_s(colourid.group, LPGENW("Message log"), _TRUNCATE);
+ wcsncpy_s(colourid.group, LPGENW("Message sessions") L"/" LPGENW("Message log"), _TRUNCATE);
Colour_RegisterW(&colourid);
}
@@ -220,8 +220,6 @@ public: chkAutoMin.OnChange = Callback(this, &COptionMainDlg::onChange_AutoMin);
chkAutoClose.OnChange = Callback(this, &COptionMainDlg::onChange_AutoClose);
chkLimitAvatar.OnChange = Callback(this, &COptionMainDlg::onChange_LimitAvatar);
- chkSendOnEnter.OnChange = Callback(this, &COptionMainDlg::onChange_SendOnEnter);
- chkSendOnDblEnter.OnChange = Callback(this, &COptionMainDlg::onChange_SendOnDblEnter);
chkSavePerContact.OnChange = Callback(this, &COptionMainDlg::onChange_SavePerContact);
CreateLink(edtNFlash, g_dat.nFlashMax);
@@ -282,16 +280,6 @@ public: chkCtrlSupport.Enable(!chkAutoClose.GetState());
}
- void onChange_SendOnEnter(CCtrlCheck*)
- {
- chkSendOnDblEnter.SetState(false);
- }
-
- void onChange_SendOnDblEnter(CCtrlCheck*)
- {
- chkSendOnEnter.SetState(false);
- }
-
void onChange_SavePerContact(CCtrlCheck*)
{
chkCascade.Enable(!chkSavePerContact.GetState());
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index eac78a6b84..1b8a5f9727 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -409,20 +409,27 @@ void SetButtonsPos(HWND hwndDlg, bool bIsChat) GetClientRect(hwndDlg, &rc);
int iLeftX = 2, iRightX = rc.right - 2;
+ bool bShow = (bIsChat) ? true : g_dat.bShowButtons;
+
CustomButtonData *cbd;
for (int i = 0; cbd = Srmm_GetNthButton(i); i++) {
HWND hwndButton = GetDlgItem(hwndDlg, cbd->m_dwButtonCID);
if (hwndButton == nullptr || cbd->m_bHidden)
continue;
- if (cbd->m_bRSided) {
- iRightX -= g_dat.iGap + cbd->m_iButtonWidth;
- hdwp = DeferWindowPos(hdwp, hwndButton, nullptr, iRightX, yPos, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
- }
- else {
- hdwp = DeferWindowPos(hdwp, hwndButton, nullptr, iLeftX, yPos, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
- iLeftX += g_dat.iGap + cbd->m_iButtonWidth;
+ if (bShow) {
+ ShowWindow(hwndButton, SW_SHOW);
+
+ if (cbd->m_bRSided) {
+ iRightX -= g_dat.iGap + cbd->m_iButtonWidth;
+ hdwp = DeferWindowPos(hdwp, hwndButton, nullptr, iRightX, yPos, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
+ }
+ else {
+ hdwp = DeferWindowPos(hdwp, hwndButton, nullptr, iLeftX, yPos, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
+ iLeftX += g_dat.iGap + cbd->m_iButtonWidth;
+ }
}
+ else ShowWindow(hwndButton, SW_HIDE);
}
EndDeferWindowPos(hdwp);
diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h index 5d890b97c3..28f6e257fd 100644 --- a/src/core/stdmsg/src/stdafx.h +++ b/src/core/stdmsg/src/stdafx.h @@ -150,7 +150,6 @@ class CTabbedWindow : public CDlgBase int iX = 0, iY = 0;
int iWidth = 0, iHeight = 0;
int m_windowWasCascaded = 0;
- bool m_bSizingLoop = false;
public:
CCtrlPages m_tab;
diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp index 7afb64175f..c244f0dd24 100644 --- a/src/core/stdmsg/src/tabs.cpp +++ b/src/core/stdmsg/src/tabs.cpp @@ -545,7 +545,6 @@ INT_PTR CTabbedWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) GetClientRect(m_hwnd, &rc); oldSizeX = rc.right - rc.left; oldSizeY = rc.bottom - rc.top; - m_bSizingLoop = true; break; case WM_EXITSIZEMOVE: @@ -557,7 +556,6 @@ INT_PTR CTabbedWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) pDlg->Resize(); } } - m_bSizingLoop = false; break; case WM_GETMINMAXINFO: @@ -685,7 +683,7 @@ INT_PTR CTabbedWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) LRESULT res = CDlgBase::DlgProc(msg, wParam, lParam); if (msg == WM_SIZE) { SendMessage(m_hwndStatus, WM_SIZE, 0, 0); - if (m_pEmbed && !m_bSizingLoop) { + if (m_pEmbed) { GetClientRect(m_tab.GetHwnd(), &rc); MoveWindow(m_pEmbed->GetHwnd(), 0, 0, rc.right - rc.left, rc.bottom - rc.top, FALSE); } |