1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2008-2012 - TortoiseGit
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 // ResetDlg.cpp : implementation file
23 #include "TortoiseProc.h"
26 #include "FileDiffDlg.h"
30 IMPLEMENT_DYNAMIC(CResetDlg
, CStandAloneDialog
)
32 CResetDlg::CResetDlg(CWnd
* pParent
/*=NULL*/)
33 : CStandAloneDialog(CResetDlg::IDD
, pParent
)
39 CResetDlg::~CResetDlg()
43 void CResetDlg::DoDataExchange(CDataExchange
* pDX
)
45 CDialog::DoDataExchange(pDX
);
49 BEGIN_MESSAGE_MAP(CResetDlg
, CStandAloneDialog
)
50 ON_BN_CLICKED(IDHELP
, &CResetDlg::OnBnClickedHelp
)
51 ON_BN_CLICKED(IDC_SHOW_MODIFIED_FILES
, &CResetDlg::OnBnClickedShowModifiedFiles
)
55 // CResetDlg message handlers
56 BOOL
CResetDlg::OnInitDialog()
58 CStandAloneDialog::OnInitDialog();
61 CString currentBranch
= g_Git
.GetCurrentBranch();
62 resetTo
.Format(IDS_PROC_RESETBRANCH
, currentBranch
, m_ResetToVersion
);
63 GetDlgItem(IDC_RESET_BRANCH_NAME
)->SetWindowTextW(resetTo
);
65 this->CheckRadioButton(IDC_RADIO_RESET_SOFT
,IDC_RADIO_RESET_HARD
,IDC_RADIO_RESET_SOFT
+m_ResetType
);
67 AdjustControlSize(IDC_RADIO_RESET_SOFT
);
68 AdjustControlSize(IDC_RADIO_RESET_MIXED
);
69 AdjustControlSize(IDC_RADIO_RESET_HARD
);
74 void CResetDlg::OnOK()
76 m_ResetType
=this->GetCheckedRadioButton(IDC_RADIO_RESET_SOFT
,IDC_RADIO_RESET_HARD
)-IDC_RADIO_RESET_SOFT
;
77 return CStandAloneDialog::OnOK();
80 void CResetDlg::OnBnClickedHelp()
85 void CResetDlg::OnBnClickedShowModifiedFiles()
89 dlg
.m_strRev1
= _T("0000000000000000000000000000000000000000");
90 dlg
.m_strRev2
= _T("HEAD");