summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-02-08 18:24:36 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-02-08 18:24:36 +0300
commit5aebbf6c518190ea03ef3e26ef3f0cd74ff928ce (patch)
tree9e297513f25674716987666dcc6c735b5428e4f7
parent12d95ea38599485662ec3f8541b14641c0254fb3 (diff)
fixes #1281 (Db_autobackups: "Use CloudFile" option should be gray out if CloudFile not installed)
-rw-r--r--plugins/Db_autobackups/src/main.cpp10
-rw-r--r--plugins/Db_autobackups/src/options.cpp4
-rw-r--r--plugins/Db_autobackups/src/stdafx.h1
-rw-r--r--plugins/Db_autobackups/src/version.h2
4 files changed, 14 insertions, 3 deletions
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp
index 5fd1b5172c..1b898f31c2 100644
--- a/plugins/Db_autobackups/src/main.cpp
+++ b/plugins/Db_autobackups/src/main.cpp
@@ -98,8 +98,16 @@ static INT_PTR OnTogglePopups(WPARAM, LPARAM)
return 0;
}
+static int PluginLoaded(WPARAM, LPARAM)
+{
+ g_plugin.bCloudFilePresent = ServiceExists(MS_CLOUDFILE_UPLOAD);
+ return 0;
+}
+
static int ModulesLoad(WPARAM, LPARAM)
{
+ PluginLoaded(0, 0);
+
CMenuItem mi(&g_plugin);
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Database"), 500000000);
@@ -167,6 +175,8 @@ int CMPlugin::Load()
HookEvent(ME_SYSTEM_OKTOEXIT, OkToExit);
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoad);
+ HookEvent(ME_SYSTEM_MODULELOAD, PluginLoaded);
+ HookEvent(ME_SYSTEM_MODULEUNLOAD, PluginLoaded);
g_plugin.registerIcon(LPGEN("Database") "/" LPGEN("Database backups"), iconList);
diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp
index cd19058170..0dd0cbb4bf 100644
--- a/plugins/Db_autobackups/src/options.cpp
+++ b/plugins/Db_autobackups/src/options.cpp
@@ -29,7 +29,7 @@ class COptionsDlg : public CDlgBase
m_period.Enable(bEnabled);
m_periodType.Enable(bEnabled);
m_backupProfile.Enable(bEnabled);
- m_useCloudFile.Enable(bEnabled);
+ m_useCloudFile.Enable(g_plugin.bCloudFilePresent && bEnabled);
if (!bEnabled) {
m_cloudFileService.Disable();
@@ -207,7 +207,7 @@ public:
CreateToolTip(tszTooltipText, TranslateT("Variables"));
}
- m_useCloudFile.Enable(ServiceExists(MS_CLOUDFILE_UPLOAD));
+ m_useCloudFile.Enable(g_plugin.bCloudFilePresent);
if (ServiceExists(MS_CLOUDFILE_ENUMSERVICES)) {
m_cloudFileService.Enable();
CallService(MS_CLOUDFILE_ENUMSERVICES, (WPARAM)&COptionsDlg::EnumCloudFileServices, (LPARAM)&m_cloudFileService);
diff --git a/plugins/Db_autobackups/src/stdafx.h b/plugins/Db_autobackups/src/stdafx.h
index c0679a5c34..9c84fc678c 100644
--- a/plugins/Db_autobackups/src/stdafx.h
+++ b/plugins/Db_autobackups/src/stdafx.h
@@ -37,6 +37,7 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
CMPlugin();
+ bool bCloudFilePresent = false;
HANDLE hevBackup;
wchar_t folder[MAX_PATH];
diff --git a/plugins/Db_autobackups/src/version.h b/plugins/Db_autobackups/src/version.h
index 5980caff22..d9f773e87d 100644
--- a/plugins/Db_autobackups/src/version.h
+++ b/plugins/Db_autobackups/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 1
#define __RELEASE_NUM 0
-#define __BUILD_NUM 5
+#define __BUILD_NUM 6
#include <stdver.h>