1
// TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2008-2013, 2016, 2020, 2023 - TortoiseGit
4 // Copyright (C) 2003-2011 - TortoiseSVN
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include "StandAloneDlg.h"
23 #include "TreePropSheet/TreePropSheet.h"
25 #include "SettingsPropPage.h"
26 #include "SettingGitRemote.h"
28 using namespace TreePropSheet
;
33 CSettingsPage(ISettingsPropPage
* page
, CString pageName
)
42 CSettingsPage(const CSettingsPage
&) = delete;
43 CSettingsPage(CSettingsPage
&& t
) noexcept
45 this->pageName
= t
.pageName
;
51 ISettingsPropPage
* page
= nullptr;
56 * \ingroup TortoiseProc
57 * This is the container for all settings pages. A setting page is
58 * a class derived from CPropertyPage with an additional method called
59 * SaveData(). The SaveData() method is used by the dialog to save
60 * the settings the user has made - if that method is not called then
61 * it means that the changes are discarded! Each settings page has
62 * to make sure that no changes are saved outside that method.
64 class CSettings
: public CTreePropSheet
66 DECLARE_DYNAMIC(CSettings
)
70 * Adds all pages to this Settings-Dialog.
74 * Removes the pages and frees up memory.
76 void RemovePropPages();
78 ISettingsPropPage
* AddPropPage(ISettingsPropPage
* page
, CString pageName
);
79 void AddPropPage(ISettingsPropPage
* page
, CString pageName
, CPropertyPage
* parentPage
);
82 std::vector
<CSettingsPage
> m_pPages
;
83 ISettingsPropPage
* m_pGitConfig
= nullptr;
84 CSettingGitRemote
* m_pGitRemote
= nullptr;
87 CSettings(UINT nIDCaption
, CTGitPath
* CmdPath
= nullptr, CWnd
* pParentWnd
= nullptr, UINT iSelectPage
= 0);
89 CString m_DefaultPage
;
91 * Calls the SaveData()-methods of each of the settings pages.
95 void SetTheme(bool bDark
);
99 BOOL
OnInitDialog() override
;