diff options
25 files changed, 127 insertions, 122 deletions
diff --git a/include/m_srmm_int.h b/include/m_srmm_int.h index 67059a625f..29d99e69e0 100644 --- a/include/m_srmm_int.h +++ b/include/m_srmm_int.h @@ -339,6 +339,7 @@ public: virtual bool GetFirstEvent() = 0;
virtual bool IsActive() const = 0;
virtual void LoadSettings() = 0;
+ virtual void OnOptionsApplied() = 0;
virtual void RemakeLog() = 0;
virtual void SetStatusText(const wchar_t *, HICON) {}
virtual void ShowFilterMenu() {}
@@ -374,6 +375,11 @@ class CMsgDialog : public CSrmmBaseDialog {}; MIR_APP_DLL(void) Srmm_AddEvent(MCONTACT hContact, MEVENT hDbEvent);
/////////////////////////////////////////////////////////////////////////////////////////
+// tell all SRMM windows that options were changed
+
+MIR_APP_DLL(void) Srmm_ApplyOptions();
+
+/////////////////////////////////////////////////////////////////////////////////////////
// sends a message to all SRMM windows
MIR_APP_DLL(void) Srmm_Broadcast(UINT, WPARAM, LPARAM);
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex eff5cda645..1bb323dbac 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex 6e75338abe..145ab13a7a 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index d062cf512a..4e1b373608 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -217,7 +217,7 @@ bool CMsgDialog::OnInitDialog() }
}
- SendMessage(m_hwnd, DM_OPTIONSAPPLIED, 0, 0);
+ OnOptionsApplied();
PopupWindow(m_bIncoming);
if (notifyUnread) {
@@ -891,43 +891,6 @@ INT_PTR CMsgDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) }
break;
- case DM_OPTIONSAPPLIED:
- if (!isChat()) {
- GetAvatar();
- SetDialogToType();
-
- m_pLog->UpdateOptions();
-
- COLORREF colour = g_plugin.getDword(SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR);
- m_message.SendMsg(EM_SETBKGNDCOLOR, 0, colour);
- InvalidateRect(m_message.GetHwnd(), nullptr, FALSE);
-
- LOGFONT lf;
- LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, &lf, &colour);
-
- CHARFORMAT2 cf2;
- memset(&cf2, 0, sizeof(cf2));
- cf2.cbSize = sizeof(cf2);
- cf2.dwMask = CFM_COLOR | CFM_FACE | CFM_CHARSET | CFM_SIZE | CFM_WEIGHT | CFM_BOLD | CFM_ITALIC;
- cf2.crTextColor = colour;
- cf2.bCharSet = lf.lfCharSet;
- wcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE);
- cf2.dwEffects = ((lf.lfWeight >= FW_BOLD) ? CFE_BOLD : 0) | (lf.lfItalic ? CFE_ITALIC : 0);
- cf2.wWeight = (uint16_t)lf.lfWeight;
- cf2.bPitchAndFamily = lf.lfPitchAndFamily;
- cf2.yHeight = abs(lf.lfHeight) * 1440 / g_dat.logPixelSY;
- m_message.SendMsg(EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf2);
- m_message.SendMsg(EM_SETLANGOPTIONS, 0, (LPARAM)m_message.SendMsg(EM_GETLANGOPTIONS, 0, 0) & ~IMF_AUTOKEYBOARD);
-
- SendMessage(m_hwnd, DM_REMAKELOG, 0, 0);
- UpdateTitle();
- UpdateTabControl();
- UpdateStatusBar();
- m_message.SendMsg(EM_REQUESTRESIZE, 0, 0);
- SetupInfobar();
- }
- break;
-
case DM_ACTIVATE:
if (isChat()) {
if (m_si->wState & STATE_TALK) {
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index b51cddc4fa..2a1975e5e6 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -75,7 +75,7 @@ int FontServiceFontsChanged(WPARAM, LPARAM) {
LoadMsgLogIcons();
LoadInfobarFonts();
- Srmm_Broadcast(DM_OPTIONSAPPLIED, 0, 0);
+ Srmm_ApplyOptions();
return 0;
}
@@ -177,7 +177,7 @@ class CBaseOptionDlg : public CDlgBase {
ReloadGlobals();
WindowList_Broadcast(g_dat.hParentWindowList, DM_OPTIONSAPPLIED, 0, 0);
- Srmm_Broadcast(DM_OPTIONSAPPLIED, 0, 0);
+ Srmm_ApplyOptions();
Chat_UpdateOptions();
}
@@ -739,7 +739,7 @@ public: }
ReloadGlobals();
- Srmm_Broadcast(DM_OPTIONSAPPLIED, 0, 0);
+ Srmm_ApplyOptions();
return true;
}
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index c6422300d7..f24d81b4d6 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -133,6 +133,7 @@ public: void EventAdded(MEVENT, const DB::EventInfo &dbei) override;
bool GetFirstEvent() override;
void LoadSettings() override;
+ void OnOptionsApplied() override;
void RemakeLog() override;
void SetStatusText(const wchar_t *, HICON) override;
void ShowFilterMenu() override;
diff --git a/plugins/Scriver/src/msgutils.cpp b/plugins/Scriver/src/msgutils.cpp index bb9da0e619..4f4fb2349b 100644 --- a/plugins/Scriver/src/msgutils.cpp +++ b/plugins/Scriver/src/msgutils.cpp @@ -294,6 +294,45 @@ void CMsgDialog::NotifyTyping(int mode) CallService(MS_PROTO_SELFISTYPING, m_hContact, m_nTypeMode); } +void CMsgDialog::OnOptionsApplied() +{ + if (isChat()) + return; + + GetAvatar(); + SetDialogToType(); + + m_pLog->UpdateOptions(); + + COLORREF colour = g_plugin.getDword(SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR); + m_message.SendMsg(EM_SETBKGNDCOLOR, 0, colour); + InvalidateRect(m_message.GetHwnd(), nullptr, FALSE); + + LOGFONT lf; + LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, &lf, &colour); + + CHARFORMAT2 cf2; + memset(&cf2, 0, sizeof(cf2)); + cf2.cbSize = sizeof(cf2); + cf2.dwMask = CFM_COLOR | CFM_FACE | CFM_CHARSET | CFM_SIZE | CFM_WEIGHT | CFM_BOLD | CFM_ITALIC; + cf2.crTextColor = colour; + cf2.bCharSet = lf.lfCharSet; + wcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE); + cf2.dwEffects = ((lf.lfWeight >= FW_BOLD) ? CFE_BOLD : 0) | (lf.lfItalic ? CFE_ITALIC : 0); + cf2.wWeight = (uint16_t)lf.lfWeight; + cf2.bPitchAndFamily = lf.lfPitchAndFamily; + cf2.yHeight = abs(lf.lfHeight) * 1440 / g_dat.logPixelSY; + m_message.SendMsg(EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf2); + m_message.SendMsg(EM_SETLANGOPTIONS, 0, (LPARAM)m_message.SendMsg(EM_GETLANGOPTIONS, 0, 0) & ~IMF_AUTOKEYBOARD); + + SendMessage(m_hwnd, DM_REMAKELOG, 0, 0); + UpdateTitle(); + UpdateTabControl(); + UpdateStatusBar(); + m_message.SendMsg(EM_REQUESTRESIZE, 0, 0); + SetupInfobar(); +} + void CMsgDialog::Reattach(HWND hwndContainer) { MCONTACT hContact = m_hContact; diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp index 9a5792651d..0dd3cafd0d 100644 --- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp +++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp @@ -56,15 +56,7 @@ static OBJLIST<MsgWndData> g_MsgWndList(10, HandleKeySortT); int UpdateSrmmDlg(WPARAM wParam, LPARAM)
{
- mir_cslock lck(csWndList);
-
- for (auto &it : g_MsgWndList) {
- if (wParam == 0 || it->pDlg->m_hContact == wParam) {
- SendMessage(it->pDlg->GetHwnd(), WM_SETREDRAW, FALSE, 0);
- it->pDlg->UpdateOptions();
- SendMessage(it->pDlg->GetHwnd(), WM_SETREDRAW, TRUE, 0);
- }
- }
+ Srmm_ApplyOptions();
return 0;
}
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index fbbc9398a7..b2dbc14ea4 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -265,12 +265,12 @@ INT_PTR LoadContactSmileys(WPARAM, LPARAM lParam) switch (cont->type) {
case 0:
g_SmileyPackCStore.AddSmileyPack(cont->pszModule, cont->path);
- NotifyEventHooks(g_hevOptionsChanged, (WPARAM)cont->pszModule, 0);
+ NotifyEventHooks(g_hevOptionsChanged, 0, (WPARAM)cont->pszModule);
break;
case 1:
g_SmileyPackCStore.AddSmiley(cont->pszModule, cont->path);
- NotifyEventHooks(g_hevOptionsChanged, (WPARAM)cont->pszModule, 0);
+ NotifyEventHooks(g_hevOptionsChanged, 0, (WPARAM)cont->pszModule);
break;
case 2:
diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp index 0294bb5c45..250346da03 100644 --- a/plugins/TabSRMM/src/chat_options.cpp +++ b/plugins/TabSRMM/src/chat_options.cpp @@ -402,7 +402,7 @@ int FontServiceFontsChanged(WPARAM, LPARAM) FreeTabConfig();
ReloadTabConfig();
Skin->setupAeroSkins();
- Srmm_Broadcast(DM_OPTIONSAPPLIED, 1, 0);
+ Srmm_ApplyOptions();
return 0;
}
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 7d1e8ceb35..7fbd56f602 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -842,7 +842,7 @@ void CMsgDialog::DM_NotifyTyping(int mode) }
}
-void CMsgDialog::DM_OptionsApplied(bool bRemakeLog)
+void CMsgDialog::OnOptionsApplied()
{
m_szMicroLf[0] = 0;
if (!m_pContainer->m_theme.isPrivate) {
@@ -868,14 +868,13 @@ void CMsgDialog::DM_OptionsApplied(bool bRemakeLog) if (m_hwnd == m_pContainer->m_hwndActive)
SendMessage(m_pContainer->m_hwnd, WM_SIZE, 0, 0);
InvalidateRect(m_message.GetHwnd(), nullptr, FALSE);
- if (bRemakeLog) {
- if (IsIconic(m_pContainer->m_hwnd))
- m_bDeferredRemakeLog = true;
- else if (isChat())
- RedrawLog();
- else
- RemakeLog();
- }
+
+ if (IsIconic(m_pContainer->m_hwnd))
+ m_bDeferredRemakeLog = true;
+ else if (isChat())
+ RedrawLog();
+ else
+ RemakeLog();
ShowWindow(m_hwndPanelPicParent, SW_SHOW);
EnableWindow(m_hwndPanelPicParent, TRUE);
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 8f6d86edb5..09aee40cb7 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -580,7 +580,7 @@ bool CMsgDialog::OnInitDialog() else {
GetFirstEvent();
- DM_OptionsApplied();
+ OnOptionsApplied();
DB::ECPTR pCursor(DB::EventsRev(m_hContact));
while (MEVENT hdbEvent = pCursor.FetchNext()) {
@@ -1434,7 +1434,7 @@ int CMsgDialog::OnFilter(MSGFILTER *pFilter) db_unset(m_hContact, SRMSGMOD_T, "mwmask");
db_unset(m_hContact, SRMSGMOD_T, "mwflags");
}
- DM_OptionsApplied();
+ OnOptionsApplied();
RemakeLog();
}
return _dlgReturn(m_hwnd, 1);
@@ -2188,7 +2188,7 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (isChat())
RedrawLog();
else
- DM_OptionsApplied();
+ OnOptionsApplied();
break;
case WM_NOTIFY:
@@ -2331,10 +2331,6 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) UpdateWindowIcon();
return 0;
- case DM_OPTIONSAPPLIED:
- DM_OptionsApplied(lParam == 0);
- return 0;
-
case DM_UPDATESTATUSMSG:
m_pPanel.Invalidate();
return 0;
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index ab56521362..2d22090b74 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -289,7 +289,7 @@ public: CacheMsgLogIcons();
PluginConfig.reloadSettings();
CSkin::setAeroEffect(-1);
- Srmm_Broadcast(DM_OPTIONSAPPLIED, 1, 0);
+ Srmm_ApplyOptions();
Srmm_Broadcast(DM_FORCEDREMAKELOG, 0, 0);
SendMessage(GetParent(m_hwnd), WM_COMMAND, IDCANCEL, 0);
}
@@ -423,7 +423,7 @@ public: db_set_b(0, SRMSGMOD_T, "dontscaleavatars", chkAvaPreserve.GetState());
PluginConfig.reloadSettings();
- Srmm_Broadcast(DM_OPTIONSAPPLIED, 1, 0);
+ Srmm_ApplyOptions();
return true;
}
@@ -852,7 +852,7 @@ public: else
db_set_dw(0, SRMSGMOD_T, "maxhist", 0);
PluginConfig.reloadSettings();
- Srmm_Broadcast(DM_OPTIONSAPPLIED, 1, 0);
+ Srmm_ApplyOptions();
return true;
}
@@ -1093,7 +1093,7 @@ public: db_set_b(0, SRMSGMOD_T, "escmode", cmbEscMode.GetCurSel());
PluginConfig.reloadSettings();
- Srmm_Broadcast(DM_OPTIONSAPPLIED, 0, 0);
+ Srmm_ApplyOptions();
return true;
}
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 7343237d28..db04ba7685 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -623,7 +623,7 @@ int IconsChanged(WPARAM, LPARAM) {
CreateImageList(false);
CacheMsgLogIcons();
- Srmm_Broadcast(DM_OPTIONSAPPLIED, 0, 0);
+ Srmm_ApplyOptions();
Srmm_Broadcast(DM_UPDATEWINICON, 0, 0);
return 0;
}
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index 4aef4ccf63..5817cfcb88 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -597,6 +597,7 @@ public: bool GetFirstEvent() override;
bool IsActive() const override;
void LoadSettings() override;
+ void OnOptionsApplied() override;
void RemakeLog() override;
void SetStatusText(const wchar_t *, HICON) override;
void ShowFilterMenu() override;
@@ -630,7 +631,6 @@ public: void LogEvent(DB::EventInfo &dbei);
- void DM_OptionsApplied(bool bRemakeLog = true);
void DM_RecalcPictureSize(void);
void DM_ScrollToBottom(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp index 944474d85a..70ff19332e 100644 --- a/plugins/TabSRMM/src/userprefs.cpp +++ b/plugins/TabSRMM/src/userprefs.cpp @@ -342,7 +342,7 @@ public: fShouldHide = false;
else
ShowWindow(dat->m_pContainer->m_hwnd, SW_HIDE);
- dat->DM_OptionsApplied();
+ dat->OnOptionsApplied();
dat->RemakeLog();
if (fShouldHide)
ShowWindow(dat->m_pContainer->m_hwnd, SW_SHOWNORMAL);
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index aef0cd9910..7794154a64 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -135,7 +135,7 @@ bool CMsgDialog::OnInitDialog() m_iSplitterY = g_plugin.getDword(g_plugin.bSavePerContact ? m_hContact : 0, "splitterPos", m_minEditInit.bottom - m_minEditInit.top);
m_message.SendMsg(EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS | ENM_CHANGE);
- OnOptionsApplied(false);
+ OnOptionsApplied();
UpdateAvatar();
if (isChat()) {
@@ -535,14 +535,6 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) UpdateAvatar();
break;
- case DM_OPTIONSAPPLIED:
- OnOptionsApplied(wParam != 0);
- if (isChat())
- RedrawLog();
- else
- RemakeLog();
- break;
-
case DM_NEWTIMEZONE:
m_hTimeZone = TimeZone_CreateByContact(m_hContact, nullptr, TZF_KNOWNONLY);
m_wMinute = 61;
@@ -1080,7 +1072,7 @@ void CMsgDialog::TabAutoComplete() /////////////////////////////////////////////////////////////////////////////////////////
-void CMsgDialog::OnOptionsApplied(bool bUpdateAvatar)
+void CMsgDialog::OnOptionsApplied()
{
CustomButtonData *cbd;
for (int i = 0; cbd = Srmm_GetNthButton(i); i++) {
@@ -1120,8 +1112,7 @@ void CMsgDialog::OnOptionsApplied(bool bUpdateAvatar) if (CallProtoService(m_szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_AVATARS)
m_limitAvatarH = g_plugin.bLimitAvatarHeight ? g_plugin.iAvatarHeight : 0;
- if (bUpdateAvatar)
- UpdateAvatar();
+ UpdateAvatar();
InvalidateRect(m_message.GetHwnd(), nullptr, FALSE);
@@ -1139,6 +1130,11 @@ void CMsgDialog::OnOptionsApplied(bool bUpdateAvatar) m_pLog->Clear();
FixTabIcons();
+
+ if (isChat())
+ RedrawLog();
+ else
+ RemakeLog();
}
void CMsgDialog::onSplitterX(CSplitter *pSplitter)
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index 4209ce01ea..5fa17a9e4e 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -253,7 +253,7 @@ public: msgTimeout = 5000;
g_plugin.msgTimeout = msgTimeout;
- Srmm_Broadcast(DM_OPTIONSAPPLIED, TRUE, 0);
+ Srmm_ApplyOptions();
return true;
}
@@ -370,7 +370,7 @@ public: FreeMsgLogIcons();
LoadMsgLogIcons();
- Srmm_Broadcast(DM_OPTIONSAPPLIED, TRUE, 0);
+ Srmm_ApplyOptions();
return true;
}
@@ -484,7 +484,7 @@ public: bool OnApply() override
{
SaveList();
- Srmm_Broadcast(DM_OPTIONSAPPLIED, TRUE, 0);
+ Srmm_ApplyOptions();
return true;
}
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 3abfeab03a..d64ec7b2c6 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -449,7 +449,7 @@ void CMsgDialog::SetButtonsPos() static int FontsChanged(WPARAM, LPARAM)
{
- Srmm_Broadcast(DM_OPTIONSAPPLIED, TRUE, 0);
+ Srmm_ApplyOptions();
return 0;
}
diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h index 51662e669d..98670d6dee 100644 --- a/src/core/stdmsg/src/msgs.h +++ b/src/core/stdmsg/src/msgs.h @@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef SRMM_MSGS_H
#define SRMM_MSGS_H
-#define DM_OPTIONSAPPLIED (WM_USER+14)
#define DM_UPDATETITLE (WM_USER+16)
#define DM_NEWTIMEZONE (WM_USER+18)
#define HM_AVATARACK (WM_USER+28)
@@ -108,8 +107,6 @@ public: void onClick_Filter(CCtrlButton *);
void onClick_NickList(CCtrlButton *);
- void OnOptionsApplied(bool bUpdateAvatar);
-
void UpdateReadChars(void);
__forceinline MCONTACT getActiveContact() const {
@@ -142,6 +139,7 @@ public: bool GetFirstEvent() override;
bool IsActive() const override;
void LoadSettings() override;
+ void OnOptionsApplied() override;
void RemakeLog() override;
void SetStatusText(const wchar_t *, HICON) override;
void ShowFilterMenu() override;
diff --git a/src/mir_app/src/chat.h b/src/mir_app/src/chat.h index 6be46ab3ba..6ba50be865 100644 --- a/src/mir_app/src/chat.h +++ b/src/mir_app/src/chat.h @@ -30,6 +30,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define STREAMSTAGE_TAIL 2
#define STREAMSTAGE_STOP 3
+#define DM_OPTIONSAPPLIED (WM_USER+14)
+
void Srmm_CreateToolbarIcons(HWND hwndDlg, int flags);
void Srmm_ProcessToolbarHotkey(MCONTACT hContact, INT_PTR iButtonFrom, HWND hwndDlg);
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index c76a0cdf00..8a939f15af 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -905,3 +905,4 @@ Clist_GroupSaveExpanded @1003 NONAME ?Srmm_Quote@@YG?AV?$CMStringT@_WV?$ChTraitsCRT@_W@@@@PB_WH@Z @1022 NONAME
?SetMessageText@CSrmmBaseDialog@@QAEXPB_W_N@Z @1023 NONAME
?GetInput@CSrmmBaseDialog@@QBEPAUHWND__@@XZ @1024 NONAME
+?Srmm_ApplyOptions@@YGXXZ @1025 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 81d7d3ce08..f36d40f651 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -905,3 +905,4 @@ Clist_GroupSaveExpanded @1003 NONAME ?Srmm_Quote@@YA?AV?$CMStringT@_WV?$ChTraitsCRT@_W@@@@PEB_WH@Z @1022 NONAME
?SetMessageText@CSrmmBaseDialog@@QEAAXPEB_W_N@Z @1023 NONAME
?GetInput@CSrmmBaseDialog@@QEBAPEAUHWND__@@XZ @1024 NONAME
+?Srmm_ApplyOptions@@YAXXZ @1025 NONAME
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp index dfe6b6007e..abd760fa97 100644 --- a/src/mir_app/src/srmm_base.cpp +++ b/src/mir_app/src/srmm_base.cpp @@ -567,6 +567,10 @@ void CSrmmBaseDialog::OnDestroy() INT_PTR CSrmmBaseDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
+ case DM_OPTIONSAPPLIED:
+ OnOptionsApplied();
+ return 0;
+
case WM_COMMAND:
if (!lParam && Clist_MenuProcessCommand(LOWORD(wParam), MPCF_CONTACTMENU, m_hContact))
return 0;
diff --git a/src/mir_app/src/srmm_util.cpp b/src/mir_app/src/srmm_util.cpp index dd69502e34..4af2be4c17 100644 --- a/src/mir_app/src/srmm_util.cpp +++ b/src/mir_app/src/srmm_util.cpp @@ -29,25 +29,26 @@ const char *g_pszHotkeySection; /////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(int) Srmm_GetWindowData(MCONTACT hContact, MessageWindowData &mwd)
+MIR_APP_DLL(void) Srmm_AddEvent(MCONTACT hContact, MEVENT hDbEvent)
{
- if (hContact == 0)
- return 1;
+ wchar_t toolTip[256];
+ mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(hContact));
- HWND hwnd = WindowList_Find(g_hWindowList, hContact);
- if (hwnd == nullptr)
- return 1;
+ CLISTEVENT cle = {};
+ cle.hContact = hContact;
+ cle.hDbEvent = hDbEvent;
+ cle.flags = CLEF_UNICODE;
+ cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
+ cle.pszService = MS_MSG_READMESSAGE;
+ cle.szTooltip.w = toolTip;
+ g_clistApi.pfnAddEvent(&cle);
+}
- mwd.hwndWindow = hwnd;
- mwd.pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- mwd.uState = MSG_WINDOW_STATE_EXISTS;
- if (IsWindowVisible(hwnd))
- mwd.uState |= MSG_WINDOW_STATE_VISIBLE;
- if (GetForegroundWindow() == hwnd)
- mwd.uState |= MSG_WINDOW_STATE_FOCUS;
- if (IsIconic(hwnd))
- mwd.uState |= MSG_WINDOW_STATE_ICONIC;
- return 0;
+/////////////////////////////////////////////////////////////////////////////////////////
+
+MIR_APP_DLL(void) Srmm_ApplyOptions()
+{
+ Srmm_Broadcast(DM_OPTIONSAPPLIED, 0, 0);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -89,19 +90,25 @@ MIR_APP_DLL(CMsgDialog*) Srmm_FindDialog(MCONTACT hContact) /////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(void) Srmm_AddEvent(MCONTACT hContact, MEVENT hDbEvent)
+MIR_APP_DLL(int) Srmm_GetWindowData(MCONTACT hContact, MessageWindowData &mwd)
{
- wchar_t toolTip[256];
- mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(hContact));
+ if (hContact == 0)
+ return 1;
- CLISTEVENT cle = {};
- cle.hContact = hContact;
- cle.hDbEvent = hDbEvent;
- cle.flags = CLEF_UNICODE;
- cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
- cle.pszService = MS_MSG_READMESSAGE;
- cle.szTooltip.w = toolTip;
- g_clistApi.pfnAddEvent(&cle);
+ HWND hwnd = WindowList_Find(g_hWindowList, hContact);
+ if (hwnd == nullptr)
+ return 1;
+
+ mwd.hwndWindow = hwnd;
+ mwd.pDlg = (CSrmmBaseDialog *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ mwd.uState = MSG_WINDOW_STATE_EXISTS;
+ if (IsWindowVisible(hwnd))
+ mwd.uState |= MSG_WINDOW_STATE_VISIBLE;
+ if (GetForegroundWindow() == hwnd)
+ mwd.uState |= MSG_WINDOW_STATE_FOCUS;
+ if (IsIconic(hwnd))
+ mwd.uState |= MSG_WINDOW_STATE_ICONIC;
+ return 0;
}
/////////////////////////////////////////////////////////////////////////////////////////
|