1 // TortoiseGit - a Windows shell extension for easy version control
\r
3 // Copyright (C) 2003-2008 - TortoiseGit
\r
5 // This program is free software; you can redistribute it and/or
\r
6 // modify it under the terms of the GNU General Public License
\r
7 // as published by the Free Software Foundation; either version 2
\r
8 // of the License, or (at your option) any later version.
\r
10 // This program is distributed in the hope that it will be useful,
\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 // GNU General Public License for more details.
\r
15 // You should have received a copy of the GNU General Public License
\r
16 // along with this program; if not, write to the Free Software Foundation,
\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
21 #include "StandAloneDlg.h"
\r
22 #include "GitStatusListCtrl.h"
\r
23 #include "ProjectProperties.h"
\r
24 #include "RegHistory.h"
\r
25 #include "Registry.h"
\r
26 #include "SciEdit.h"
\r
27 #include "SplitterControl.h"
\r
28 #include "PathWatcher.h"
\r
29 #include "BugTraqAssociations.h"
\r
30 #include "Tooltip.h"
\r
31 #include "..\IBugTraqProvider\IBugTraqProvider_h.h"
\r
35 using namespace std;
\r
37 #define ENDDIALOGTIMER 100
\r
38 #define REFRESHTIMER 101
\r
42 * \ingroup TortoiseProc
\r
43 * Dialog to enter log messages used in a commit.
\r
45 class CCommitDlg : public CResizableStandAloneDialog, public CSciEditContextMenuInterface
\r
47 DECLARE_DYNAMIC(CCommitDlg)
\r
50 CCommitDlg(CWnd* pParent = NULL); // standard constructor
\r
51 virtual ~CCommitDlg();
\r
53 // CSciEditContextMenuInterface
\r
54 virtual void InsertMenuItems(CMenu& mPopup, int& nCmd);
\r
55 virtual bool HandleMenuItemClick(int cmd, CSciEdit * pSciEdit);
\r
58 static UINT StatusThreadEntry(LPVOID pVoid);
\r
59 UINT StatusThread();
\r
60 void UpdateOKButton();
\r
63 enum { IDD = IDD_COMMITDLG };
\r
66 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
\r
68 virtual BOOL OnInitDialog();
\r
69 virtual void OnOK();
\r
70 virtual void OnCancel();
\r
71 virtual BOOL PreTranslateMessage(MSG* pMsg);
\r
72 virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
\r
73 afx_msg void OnBnClickedSelectall();
\r
74 afx_msg void OnBnClickedHelp();
\r
75 afx_msg void OnBnClickedShowunversioned();
\r
76 afx_msg void OnBnClickedHistory();
\r
77 afx_msg void OnBnClickedBugtraqbutton();
\r
78 afx_msg void OnEnChangeLogmessage();
\r
79 afx_msg void OnStnClickedExternalwarning();
\r
80 afx_msg LRESULT OnGitStatusListCtrlItemCountChanged(WPARAM, LPARAM);
\r
81 afx_msg LRESULT OnGitStatusListCtrlNeedsRefresh(WPARAM, LPARAM);
\r
82 afx_msg LRESULT OnGitStatusListCtrlCheckChanged(WPARAM, LPARAM);
\r
83 afx_msg LRESULT OnAutoListReady(WPARAM, LPARAM);
\r
84 afx_msg LRESULT OnFileDropped(WPARAM, LPARAM lParam);
\r
85 afx_msg void OnTimer(UINT_PTR nIDEvent);
\r
86 afx_msg void OnSize(UINT nType, int cx, int cy);
\r
88 void GetAutocompletionList();
\r
89 void ScanFile(const CString& sFilePath, const CString& sRegex);
\r
90 void DoSize(int delta);
\r
91 void SetSplitterRange();
\r
92 void SaveSplitterPos();
\r
93 void ParseRegexFile(const CString& sFile, std::map<CString, CString>& mapRegex);
\r
95 DECLARE_MESSAGE_MAP()
\r
99 CTGitPathList m_pathList;
\r
100 CTGitPathList m_updatedPathList;
\r
101 CTGitPathList m_selectedPathList;
\r
102 CTGitPathList m_checkedPathList;
\r
104 CSciEdit m_cLogMessage;
\r
105 CString m_sLogMessage;
\r
106 BOOL m_bWholeProject;
\r
108 CString m_sChangeList;
\r
109 BOOL m_bKeepChangeList;
\r
110 BOOL m_bCommitAmend;
\r
111 INT_PTR m_itemsCount;
\r
112 bool m_bSelectFilesForCommit;
\r
113 CComPtr<IBugTraqProvider> m_BugTraqProvider;
\r
114 CString m_NoAmendStr;
\r
115 CString m_AmendStr;
\r
118 CWinThread* m_pThread;
\r
119 std::set<CString> m_autolist;
\r
120 CGitStatusListCtrl m_ListCtrl;
\r
121 BOOL m_bShowUnversioned;
\r
122 volatile LONG m_bBlock;
\r
123 volatile LONG m_bThreadRunning;
\r
124 volatile LONG m_bRunThread;
\r
125 CToolTips m_tooltips;
\r
126 CRegDWORD m_regAddBeforeCommit;
\r
127 CRegDWORD m_regKeepChangelists;
\r
128 ProjectProperties m_ProjectProperties;
\r
129 CButton m_SelectAll;
\r
130 CString m_sWindowTitle;
\r
131 static UINT WM_AUTOLISTREADY;
\r
132 int m_nPopupPasteListCmd;
\r
133 int m_nPopupPasteLastMessage;
\r
134 CRegHistory m_History;
\r
136 CSplitterControl m_wndSplitter;
\r
137 CRect m_DlgOrigRect;
\r
138 CRect m_LogMsgOrigRect;
\r
139 CPathWatcher m_pathwatcher;
\r
141 CBugTraqAssociation m_bugtraq_association;
\r
144 afx_msg void OnBnClickedSignOff();
\r
145 afx_msg void OnStnClickedCommitlabel();
\r
146 afx_msg void OnBnClickedCommitAmend();
\r
147 afx_msg void OnBnClickedWholeProject();
\r
148 afx_msg void OnStnClickedBugidlabel();
\r