1 // TortoiseSVN - a Windows shell extension for easy version control
3 // Copyright (C) 2003-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.
20 #include "TortoiseProc.h"
25 //IMPLEMENT_DYNAMIC(CBlameDlg, CStandAloneDialog)
26 CBlameDlg::CBlameDlg(CWnd
* pParent
/*=NULL*/)
27 : CStandAloneDialog(CBlameDlg::IDD
, pParent
)
30 // , m_sStartRev(_T("1"))
33 , m_bIncludeMerge(TRUE
)
35 m_regTextView
= CRegDWORD(_T("Software\\TortoiseGit\\TextBlame"), FALSE
);
36 m_bTextView
= m_regTextView
;
39 CBlameDlg::~CBlameDlg()
43 void CBlameDlg::DoDataExchange(CDataExchange
* pDX
)
45 CStandAloneDialog::DoDataExchange(pDX
);
46 DDX_Text(pDX
, IDC_REVISON_START
, m_sStartRev
);
47 DDX_Text(pDX
, IDC_REVISION_END
, m_sEndRev
);
48 DDX_Check(pDX
, IDC_USETEXTVIEWER
, m_bTextView
);
49 DDX_Check(pDX
, IDC_IGNOREEOL2
, m_bIgnoreEOL
);
50 DDX_Check(pDX
, IDC_INCLUDEMERGEINFO
, m_bIncludeMerge
);
54 BEGIN_MESSAGE_MAP(CBlameDlg
, CStandAloneDialog
)
55 ON_BN_CLICKED(IDHELP
, OnBnClickedHelp
)
56 ON_EN_CHANGE(IDC_REVISION_END
, &CBlameDlg::OnEnChangeRevisionEnd
)
61 BOOL
CBlameDlg::OnInitDialog()
63 CStandAloneDialog::OnInitDialog();
64 CAppUtils::MarkWindowAsUnpinnable(m_hWnd
);
66 AdjustControlSize(IDC_USETEXTVIEWER
);
67 AdjustControlSize(IDC_IGNOREEOL
);
68 AdjustControlSize(IDC_COMPAREWHITESPACES
);
69 AdjustControlSize(IDC_IGNOREWHITESPACECHANGES
);
70 AdjustControlSize(IDC_IGNOREALLWHITESPACES
);
71 AdjustControlSize(IDC_INCLUDEMERGEINFO
);
73 m_bTextView
= m_regTextView
;
74 // set head revision as default revision
75 // if (EndRev.IsHead())
76 CheckRadioButton(IDC_REVISION_HEAD
, IDC_REVISION_N
, IDC_REVISION_HEAD
);
79 // m_sEndRev = EndRev.ToString();
81 // CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_N);
84 CheckRadioButton(IDC_COMPAREWHITESPACES
, IDC_IGNOREALLWHITESPACES
, IDC_IGNOREALLWHITESPACES
);
86 if ((m_pParentWnd
==NULL
)&&(hWndExplorer
))
87 CenterWindow(CWnd::FromHandle(hWndExplorer
));
91 void CBlameDlg::OnOK()
93 if (!UpdateData(TRUE
))
94 return; // don't dismiss dialog (error message already shown by MFC framework)
96 m_regTextView
= m_bTextView
;
97 // StartRev = SVNRev(m_sStartRev);
98 // EndRev = SVNRev(m_sEndRev);
99 // if (!StartRev.IsValid())
101 /// ShowBalloon(IDC_REVISON_START, IDS_ERR_INVALIDREV);
104 // EndRev = SVNRev(m_sEndRev);
105 // if (GetCheckedRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N) == IDC_REVISION_HEAD)
109 // if (!EndRev.IsValid())
111 // ShowBalloon(IDC_REVISION_END, IDS_ERR_INVALIDREV);
114 BOOL extBlame
= CRegDWORD(_T("Software\\TortoiseGit\\TextBlame"), FALSE
);
118 int rb
= GetCheckedRadioButton(IDC_COMPAREWHITESPACES
, IDC_IGNOREALLWHITESPACES
);
121 case IDC_IGNOREWHITESPACECHANGES
:
122 // m_IgnoreSpaces = svn_diff_file_ignore_space_change;
124 case IDC_IGNOREALLWHITESPACES
:
125 // m_IgnoreSpaces = svn_diff_file_ignore_space_all;
127 case IDC_COMPAREWHITESPACES
:
129 // m_IgnoreSpaces = svn_diff_file_ignore_space_none;
135 CStandAloneDialog::OnOK();
138 void CBlameDlg::OnBnClickedHelp()
143 void CBlameDlg::OnEnChangeRevisionEnd()
146 if (m_sEndRev
.IsEmpty())
147 CheckRadioButton(IDC_REVISION_HEAD
, IDC_REVISION_N
, IDC_REVISION_HEAD
);
149 CheckRadioButton(IDC_REVISION_HEAD
, IDC_REVISION_N
, IDC_REVISION_N
);