dropped unused TSVN settings
[TortoiseGit.git] / src / TortoiseProc / CommitDlg.h
blob6d9a81477c90e617ec1597d2f29f61943f5778f9
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2003-2008 - TortoiseSVN
4 // Copyright (C) 2008-2011 - TortoiseGit
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #pragma once
22 #include "StandAloneDlg.h"
23 #include "GitStatusListCtrl.h"
24 #include "ProjectProperties.h"
25 #include "RegHistory.h"
26 #include "Registry.h"
27 #include "SciEdit.h"
28 #include "SplitterControl.h"
29 #include "PathWatcher.h"
30 #include "BugTraqAssociations.h"
31 #include "Tooltip.h"
32 #include "..\IBugTraqProvider\IBugTraqProvider_h.h"
33 #include "Git.h"
34 #include "HyperLink.h"
35 #include "PatchViewDlg.h"
37 #include <regex>
38 using namespace std;
40 #define ENDDIALOGTIMER 100
41 #define REFRESHTIMER 101
43 /**
44 * \ingroup TortoiseProc
45 * Dialog to enter log messages used in a commit.
47 class CCommitDlg : public CResizableStandAloneDialog, public CSciEditContextMenuInterface
49 DECLARE_DYNAMIC(CCommitDlg)
51 public:
52 CCommitDlg(CWnd* pParent = NULL); // standard constructor
53 virtual ~CCommitDlg();
55 protected:
56 // CSciEditContextMenuInterface
57 virtual void InsertMenuItems(CMenu& mPopup, int& nCmd);
58 virtual bool HandleMenuItemClick(int cmd, CSciEdit * pSciEdit);
60 public:
61 void ShowViewPatchText(bool b=true)
63 if(b)
64 this->m_ctrlShowPatch.SetWindowText(_T("View Patch>>"));
65 else
66 this->m_ctrlShowPatch.SetWindowText(_T("Hide Patch<<"));
68 m_ctrlShowPatch.Invalidate();
70 private:
71 static UINT StatusThreadEntry(LPVOID pVoid);
72 UINT StatusThread();
73 void UpdateOKButton();
74 void FillPatchView();
75 void SetDlgTitle();
76 CString GetSignedOffByLine();
77 CString m_sTitle;
79 // Dialog Data
80 enum { IDD = IDD_COMMITDLG };
82 protected:
83 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
85 virtual BOOL OnInitDialog();
86 virtual void OnOK();
87 virtual void OnCancel();
88 virtual BOOL PreTranslateMessage(MSG* pMsg);
89 virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
90 afx_msg void OnBnClickedSelectall();
91 afx_msg void OnBnClickedHelp();
92 afx_msg void OnBnClickedShowunversioned();
93 afx_msg void OnBnClickedHistory();
94 afx_msg void OnBnClickedBugtraqbutton();
95 afx_msg void OnEnChangeLogmessage();
96 afx_msg void OnStnClickedExternalwarning();
97 afx_msg void OnFocusMessage();
98 afx_msg LRESULT OnGitStatusListCtrlItemCountChanged(WPARAM, LPARAM);
99 afx_msg LRESULT OnGitStatusListCtrlNeedsRefresh(WPARAM, LPARAM);
100 afx_msg LRESULT OnGitStatusListCtrlCheckChanged(WPARAM, LPARAM);
101 afx_msg LRESULT OnGitStatusListCtrlItemChanged(WPARAM, LPARAM);
103 afx_msg LRESULT OnAutoListReady(WPARAM, LPARAM);
104 afx_msg LRESULT OnFileDropped(WPARAM, LPARAM lParam);
105 afx_msg void OnTimer(UINT_PTR nIDEvent);
106 afx_msg void OnSize(UINT nType, int cx, int cy);
107 void Refresh();
108 void GetAutocompletionList();
109 void ScanFile(const CString& sFilePath, const CString& sRegex);
110 void DoSize(int delta);
111 void SetSplitterRange();
112 void SaveSplitterPos();
113 void ParseRegexFile(const CString& sFile, std::map<CString, CString>& mapRegex);
115 DECLARE_MESSAGE_MAP()
117 public:
118 CString m_sLogMessage;
119 BOOL m_bKeepChangeList;
120 BOOL m_bDoNotAutoselectSubmodules;
121 BOOL m_bCommitAmend;
122 BOOL m_bNoPostActions;
123 bool m_bSelectFilesForCommit;
124 bool m_bAutoClose;
125 CString m_AmendStr;
126 CString m_sBugID;
127 BOOL m_bWholeProject;
128 CTGitPathList m_pathList;
129 CTGitPathList m_checkedPathList;
130 CTGitPathList m_updatedPathList;
131 int m_PostCmd;
132 BOOL m_bPushAfterCommit;
133 BOOL m_bAmendDiffToLastCommit;
135 protected:
136 CTGitPathList m_selectedPathList;
137 BOOL m_bRecursive;
138 CSciEdit m_cLogMessage;
139 CString m_sChangeList;
140 INT_PTR m_itemsCount;
141 CComPtr<IBugTraqProvider> m_BugTraqProvider;
142 CString m_NoAmendStr;
144 int CheckHeadDetach();
146 private:
147 CWinThread* m_pThread;
148 std::set<CString> m_autolist;
149 CGitStatusListCtrl m_ListCtrl;
150 BOOL m_bShowUnversioned;
151 volatile LONG m_bBlock;
152 volatile LONG m_bThreadRunning;
153 volatile LONG m_bRunThread;
154 CToolTips m_tooltips;
155 CRegDWORD m_regAddBeforeCommit;
156 CRegDWORD m_regKeepChangelists;
157 CRegDWORD m_regDoNotAutoselectSubmodules;
158 ProjectProperties m_ProjectProperties;
159 CButton m_SelectAll;
160 CString m_sWindowTitle;
161 static UINT WM_AUTOLISTREADY;
162 int m_nPopupPasteListCmd;
163 int m_nPopupPasteLastMessage;
164 int m_nPopupRecentMessage;
165 CRegHistory m_History;
166 bool m_bCancelled;
167 CSplitterControl m_wndSplitter;
168 CRect m_DlgOrigRect;
169 CRect m_LogMsgOrigRect;
170 CPathWatcher m_pathwatcher;
171 CHyperLink m_ctrlShowPatch;
172 CPatchViewDlg m_patchViewdlg;
173 BOOL m_bSetCommitDateTime;
174 CDateTimeCtrl m_CommitDate;
175 CDateTimeCtrl m_CommitTime;
177 CBugTraqAssociation m_bugtraq_association;
178 HACCEL m_hAccel;
180 protected:
181 afx_msg void OnBnClickedSignOff();
182 afx_msg void OnBnClickedCommitAmend();
183 afx_msg void OnBnClickedWholeProject();
184 afx_msg void OnScnUpdateUI(NMHDR *pNMHDR, LRESULT *pResult);
185 afx_msg void OnStnClickedViewPatch();
186 afx_msg void OnMoving(UINT fwSide, LPRECT pRect);
187 afx_msg void OnSizing(UINT fwSide, LPRECT pRect);
188 afx_msg void OnHdnItemchangedFilelist(NMHDR *pNMHDR, LRESULT *pResult);
189 afx_msg void OnBnClickedCommitAmenddiff();
190 afx_msg void OnBnClickedNoautoselectsubmodules();
191 afx_msg void OnBnClickedCommitSetDateTime();