summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-09-26 12:20:03 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-09-26 12:20:03 +0300
commitb6669f0ee3361891e9807e5c734bf9121e9cfb06 (patch)
tree89f4662ee0f9b743126b213354820fd1671a5657 /src/core
parent82228dfaa3f7c387ff1f42e1698c4d68fe8e1335 (diff)
SRMM options update unification
Diffstat (limited to 'src/core')
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp20
-rw-r--r--src/core/stdmsg/src/msgoptions.cpp6
-rw-r--r--src/core/stdmsg/src/msgs.cpp2
-rw-r--r--src/core/stdmsg/src/msgs.h4
4 files changed, 13 insertions, 19 deletions
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;