From 452dc9428a541f41542726c4bface33cd9c89df2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 30 Aug 2018 22:33:33 +0300 Subject: fixes #1561 (TabSRMM warnings) --- plugins/TabSRMM/src/generic_msghandlers.cpp | 4 ++-- plugins/TabSRMM/src/msgdialog.cpp | 3 +-- plugins/TabSRMM/src/msgs.cpp | 2 -- plugins/TabSRMM/src/sendlater.cpp | 2 +- plugins/TabSRMM/src/utils.cpp | 8 +++---- plugins/TabSRMM/src/utils.h | 37 +++++++++++++---------------- plugins/TabSRMM/src/version.h | 2 +- 7 files changed, 25 insertions(+), 33 deletions(-) (limited to 'plugins') diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 3eb99ed124..692424be90 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -391,7 +391,7 @@ LRESULT CTabBaseDlg::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPar if (sendLater->isAvail()) m_sendMode ^= SMODE_SENDLATER; else - CWarning::show(CWarning::WARN_NO_SENDLATER, MB_OK | MB_ICONINFORMATION, TranslateT("Configuration issue|The unattended send feature is disabled. The \\b1 send later\\b0 and \\b1 send to multiple contacts\\b0 features depend on it.\n\nYou must enable it under \\b1Options -> Message sessions -> Advanced tweaks\\b0. Changing this option requires a restart.")); + CWarning::show(CWarning::WARN_NO_SENDLATER, MB_OK | MB_ICONINFORMATION); break; case ID_SENDMENU_SENDWITHOUTTIMEOUTS: m_sendMode ^= SMODE_NOACK; @@ -762,7 +762,7 @@ void CTabBaseDlg::DM_UpdateLastMessage() const HWND CTabBaseDlg::DM_CreateClist() { if (!sendLater->isAvail()) { - CWarning::show(CWarning::WARN_NO_SENDLATER, MB_OK | MB_ICONINFORMATION, TranslateT("Configuration issue|The unattended send feature is disabled. The \\b1 send later\\b0 and \\b1 send to multiple contacts\\b0 features depend on it.\n\nYou must enable it under \\b1Options -> Message sessions -> Advanced tweaks\\b0. Changing this option requires a restart.")); + CWarning::show(CWarning::WARN_NO_SENDLATER, MB_OK | MB_ICONINFORMATION); m_sendMode &= ~SMODE_MULTIPLE; return nullptr; } diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 5775c807fd..d502b02685 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -1527,8 +1527,7 @@ int CSrmmWindow::OnFilter(MSGFILTER *pFilter) SWP_NOMOVE | SWP_NOSIZE | SWP_NOCOPYBITS); RedrawWindow(m_hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN); } - else - CWarning::show(CWarning::WARN_NO_SENDLATER, MB_OK | MB_ICONINFORMATION, TranslateT("Configuration issue|The unattended send feature is disabled. The \\b1 send later\\b0 and \\b1 send to multiple contacts\\b0 features depend on it.\n\nYou must enable it under \\b1Options -> Message sessions -> Advanced tweaks\\b0. Changing this option requires a restart.")); + else CWarning::show(CWarning::WARN_NO_SENDLATER, MB_OK | MB_ICONINFORMATION); return _dlgReturn(m_hwnd, 1); case TABSRMM_HK_TOGGLERTL: m_dwFlags ^= MWF_LOG_RTL; diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 8eef8a5e26..5161067678 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -843,8 +843,6 @@ static int GetIconPackVersion(HMODULE hDLL) else if (!mir_strcmp(szIDString, "__tabSRMM_ICONPACK 5.0__")) version = 5; - if (version < 5) - CWarning::show(CWarning::WARN_ICONPACK_VERSION, MB_OK | MB_ICONERROR); return version; } diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index e35033e2aa..d60c9f4ad1 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -273,7 +273,7 @@ void CSendLater::processContacts() // @return 0 on failure, 1 otherwise int CSendLater::addJob(const char *szSetting, void *lParam) { - MCONTACT hContact = (MCONTACT)lParam; + MCONTACT hContact = (UINT_PTR)lParam; DBVARIANT dbv = { 0 }; char *szOrig_Utf = nullptr; diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 3a4aa9cb75..8d71295835 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -1049,14 +1049,12 @@ int _DebugPopup(MCONTACT hContact, const wchar_t *fmt, ...) // Entries that do not use the LPGENW() macro are NOT TRANSLATABLE, so don't bother translating them. static wchar_t* warnings[] = { - LPGENW("Important release notes|A test warning message"), /* WARN_TEST */ /* reserved for important notes after upgrade - NOT translatable */ - LPGENW("Icon pack version check|The installed icon pack is outdated and might be incompatible with TabSRMM version 3.\n\n\\b1Missing or misplaced icons are possible issues with the currently installed icon pack.\\b0"), /* WARN_ICONPACKVERSION */ LPGENW("Edit user notes|You are editing the user notes. Click the button again or use the hotkey (default: Alt+N) to save the notes and return to normal messaging mode"), /* WARN_EDITUSERNOTES */ LPGENW("Missing component|The icon pack is missing. Please install it to the default icons folder.\n\nNo icons will be available"), /* WARN_ICONPACKMISSING */ LPGENW("Aero peek warning|You have enabled Aero Peek features and loaded a custom container window skin\n\nThis can result in minor visual anomalies in the live preview feature."), /* WARN_AEROPEEKSKIN */ LPGENW("File transfer problem|Sending the image by file transfer failed.\n\nPossible reasons: File transfers not supported, either you or the target contact is offline, or you are invisible and the target contact is not on your visibility list."), /* WARN_IMGSVC_MISSING */ LPGENW("Settings problem|The option \\b1 History -> Imitate IEView API\\b0 is enabled and the History++ plugin is active. This can cause problems when using IEView as message log viewer.\n\nShould I correct the option (a restart is required)?"), /* WARN_HPP_APICHECK */ - L" ", /* WARN_NO_SENDLATER */ /*uses "Configuration issue|The unattended send feature is disabled. The \\b1 send later\\b0 and \\b1 send to multiple contacts\\b0 features depend on it.\n\nYou must enable it under \\b1Options -> Message sessions -> Advanced tweaks\\b0. Changing this option requires a restart." */ + LPGENW("Configuration issue|The unattended send feature is disabled. The \\b1 send later\\b0 and \\b1 send to multiple contacts\\b0 features depend on it.\n\nYou must enable it under \\b1Options -> Message sessions -> Advanced tweaks\\b0. Changing this option requires a restart."), /* WARN_NO_SENDLATER */ LPGENW("Closing Window|You are about to close a window with multiple tabs open.\n\nProceed?"), /* WARN_CLOSEWINDOW */ LPGENW("Closing options dialog|To reflect the changes done by importing a theme in the options dialog, the dialog must be closed after loading a theme \\b1 and unsaved changes might be lost\\b0 .\n\nDo you want to continue?"), /* WARN_OPTION_CLOSE */ LPGENW("Loading a theme|Loading a color and font theme can overwrite the settings defined by your skin.\n\nDo you want to continue?"), /* WARN_THEME_OVERWRITE */ @@ -1136,7 +1134,7 @@ LRESULT CWarning::show(const int uId, DWORD dwFlags, const wchar_t* tszTxt) else { if (uId == -1) return -1; - + if (dwFlags & CWF_UNTRANSLATED) _s = TranslateW(warnings[uId]); else { @@ -1163,7 +1161,7 @@ LRESULT CWarning::show(const int uId, DWORD dwFlags, const wchar_t* tszTxt) if (separator_pos) { *separator_pos = 0; - CWarning *w = new CWarning(s, separator_pos+1, uId, dwFlags); + CWarning *w = new CWarning(s, separator_pos + 1, uId, dwFlags); if (dwFlags & MB_YESNO || dwFlags & MB_YESNOCANCEL) return w->ShowDialog(); diff --git a/plugins/TabSRMM/src/utils.h b/plugins/TabSRMM/src/utils.h index 229c379285..04f4fc2e25 100644 --- a/plugins/TabSRMM/src/utils.h +++ b/plugins/TabSRMM/src/utils.h @@ -122,29 +122,26 @@ __forceinline LRESULT _dlgReturn(HWND hWnd, LRESULT result) // implements a warning dialog with a "do not show this again" check // box -class CWarning { - -public: - /* - * the warning IDs - */ - enum { - WARN_RELNOTES = 0, - WARN_ICONPACK_VERSION = 1, - WARN_EDITUSERNOTES = 2, - WARN_ICONPACKMISSING = 3, - WARN_AEROPEEK_SKIN = 4, - WARN_SENDFILE = 5, - WARN_HPP_APICHECK = 6, - WARN_NO_SENDLATER = 7, - WARN_CLOSEWINDOW = 8, - WARN_OPTION_CLOSE = 9, - WARN_THEME_OVERWRITE = 10, - WARN_LAST = 11 +struct CWarning +{ + // warning IDs + enum + { + WARN_EDITUSERNOTES = 0, + WARN_ICONPACKMISSING, + WARN_AEROPEEK_SKIN, + WARN_SENDFILE, + WARN_HPP_APICHECK, + WARN_NO_SENDLATER, + WARN_CLOSEWINDOW, + WARN_OPTION_CLOSE, + WARN_THEME_OVERWRITE, + WARN_LAST }; // the flags(low word is reserved for default windows flags like MB_OK etc. - enum { + enum + { CWF_UNTRANSLATED = 0x00010000, // do not translate the msg (useful for some error messages) CWF_NOALLOWHIDE = 0x00020000 // critical message, hide the "do not show this again" check box }; diff --git a/plugins/TabSRMM/src/version.h b/plugins/TabSRMM/src/version.h index 47b284c14b..ad52c5c34c 100644 --- a/plugins/TabSRMM/src/version.h +++ b/plugins/TabSRMM/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 3 #define __MINOR_VERSION 5 #define __RELEASE_NUM 0 -#define __BUILD_NUM 11 +#define __BUILD_NUM 12 #include -- cgit v1.2.3