1 // TortoiseGit - 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
);
67 GetWindowText(sWindowTitle
);
68 CAppUtils::SetWindowTitle(m_hWnd
, m_path
.GetUIPathString(), sWindowTitle
);
70 AdjustControlSize(IDC_USETEXTVIEWER
);
71 AdjustControlSize(IDC_IGNOREEOL
);
72 AdjustControlSize(IDC_COMPAREWHITESPACES
);
73 AdjustControlSize(IDC_IGNOREWHITESPACECHANGES
);
74 AdjustControlSize(IDC_IGNOREALLWHITESPACES
);
75 AdjustControlSize(IDC_INCLUDEMERGEINFO
);
77 m_bTextView
= m_regTextView
;
78 // set head revision as default revision
79 // if (EndRev.IsHead())
80 CheckRadioButton(IDC_REVISION_HEAD
, IDC_REVISION_N
, IDC_REVISION_HEAD
);
83 // m_sEndRev = EndRev.ToString();
85 // CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_N);
88 CheckRadioButton(IDC_COMPAREWHITESPACES
, IDC_IGNOREALLWHITESPACES
, IDC_IGNOREALLWHITESPACES
);
90 if ((m_pParentWnd
==NULL
)&&(hWndExplorer
))
91 CenterWindow(CWnd::FromHandle(hWndExplorer
));
95 void CBlameDlg::OnOK()
97 if (!UpdateData(TRUE
))
98 return; // don't dismiss dialog (error message already shown by MFC framework)
100 m_regTextView
= m_bTextView
;
101 // StartRev = SVNRev(m_sStartRev);
102 // EndRev = SVNRev(m_sEndRev);
103 // if (!StartRev.IsValid())
105 /// ShowBalloon(IDC_REVISON_START, IDS_ERR_INVALIDREV);
108 // EndRev = SVNRev(m_sEndRev);
109 // if (GetCheckedRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N) == IDC_REVISION_HEAD)
113 // if (!EndRev.IsValid())
115 // ShowBalloon(IDC_REVISION_END, IDS_ERR_INVALIDREV);
118 BOOL extBlame
= CRegDWORD(_T("Software\\TortoiseGit\\TextBlame"), FALSE
);
122 int rb
= GetCheckedRadioButton(IDC_COMPAREWHITESPACES
, IDC_IGNOREALLWHITESPACES
);
125 case IDC_IGNOREWHITESPACECHANGES
:
126 // m_IgnoreSpaces = svn_diff_file_ignore_space_change;
128 case IDC_IGNOREALLWHITESPACES
:
129 // m_IgnoreSpaces = svn_diff_file_ignore_space_all;
131 case IDC_COMPAREWHITESPACES
:
133 // m_IgnoreSpaces = svn_diff_file_ignore_space_none;
139 CStandAloneDialog::OnOK();
142 void CBlameDlg::OnBnClickedHelp()
147 void CBlameDlg::OnEnChangeRevisionEnd()
150 if (m_sEndRev
.IsEmpty())
151 CheckRadioButton(IDC_REVISION_HEAD
, IDC_REVISION_N
, IDC_REVISION_HEAD
);
153 CheckRadioButton(IDC_REVISION_HEAD
, IDC_REVISION_N
, IDC_REVISION_N
);