-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathUTCMGRApp.hpp
153 lines (127 loc) · 3.39 KB
/
UTCMGRApp.hpp
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/******************************************************************************
** (C) Chris Oldwood
**
** MODULE: UTCMGR.HPP
** COMPONENT: The Application.
** DESCRIPTION: The CUTCMGRApp class declaration.
**
*******************************************************************************
*/
// Check for previous inclusion
#ifndef UTCMGR_HPP
#define UTCMGR_HPP
#if _MSC_VER > 1000
#pragma once
#endif
#include <WCL/App.hpp>
#include "AppWnd.hpp"
#include "AppCmds.hpp"
#include "Profile.hpp"
#include <WCL/HelpFile.hpp>
#include <WCL/IniFile.hpp>
#include "Cache.hpp"
#include <WCL/StrArray.hpp>
/******************************************************************************
**
** The application class.
**
*******************************************************************************
*/
class CUTCMGRApp : public CApp
{
public:
//
// Constructors/Destructor.
//
CUTCMGRApp();
~CUTCMGRApp();
//
// Members
//
CAppWnd m_AppWnd; // Main window.
CAppCmds m_AppCmds; // Command handler.
CHelpFile m_oHelpFile; // The help file.
CIniFile m_oIniFile; // Config File.
uint m_nModified; // Config modified flags.
CCache m_oCache; // MDB Cache table.
CProfiles m_aoProfiles; // The list of profiles.
CProfile* m_pProfile; // Current profile.
CString m_strDefProfile; // Default profile.
CString m_strCacheIndex; // Cache index file name.
CString m_strCacheExt; // Cache file extensions.
CStrArray m_astrPinned; // The list of pinned files.
bool m_bScanOnStart; // Scan on startup?
bool m_bScanOnSwitch; // Scan when switching profiles?
bool m_bScanForTmp; // Scan for old .tmp files?
bool m_bScanIndex; // Scan index for old entries?
bool m_bShowAllFiles; // Show all files?
bool m_bLogEdits; // Log edit operations to a file?
bool m_bIgnoreDates; // Ignore dates mismatches?
CRect m_rcLastWndPos; // Main window position.
CRect m_rcLastDlgPos; // Import/Restore dialog position.
CString m_strDefStatus; // The default status bar text.
//
// Profile methods.
//
CProfile* FindProfile(const tchar* pszName) const;
CProfile* FindProfileByCfgFile(const CPath& strCfgFile) const;
int GetProfileIndex(CProfile* pProfile) const;
void BuildProfileMenu();
//
// Formatting methods.
//
CString FormatType(tchar cType) const;
CString FormatSize(int nSize) const;
CString FormatStatus(tchar cStatus) const;
int IconIndex(tchar cType) const;
//
// Utility methods.
//
void UpdateCacheStatus();
//
// Constants.
//
static const tchar* VERSION;
//
// Modified flags.
//
enum
{
NONE = 0x0000,
SETTINGS = 0x0001,
PROFILES = 0x0002,
PIN_LIST = 0x0004,
};
protected:
//
// Startup and Shutdown template methods.
//
virtual bool OnOpen();
virtual bool OnClose();
//
// Internal methods.
//
void LoadConfig();
void SaveConfig();
//
// Constants.
//
static const tchar* INI_FILE_VER_10;
static const tchar* INI_FILE_VER_20;
static const tchar* INI_FILE_VER_25;
};
/******************************************************************************
**
** Global variables.
**
*******************************************************************************
*/
// The application object.
extern CUTCMGRApp App;
/******************************************************************************
**
** Implementation of inline functions.
**
*******************************************************************************
*/
#endif //UTCMGR_HPP