Merge branch 'restructure-tree'
[TortoiseGit.git] / src / TortoiseProc / MergeWizardStart.cpp
blob29f8489611560e301090e92c772d5744d1e94611
1 // TortoiseSVN - a Windows shell extension for easy version control
3 // Copyright (C) 2007-2008 - 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 "TortoiseProc.h"
21 #include "MergeWizard.h"
22 #include "MergeWizardStart.h"
25 IMPLEMENT_DYNAMIC(CMergeWizardStart, CMergeWizardBasePage)
27 CMergeWizardStart::CMergeWizardStart()
28 : CMergeWizardBasePage(CMergeWizardStart::IDD)
30 m_psp.dwFlags |= PSP_DEFAULT|PSP_USEHEADERTITLE|PSP_USEHEADERSUBTITLE;
31 m_psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_MERGEWIZARD_STARTTITLE);
32 m_psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_MERGEWIZARD_STARTSUBTITLE);
35 CMergeWizardStart::~CMergeWizardStart()
39 void CMergeWizardStart::DoDataExchange(CDataExchange* pDX)
41 CMergeWizardBasePage::DoDataExchange(pDX);
45 BEGIN_MESSAGE_MAP(CMergeWizardStart, CMergeWizardBasePage)
46 END_MESSAGE_MAP()
49 LRESULT CMergeWizardStart::OnWizardNext()
51 int nButton = GetCheckedRadioButton(IDC_MERGE_REVRANGE, IDC_MERGE_TREE);
53 CMergeWizard* wiz = (CMergeWizard*)GetParent();
54 switch (nButton)
56 case IDC_MERGE_REVRANGE:
57 wiz->nRevRangeMerge = MERGEWIZARD_REVRANGE;
58 break;
59 case IDC_MERGE_TREE:
60 wiz->nRevRangeMerge = MERGEWIZARD_TREE;
61 break;
62 case IDC_MERGE_REINTEGRATE:
63 wiz->nRevRangeMerge = MERGEWIZARD_REINTEGRATE;
64 break;
67 wiz->SaveMode();
69 return wiz->GetSecondPage();
72 BOOL CMergeWizardStart::OnInitDialog()
74 CMergeWizardBasePage::OnInitDialog();
76 CString sLabel;
77 sLabel.LoadString(IDS_MERGEWIZARD_REVRANGELABEL);
78 SetDlgItemText(IDC_MERGERANGELABEL, sLabel);
79 sLabel.LoadString(IDS_MERGEWIZARD_REINTEGRATELABEL);
80 SetDlgItemText(IDC_MERGEREINTEGRATELABEL, sLabel);
81 sLabel.LoadString(IDS_MERGEWIZARD_TREELABEL);
82 SetDlgItemText(IDC_TREELABEL, sLabel);
84 AdjustControlSize(IDC_MERGE_REVRANGE);
85 AdjustControlSize(IDC_MERGE_REINTEGRATE);
86 AdjustControlSize(IDC_MERGE_TREE);
88 return TRUE;
91 BOOL CMergeWizardStart::OnSetActive()
93 CMergeWizard* wiz = (CMergeWizard*)GetParent();
95 wiz->SetWizardButtons(PSWIZB_NEXT);
96 SetButtonTexts();
98 int nButton = IDC_MERGE_REVRANGE;
99 switch (wiz->nRevRangeMerge)
101 case MERGEWIZARD_REVRANGE:
102 nButton = IDC_MERGE_REVRANGE;
103 break;
104 case MERGEWIZARD_REINTEGRATE:
105 nButton = IDC_MERGE_REINTEGRATE;
106 break;
107 case MERGEWIZARD_TREE:
108 nButton = IDC_MERGE_TREE;
109 break;
111 CheckRadioButton(
112 IDC_MERGE_REVRANGE, IDC_MERGE_TREE,
113 nButton);
115 return CMergeWizardBasePage::OnSetActive();