Re-integrate the GPG signed commit into the unit tests
[TortoiseGit.git] / src / TortoiseProc / CommitIsOnRefsDlg.h
blob0873c6c6233f2931a15c6151ac5afde7a9e25749
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.
20 #pragma once
21 #include "StandAloneDlg.h"
22 #include "registry.h"
23 #include "GitRev.h"
24 #include "ACEdit.h"
25 #include "MenuButton.h"
26 #include "FilterEdit.h"
27 #include "HintCtrl.h"
29 // CCommitIsOnRefsDlg dialog
31 #define IDT_FILTER 101
32 #define IDT_INPUT 102
34 class CCommitIsOnRefsDlg : public CResizableStandAloneDialog
36 DECLARE_DYNAMIC(CCommitIsOnRefsDlg)
38 public:
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(); }
43 // Dialog Data
44 enum { IDD = IDD_COMMITISONREFS };
46 enum eCmd
48 eCmd_ViewLog = WM_APP,
49 eCmd_Diff,
50 eCmd_RepoBrowser,
51 eCmd_ViewLogRange,
52 eCmd_ViewLogRangeReachableFromOnlyOne,
53 eCmd_UnifiedDiff,
54 eCmd_Copy,
55 eCmd_DiffWC,
58 protected:
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);
76 DECLARE_MESSAGE_MAP()
78 STRING_VECTOR m_RefList;
80 static CString GetTwoSelectedRefs(const STRING_VECTOR& selectedRefs, const CString& lastSelected, const CString& separator);
81 void AddToList();
82 void CopySelectionToClipboard();
83 int FillRevFromString(const CString& str)
85 GitRev gitrev;
86 if (gitrev.GetCommit(str))
88 MessageBox(gitrev.GetLastErr(), L"TortoiseGit", MB_ICONERROR);
89 return -1;
91 m_gitrev = gitrev;
92 return 0;
94 GitRev m_gitrev;
96 public:
97 CString m_Rev;
99 private:
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;
107 bool m_bRefsLoaded;
108 CString m_sLastSelected;
109 CHintCtrl<CListCtrl> m_cRefList;
110 CACEdit m_cRevEdit;
111 CMenuButton m_cSelRevBtn;
112 CFilterEdit m_cFilter;
113 bool m_bHasWC;