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"
33 #define IDT_FILTER 101
36 * \ingroup TortoiseProc
37 * Dialog which fetches and shows the difference between two urls in the
38 * repository. It shows a list of files/folders which were changed in those
41 class CFileDiffDlg
: public CResizableStandAloneDialog
43 DECLARE_DYNAMIC(CFileDiffDlg
)
49 // svn_client_diff_summarize_kind_t kind;
51 // svn_node_kind_t node;
55 CFileDiffDlg(CWnd
* pParent
= NULL
);
56 virtual ~CFileDiffDlg();
58 // void SetDiff(const CTGitPath& path1, GitRev rev1, const CTGitPath& path2, GitRev rev2, svn_depth_t depth, bool ignoreancestry);
59 // void SetDiff(const CTGitPath& path, GitRev peg, GitRev rev1, GitRev rev2, svn_depth_t depth, bool ignoreancestry);
61 void SetDiff(CTGitPath
* path
, GitRev rev1
,GitRev rev2
);
62 void SetDiff(CTGitPath
* path
, GitRev rev1
);
63 void SetDiff(CTGitPath
* path
, CString
&hash1
, CString
&hash2
);
65 void DoBlame(bool blame
= true) {m_bBlame
= blame
;}
67 enum { IDD
= IDD_DIFFFILES
};
70 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
71 virtual void OnCancel();
72 virtual BOOL
OnInitDialog();
73 virtual BOOL
PreTranslateMessage(MSG
* pMsg
);
74 afx_msg
void OnNMDblclkFilelist(NMHDR
*pNMHDR
, LRESULT
*pResult
);
75 afx_msg
void OnLvnGetInfoTipFilelist(NMHDR
*pNMHDR
, LRESULT
*pResult
);
76 afx_msg
void OnNMCustomdrawFilelist(NMHDR
*pNMHDR
, LRESULT
*pResult
);
77 afx_msg
void OnContextMenu(CWnd
* /*pWnd*/, CPoint
/*point*/);
78 afx_msg BOOL
OnSetCursor(CWnd
* pWnd
, UINT nHitTest
, UINT message
);
79 afx_msg
void OnEnSetfocusSecondurl();
80 afx_msg
void OnEnSetfocusFirsturl();
81 afx_msg
void OnBnClickedSwitchleftright();
82 afx_msg
void OnHdnItemclickFilelist(NMHDR
*pNMHDR
, LRESULT
*pResult
);
83 afx_msg
void OnBnClickedRev1btn();
84 afx_msg
void OnBnClickedRev2btn();
85 afx_msg LRESULT
OnClickedCancelFilter(WPARAM wParam
, LPARAM lParam
);
86 afx_msg
void OnEnChangeFilter();
87 afx_msg
void OnTimer(UINT_PTR nIDEvent
);
91 // virtual svn_error_t* DiffSummarizeCallback(const CTGitPath& path,
92 // svn_client_diff_summarize_kind_t kind,
94 // svn_node_kind_t node);
96 int AddEntry(const CTGitPath
* fd
);
97 void DoDiff(int selIndex
, bool blame
);
98 void DiffProps(int selIndex
);
100 void Filter(CString sFilterText
);
101 void CopySelectionToClipboard();
103 static UINT
DiffThreadEntry(LPVOID pVoid
);
105 static UINT
ExportThreadEntry(LPVOID pVoid
);
108 virtual BOOL
Cancel() {return m_bCancelled
;}
110 CToolTips m_tooltips
;
114 CFilterEdit m_cFilter
;
116 CXPImageButton m_SwitchButton
;
119 CHintListCtrl m_cFileList
;
122 CTGitPathList m_arFileList
;
123 std::vector
<CTGitPath
*> m_arFilteredList
;
124 CArray
<CTGitPath
*, CTGitPath
*> m_arSelectedFileList
;
126 CString m_strExportDir
;
127 CProgressDlg
* m_pProgDlg
;
137 bool m_bIgnoreancestry
;
139 volatile LONG m_bThreadRunning
;
144 // static bool SortCompare(const FileDiff& Data1, const FileDiff& Data2);
146 static BOOL m_bAscending
;
147 static int m_nSortedColumn
;