summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-10-15 10:36:22 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-10-15 10:36:22 +0000
commitb1e20e52b7b0ed9cd528e209d0a09e1ef4e2c3b7 (patch)
treebe0c0c2c428f5cde651c83c1832a261c5f82fbe4
parentd7b9ee00b935f774c1d521b9efcb2e41f087f744 (diff)
db_autobackups: dropbox support
git-svn-id: http://svn.miranda-ng.org/main/trunk@15560 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Db_autobackups/res/db_autobackups.rc5
-rw-r--r--plugins/Db_autobackups/src/backup.cpp6
-rw-r--r--plugins/Db_autobackups/src/options.cpp7
-rw-r--r--plugins/Db_autobackups/src/options.h1
-rw-r--r--plugins/Db_autobackups/src/resource.h8
-rw-r--r--plugins/Db_autobackups/src/stdafx.h1
6 files changed, 23 insertions, 5 deletions
diff --git a/plugins/Db_autobackups/res/db_autobackups.rc b/plugins/Db_autobackups/res/db_autobackups.rc
index cced08540f..57424b1c3a 100644
--- a/plugins/Db_autobackups/res/db_autobackups.rc
+++ b/plugins/Db_autobackups/res/db_autobackups.rc
@@ -56,8 +56,9 @@ BEGIN
CONTROL "Go to the ""Customize -> Folders"" to change settings",IDC_LNK_FOLDERS,
"Hyperlink",NOT WS_VISIBLE | WS_TABSTOP,18,135,231,17
CONTROL "Compress backup to zip-archive",IDC_CHK_USEZIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,156,231,10
- CONTROL "Disable progress bar",IDC_CHK_NOPROG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,172,231,10
- CONTROL "Disable popups",IDC_CHK_NOPOPUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,188,231,11
+ CONTROL "Disable progress bar",IDC_CHK_NOPROG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,167,231,10
+ CONTROL "Disable popups",IDC_CHK_NOPOPUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,176,231,11
+ CONTROL "Use Dropbox",IDC_DROPBOX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,187,176,10
END
diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp
index 3a9a39b7e4..dad007daba 100644
--- a/plugins/Db_autobackups/src/backup.cpp
+++ b/plugins/Db_autobackups/src/backup.cpp
@@ -272,6 +272,12 @@ int Backup(TCHAR *backup_filename)
SendDlgItemMessage(progress_dialog, IDC_PROGRESS, PBM_SETPOS, (WPARAM)(100), 0);
UpdateWindow(progress_dialog);
db_set_dw(0, "AutoBackups", "LastBackupTimestamp", (DWORD)time(0));
+
+ if (options.use_dropbox)
+ {
+ CallService(MS_DROPBOX_SEND_FILE, NULL, (LPARAM)&dest_file);
+ }
+
if (!options.disable_popups) {
size_t dest_file_len = mir_tstrlen(dest_file);
TCHAR *puText;
diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp
index 59e5ca5306..4f4339b2f8 100644
--- a/plugins/Db_autobackups/src/options.cpp
+++ b/plugins/Db_autobackups/src/options.cpp
@@ -60,6 +60,7 @@ int LoadOptions(void)
options.disable_progress = (BOOL)db_get_b(0, "AutoBackups", "NoProgress", 0);
options.disable_popups = (BOOL)db_get_b(0, "AutoBackups", "NoPopups", 0);
options.use_zip = (BOOL)db_get_b(0, "AutoBackups", "UseZip", 0);
+ options.use_dropbox = (BOOL)db_get_b(0, "AutoBackups", "UseDropbox", 0);
SetBackupTimer();
return 0;
@@ -95,6 +96,7 @@ int SaveOptions(void)
db_set_b(0, "AutoBackups", "NoProgress", (BYTE)options.disable_progress);
db_set_b(0, "AutoBackups", "NoPopups", (BYTE)options.disable_popups);
db_set_b(0, "AutoBackups", "UseZip", (BYTE)options.use_zip);
+ db_set_b(0, "AutoBackups", "UseDropbox", (BYTE)options.use_dropbox);
SetBackupTimer();
return 0;
@@ -152,6 +154,7 @@ int SetDlgState(HWND hwndDlg)
CheckDlgButton(hwndDlg, IDC_CHK_NOPROG, new_options.disable_progress ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CHK_NOPOPUP, new_options.disable_popups ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CHK_USEZIP, new_options.use_zip ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DROPBOX, new_options.use_dropbox ? BST_CHECKED : BST_UNCHECKED);
if (!ServiceExists(MS_POPUP_ADDPOPUPT))
ShowWindow(GetDlgItem(hwndDlg, IDC_CHK_NOPOPUP), SW_HIDE);
@@ -304,6 +307,10 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
new_options.use_zip = IsDlgButtonChecked(hwndDlg, IDC_CHK_USEZIP);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
+ case IDC_DROPBOX:
+ new_options.use_dropbox = IsDlgButtonChecked(hwndDlg, IDC_DROPBOX);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
case IDC_LNK_FOLDERS:
{
OPENOPTIONSDIALOG ood = { 0 };
diff --git a/plugins/Db_autobackups/src/options.h b/plugins/Db_autobackups/src/options.h
index 1b1a94938a..ab799d495a 100644
--- a/plugins/Db_autobackups/src/options.h
+++ b/plugins/Db_autobackups/src/options.h
@@ -34,6 +34,7 @@ typedef struct Options_tag {
BOOL disable_progress;
BOOL disable_popups;
BOOL use_zip;
+ BOOL use_dropbox;
} Options;
extern Options options; \ No newline at end of file
diff --git a/plugins/Db_autobackups/src/resource.h b/plugins/Db_autobackups/src/resource.h
index c1e0c84d7d..b0628a3653 100644
--- a/plugins/Db_autobackups/src/resource.h
+++ b/plugins/Db_autobackups/src/resource.h
@@ -1,6 +1,6 @@
//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by db_autobackups.rc
+// Включаемый файл, созданный в Microsoft Visual C++.
+// Используется D:\Others\SVN\MirandaNG\trunk\plugins\Db_autobackups\res\db_autobackups.rc
//
#define IDD_OPTIONS 101
#define IDI_ICON1 270
@@ -21,6 +21,8 @@
#define IDC_BUT_NOW 1671
#define IDC_CHK_NOPOPUP 1672
#define IDC_CHK_USEZIP 1673
+#define IDC_CHECK1 1674
+#define IDC_DROPBOX 1674
#define IDC_PROGRESSMESSAGE 0xDAED
#define IDC_PROGRESS 0xDEAD
@@ -30,7 +32,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 272
#define _APS_NEXT_COMMAND_VALUE 40018
-#define _APS_NEXT_CONTROL_VALUE 1673
+#define _APS_NEXT_CONTROL_VALUE 1675
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/plugins/Db_autobackups/src/stdafx.h b/plugins/Db_autobackups/src/stdafx.h
index 32fae90870..9a4676583f 100644
--- a/plugins/Db_autobackups/src/stdafx.h
+++ b/plugins/Db_autobackups/src/stdafx.h
@@ -18,6 +18,7 @@
#include <m_autobackups.h>
#include <m_folders.h>
+#include <m_dropbox.h>
#include "options.h"
#include "resource.h"