summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Db_autobackups/src/backup.cpp1
-rw-r--r--plugins/Db_autobackups/src/main.cpp1
-rw-r--r--plugins/Db_autobackups/src/options.cpp14
-rw-r--r--plugins/Db_autobackups/src/stdafx.h6
4 files changed, 21 insertions, 1 deletions
diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp
index 1ac63a7bab..fce17e44fd 100644
--- a/plugins/Db_autobackups/src/backup.cpp
+++ b/plugins/Db_autobackups/src/backup.cpp
@@ -266,6 +266,7 @@ static int Backup(wchar_t *backup_filename)
UpdateWindow(progress_dialog);
}
g_plugin.setDword("LastBackupTimestamp", (DWORD)time(0));
+ NotifyEventHooks(g_plugin.hevBackup);
if (g_plugin.use_cloudfile) {
CFUPLOADDATA ui = { g_plugin.cloudfile_service, dest_file, L"Backups" };
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp
index fa7dc4199a..5fd1b5172c 100644
--- a/plugins/Db_autobackups/src/main.cpp
+++ b/plugins/Db_autobackups/src/main.cpp
@@ -173,6 +173,7 @@ int CMPlugin::Load()
CreateServiceFunction(MS_AB_BACKUP, ABService);
CreateServiceFunction(MS_AB_SAVEAS, DBSaveAs);
+ hevBackup = CreateHookableEvent(ME_AUTOBACKUP_DONE);
HookEvent(ME_OPT_INITIALISE, OptionsInit);
SetBackupTimer();
diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp
index d0688efd59..f6f3808174 100644
--- a/plugins/Db_autobackups/src/options.cpp
+++ b/plugins/Db_autobackups/src/options.cpp
@@ -1,5 +1,7 @@
#include "stdafx.h"
+#define WM_BACKUP_DONE (WM_USER+1)
+
/////////////////////////////////////////////////////////////////////////////////////////
class COptionsDlg : public CDlgBase
@@ -113,6 +115,16 @@ class COptionsDlg : public CDlgBase
CCtrlHyperlink m_foldersPageLink;
HWND m_hPathTip;
+ HANDLE m_hEvent;
+
+ UI_MESSAGE_MAP(COptionsDlg, CDlgBase);
+ UI_MESSAGE(WM_BACKUP_DONE, BackupDone);
+ UI_MESSAGE_MAP_END();
+
+ INT_PTR BackupDone(UINT, WPARAM, LPARAM)
+ {
+ onChange_Period(0);
+ }
public:
COptionsDlg() :
@@ -157,6 +169,8 @@ public:
bool OnInitDialog() override
{
+ m_hEvent = HookEventMessage(ME_AUTOBACKUP_DONE, m_hwnd, WM_BACKUP_DONE);
+
m_disable.SetState(g_plugin.backup_types == BT_DISABLED);
m_backupOnStart.SetState(g_plugin.backup_types & BT_START ? TRUE : FALSE);
m_backupOnExit.SetState(g_plugin.backup_types & BT_EXIT ? TRUE : FALSE);
diff --git a/plugins/Db_autobackups/src/stdafx.h b/plugins/Db_autobackups/src/stdafx.h
index 48ccefd7df..883372ea4d 100644
--- a/plugins/Db_autobackups/src/stdafx.h
+++ b/plugins/Db_autobackups/src/stdafx.h
@@ -37,10 +37,12 @@ struct CMPlugin : public PLUGIN<CMPlugin>
{
CMPlugin();
+ HANDLE hevBackup;
+ wchar_t folder[MAX_PATH];
+
CMOption<BYTE> backup_types;
CMOption<WORD> period;
CMOption<BYTE> period_type;
- wchar_t folder[MAX_PATH];
CMOption<wchar_t*> file_mask;
CMOption<WORD> num_backups;
CMOption<BYTE> disable_progress;
@@ -60,6 +62,8 @@ struct CMPlugin : public PLUGIN<CMPlugin>
#define SUB_DIR L"\\AutoBackups"
#define DIR L"%miranda_userdata%"
+#define ME_AUTOBACKUP_DONE "Autobackup/Done"
+
int SetBackupTimer(void);
int OptionsInit(WPARAM wParam, LPARAM lParam);
void BackupStart(wchar_t *backup_filename);