Show Push Dialog after close commit dialog
[TortoiseGit.git] / src / TortoiseProc / CommitDlg.h
bloba10f5fdc862ecd8c9e0be1f11af03b5e940ecc9b
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
21 #include "StandAloneDlg.h"
22 #include "GitStatusListCtrl.h"
23 #include "ProjectProperties.h"
24 #include "RegHistory.h"
25 #include "Registry.h"
26 #include "SciEdit.h"
27 #include "SplitterControl.h"
28 #include "PathWatcher.h"
29 #include "BugTraqAssociations.h"
30 #include "Tooltip.h"
31 #include "..\IBugTraqProvider\IBugTraqProvider_h.h"
32 #include "Git.h"
34 #include <regex>
35 using namespace std;
37 #define ENDDIALOGTIMER 100
38 #define REFRESHTIMER 101
41 /**
42 * \ingroup TortoiseProc
43 * Dialog to enter log messages used in a commit.
45 class CCommitDlg : public CResizableStandAloneDialog, public CSciEditContextMenuInterface
47 DECLARE_DYNAMIC(CCommitDlg)
49 public:
50 CCommitDlg(CWnd* pParent = NULL); // standard constructor
51 virtual ~CCommitDlg();
53 // CSciEditContextMenuInterface
54 virtual void InsertMenuItems(CMenu& mPopup, int& nCmd);
55 virtual bool HandleMenuItemClick(int cmd, CSciEdit * pSciEdit);
57 private:
58 static UINT StatusThreadEntry(LPVOID pVoid);
59 UINT StatusThread();
60 void UpdateOKButton();
62 // Dialog Data
63 enum { IDD = IDD_COMMITDLG };
65 protected:
66 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
68 virtual BOOL OnInitDialog();
69 virtual void OnOK();
70 virtual void OnCancel();
71 virtual BOOL PreTranslateMessage(MSG* pMsg);
72 virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
73 afx_msg void OnBnClickedSelectall();
74 afx_msg void OnBnClickedHelp();
75 afx_msg void OnBnClickedShowunversioned();
76 afx_msg void OnBnClickedHistory();
77 afx_msg void OnBnClickedBugtraqbutton();
78 afx_msg void OnEnChangeLogmessage();
79 afx_msg void OnStnClickedExternalwarning();
80 afx_msg LRESULT OnGitStatusListCtrlItemCountChanged(WPARAM, LPARAM);
81 afx_msg LRESULT OnGitStatusListCtrlNeedsRefresh(WPARAM, LPARAM);
82 afx_msg LRESULT OnGitStatusListCtrlCheckChanged(WPARAM, LPARAM);
83 afx_msg LRESULT OnAutoListReady(WPARAM, LPARAM);
84 afx_msg LRESULT OnFileDropped(WPARAM, LPARAM lParam);
85 afx_msg void OnTimer(UINT_PTR nIDEvent);
86 afx_msg void OnSize(UINT nType, int cx, int cy);
87 void Refresh();
88 void GetAutocompletionList();
89 void ScanFile(const CString& sFilePath, const CString& sRegex);
90 void DoSize(int delta);
91 void SetSplitterRange();
92 void SaveSplitterPos();
93 void ParseRegexFile(const CString& sFile, std::map<CString, CString>& mapRegex);
95 DECLARE_MESSAGE_MAP()
98 public:
99 CTGitPathList m_pathList;
100 CTGitPathList m_updatedPathList;
101 CTGitPathList m_selectedPathList;
102 CTGitPathList m_checkedPathList;
103 BOOL m_bRecursive;
104 CSciEdit m_cLogMessage;
105 CString m_sLogMessage;
106 BOOL m_bWholeProject;
107 CString m_sBugID;
108 CString m_sChangeList;
109 BOOL m_bKeepChangeList;
110 BOOL m_bCommitAmend;
111 INT_PTR m_itemsCount;
112 bool m_bSelectFilesForCommit;
113 CComPtr<IBugTraqProvider> m_BugTraqProvider;
114 CString m_NoAmendStr;
115 CString m_AmendStr;
117 BOOL m_bPushAfterCommit;
119 private:
120 CWinThread* m_pThread;
121 std::set<CString> m_autolist;
122 CGitStatusListCtrl m_ListCtrl;
123 BOOL m_bShowUnversioned;
124 volatile LONG m_bBlock;
125 volatile LONG m_bThreadRunning;
126 volatile LONG m_bRunThread;
127 CToolTips m_tooltips;
128 CRegDWORD m_regAddBeforeCommit;
129 CRegDWORD m_regKeepChangelists;
130 ProjectProperties m_ProjectProperties;
131 CButton m_SelectAll;
132 CString m_sWindowTitle;
133 static UINT WM_AUTOLISTREADY;
134 int m_nPopupPasteListCmd;
135 int m_nPopupPasteLastMessage;
136 CRegHistory m_History;
137 bool m_bCancelled;
138 CSplitterControl m_wndSplitter;
139 CRect m_DlgOrigRect;
140 CRect m_LogMsgOrigRect;
141 CPathWatcher m_pathwatcher;
143 CBugTraqAssociation m_bugtraq_association;
145 public:
146 afx_msg void OnBnClickedSignOff();
147 afx_msg void OnStnClickedCommitlabel();
148 afx_msg void OnBnClickedCommitAmend();
149 afx_msg void OnBnClickedWholeProject();
150 afx_msg void OnStnClickedBugidlabel();