1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2016-2017 - 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"
25 #include "MenuButton.h"
26 #include "FilterEdit.h"
29 // CCommitIsOnRefsDlg dialog
31 #define IDT_FILTER 101
34 class CCommitIsOnRefsDlg
: public CResizableStandAloneDialog
36 DECLARE_DYNAMIC(CCommitIsOnRefsDlg
)
39 CCommitIsOnRefsDlg(CWnd
* pParent
= nullptr); // standard constructor
40 virtual ~CCommitIsOnRefsDlg();
41 void Create(CWnd
* pParent
= nullptr) { m_bNonModalParentHWND
= pParent
->GetSafeHwnd(); CDialog::Create(IDD
, pParent
); ShowWindow(SW_SHOW
); UpdateWindow(); }
44 enum { IDD
= IDD_COMMITISONREFS
};
48 eCmd_ViewLog
= WM_APP
,
52 eCmd_ViewLogRangeReachableFromOnlyOne
,
59 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
60 virtual void OnCancel();
61 virtual BOOL
OnInitDialog();
62 virtual BOOL
PreTranslateMessage(MSG
* pMsg
);
63 virtual void PostNcDestroy();
64 afx_msg
void OnEnChangeEditFilter();
65 afx_msg LRESULT
OnClickedCancelFilter(WPARAM wParam
, LPARAM lParam
);
66 afx_msg
void OnBnClickedSelRevBtn();
67 afx_msg
void OnBnClickedShowLog();
68 afx_msg
void OnTimer(UINT_PTR nIDEvent
);
69 afx_msg LRESULT
OnEnChangeCommit(WPARAM wParam
, LPARAM lParam
);
70 afx_msg
void OnItemChangedListRefs(NMHDR
* pNMHDR
, LRESULT
* pResult
);
71 afx_msg
void OnNMDblClickListRefs(NMHDR
* pNMHDR
, LRESULT
* pResult
);
72 afx_msg
void OnContextMenu(CWnd
* pWnd
, CPoint point
);
73 afx_msg BOOL
OnSetCursor(CWnd
* pWnd
, UINT nHitTest
, UINT message
);
74 afx_msg LRESULT
OnGettingRefsFinished(WPARAM
, LPARAM
);
78 STRING_VECTOR m_RefList
;
80 static CString
GetTwoSelectedRefs(const STRING_VECTOR
& selectedRefs
, const CString
& lastSelected
, const CString
& separator
);
82 void CopySelectionToClipboard();
83 int FillRevFromString(const CString
& str
)
86 if (gitrev
.GetCommit(str
))
88 MessageBox(gitrev
.GetLastErr(), L
"TortoiseGit", MB_ICONERROR
);
100 HWND m_bNonModalParentHWND
;
101 static UINT WM_GETTINGREFSFINISHED
;
102 void StartGetRefsThread();
103 static UINT
GetRefsThreadEntry(LPVOID pVoid
);
104 UINT
GetRefsThread();
106 volatile LONG m_bThreadRunning
;
108 CString m_sLastSelected
;
109 CHintCtrl
<CListCtrl
> m_cRefList
;
111 CMenuButton m_cSelRevBtn
;
112 CFilterEdit m_cFilter
;