2011-11-27 13:24:37 +00:00
|
|
|
/*
|
|
|
|
Copyright (C) 2011 Birunthan Mohanathas
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program 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 General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2012-01-23 06:36:15 +00:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2011-11-27 13:24:37 +00:00
|
|
|
*/
|
|
|
|
|
2012-06-08 12:53:33 +00:00
|
|
|
#ifndef SKININSTALLER_DIALOGBACKUP_H_
|
|
|
|
#define SKININSTALLER_DIALOGBACKUP_H_
|
2011-11-27 13:24:37 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include "zip.h"
|
|
|
|
#include "../Library/Dialog.h"
|
|
|
|
|
|
|
|
class CDialogBackup : public CDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static void Create(HINSTANCE hInstance, LPWSTR lpCmdLine);
|
|
|
|
|
|
|
|
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
INT_PTR OnInitDialog(WPARAM wParam, LPARAM lParam);
|
|
|
|
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
|
|
|
|
|
|
|
|
static CDialogBackup* c_Dialog;
|
|
|
|
|
2012-02-21 09:03:16 +00:00
|
|
|
protected:
|
|
|
|
virtual CTab& GetActiveTab();
|
|
|
|
|
2011-11-27 13:24:37 +00:00
|
|
|
private:
|
|
|
|
class CTabBackup : public CTab
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CTabBackup(HWND window);
|
|
|
|
|
|
|
|
virtual void Initialize();
|
|
|
|
|
|
|
|
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
|
|
|
|
};
|
|
|
|
|
|
|
|
CDialogBackup(HWND wnd);
|
|
|
|
virtual ~CDialogBackup();
|
|
|
|
|
|
|
|
void StartBackup();
|
|
|
|
bool CreateBackup();
|
|
|
|
static unsigned __stdcall BackupThreadProc(void* pParam);
|
|
|
|
|
|
|
|
bool AddFileToBackup(const char* realPath, const char* zipPath);
|
|
|
|
bool AddFolderToBackup(const std::wstring& path, std::wstring base, char* zipPrefix, bool recursive);
|
|
|
|
|
|
|
|
CTabBackup m_TabBackup;
|
|
|
|
|
|
|
|
std::wstring m_TargetFile;
|
2012-06-10 07:48:07 +00:00
|
|
|
std::wstring m_BackupTime;
|
2011-11-27 13:24:37 +00:00
|
|
|
|
|
|
|
HANDLE m_ThreadHandle;
|
|
|
|
|
|
|
|
zipFile m_ZipFile;
|
|
|
|
void* m_WriteBuffer;
|
|
|
|
static const int c_WriteBufferSize = 16384;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|