diff options
author | George Hazan <ghazan@miranda.im> | 2020-10-11 17:37:09 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-10-11 17:37:16 +0300 |
commit | fcb6e9d2f7ea4c76236b85389625c5f6fe821c33 (patch) | |
tree | 412846521345ee517f2674643af44db9ba2efd46 | |
parent | 20c5f9b5ad74780ec2cade5a47bd066ed69453b0 (diff) |
fixes #2590 (TabSRMM: Cannot setup event filter)
-rw-r--r-- | include/m_chat_int.h | 1 | ||||
-rw-r--r-- | plugins/Scriver/src/msgdialog.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 10 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/chat_manager.cpp | 3 | ||||
-rw-r--r-- | src/mir_app/src/srmm_base.cpp | 6 |
6 files changed, 13 insertions, 11 deletions
diff --git a/include/m_chat_int.h b/include/m_chat_int.h index f5605f80a6..664d5d477d 100644 --- a/include/m_chat_int.h +++ b/include/m_chat_int.h @@ -347,6 +347,7 @@ struct CHAT_MANAGER FONTINFO aFonts[OPTIONS_FONTCOUNT];
LIST<SESSION_INFO> &arSessions;
char **pLogIconBmpBits;
+ CMOption<bool> bRightClickFilter;
// user-defined custom callbacks
void (*OnCreateModule)(MODULEINFO*);
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 9c68eea85a..0385d68e50 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -569,7 +569,7 @@ void CMsgDialog::onClick_Filter(CCtrlButton *pButton) m_bFilterEnabled = !m_bFilterEnabled;
pButton->SendMsg(BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(m_bFilterEnabled ? IDI_FILTER : IDI_FILTER2));
- if (m_bFilterEnabled && db_get_b(0, CHAT_MODULE, "RightClickFilter", 0) == 0)
+ if (m_bFilterEnabled && !g_chatApi.bRightClickFilter)
ShowFilterMenu();
else
RedrawLog();
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 77fc5b539a..e9b1618f0e 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -1000,13 +1000,13 @@ void CMsgDialog::onClick_Filter(CCtrlButton *pButton) m_btnFilter.SendMsg(BUTTONSETOVERLAYICON, (LPARAM)(m_bFilterEnabled ? PluginConfig.g_iconOverlayEnabled : PluginConfig.g_iconOverlayDisabled), 0);
- if (m_bFilterEnabled && db_get_b(0, CHAT_MODULE, "RightClickFilter", 1) == 0) {
+ if (m_bFilterEnabled && !g_chatApi.bRightClickFilter)
ShowFilterMenu();
- return;
+ else {
+ RedrawLog();
+ UpdateTitle();
+ db_set_b(m_si->hContact, CHAT_MODULE, "FilterEnabled", m_bFilterEnabled);
}
- RedrawLog();
- UpdateTitle();
- db_set_b(m_si->hContact, CHAT_MODULE, "FilterEnabled", m_bFilterEnabled);
}
void CMsgDialog::onClick_ShowNickList(CCtrlButton *pButton)
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 966b212cc8..a1f662deb9 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -333,7 +333,7 @@ void CMsgDialog::onClick_Filter(CCtrlButton *pButton) m_bFilterEnabled = !m_bFilterEnabled;
m_btnFilter.SendMsg(BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(m_bFilterEnabled ? IDI_FILTER : IDI_FILTER2, FALSE));
- if (m_bFilterEnabled && db_get_b(0, CHAT_MODULE, "RightClickFilter", 0) == 0)
+ if (m_bFilterEnabled && !g_chatApi.bRightClickFilter)
ShowFilterMenu();
else
RedrawLog();
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp index 7456567452..1656ebfc28 100644 --- a/src/mir_app/src/chat_manager.cpp +++ b/src/mir_app/src/chat_manager.cpp @@ -990,7 +990,8 @@ void Chat_RemoveContact(MCONTACT hContact) /////////////////////////////////////////////////////////////////////////////////////////
CHAT_MANAGER::CHAT_MANAGER() :
- arSessions(g_arSessions)
+ arSessions(g_arSessions),
+ bRightClickFilter(CHAT_MODULE, "RightClickFilter", false)
{
pLogIconBmpBits = ::pLogIconBmpBits;
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp index 9813fc9f20..e672cf5776 100644 --- a/src/mir_app/src/srmm_base.cpp +++ b/src/mir_app/src/srmm_base.cpp @@ -117,7 +117,7 @@ static LRESULT CALLBACK Srmm_ButtonSubclassProc(HWND hwnd, UINT msg, WPARAM wPar { switch (msg) { case WM_RBUTTONUP: - if (db_get_b(0, CHAT_MODULE, "RightClickFilter", 0) != 0) { + if (g_chatApi.bRightClickFilter) { CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA); if (pDlg == nullptr) break; @@ -616,7 +616,7 @@ void CSrmmBaseDialog::onClick_Color(CCtrlButton *pButton) cf.dwMask = CFM_COLOR; if (IsDlgButtonChecked(m_hwnd, pButton->GetCtrlId())) { - if (db_get_b(0, CHAT_MODULE, "RightClickFilter", 0) == 0) { + if (!g_chatApi.bRightClickFilter) { ShowColorChooser(pButton->GetCtrlId()); return; } @@ -639,7 +639,7 @@ void CSrmmBaseDialog::onClick_BkColor(CCtrlButton *pButton) cf.dwMask = CFM_BACKCOLOR; if (IsDlgButtonChecked(m_hwnd, pButton->GetCtrlId())) { - if (!db_get_b(0, CHAT_MODULE, "RightClickFilter", 0)) { + if (!g_chatApi.bRightClickFilter) { ShowColorChooser(pButton->GetCtrlId()); return; } |