forked from uroni/urbackup_frontend_wx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSelectRestoreWindowsComponents.h
98 lines (77 loc) · 2.25 KB
/
SelectRestoreWindowsComponents.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#pragma once
#include "gui/GUIRestoreWindowsComponents.h"
#include <wx/timer.h>
#include <wx/thread.h>
#include "Connector.h"
#include "SelectWindowsComponents.h"
wxString accessErrorToString(Connector::EAccessError access_error);
class RetrieveComponentBackups : public wxThread
{
public:
RetrieveComponentBackups();
~RetrieveComponentBackups();
bool hasSuccess() { return success; }
std::vector<SBackupFile>& getFileList() { return filelist; }
Connector::EAccessError getAccessError() {
return access_error;
}
protected:
virtual ExitCode Entry();
private:
Connector::EAccessError access_error;
bool success;
std::vector<SBackupFile> filelist;
};
class RetrieveComponentConfig : public wxThread
{
public:
RetrieveComponentConfig();
~RetrieveComponentConfig();
void reset(int pbackupid) {
backupid = pbackupid;
success = false; }
bool hasSuccess() { return success; }
Connector::EAccessError getAccessError() {
return access_error;
}
SComponent* getRoot() { return &root; }
std::string getErrMsg() { return errmsg; }
wxString getComponentConfigDir() {
return componentConfigDir;
}
int getBackupid() { return backupid; }
protected:
virtual ExitCode Entry();
private:
int backupid;
Connector::EAccessError access_error;
bool success;
SComponent root;
std::vector<SComponent*> components;
std::string errmsg;
wxString componentConfigDir;
};
class SelectRestoreComponents : public GUISelectRestoreComponents, public wxTimer
{
public:
SelectRestoreComponents(wxWindow* parent);
protected:
virtual void Notify(void);
virtual void onListBoxSelected(wxCommandEvent& event);
virtual void onStartRestore(wxCommandEvent& event);
virtual void evtOnTreeStateImageClick(wxTreeEvent& event);
virtual void onCancel(wxCommandEvent& event);
private:
RetrieveComponentBackups retrieveComponentBackups;
std::auto_ptr<RetrieveComponentConfig> retrieveComponentConfig;
wxImageList* iconList;
wxImageList* selectList;
bool canSelectBackup;
bool retrievingBackupConfig;
std::map<wxTreeItemId, SComponent*> tree_components;
std::map<SComponent*, wxTreeItemId> tree_items;
wxString componentConfigDir;
int backupid;
int icon_width;
int icon_height;
};