summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-05-30 21:38:21 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-05-30 21:38:21 +0300
commit31227b632831b50417766926d5a953caf819e71d (patch)
tree55945ec3be965f2419102f893feede4ef182d37e /plugins/SmileyAdd/src
parent502b684aba2c511bedae4b56a8d895d6c2ac5269 (diff)
SmileyAdd: fix for incorrectly adapted dialog procedure
Diffstat (limited to 'plugins/SmileyAdd/src')
-rw-r--r--plugins/SmileyAdd/src/download.cpp3
-rw-r--r--plugins/SmileyAdd/src/options.cpp9
-rw-r--r--plugins/SmileyAdd/src/services.cpp2
-rw-r--r--plugins/SmileyAdd/src/smileys.cpp21
4 files changed, 25 insertions, 10 deletions
diff --git a/plugins/SmileyAdd/src/download.cpp b/plugins/SmileyAdd/src/download.cpp
index 5cbf42efc9..17a203bc68 100644
--- a/plugins/SmileyAdd/src/download.cpp
+++ b/plugins/SmileyAdd/src/download.cpp
@@ -221,6 +221,9 @@ int FolderChanged(WPARAM, LPARAM)
{
FoldersGetCustomPathT(hFolderCache, g_wszCachePath, MAX_PATH, L"");
FoldersGetCustomPathT(hFolderPacks, g_plugin.wszDefaultPath, MAX_PATH, L"Smileys");
+ size_t len = mir_wstrlen(g_plugin.wszDefaultPath);
+ if (len && g_plugin.wszDefaultPath[len - 1] != '\\')
+ mir_wstrcpy(g_plugin.wszDefaultPath + len, L"\\");
return 0;
}
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp
index 49a180b248..3a857a49bd 100644
--- a/plugins/SmileyAdd/src/options.cpp
+++ b/plugins/SmileyAdd/src/options.cpp
@@ -297,7 +297,6 @@ public:
chkStdPack.OnChange = Callback(this, &COptionsDialog::onChange_StdPack);
chkUsePhys.OnChange = Callback(this, &COptionsDialog::onChange_UsePhys);
- edtFilename.OnChange = Callback(this, &COptionsDialog::onChange_Filename);
categories.OnSelChanged = Callback(this, &COptionsDialog::onSelectChange_Tree);
categories.OnItemChanged = Callback(this, &COptionsDialog::onChange_Filename);
@@ -357,6 +356,14 @@ public:
return true;
}
+ INT_PTR DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) override
+ {
+ if (uMsg == WM_COMMAND && LOWORD(wParam) == IDC_FILENAME && HIWORD(wParam) == EN_KILLFOCUS)
+ onChange_Filename(0);
+
+ return CDlgBase::DlgProc(uMsg, wParam, lParam);
+ }
+
bool OnApply() override
{
ProcessAllInputAreas(true);
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp
index b7e7e3e066..65cea6dce4 100644
--- a/plugins/SmileyAdd/src/services.cpp
+++ b/plugins/SmileyAdd/src/services.cpp
@@ -440,4 +440,4 @@ int ReloadColour(WPARAM, LPARAM)
{
opt.SelWndBkgClr = db_get_dw(0, "SmileyAdd", "SelWndBkgClr", GetSysColor(COLOR_WINDOW));
return 0;
-} \ No newline at end of file
+}
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp
index 118bf70fa6..62621fd297 100644
--- a/plugins/SmileyAdd/src/smileys.cpp
+++ b/plugins/SmileyAdd/src/smileys.cpp
@@ -352,15 +352,20 @@ bool SmileyPackType::LoadSmileyFile(const CMStringW &filename, const CMStringW &
CMStringW modpath = VARSW(filename);
if (_waccess(modpath, 4) != 0) {
- if (!noerr) {
- static const wchar_t errmsg[] = LPGENW("Smiley pack %s for category \"%s\" not found.\nSelect correct smiley pack in the Options -> Customize -> Smileys.");
- wchar_t msgtxt[1024];
- mir_snwprintf(msgtxt, TranslateW(errmsg), modpath.c_str(), packname.c_str());
- ReportError(msgtxt);
- }
+ wchar_t wszTmp[MAX_PATH];
+ PathToAbsoluteW(filename, wszTmp, g_plugin.wszDefaultPath);
+ if (_waccess(wszTmp, 4) != 0) {
+ if (!noerr) {
+ static const wchar_t errmsg[] = LPGENW("Smiley pack %s for category \"%s\" not found.\nSelect correct smiley pack in the Options -> Customize -> Smileys.");
+ wchar_t msgtxt[1024];
+ mir_snwprintf(msgtxt, TranslateW(errmsg), modpath.c_str(), packname.c_str());
+ ReportError(msgtxt);
+ }
- m_Name = L"Nothing loaded";
- return false;
+ m_Name = L"Nothing loaded";
+ return false;
+ }
+ modpath = wszTmp;
}
m_Filename = filename;