Add bugtraq to support commit dialog bug track.
[TortoiseGit.git] / src / TortoiseProc / FileDiffDlg.h
blobe94a8b5c7a7e470dd20e8bec330927e2af9525a0
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.
19 #pragma once
20 #include "afxcmn.h"
21 #include "StandAloneDlg.h"
22 #include "Git.h"
23 #include "TGitPath.h"
24 //#include "Blame.h"
25 #include "Git.h"
26 #include "HintListCtrl.h"
27 #include "Colors.h"
28 #include "XPImageButton.h"
29 #include "FilterEdit.h"
30 #include "Tooltip.h"
33 #define IDT_FILTER 101
35 /**
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
39 * two revisions.
41 class CFileDiffDlg : public CResizableStandAloneDialog
43 DECLARE_DYNAMIC(CFileDiffDlg)
44 public:
45 // class FileDiff
46 // {
47 // public:
48 // CTGitPath path;
49 // svn_client_diff_summarize_kind_t kind;
50 bool propchanged;
51 // svn_node_kind_t node;
52 // };
54 public:
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 };
69 protected:
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);
89 DECLARE_MESSAGE_MAP()
91 // virtual svn_error_t* DiffSummarizeCallback(const CTGitPath& path,
92 // svn_client_diff_summarize_kind_t kind,
93 // bool propchanged,
94 // svn_node_kind_t node);
96 int AddEntry(const CTGitPath * fd);
97 void DoDiff(int selIndex, bool blame);
98 void DiffProps(int selIndex);
99 void SetURLLabels();
100 void Filter(CString sFilterText);
101 void CopySelectionToClipboard();
102 private:
103 static UINT DiffThreadEntry(LPVOID pVoid);
104 UINT DiffThread();
105 static UINT ExportThreadEntry(LPVOID pVoid);
106 UINT ExportThread();
108 virtual BOOL Cancel() {return m_bCancelled;}
110 CToolTips m_tooltips;
112 CButton m_cRev1Btn;
113 CButton m_cRev2Btn;
114 CFilterEdit m_cFilter;
116 CXPImageButton m_SwitchButton;
117 HICON m_hSwitchIcon;
118 CColors m_colors;
119 CHintListCtrl m_cFileList;
120 bool m_bBlame;
121 // CBlame m_blamer;
122 CTGitPathList m_arFileList;
123 std::vector<CTGitPath*> m_arFilteredList;
124 CArray<CTGitPath*, CTGitPath*> m_arSelectedFileList;
126 CString m_strExportDir;
127 CProgressDlg * m_pProgDlg;
129 int m_nIconFolder;
131 CTGitPath m_path1;
132 GitRev m_peg;
133 GitRev m_rev1;
134 CTGitPath m_path2;
135 GitRev m_rev2;
137 bool m_bIgnoreancestry;
138 bool m_bDoPegDiff;
139 volatile LONG m_bThreadRunning;
141 bool m_bCancelled;
143 void Sort();
144 // static bool SortCompare(const FileDiff& Data1, const FileDiff& Data2);
146 static BOOL m_bAscending;
147 static int m_nSortedColumn;