doc: updated images
[TortoiseGit.git] / src / TortoiseProc / ResetDlg.cpp
blobde56e65b3f7175c4e4b782428c8c4324bab04fc9
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
22 #include "stdafx.h"
23 #include "TortoiseProc.h"
24 #include "ResetDlg.h"
25 #include "Git.h"
26 #include "FileDiffDlg.h"
28 // CResetDlg dialog
30 IMPLEMENT_DYNAMIC(CResetDlg, CStandAloneDialog)
32 CResetDlg::CResetDlg(CWnd* pParent /*=NULL*/)
33 : CStandAloneDialog(CResetDlg::IDD, pParent)
34 , m_ResetType(1)
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)
52 END_MESSAGE_MAP()
55 // CResetDlg message handlers
56 BOOL CResetDlg::OnInitDialog()
58 CStandAloneDialog::OnInitDialog();
60 CString resetTo;
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);
71 return TRUE;
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()
82 OnHelp();
85 void CResetDlg::OnBnClickedShowModifiedFiles()
87 CFileDiffDlg dlg;
89 dlg.m_strRev1 = _T("0000000000000000000000000000000000000000");
90 dlg.m_strRev2 = _T("HEAD");
92 dlg.DoModal();