Fixed issue #1279: Nothing seen in Repository Browser without config core.bare=false
[TortoiseGit.git] / src / TortoiseProc / Settings / SettingsPropPage.h
blob1c4bb1893311a3355280ee270ab5772e3de78732
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.
19 #pragma once
20 #include "MessageBox.h"
22 /**
23 * \ingroup TortoiseProc
24 * Base class for all the settings property pages
26 class ISettingsPropPage : public CPropertyPage
28 DECLARE_DYNAMIC(ISettingsPropPage)
29 public:
30 // simple construction
31 ISettingsPropPage();
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();
43 enum SettingsRestart
45 Restart_None = 0,
46 Restart_System = 1,
47 Restart_Cache = 2
50 /**
51 * Returns the icon ID
53 virtual UINT GetIconID() = 0;
55 /**
56 * Returns the restart code
58 virtual SettingsRestart GetRestart() {return m_restart;}
60 protected:
62 SettingsRestart m_restart;
64 /**
65 * Utility method:
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)
73 registryKey = value;
74 if (registryKey.GetLastError() != ERROR_SUCCESS)
75 CMessageBox::Show (m_hWnd, registryKey.getErrorString(), _T("TortoiseGit"), MB_ICONERROR);