1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2007-2010 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include "MessageBox.h"
23 * \ingroup TortoiseProc
24 * Base class for all the settings property pages
26 class ISettingsPropPage
: public CPropertyPage
28 DECLARE_DYNAMIC(ISettingsPropPage
)
30 // simple construction
32 explicit ISettingsPropPage(UINT nIDTemplate
, UINT nIDCaption
= 0, DWORD dwSize
= sizeof(PROPSHEETPAGE
));
33 explicit ISettingsPropPage(LPCTSTR lpszTemplateName
, UINT nIDCaption
= 0, DWORD dwSize
= sizeof(PROPSHEETPAGE
));
35 // extended construction
36 ISettingsPropPage(UINT nIDTemplate
, UINT nIDCaption
,
37 UINT nIDHeaderTitle
, UINT nIDHeaderSubTitle
= 0, DWORD dwSize
= sizeof(PROPSHEETPAGE
));
38 ISettingsPropPage(LPCTSTR lpszTemplateName
, UINT nIDCaption
,
39 UINT nIDHeaderTitle
, UINT nIDHeaderSubTitle
= 0, DWORD dwSize
= sizeof(PROPSHEETPAGE
));
41 virtual ~ISettingsPropPage();
53 virtual UINT
GetIconID() = 0;
56 * Returns the restart code
58 virtual SettingsRestart
GetRestart() {return m_restart
;}
62 SettingsRestart m_restart
;
66 * Store the current value of a BOOL, DWORD or CString into the
67 * respective CRegDWORD etc. and check for success.
70 template<class T
, class Reg
>
71 void Store (const T
& value
, Reg
& registryKey
)
74 if (registryKey
.GetLastError() != ERROR_SUCCESS
)
75 CMessageBox::Show (m_hWnd
, registryKey
.getErrorString(), _T("TortoiseGit"), MB_ICONERROR
);