diff options
Diffstat (limited to 'plugins/Db_autobackups')
-rw-r--r-- | plugins/Db_autobackups/db_autobackups_10.vcxproj | 5 | ||||
-rw-r--r-- | plugins/Db_autobackups/db_autobackups_11.vcxproj | 5 | ||||
-rw-r--r-- | plugins/Db_autobackups/db_autobackups_12.vcxproj | 5 | ||||
-rw-r--r-- | plugins/Db_autobackups/res/db_autobackups.rc | 55 | ||||
-rw-r--r-- | plugins/Db_autobackups/src/backup.cpp | 122 | ||||
-rw-r--r-- | plugins/Db_autobackups/src/headers.h | 1 | ||||
-rw-r--r-- | plugins/Db_autobackups/src/options.cpp | 9 | ||||
-rw-r--r-- | plugins/Db_autobackups/src/options.h | 1 | ||||
-rw-r--r-- | plugins/Db_autobackups/src/resource.h | 1 | ||||
-rw-r--r-- | plugins/Db_autobackups/src/version.h | 22 |
10 files changed, 168 insertions, 58 deletions
diff --git a/plugins/Db_autobackups/db_autobackups_10.vcxproj b/plugins/Db_autobackups/db_autobackups_10.vcxproj index 0c3ac91019..42d285f610 100644 --- a/plugins/Db_autobackups/db_autobackups_10.vcxproj +++ b/plugins/Db_autobackups/db_autobackups_10.vcxproj @@ -173,6 +173,11 @@ </ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
+ <ProjectReference Include="..\Zlib\zlib_11.vcxproj">
+ <Project>{e2a369cd-eda3-414f-8ad0-e732cd7ee68c}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
<ClCompile Include="src\backup.cpp" />
<ClCompile Include="src\options.cpp" />
<ClCompile Include="src\stdafx.cpp">
diff --git a/plugins/Db_autobackups/db_autobackups_11.vcxproj b/plugins/Db_autobackups/db_autobackups_11.vcxproj index c2a3156b44..034fd73f86 100644 --- a/plugins/Db_autobackups/db_autobackups_11.vcxproj +++ b/plugins/Db_autobackups/db_autobackups_11.vcxproj @@ -176,6 +176,11 @@ </ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
+ <ProjectReference Include="..\Zlib\zlib_11.vcxproj">
+ <Project>{e2a369cd-eda3-414f-8ad0-e732cd7ee68c}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
<ClCompile Include="src\backup.cpp" />
<ClCompile Include="src\options.cpp" />
<ClCompile Include="src\stdafx.cpp">
diff --git a/plugins/Db_autobackups/db_autobackups_12.vcxproj b/plugins/Db_autobackups/db_autobackups_12.vcxproj index dfb297adbf..4c6e38cf6a 100644 --- a/plugins/Db_autobackups/db_autobackups_12.vcxproj +++ b/plugins/Db_autobackups/db_autobackups_12.vcxproj @@ -176,6 +176,11 @@ </ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
+ <ProjectReference Include="..\Zlib\zlib_11.vcxproj">
+ <Project>{e2a369cd-eda3-414f-8ad0-e732cd7ee68c}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
<ClCompile Include="src\backup.cpp" />
<ClCompile Include="src\options.cpp" />
<ClCompile Include="src\stdafx.cpp">
diff --git a/plugins/Db_autobackups/res/db_autobackups.rc b/plugins/Db_autobackups/res/db_autobackups.rc index e04f8eb650..b87177f362 100644 --- a/plugins/Db_autobackups/res/db_autobackups.rc +++ b/plugins/Db_autobackups/res/db_autobackups.rc @@ -12,13 +12,11 @@ #undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
-// Russian resources
+// Русский (Россия) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
-#ifdef _WIN32
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#pragma code_page(1251)
-#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
@@ -26,8 +24,7 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT //
IDD_COPYPROGRESS DIALOGEX 0, 0, 186, 58
-STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER |
- WS_POPUP | WS_VISIBLE | WS_CAPTION
+STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION
CAPTION "Backup progress"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
@@ -36,40 +33,30 @@ BEGIN PUSHBUTTON "Cancel",IDCANCEL,58,39,67,12
END
-IDD_OPTIONS DIALOGEX 0, 0, 271, 193
+IDD_OPTIONS DIALOGEX 0, 0, 271, 220
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
- GROUPBOX "Automatic Backups",IDC_STATIC,6,7,258,179,WS_GROUP
+ GROUPBOX "Automatic Backups",IDC_STATIC,6,4,258,209,WS_GROUP
RTEXT "Number of backups to keep:",IDC_STATIC,13,94,132,8
EDITTEXT IDC_ED_NUMBACKUPS,164,90,30,12,ES_NUMBER,WS_EX_RIGHT
- CONTROL "",SPIN_NUMBACKUPS,"msctls_updown32",UDS_SETBUDDYINT |
- UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,182,90,10,
- 12
+ CONTROL "",SPIN_NUMBACKUPS,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,182,90,10,12
PUSHBUTTON "Backup NOW",IDC_BUT_NOW,173,19,75,14
- CONTROL "Disabled",IDC_RAD_DISABLED,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,17,19,128,10
- CONTROL "When Miranda starts",IDC_RAD_START,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,17,35,156,10
- CONTROL "When Miranda exits",IDC_RAD_EXIT,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,17,51,156,10
- CONTROL "Every:",IDC_RAD_PERIODIC,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,17,67,43,10
+ CONTROL "Disabled",IDC_RAD_DISABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,19,128,10
+ CONTROL "When Miranda starts",IDC_RAD_START,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,35,156,10
+ CONTROL "When Miranda exits",IDC_RAD_EXIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,51,156,10
+ CONTROL "Every:",IDC_RAD_PERIODIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,67,43,10
COMBOBOX IDC_PT,148,67,46,30,CBS_DROPDOWNLIST | WS_TABSTOP
EDITTEXT IDC_ED_PERIOD,106,67,30,12,ES_NUMBER,WS_EX_RIGHT
- CONTROL "",SPIN_PERIOD,"msctls_updown32",UDS_SETBUDDYINT |
- UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,126,67,10,
- 12
+ CONTROL "",SPIN_PERIOD,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,126,67,10,12
LTEXT "Backup to folder:",IDC_STATIC,18,120,124,11
EDITTEXT IDC_ED_FOLDER,26,133,168,13,ES_AUTOHSCROLL
PUSHBUTTON "Browse...",IDC_BUT_BROWSE,199,132,49,14
- CONTROL "Go to the ""Customize -> Folders"" to change settings",
- IDC_LNK_FOLDERS,"Hyperlink",NOT WS_VISIBLE | WS_TABSTOP,
- 18,129,231,21
- CONTROL "Disable progress bar",IDC_CHK_NOPROG,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,17,152,182,11
- CONTROL "Disable Popups",IDC_CHK_NOPOPUP,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,17,168,182,11
+ CONTROL "Go to the ""Customize -> Folders"" to change settings",IDC_LNK_FOLDERS,
+ "Hyperlink",NOT WS_VISIBLE | WS_TABSTOP,18,129,231,21
+ CONTROL "Compress backup to zip-archive",IDC_CHK_USEZIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,156,231,11
+ CONTROL "Disable progress bar",IDC_CHK_NOPROG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,174,231,11
+ CONTROL "Disable Popups",IDC_CHK_NOPOPUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,192,231,11
END
@@ -79,7 +66,7 @@ END //
#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
+GUIDELINES DESIGNINFO
BEGIN
IDD_COPYPROGRESS, DIALOG
BEGIN
@@ -97,7 +84,7 @@ BEGIN VERTGUIDE, 193
VERTGUIDE, 248
TOPMARGIN, 38
- BOTTOMMARGIN, 186
+ BOTTOMMARGIN, 213
END
END
#endif // APSTUDIO_INVOKED
@@ -112,10 +99,6 @@ END // remains consistent on all systems.
IDI_ICON1 ICON "backup.ico"
-#endif // Russian resources
-/////////////////////////////////////////////////////////////////////////////
-
-
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
@@ -140,6 +123,10 @@ END #endif // APSTUDIO_INVOKED
+#endif // Русский (Россия) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp index 3050b4d050..8ae4384bac 100644 --- a/plugins/Db_autobackups/src/backup.cpp +++ b/plugins/Db_autobackups/src/backup.cpp @@ -1,6 +1,8 @@ #include "headers.h"
+#include "..\Zlib\src\zip.h"
TCHAR dbname[MAX_PATH];
+HWND progress_dialog;
static UINT_PTR timer_id;
@@ -24,6 +26,95 @@ INT_PTR CALLBACK DlgProcProgress(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l }
return FALSE;
}
+TCHAR* DoubleSlash(TCHAR *sorce)
+{
+ TCHAR *ret = (TCHAR*)mir_calloc(MAX_PATH);
+ TCHAR *r, *s;
+ for (s = sorce, r = ret; *s && r - ret < MAX_PATH; s++, r++){
+ if (*s != _T('\\'))
+ *r = *s;
+ else{
+ *r = _T('\\');
+ r++;
+ *r = _T('\\');
+ }
+ }
+ return ret;
+}
+
+bool MakeZip(LPCTSTR tszSource, LPCTSTR tszDest)
+{
+ bool ret = false;
+
+ char* tmp = mir_u2a(tszSource);
+
+ ptrA szSourceName(mir_strdup(strrchr(tmp, '\\') + 1));
+ ptrT tszDestPath(DoubleSlash((TCHAR*)tszDest));
+
+ mir_free(tmp);
+
+ WIN32_FILE_ATTRIBUTE_DATA fad = {0};
+ if ( GetFileAttributesEx( tszSource, GetFileExInfoStandard, &fad ) )
+ {
+ SYSTEMTIME st;
+ FileTimeToLocalFileTime( &fad.ftLastWriteTime, &fad.ftLastWriteTime );
+ FileTimeToSystemTime( &fad.ftLastWriteTime, &st );
+
+ HANDLE hSrc = CreateFile( tszSource, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
+ if ( hSrc != INVALID_HANDLE_VALUE )
+ {
+ if ( zipFile hZip = zipOpen2_64(tszDestPath, APPEND_STATUS_CREATE, NULL, NULL) )
+ {
+ zip_fileinfo fi = {0};
+ fi.tmz_date.tm_sec = st.wSecond;
+ fi.tmz_date.tm_min = st.wMinute;
+ fi.tmz_date.tm_hour = st.wHour;
+ fi.tmz_date.tm_mday = st.wDay;
+ fi.tmz_date.tm_mon = st.wMonth;
+ fi.tmz_date.tm_year = st.wYear;
+
+ int res = zipOpenNewFileInZip( hZip, szSourceName, &fi, NULL, 0, NULL, 0, "", Z_DEFLATED, Z_BEST_COMPRESSION );
+ if ( res == ZIP_OK )
+ {
+ DWORD buf_length = 256 * 1024; // 256 KB
+ HWND hProgBar = GetDlgItem(progress_dialog, IDC_PROGRESS);
+ UINT i = 0;
+ if ( void* buf = mir_alloc( buf_length ) )
+ {
+ for (;;)
+ {
+ DWORD read = 0;
+ if ( ! ReadFile( hSrc, buf, buf_length, &read, NULL ) )
+ break;
+
+ if ( read == 0 )
+ {
+ // EOF
+ ret = true;
+ break;
+ }
+
+ res = zipWriteInFileInZip( hZip, buf, read );
+ if ( res != ZIP_OK )
+ break;
+
+ SendMessage(hProgBar, PBM_SETPOS, (WPARAM)(100 / ((int)fad.nFileSizeLow / buf_length) * ++i), 0);
+ }
+
+ mir_free( buf );
+ }
+ zipCloseFileInZip( hZip );
+ }
+ char szComment[128];
+ mir_snprintf(szComment, SIZEOF(szComment), "Miranda NG Database\r\nCreated by: %s %d.%d.%d.%d\r\n", __PLUGIN_NAME, __MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM);
+ zipClose( hZip, szComment);
+ }
+ CloseHandle( hSrc );
+ }
+ }
+
+ return ret;
+}
INT_PTR DBSaveAs(WPARAM wParam, LPARAM lParam)
{
@@ -58,11 +149,11 @@ struct FileNameFound_Tag FILETIME CreationTime;
}FileNameFound;
-int RotateBackups(HWND progress_dialog, DWORD start_time)
+int RotateBackups(DWORD start_time)
{
TCHAR backupfilename1[MAX_PATH] = {0}, backupfolderTmp[MAX_PATH] = {0};
unsigned int i = 0;
- HWND prog = GetDlgItem(progress_dialog, IDC_PROGRESS);
+ HWND hProgBar = GetDlgItem(progress_dialog, IDC_PROGRESS);
MSG msg;
WIN32_FIND_DATA FindFileData;
@@ -78,7 +169,7 @@ int RotateBackups(HWND progress_dialog, DWORD start_time) {
if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
continue;
- else if (_tcsicmp(&FindFileData.cFileName[_tcslen(FindFileData.cFileName)-4], _T(".bak")) == 0)
+ else if (_tcsicmp(&FindFileData.cFileName[_tcslen(FindFileData.cFileName)-4], _T(".bak")) == 0 || _tcsicmp(&FindFileData.cFileName[_tcslen(FindFileData.cFileName)-4], _T(".zip")) == 0)
{
if (_tcsicmp(FileNameFound.Name, _T("")) == 0)
{
@@ -90,7 +181,6 @@ int RotateBackups(HWND progress_dialog, DWORD start_time) _tcscpy(FileNameFound.Name, FindFileData.cFileName);
FileNameFound.CreationTime = FindFileData.ftCreationTime;
}
- i++;
while(PeekMessage(&msg, progress_dialog, 0, 0, PM_REMOVE) != 0)
{
if (!IsDialogMessage(progress_dialog, &msg))
@@ -100,8 +190,8 @@ int RotateBackups(HWND progress_dialog, DWORD start_time) }
}
- SendMessage(prog, PBM_SETPOS, (WPARAM)(int)(100 * (options.num_backups - i) / options.num_backups), 0);
- UpdateWindow(progress_dialog);
+ SendMessage(hProgBar, PBM_SETPOS, (WPARAM)(100 / options.num_backups * ++i), 0);
+ //UpdateWindow(progress_dialog);
}
}
@@ -123,8 +213,8 @@ void BackupThread(void* backup_filename) int Backup(TCHAR* backup_filename)
{
TCHAR source_file[MAX_PATH] = {0}, dest_file[MAX_PATH] = {0};
- HWND progress_dialog;
DWORD start_time = GetTickCount();
+ BOOL bZip = FALSE;
CallService(MS_DB_GETPROFILENAMET, MAX_PATH, (LPARAM)dbname);
@@ -133,6 +223,7 @@ int Backup(TCHAR* backup_filename) SYSTEMTIME st;
TCHAR buffer[MAX_COMPUTERNAME_LENGTH+1];
DWORD size = sizeof(buffer);
+ bZip = options.use_zip;
TCHAR *backupfolder = Utils_ReplaceVarsT(options.folder);
// ensure the backup folder exists (either create it or return non-zero signifying error)
@@ -143,7 +234,7 @@ int Backup(TCHAR* backup_filename) GetLocalTime(&st);
GetComputerName(buffer, &size);
- mir_sntprintf(dest_file, MAX_PATH, _T("%s\\%s_%02d.%02d.%02d@%02d-%02d-%02d_%s.bak"), backupfolder, dbname, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, buffer);
+ mir_sntprintf(dest_file, MAX_PATH, _T("%s\\%s_%02d.%02d.%02d@%02d-%02d-%02d_%s.%s"), backupfolder, dbname, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, buffer, bZip? _T("zip") : _T("bak"));
mir_free(backupfolder);
}
else
@@ -157,17 +248,22 @@ int Backup(TCHAR* backup_filename) SetDlgItemText(progress_dialog, IDC_PROGRESSMESSAGE, TranslateT("Rotating backup files..."));
}
- RotateBackups(progress_dialog, start_time);
+ RotateBackups(start_time);
- SetDlgItemText(progress_dialog, 0xDAED, TranslateT("Copying database file..."));
- SendMessage(progress_dialog, PBM_SETPOS, (WPARAM)(int)(0), 0);
+ SetDlgItemText(progress_dialog, IDC_PROGRESSMESSAGE, TranslateT("Copying database file..."));
+ SendMessage(GetDlgItem(progress_dialog, IDC_PROGRESS), PBM_SETPOS, (WPARAM)0, 0);
UpdateWindow(progress_dialog);
mir_sntprintf(source_file, MAX_PATH, _T("%s\\%s"), profilePath, dbname);
TCHAR *pathtmp = Utils_ReplaceVarsT(source_file);
- if (CopyFile(pathtmp, dest_file, 0))
+ BOOL res = 0;
+ if(bZip)
+ res = MakeZip(pathtmp, dest_file);
+ else
+ res = CopyFile(pathtmp, dest_file, 0);
+ if (res)
{
- SendMessage(progress_dialog, PBM_SETPOS, (WPARAM)(int)(100), 0);
+ SendMessage(GetDlgItem(progress_dialog, IDC_PROGRESS), PBM_SETPOS, (WPARAM)(100), 0);
UpdateWindow(progress_dialog);
db_set_dw(0, "AutoBackups", "LastBackupTimestamp", (DWORD)time(0));
if (!options.disable_popups)
diff --git a/plugins/Db_autobackups/src/headers.h b/plugins/Db_autobackups/src/headers.h index 8195df1c36..447c2bd885 100644 --- a/plugins/Db_autobackups/src/headers.h +++ b/plugins/Db_autobackups/src/headers.h @@ -38,6 +38,7 @@ int OptionsInit(WPARAM wParam, LPARAM lParam); int LoadOptions(void);
HWND CreateToolTip(HWND hwndParent, LPTSTR ptszText, LPTSTR ptszTitle);
void BackupThread(void* backup_filename);
+bool MakeZip(LPCTSTR szSource, LPCTSTR szDest);
extern HINSTANCE hInst;
extern TCHAR* profilePath;
diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp index e76707a904..e547b3f6c4 100644 --- a/plugins/Db_autobackups/src/options.cpp +++ b/plugins/Db_autobackups/src/options.cpp @@ -29,6 +29,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);
SetBackupTimer();
return 0;
@@ -63,6 +64,7 @@ int SaveOptions(void) db_set_w(0, "AutoBackups", "NumBackups", (WORD)options.num_backups);
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);
SetBackupTimer();
return 0;
@@ -83,6 +85,7 @@ int SetDlgState(HWND hwndDlg) EnableWindow(GetDlgItem(hwndDlg, IDC_LNK_FOLDERS), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_NOPROG), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_NOPOPUP), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_USEZIP), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_ED_PERIOD), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_PT), FALSE);
@@ -97,6 +100,7 @@ int SetDlgState(HWND hwndDlg) EnableWindow(GetDlgItem(hwndDlg, IDC_LNK_FOLDERS), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_NOPROG), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_NOPOPUP), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_USEZIP), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_ED_PERIOD), new_options.backup_types & BT_PERIODIC);
EnableWindow(GetDlgItem(hwndDlg, IDC_PT), new_options.backup_types & BT_PERIODIC);
@@ -116,6 +120,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);
if ( !ServiceExists(MS_POPUP_ADDPOPUP))
ShowWindow(GetDlgItem(hwndDlg, IDC_CHK_NOPOPUP), SW_HIDE);
@@ -264,6 +269,10 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP new_options.disable_popups = IsDlgButtonChecked(hwndDlg, IDC_CHK_NOPOPUP);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
+ case IDC_CHK_USEZIP:
+ new_options.use_zip = IsDlgButtonChecked(hwndDlg, IDC_CHK_USEZIP);
+ 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 240fc9566e..2a40fef27f 100644 --- a/plugins/Db_autobackups/src/options.h +++ b/plugins/Db_autobackups/src/options.h @@ -32,6 +32,7 @@ typedef struct Options_tag { unsigned int num_backups;
BOOL disable_progress;
BOOL disable_popups;
+ BOOL use_zip;
} 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 fe3f28621c..c1e0c84d7d 100644 --- a/plugins/Db_autobackups/src/resource.h +++ b/plugins/Db_autobackups/src/resource.h @@ -20,6 +20,7 @@ #define IDC_CHK_NOPROG 1670
#define IDC_BUT_NOW 1671
#define IDC_CHK_NOPOPUP 1672
+#define IDC_CHK_USEZIP 1673
#define IDC_PROGRESSMESSAGE 0xDAED
#define IDC_PROGRESS 0xDEAD
diff --git a/plugins/Db_autobackups/src/version.h b/plugins/Db_autobackups/src/version.h index e0a5f3290c..b883b2e917 100644 --- a/plugins/Db_autobackups/src/version.h +++ b/plugins/Db_autobackups/src/version.h @@ -1,14 +1,14 @@ -#define __MAJOR_VERSION 0
-#define __MINOR_VERSION 0
-#define __RELEASE_NUM 0
-#define __BUILD_NUM 9
+#define __MAJOR_VERSION 0
+#define __MINOR_VERSION 0
+#define __RELEASE_NUM 0
+#define __BUILD_NUM 10
#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
-#define __PLUGIN_NAME "Db autobackuper"
-#define __FILENAME "Db_autobackups.dll"
-#define __DESCRIPTION "Db autobackuper plugin."
-#define __AUTHOR "chaos.persei, sje, Kildor, Billy_Bons"
-#define __AUTHOREMAIL "chaos.persei@gmail.com"
-#define __AUTHORWEB "http://miranda-ng.org/p/Db_autobackups/"
-#define __COPYRIGHT "© 2005-2011 chaos.persei, sje, Kildor, Billy_Bons, Vasilich"
+#define __PLUGIN_NAME "Db autobackuper"
+#define __FILENAME "Db_autobackups.dll"
+#define __DESCRIPTION "Db autobackuper plugin."
+#define __AUTHOR "chaos.persei, sje, Kildor, Billy_Bons"
+#define __AUTHOREMAIL "chaos.persei@gmail.com"
+#define __AUTHORWEB "http://miranda-ng.org/p/Db_autobackups/"
+#define __COPYRIGHT "© 2005-2013 chaos.persei, sje, Kildor, Billy_Bons, Vasilich"
|