1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2003-2008 - 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.
21 #include "StandAloneDlg.h"
26 #include "HintListCtrl.h"
28 #include "XPImageButton.h"
29 #include "FilterEdit.h"
31 #include "ProgressDlg.h"
34 #define IDT_FILTER 101
37 * \ingroup TortoiseProc
38 * Dialog which fetches and shows the difference between two urls in the
39 * repository. It shows a list of files/folders which were changed in those
42 class CFileDiffDlg
: public CResizableStandAloneDialog
44 DECLARE_DYNAMIC(CFileDiffDlg
)
50 // svn_client_diff_summarize_kind_t kind;
52 // svn_node_kind_t node;
56 CFileDiffDlg(CWnd
* pParent
= NULL
);
57 virtual ~CFileDiffDlg();
59 // void SetDiff(const CTGitPath& path1, GitRev rev1, const CTGitPath& path2, GitRev rev2, svn_depth_t depth, bool ignoreancestry);
60 // void SetDiff(const CTGitPath& path, GitRev peg, GitRev rev1, GitRev rev2, svn_depth_t depth, bool ignoreancestry);
62 void SetDiff(CTGitPath
* path
, GitRev rev1
,GitRev rev2
);
63 void SetDiff(CTGitPath
* path
, GitRev rev1
);
64 void SetDiff(CTGitPath
* path
, CString
&hash1
, CString
&hash2
);
66 void DoBlame(bool blame
= true) {m_bBlame
= blame
;}
68 enum { IDD
= IDD_DIFFFILES
};
71 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
72 virtual void OnCancel();
73 virtual BOOL
OnInitDialog();
74 virtual BOOL
PreTranslateMessage(MSG
* pMsg
);
75 afx_msg
void OnNMDblclkFilelist(NMHDR
*pNMHDR
, LRESULT
*pResult
);
76 afx_msg
void OnLvnGetInfoTipFilelist(NMHDR
*pNMHDR
, LRESULT
*pResult
);
77 afx_msg
void OnNMCustomdrawFilelist(NMHDR
*pNMHDR
, LRESULT
*pResult
);
78 afx_msg
void OnContextMenu(CWnd
* /*pWnd*/, CPoint
/*point*/);
79 afx_msg BOOL
OnSetCursor(CWnd
* pWnd
, UINT nHitTest
, UINT message
);
80 afx_msg
void OnEnSetfocusSecondurl();
81 afx_msg
void OnEnSetfocusFirsturl();
82 afx_msg
void OnBnClickedSwitchleftright();
83 afx_msg
void OnHdnItemclickFilelist(NMHDR
*pNMHDR
, LRESULT
*pResult
);
84 afx_msg
void OnBnClickedRev1btn();
85 afx_msg
void OnBnClickedRev2btn();
86 afx_msg LRESULT
OnClickedCancelFilter(WPARAM wParam
, LPARAM lParam
);
87 afx_msg
void OnEnChangeFilter();
88 afx_msg
void OnTimer(UINT_PTR nIDEvent
);
92 // virtual svn_error_t* DiffSummarizeCallback(const CTGitPath& path,
93 // svn_client_diff_summarize_kind_t kind,
95 // svn_node_kind_t node);
97 int AddEntry(const CTGitPath
* fd
);
98 void DoDiff(int selIndex
, bool blame
);
99 void DiffProps(int selIndex
);
101 void Filter(CString sFilterText
);
102 void CopySelectionToClipboard();
104 static UINT
DiffThreadEntry(LPVOID pVoid
);
106 static UINT
ExportThreadEntry(LPVOID pVoid
);
109 virtual BOOL
Cancel() {return m_bCancelled
;}
111 CToolTips m_tooltips
;
115 CFilterEdit m_cFilter
;
117 CXPImageButton m_SwitchButton
;
120 CHintListCtrl m_cFileList
;
123 CTGitPathList m_arFileList
;
124 std::vector
<CTGitPath
*> m_arFilteredList
;
125 CArray
<CTGitPath
*, CTGitPath
*> m_arSelectedFileList
;
127 CString m_strExportDir
;
128 CProgressDlg
* m_pProgDlg
;
138 bool m_bIgnoreancestry
;
140 volatile LONG m_bThreadRunning
;
145 // static bool SortCompare(const FileDiff& Data1, const FileDiff& Data2);
147 static BOOL m_bAscending
;
148 static int m_nSortedColumn
;