diff options
-rw-r--r-- | plugins/ExternalAPI/m_PluginUpdater.h | 26 | ||||
-rw-r--r-- | plugins/NewStory/src/history_dlg.cpp | 13 | ||||
-rw-r--r-- | plugins/NewStory/src/stdafx.h | 1 | ||||
-rw-r--r-- | plugins/PluginUpdater/src/stdafx.h | 4 |
4 files changed, 40 insertions, 4 deletions
diff --git a/plugins/ExternalAPI/m_PluginUpdater.h b/plugins/ExternalAPI/m_PluginUpdater.h new file mode 100644 index 0000000000..2f3bc2e45c --- /dev/null +++ b/plugins/ExternalAPI/m_PluginUpdater.h @@ -0,0 +1,26 @@ +/* +Copyright (C) 2010 Mataes + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ + +#pragma once + +// a service to check updates +#define MS_PU_CHECK "PluginUpdater/CheckUpdates" + +// a service to install missing features +#define MS_PU_SHOWLIST "PluginUpdater/ShowList" 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 diff --git a/plugins/PluginUpdater/src/stdafx.h b/plugins/PluginUpdater/src/stdafx.h index 3248123ed1..7053769c59 100644 --- a/plugins/PluginUpdater/src/stdafx.h +++ b/plugins/PluginUpdater/src/stdafx.h @@ -55,9 +55,7 @@ extern "C" #include "resource.h"
#include <m_autobackups.h>
-
-#define MS_PU_CHECK "PluginUpdater/CheckUpdates"
-#define MS_PU_SHOWLIST "PluginUpdater/ShowList"
+#include <m_PluginUpdater.h>
#include "Notifications.h"
|