1 // TortoiseSVN - a Windows shell extension for easy version control
\r
3 // Copyright (C) 2003-2008 - TortoiseSVN
\r
5 // This program is free software; you can redistribute it and/or
\r
6 // modify it under the terms of the GNU General Public License
\r
7 // as published by the Free Software Foundation; either version 2
\r
8 // of the License, or (at your option) any later version.
\r
10 // This program is distributed in the hope that it will be useful,
\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 // GNU General Public License for more details.
\r
15 // You should have received a copy of the GNU General Public License
\r
16 // along with this program; if not, write to the Free Software Foundation,
\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
20 #include "TortoiseProc.h"
\r
21 #include "BlameDlg.h"
\r
22 #include "Registry.h"
\r
24 //IMPLEMENT_DYNAMIC(CBlameDlg, CStandAloneDialog)
\r
25 CBlameDlg::CBlameDlg(CWnd* pParent /*=NULL*/)
\r
26 : CStandAloneDialog(CBlameDlg::IDD, pParent)
\r
29 // , m_sStartRev(_T("1"))
\r
30 , m_bTextView(FALSE)
\r
31 , m_bIgnoreEOL(TRUE)
\r
32 , m_bIncludeMerge(TRUE)
\r
34 m_regTextView = CRegDWORD(_T("Software\\TortoiseGit\\TextBlame"), FALSE);
\r
35 m_bTextView = m_regTextView;
\r
38 CBlameDlg::~CBlameDlg()
\r
42 void CBlameDlg::DoDataExchange(CDataExchange* pDX)
\r
44 CStandAloneDialog::DoDataExchange(pDX);
\r
45 DDX_Text(pDX, IDC_REVISON_START, m_sStartRev);
\r
46 DDX_Text(pDX, IDC_REVISION_END, m_sEndRev);
\r
47 DDX_Check(pDX, IDC_USETEXTVIEWER, m_bTextView);
\r
48 DDX_Check(pDX, IDC_IGNOREEOL2, m_bIgnoreEOL);
\r
49 DDX_Check(pDX, IDC_INCLUDEMERGEINFO, m_bIncludeMerge);
\r
53 BEGIN_MESSAGE_MAP(CBlameDlg, CStandAloneDialog)
\r
54 ON_BN_CLICKED(IDHELP, OnBnClickedHelp)
\r
55 ON_EN_CHANGE(IDC_REVISION_END, &CBlameDlg::OnEnChangeRevisionEnd)
\r
60 BOOL CBlameDlg::OnInitDialog()
\r
62 CStandAloneDialog::OnInitDialog();
\r
64 AdjustControlSize(IDC_USETEXTVIEWER);
\r
65 AdjustControlSize(IDC_IGNOREEOL);
\r
66 AdjustControlSize(IDC_COMPAREWHITESPACES);
\r
67 AdjustControlSize(IDC_IGNOREWHITESPACECHANGES);
\r
68 AdjustControlSize(IDC_IGNOREALLWHITESPACES);
\r
69 AdjustControlSize(IDC_INCLUDEMERGEINFO);
\r
71 m_bTextView = m_regTextView;
\r
72 // set head revision as default revision
\r
73 // if (EndRev.IsHead())
\r
74 CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_HEAD);
\r
77 // m_sEndRev = EndRev.ToString();
\r
78 // UpdateData(FALSE);
\r
79 // CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_N);
\r
82 CheckRadioButton(IDC_COMPAREWHITESPACES, IDC_IGNOREALLWHITESPACES, IDC_IGNOREALLWHITESPACES);
\r
84 if ((m_pParentWnd==NULL)&&(hWndExplorer))
\r
85 CenterWindow(CWnd::FromHandle(hWndExplorer));
\r
89 void CBlameDlg::OnOK()
\r
91 if (!UpdateData(TRUE))
\r
92 return; // don't dismiss dialog (error message already shown by MFC framework)
\r
94 m_regTextView = m_bTextView;
\r
95 // StartRev = SVNRev(m_sStartRev);
\r
96 // EndRev = SVNRev(m_sEndRev);
\r
97 // if (!StartRev.IsValid())
\r
99 /// ShowBalloon(IDC_REVISON_START, IDS_ERR_INVALIDREV);
\r
102 // EndRev = SVNRev(m_sEndRev);
\r
103 // if (GetCheckedRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N) == IDC_REVISION_HEAD)
\r
105 EndRev = _T("HEAD");
\r
107 // if (!EndRev.IsValid())
\r
109 // ShowBalloon(IDC_REVISION_END, IDS_ERR_INVALIDREV);
\r
112 BOOL extBlame = CRegDWORD(_T("Software\\TortoiseGit\\TextBlame"), FALSE);
\r
114 m_bTextView = true;
\r
116 int rb = GetCheckedRadioButton(IDC_COMPAREWHITESPACES, IDC_IGNOREALLWHITESPACES);
\r
119 case IDC_IGNOREWHITESPACECHANGES:
\r
120 // m_IgnoreSpaces = svn_diff_file_ignore_space_change;
\r
122 case IDC_IGNOREALLWHITESPACES:
\r
123 // m_IgnoreSpaces = svn_diff_file_ignore_space_all;
\r
125 case IDC_COMPAREWHITESPACES:
\r
127 // m_IgnoreSpaces = svn_diff_file_ignore_space_none;
\r
133 CStandAloneDialog::OnOK();
\r
136 void CBlameDlg::OnBnClickedHelp()
\r
141 void CBlameDlg::OnEnChangeRevisionEnd()
\r
144 if (m_sEndRev.IsEmpty())
\r
145 CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_HEAD);
\r
147 CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_N);
\r