forked from rainmeter/rainmeter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDialogPackage.h
116 lines (87 loc) · 3.21 KB
/
DialogPackage.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/* Copyright (C) 2012 Rainmeter Project Developers
*
* This Source Code Form is subject to the terms of the GNU General Public
* License; either version 2 of the License, or (at your option) any later
* version. If a copy of the GPL was not distributed with this file, You can
* obtain one at <https://www.gnu.org/licenses/gpl-2.0.html>. */
#ifndef SKININSTALLER_DIALOGPACKAGE_H_
#define SKININSTALLER_DIALOGPACKAGE_H_
#include <string>
#include "zip.h"
#include "Dialog.h"
class DialogPackage : public OldDialog
{
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);
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
static DialogPackage* c_Dialog;
protected:
virtual Tab& GetActiveTab();
private:
class TabInfo : public Tab
{
public:
TabInfo(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);
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
};
class TabOptions : public Tab
{
public:
TabOptions(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);
};
class TabAdvanced : public Tab
{
public:
TabAdvanced(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);
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
};
DialogPackage(HWND wnd);
virtual ~DialogPackage();
void SetNextButtonState();
bool CreatePackage();
static unsigned __stdcall PackagerThreadProc(void* pParam);
bool AddFileToPackage(const WCHAR* realPath, const WCHAR* zipPath);
bool AddFolderToPackage(const std::wstring& path, std::wstring base, const WCHAR* zipPrefix);
void ShowHelp();
static std::wstring SelectFolder(HWND parent, const std::wstring& existingPath);
static INT_PTR CALLBACK SelectFolderDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static std::pair<std::wstring, std::wstring> SelectPlugin(HWND parent);
static INT_PTR CALLBACK SelectPluginDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
TabInfo m_TabInfo;
TabOptions m_TabOptions;
TabAdvanced m_TabAdvanced;
std::wstring m_BackupTime;
// Info tab
std::wstring m_Name;
std::wstring m_Author;
std::wstring m_Version;
std::pair<std::wstring, std::wstring> m_SkinFolder;
std::map<std::wstring, std::wstring> m_LayoutFolders;
std::map<std::wstring, std::pair<std::wstring, std::wstring>> m_PluginFolders;
// Options tab
std::wstring m_TargetFile;
std::wstring m_MinimumRainmeter;
std::wstring m_MinimumWindows;
bool m_LoadLayout;
std::wstring m_Load;
// Advanced tab
std::wstring m_HeaderFile;
std::wstring m_VariableFiles;
bool m_MergeSkins;
HANDLE m_PackagerThread;
zipFile m_ZipFile;
bool m_AllowNonAsciiFilenames;
};
#endif