diff options
author | George Hazan <ghazan@miranda.im> | 2020-03-09 21:33:34 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-03-09 21:33:34 +0300 |
commit | e6add7951f526ddaea6b7874ce767c07eae806b0 (patch) | |
tree | fc05ced1f2df3bec6982384e96b26a400ed1b364 | |
parent | 15c5d4bba2dd69b1dfa6310e3349e9ddf5a2e924 (diff) |
tabSRMM: warning if a temporary file cannot be written
-rw-r--r-- | plugins/TabSRMM/src/hotkeyhandler.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgother.cpp | 5 | ||||
-rw-r--r-- | plugins/TabSRMM/src/utils.cpp | 3 | ||||
-rw-r--r-- | plugins/TabSRMM/src/utils.h | 3 |
4 files changed, 9 insertions, 4 deletions
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index e9aa7d72bd..c669828673 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -105,7 +105,7 @@ static INT_PTR HotkeyProcessor(WPARAM, LPARAM lParam) if (g_arUnreadWindows.getCount()) {
HANDLE hContact = g_arUnreadWindows[0];
g_arUnreadWindows.remove(0);
- HandleMenuEntryFromhContact(MCONTACT(hContact));
+ HandleMenuEntryFromhContact(UINT_PTR(hContact));
}
// restore last active container
else if (pLastActiveContainer != nullptr) {
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp index 28d66676d2..d438a8a221 100644 --- a/plugins/TabSRMM/src/msgdlgother.cpp +++ b/plugins/TabSRMM/src/msgdlgother.cpp @@ -1405,7 +1405,10 @@ void CMsgDialog::SendHBitmapAsFile(HBITMAP hbmp) const ii.pwszName = filename; ii.dwMask = IMGI_HBITMAP; ii.fif = FIF_JPEG; - Image_Save(&ii); + if (!Image_Save(&ii)) { + CWarning::show(CWarning::WARN_SAVEFILE, MB_OK | MB_ICONEXCLAMATION | CWarning::CWF_NOALLOWHIDE); + return; + } int totalCount = 0; wchar_t **ppFiles = nullptr; diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 80a21c2c9d..84436070d3 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -1062,7 +1062,8 @@ 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[] = {
- nullptr, nullptr,
+ nullptr,
+ LPGENW("Save file|Unable to save temporary file"), // WARN_SAVEFILE
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 */
diff --git a/plugins/TabSRMM/src/utils.h b/plugins/TabSRMM/src/utils.h index 17b054c1db..e2d57779bf 100644 --- a/plugins/TabSRMM/src/utils.h +++ b/plugins/TabSRMM/src/utils.h @@ -127,7 +127,8 @@ struct CWarning // warning IDs
enum
{
- WARN_EDITUSERNOTES = 2,
+ WARN_SAVEFILE = 1,
+ WARN_EDITUSERNOTES,
WARN_ICONPACKMISSING,
WARN_AEROPEEK_SKIN,
WARN_SENDFILE,
|