Doc: Fix broken link
[TortoiseGit.git] / src / TortoiseMerge / Settings.cpp
bloba947d433bb26456d342b03c3856835499bd3c138
1 // TortoiseGitMerge - a Diff/Patch program
3 // Copyright (C) 2006, 2009-2010, 2017 - 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 #include "stdafx.h"
20 #include "Settings.h"
21 #include "SetMainPage.h"
22 #include "SetColorPage.h"
24 IMPLEMENT_DYNAMIC(CSettings, CPropertySheet)
25 CSettings::CSettings(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
26 : CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
27 , m_pMainPage(nullptr)
28 , m_pColorPage(nullptr)
32 CSettings::CSettings(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
33 : CPropertySheet(pszCaption, pParentWnd, iSelectPage)
34 , m_pMainPage(nullptr)
35 , m_pColorPage(nullptr)
37 AddPropPages();
40 CSettings::~CSettings()
42 RemovePropPages();
45 void CSettings::AddPropPages()
47 m_pMainPage = new CSetMainPage();
48 m_pColorPage = new CSetColorPage();
50 AddPage(m_pMainPage);
51 AddPage(m_pColorPage);
53 // remove the "apply" button: changes show only after the settings dialog
54 // is closed, so the OK button is enough and the "apply" button only
55 // confuses users.
56 m_psh.dwFlags |= PSH_NOAPPLYNOW;
59 void CSettings::RemovePropPages()
61 delete m_pMainPage;
62 m_pMainPage = nullptr;
63 delete m_pColorPage;
64 m_pColorPage = nullptr;
67 void CSettings::SaveData()
69 m_pMainPage->SaveData();
70 m_pColorPage->SaveData();
73 BOOL CSettings::IsReloadNeeded() const
75 BOOL bReload = FALSE;
76 bReload = (m_pMainPage->m_bReloadNeeded || bReload);
77 bReload = (m_pColorPage->m_bReloadNeeded || bReload);
78 return bReload;
81 BEGIN_MESSAGE_MAP(CSettings, CPropertySheet)
82 END_MESSAGE_MAP()
85 // CSettings message handlers
87 BOOL CSettings::OnInitDialog()
89 BOOL bResult = CPropertySheet::OnInitDialog();
90 return bResult;