summaryrefslogtreecommitdiff
path: root/plugins/NewStory
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-01-09 11:29:56 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-01-09 11:29:56 +0300
commit74c01c7fb7862ec01ad27c4b225b08b7aa0f3b0a (patch)
tree5dd8a3ba49811e564d9365d94c628aeb727026d4 /plugins/NewStory
parentc1137914b90fd115909178ba8e037281708cfd9a (diff)
fixes #4110 (NewStory: падает экспорт в json)
Diffstat (limited to 'plugins/NewStory')
-rw-r--r--plugins/NewStory/src/history_dlg.cpp13
-rw-r--r--plugins/NewStory/src/stdafx.h1
2 files changed, 13 insertions, 1 deletions
diff --git a/plugins/NewStory/src/history_dlg.cpp b/plugins/NewStory/src/history_dlg.cpp
index 2d557db8b6..388a027732 100644
--- a/plugins/NewStory/src/history_dlg.cpp
+++ b/plugins/NewStory/src/history_dlg.cpp
@@ -826,6 +826,18 @@ public:
void onClick_Export(CCtrlButton *)
{
+ auto *pDriver = GetDatabasePlugin("JSON");
+ if (pDriver == nullptr) {
+ CMStringW wszText(TranslateT("Import plugin is missing to perform this operation."));
+ if (ServiceExists(MS_PU_SHOWLIST)) {
+ wszText.AppendFormat(L" %s", TranslateT("Do you want to install it using Plugin Updater?"));
+ if (IDYES == MessageBoxW(m_hwnd, wszText, TranslateT("Missing plugin"), MB_YESNO | MB_ICONQUESTION))
+ CallService(MS_PU_SHOWLIST);
+ }
+ else MessageBoxW(m_hwnd, wszText, TranslateT("Missing plugin"), MB_OK | MB_ICONERROR);
+ return;
+ }
+
wchar_t FileName[MAX_PATH];
VARSW tszMirDir(L"%miranda_userdata%\\NewStoryExport");
@@ -871,7 +883,6 @@ public:
if (PathFileExistsW(FileName))
DeleteFileW(FileName);
- auto *pDriver = GetDatabasePlugin("JSON");
auto *pDB = pDriver->Export(FileName);
pDB->BeginExport();
pDB->ExportContact(m_hContact);
diff --git a/plugins/NewStory/src/stdafx.h b/plugins/NewStory/src/stdafx.h
index 42fcc8a89b..f6cb9c2c89 100644
--- a/plugins/NewStory/src/stdafx.h
+++ b/plugins/NewStory/src/stdafx.h
@@ -60,6 +60,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <m_utils.h>
#include "m_NewStory.h"
+#include "m_PluginUpdater.h"
#include "m_smileyadd.h"
#ifndef MTEXT_NOHELPERS
#define MTEXT_NOHELPERS