summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-08 20:40:49 +0200
committerGeorge Hazan <ghazan@miranda.im>2018-05-08 20:47:39 +0200
commit6a6f2b9e3b2749f16b513dfc98d5d5038b5628fb (patch)
treef0bc709157a49e0cff4ac436e60c0e098739b00c /src
parentc575dc94be9630240b7377a2e05011630bb8eb1e (diff)
merge from master
Diffstat (limited to 'src')
-rw-r--r--src/core/stdmsg/res/resource.rc4
-rw-r--r--src/core/stdmsg/src/chat_manager.cpp4
-rw-r--r--src/core/stdmsg/src/chat_window.cpp2
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp17
-rw-r--r--src/core/stdmsg/src/msglog.cpp3
-rw-r--r--src/core/stdmsg/src/msgoptions.cpp22
-rw-r--r--src/core/stdmsg/src/msgs.cpp21
-rw-r--r--src/core/stdmsg/src/stdafx.h1
-rw-r--r--src/core/stdmsg/src/tabs.cpp4
-rw-r--r--src/core/stduserinfo/src/contactinfo.cpp10
-rw-r--r--src/mir_app/src/FontOptions.cpp74
-rw-r--r--src/mir_app/src/FontService.cpp27
-rw-r--r--src/mir_app/src/chat_opts.cpp3
-rw-r--r--src/mir_app/src/clui.cpp3
-rw-r--r--src/mir_app/src/findadd.cpp2
-rw-r--r--src/mir_app/src/ignore.cpp2
-rw-r--r--src/mir_app/src/netliblog.cpp3
-rw-r--r--src/mir_app/src/visibility.cpp3
18 files changed, 122 insertions, 83 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);
}
diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp
index 4a1c8ba273..41a5c6331e 100644
--- a/src/core/stduserinfo/src/contactinfo.cpp
+++ b/src/core/stduserinfo/src/contactinfo.cpp
@@ -42,9 +42,12 @@ static INT_PTR CALLBACK EditUserEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar
switch (LOWORD(wParam)) {
case IDOK:
GetDlgItemTextA(hwndDlg, IDC_EMAIL, (char*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA), 256);
- //fall through
+ __fallthrough;
+
case IDCANCEL:
EndDialog(hwndDlg, wParam);
+ __fallthrough;
+
case IDC_EMAIL:
if (HIWORD(wParam) == EN_CHANGE)
EnableWindow(GetDlgItem(hwndDlg, IDOK), GetWindowTextLength(GetDlgItem(hwndDlg, IDC_EMAIL)));
@@ -100,9 +103,12 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar
}
if (IsDlgButtonChecked(hwndDlg, IDC_SMS)) mir_strcat(szText, " SMS");
}
- //fall through
+ __fallthrough;
+
case IDCANCEL:
EndDialog(hwndDlg, wParam);
+ __fallthrough;
+
case IDC_COUNTRY:
if (HIWORD(wParam) != CBN_SELCHANGE)
break;
diff --git a/src/mir_app/src/FontOptions.cpp b/src/mir_app/src/FontOptions.cpp
index 9d42904807..6e3b97709a 100644
--- a/src/mir_app/src/FontOptions.cpp
+++ b/src/mir_app/src/FontOptions.cpp
@@ -28,6 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// *_w2 is working copy of list
// *_w3 is stores initial configuration
+HWND hwndFontOptions = nullptr;
+
static int sttCompareFont(const FontInternal* p1, const FontInternal* p2)
{
int result = mir_wstrcmp(p1->group, p2->group);
@@ -113,7 +115,6 @@ int __inline DrawTextWithEffect(HDC hdc, LPCTSTR lpchText, int cchText, RECT * l
}
#define UM_SETFONTGROUP (WM_USER + 101)
-#define TIMER_ID 11015
#define FSUI_COLORBOXWIDTH 50
#define FSUI_COLORBOXLEFT 5
@@ -540,6 +541,36 @@ static void sttSaveFontData(HWND hwndDlg, FontInternal &F)
db_set_w(0, F.dbSettingsGroup, str, (WORD)F.flags);
}
+static void RebuildTree(HWND hwndDlg)
+{
+ font_id_list_w2 = font_id_list;
+ font_id_list_w3 = font_id_list;
+
+ colour_id_list_w2 = colour_id_list;
+ colour_id_list_w3 = colour_id_list;
+
+ effect_id_list_w2 = effect_id_list;
+ effect_id_list_w3 = effect_id_list;
+
+ for (auto &F : font_id_list_w2) {
+ // sync settings with database
+ UpdateFontSettings(F, &F->value);
+ sttFsuiCreateSettingsTreeNode(GetDlgItem(hwndDlg, IDC_FONTGROUP), F->group, F->hLangpack);
+ }
+
+ for (auto &C : colour_id_list_w2) {
+ // sync settings with database
+ UpdateColourSettings(C, &C->value);
+ sttFsuiCreateSettingsTreeNode(GetDlgItem(hwndDlg, IDC_FONTGROUP), C->group, C->hLangpack);
+ }
+
+ for (auto &E : effect_id_list_w2) {
+ // sync settings with database
+ UpdateEffectSettings(E, &E->value);
+ sttFsuiCreateSettingsTreeNode(GetDlgItem(hwndDlg, IDC_FONTGROUP), E->group, E->hLangpack);
+ }
+}
+
static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
int selCount;
@@ -550,33 +581,9 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
+ hwndFontOptions = hwndDlg;
- font_id_list_w2 = font_id_list;
- font_id_list_w3 = font_id_list;
-
- colour_id_list_w2 = colour_id_list;
- colour_id_list_w3 = colour_id_list;
-
- effect_id_list_w2 = effect_id_list;
- effect_id_list_w3 = effect_id_list;
-
- for (auto &F : font_id_list_w2) {
- // sync settings with database
- UpdateFontSettings(F, &F->value);
- sttFsuiCreateSettingsTreeNode(GetDlgItem(hwndDlg, IDC_FONTGROUP), F->group, F->hLangpack);
- }
-
- for (auto &C : colour_id_list_w2) {
- // sync settings with database
- UpdateColourSettings(C, &C->value);
- sttFsuiCreateSettingsTreeNode(GetDlgItem(hwndDlg, IDC_FONTGROUP), C->group, C->hLangpack);
- }
-
- for (auto &E : effect_id_list_w2) {
- // sync settings with database
- UpdateEffectSettings(E, &E->value);
- sttFsuiCreateSettingsTreeNode(GetDlgItem(hwndDlg, IDC_FONTGROUP), E->group, E->hLangpack);
- }
+ RebuildTree(hwndDlg);
SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETDEFAULTCOLOUR, 0, (LPARAM)GetSysColor(COLOR_WINDOW));
return TRUE;
@@ -906,8 +913,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
if (HIWORD(wParam) != LBN_DBLCLK)
return TRUE;
-
- //fall through
+ __fallthrough;
case IDC_CHOOSEFONT:
if (selCount = SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_GETSELCOUNT, 0, 0)) {
@@ -1151,8 +1157,16 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
}
break;
+ case WM_TIMER:
+ if (wParam == 1) {
+ KillTimer(hwndDlg, wParam);
+ TreeView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_FONTGROUP));
+ RebuildTree(hwndDlg);
+ }
+ break;
+
case WM_DESTROY:
- KillTimer(hwndDlg, TIMER_ID);
+ hwndFontOptions = nullptr;
sttSaveCollapseState(GetDlgItem(hwndDlg, IDC_FONTGROUP));
DeleteObject(hBkgColourBrush);
font_id_list_w2.destroy();
diff --git a/src/mir_app/src/FontService.cpp b/src/mir_app/src/FontService.cpp
index 8e07db3829..7acc62ac0b 100644
--- a/src/mir_app/src/FontService.cpp
+++ b/src/mir_app/src/FontService.cpp
@@ -27,6 +27,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
int code_page = CP_ACP;
HANDLE hFontReloadEvent, hColourReloadEvent;
+extern HWND hwndFontOptions;
+
+static void notifyOptions()
+{
+ if (hwndFontOptions)
+ SetTimer(hwndFontOptions, 1, 100, nullptr);
+}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -266,6 +273,8 @@ static int sttRegisterFontWorker(FontIDW *font_id, int _hLang)
UpdateFontSettings(font_id, &newItem->value);
font_id_list.insert(newItem);
+
+ notifyOptions();
return 0;
}
@@ -327,9 +336,12 @@ static INT_PTR ReloadFonts(WPARAM, LPARAM)
MIR_APP_DLL(void) KillModuleFonts(int _hLang)
{
auto T = font_id_list.rev_iter();
- for (auto &it : T)
- if (it->hLangpack == _hLang)
+ for (auto &it : T) {
+ if (it->hLangpack == _hLang) {
font_id_list.remove(T.indexOf(&it));
+ notifyOptions();
+ }
+ }
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -355,6 +367,8 @@ static INT_PTR sttRegisterColourWorker(ColourIDW *colour_id, int _hLang)
newItem->hLangpack = _hLang;
UpdateColourSettings(colour_id, &newItem->value);
colour_id_list.insert(newItem);
+
+ notifyOptions();
return 0;
}
@@ -403,9 +417,12 @@ static INT_PTR ReloadColours(WPARAM, LPARAM)
MIR_APP_DLL(void) KillModuleColours(int _hLang)
{
auto T = colour_id_list.rev_iter();
- for (auto &it : T)
- if (it->hLangpack == _hLang)
+ for (auto &it : T) {
+ if (it->hLangpack == _hLang) {
colour_id_list.remove(T.indexOf(&it));
+ notifyOptions();
+ }
+ }
}
//////////////////////////////////////////////////////////////////////////
@@ -442,6 +459,8 @@ static int sttRegisterEffectWorker(EffectIDW *effect_id, int _hLang)
newItem->hLangpack = _hLang;
UpdateEffectSettings(effect_id, &newItem->value);
effect_id_list.insert(newItem);
+
+ notifyOptions();
return 0;
}
diff --git a/src/mir_app/src/chat_opts.cpp b/src/mir_app/src/chat_opts.cpp
index 705d74a125..2282f53374 100644
--- a/src/mir_app/src/chat_opts.cpp
+++ b/src/mir_app/src/chat_opts.cpp
@@ -166,7 +166,8 @@ void RegisterFonts(void)
FO.szDefFace = L"Webdings";
FO.defColour = RGB(170, 170, 170);
FO.defCharset = SYMBOL_CHARSET;
- // fall through
+ __fallthrough;
+
default:
wcsncpy_s(fontid.backgroundName, LPGENW("Group chat log background"), _TRUNCATE);
break;
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp
index 75c66b3b25..5da831c9de 100644
--- a/src/mir_app/src/clui.cpp
+++ b/src/mir_app/src/clui.cpp
@@ -141,7 +141,8 @@ static INT_PTR CALLBACK AskForConfirmationDlgProc(HWND hWnd, UINT msg, WPARAM wP
EndDialog(hWnd, IDC_HIDE);
break;
}
- //fall through
+ __fallthrough;
+
case IDCANCEL:
case IDNO:
EndDialog(hWnd, LOWORD(wParam));
diff --git a/src/mir_app/src/findadd.cpp b/src/mir_app/src/findadd.cpp
index 19caaf101a..fdadcd9b7c 100644
--- a/src/mir_app/src/findadd.cpp
+++ b/src/mir_app/src/findadd.cpp
@@ -439,7 +439,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
GetClientRect(hwndList, &rc);
ListView_SetColumnWidth(hwndList, 0, rc.right);
}
- // fall through
+ __fallthrough;
case WM_MOVE:
if (dat && dat->hwndAdvSearch) {
diff --git a/src/mir_app/src/ignore.cpp b/src/mir_app/src/ignore.cpp
index bf7e23e659..86d60be867 100644
--- a/src/mir_app/src/ignore.cpp
+++ b/src/mir_app/src/ignore.cpp
@@ -253,7 +253,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM
case CLN_NEWCONTACT:
case CLN_LISTREBUILT:
SetAllContactIcons(GetDlgItem(hwndDlg, IDC_LIST));
- //fall through
+ __fallthrough;
case CLN_CONTACTMOVED:
SetListGroupIcons(GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, nullptr);
break;
diff --git a/src/mir_app/src/netliblog.cpp b/src/mir_app/src/netliblog.cpp
index c0d17d7b3c..392f8dc4f3 100644
--- a/src/mir_app/src/netliblog.cpp
+++ b/src/mir_app/src/netliblog.cpp
@@ -247,7 +247,8 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
}
}
InitLog();
- // fall through
+ __fallthrough;
+
case IDCANCEL:
DestroyWindow(hwndDlg);
}
diff --git a/src/mir_app/src/visibility.cpp b/src/mir_app/src/visibility.cpp
index e90fd88e05..77536c2c94 100644
--- a/src/mir_app/src/visibility.cpp
+++ b/src/mir_app/src/visibility.cpp
@@ -171,7 +171,8 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP
case CLN_NEWCONTACT:
case CLN_LISTREBUILT:
SetAllContactIcons(GetDlgItem(hwndDlg, IDC_LIST));
- //fall through
+ __fallthrough;
+
case CLN_CONTACTMOVED:
SetListGroupIcons(GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, nullptr);
break;