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"
28 #include "GestureEnabledControl.h"
30 // CCommitIsOnRefsDlg dialog
32 #define IDT_FILTER 101
35 class CCommitIsOnRefsDlg
: public CResizableStandAloneDialog
37 DECLARE_DYNAMIC(CCommitIsOnRefsDlg
)
40 CCommitIsOnRefsDlg(CWnd
* pParent
= nullptr); // standard constructor
41 virtual ~CCommitIsOnRefsDlg();
42 void Create(CWnd
* pParent
= nullptr) { m_bNonModalParentHWND
= pParent
->GetSafeHwnd(); CDialog::Create(IDD
, pParent
); ShowWindow(SW_SHOW
); UpdateWindow(); }
45 enum { IDD
= IDD_COMMITISONREFS
};
49 eCmd_ViewLog
= WM_APP
,
53 eCmd_ViewLogRangeReachableFromOnlyOne
,
60 virtual void DoDataExchange(CDataExchange
* pDX
) override
; // DDX/DDV support
61 virtual void OnCancel() override
;
62 virtual BOOL
OnInitDialog() override
;
63 virtual BOOL
PreTranslateMessage(MSG
* pMsg
) override
;
64 virtual void PostNcDestroy() override
;
65 afx_msg
void OnEnChangeEditFilter();
66 afx_msg LRESULT
OnClickedCancelFilter(WPARAM wParam
, LPARAM lParam
);
67 afx_msg
void OnBnClickedSelRevBtn();
68 afx_msg
void OnBnClickedShowLog();
69 afx_msg
void OnTimer(UINT_PTR nIDEvent
);
70 afx_msg LRESULT
OnEnChangeCommit(WPARAM wParam
, LPARAM lParam
);
71 afx_msg
void OnItemChangedListRefs(NMHDR
* pNMHDR
, LRESULT
* pResult
);
72 afx_msg
void OnNMDblClickListRefs(NMHDR
* pNMHDR
, LRESULT
* pResult
);
73 afx_msg
void OnContextMenu(CWnd
* pWnd
, CPoint point
);
74 afx_msg BOOL
OnSetCursor(CWnd
* pWnd
, UINT nHitTest
, UINT message
);
75 afx_msg LRESULT
OnGettingRefsFinished(WPARAM
, LPARAM
);
79 STRING_VECTOR m_RefList
;
81 static CString
GetTwoSelectedRefs(const STRING_VECTOR
& selectedRefs
, const CString
& lastSelected
, const CString
& separator
);
83 void CopySelectionToClipboard();
84 int FillRevFromString(const CString
& str
)
87 if (gitrev
.GetCommit(str
))
89 MessageBox(gitrev
.GetLastErr(), L
"TortoiseGit", MB_ICONERROR
);
101 HWND m_bNonModalParentHWND
;
102 static UINT WM_GETTINGREFSFINISHED
;
103 void StartGetRefsThread();
104 static UINT
GetRefsThreadEntry(LPVOID pVoid
);
105 UINT
GetRefsThread();
107 volatile LONG m_bThreadRunning
;
109 CString m_sLastSelected
;
110 CGestureEnabledControlTmpl
<CHintCtrl
<CListCtrl
>> m_cRefList
;
112 CMenuButton m_cSelRevBtn
;
113 CFilterEdit m_cFilter
;