rainmeter-studio/SkinInstaller/DialogPackage.h

127 lines
3.6 KiB
C
Raw Normal View History

2012-06-16 18:56:46 +00:00
/*
2012-06-17 07:39:48 +00:00
Copyright (C) 2012 Birunthan Mohanathas
2012-06-16 18:56:46 +00:00
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
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
2012-06-17 07:39:48 +00:00
#ifndef SKININSTALLER_DIALOGPACKAGE_H_
#define SKININSTALLER_DIALOGPACKAGE_H_
2012-06-16 18:56:46 +00:00
#include <string>
#include "zip.h"
#include "../Library/Dialog.h"
2013-05-31 14:18:52 +00:00
class DialogPackage : public Dialog
2012-06-16 18:56:46 +00:00
{
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);
2013-05-31 14:18:52 +00:00
static DialogPackage* c_Dialog;
2012-06-16 18:56:46 +00:00
protected:
2013-05-31 14:18:52 +00:00
virtual Tab& GetActiveTab();
2012-06-16 18:56:46 +00:00
private:
2013-05-31 14:18:52 +00:00
class TabInfo : public Tab
2012-06-16 18:56:46 +00:00
{
public:
2013-05-31 14:18:52 +00:00
TabInfo(HWND window);
2012-06-16 18:56:46 +00:00
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);
};
2013-05-31 14:18:52 +00:00
class TabOptions : public Tab
2012-06-16 18:56:46 +00:00
{
public:
2013-05-31 14:18:52 +00:00
TabOptions(HWND window);
2012-06-16 18:56:46 +00:00
virtual void Initialize();
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
};
2013-05-31 14:18:52 +00:00
class TabAdvanced : public Tab
2012-06-16 18:56:46 +00:00
{
public:
2013-05-31 14:18:52 +00:00
TabAdvanced(HWND window);
2012-06-16 18:56:46 +00:00
virtual void Initialize();
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
2012-06-23 19:49:55 +00:00
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
2012-06-16 18:56:46 +00:00
};
2013-05-31 14:18:52 +00:00
DialogPackage(HWND wnd);
virtual ~DialogPackage();
2012-06-16 18:56:46 +00:00
void SetNextButtonState();
bool CreatePackage();
static unsigned __stdcall PackagerThreadProc(void* pParam);
2012-06-17 08:32:52 +00:00
bool AddFileToPackage(const WCHAR* realPath, const WCHAR* zipPath);
bool AddFolderToPackage(const std::wstring& path, std::wstring base, const WCHAR* zipPrefix);
2012-06-16 18:56:46 +00:00
void ShowHelp();
2012-06-16 18:56:46 +00:00
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);
2013-05-31 14:18:52 +00:00
TabInfo m_TabInfo;
TabOptions m_TabOptions;
TabAdvanced m_TabAdvanced;
2012-06-16 18:56:46 +00:00
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;
2012-10-02 14:44:47 +00:00
std::map<std::wstring, std::wstring> m_LayoutFolders;
2012-06-16 18:56:46 +00:00
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;
2012-10-02 14:44:47 +00:00
bool m_LoadLayout;
2012-06-16 18:56:46 +00:00
std::wstring m_Load;
// Advanced tab
std::wstring m_HeaderFile;
std::wstring m_VariableFiles;
bool m_MergeSkins;
HANDLE m_PackagerThread;
zipFile m_ZipFile;
};
#endif