diff options
author | George Hazan <ghazan@miranda.im> | 2022-08-12 13:05:24 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-08-12 13:05:24 +0300 |
commit | 93cc6c29218ee9877e4fcb2c31fe0c653a62b3f7 (patch) | |
tree | a0165c83577340ff9938f6ef633aed85633552af /plugins | |
parent | fa4c4d3167a504cdf55d5140de71960335124436 (diff) |
fixes #3156 (TabSRMM: warning dialog)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/TabSRMM/src/utils.cpp | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index c2f54ba149..e1b3a9e511 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -1031,7 +1031,6 @@ void CWarning::destroyAll() LRESULT CWarning::show(const int uId, uint32_t dwFlags, const wchar_t* tszTxt)
{
wchar_t* separator_pos = nullptr;
- __int64 mask = 0, val = 0;
if (nullptr == hWindowList)
hWindowList = WindowList_Create();
@@ -1061,25 +1060,28 @@ LRESULT CWarning::show(const int uId, uint32_t dwFlags, const wchar_t* tszTxt) }
if ((mir_wstrlen(_s) > 3) && ((separator_pos = wcschr(_s, '|')) != nullptr)) {
- if (uId >= 0) {
- mask = M.GetDword("cWarningsL", 0);
- val = ((__int64)1L) << uId;
+ if (uId >= 0 && !(dwFlags & CWF_NOALLOWHIDE)) {
+ uint32_t val = M.GetDword("cWarningsL", 0);
+ uint32_t mask = ((__int64)1L) << uId;
+ if (mask & val) {
+ bool bResult = (M.GetDword("cWarningsV", 0xFFFFFFFF) & mask) != 0;
+ if (dwFlags & MB_YESNO || dwFlags & MB_YESNOCANCEL)
+ return (bResult) ? IDYES : IDNO;
+ return IDOK;
+ }
}
- else mask = val = 0;
- if (0 == (mask & val) || dwFlags & CWF_NOALLOWHIDE) {
- ptrW s(mir_wstrdup(_s));
- separator_pos = wcschr(s, '|');
+ ptrW s(mir_wstrdup(_s));
+ separator_pos = wcschr(s, '|');
- if (separator_pos) {
- *separator_pos = 0;
+ if (separator_pos) {
+ *separator_pos = 0;
- CWarning *w = new CWarning(s, separator_pos + 1, uId, dwFlags);
- if (dwFlags & MB_YESNO || dwFlags & MB_YESNOCANCEL)
- return w->ShowDialog();
+ CWarning *w = new CWarning(s, separator_pos + 1, uId, dwFlags);
+ if (dwFlags & MB_YESNO || dwFlags & MB_YESNOCANCEL)
+ return w->ShowDialog();
- w->ShowDialog();
- }
+ w->ShowDialog();
}
}
return -1;
@@ -1203,6 +1205,10 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP uint32_t newVal = M.GetDword("cWarningsL", 0) | ((uint32_t)1L << m_uId);
db_set_dw(0, SRMSGMOD_T, "cWarningsL", newVal);
}
+ if (LOWORD(wParam) != IDNO) {
+ uint32_t newVal = M.GetDword("cWarningsV", 0) | ((uint32_t)1L << m_uId);
+ db_set_dw(0, SRMSGMOD_T, "cWarningsV", newVal);
+ }
__fallthrough;
case IDCANCEL:
|