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.
21 #include "StandAloneDlg.h"
22 #include "GitStatusListCtrl.h"
23 #include "ProjectProperties.h"
24 #include "RegHistory.h"
27 #include "SplitterControl.h"
28 #include "PathWatcher.h"
29 #include "BugTraqAssociations.h"
31 #include "..\IBugTraqProvider\IBugTraqProvider_h.h"
37 #define ENDDIALOGTIMER 100
38 #define REFRESHTIMER 101
42 * \ingroup TortoiseProc
43 * Dialog to enter log messages used in a commit.
45 class CCommitDlg
: public CResizableStandAloneDialog
, public CSciEditContextMenuInterface
47 DECLARE_DYNAMIC(CCommitDlg
)
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
);
58 static UINT
StatusThreadEntry(LPVOID pVoid
);
60 void UpdateOKButton();
63 enum { IDD
= IDD_COMMITDLG
};
66 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
68 virtual BOOL
OnInitDialog();
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
);
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
);
99 CTGitPathList m_pathList
;
100 CTGitPathList m_updatedPathList
;
101 CTGitPathList m_selectedPathList
;
102 CTGitPathList m_checkedPathList
;
104 CSciEdit m_cLogMessage
;
105 CString m_sLogMessage
;
106 BOOL m_bWholeProject
;
108 CString m_sChangeList
;
109 BOOL m_bKeepChangeList
;
111 INT_PTR m_itemsCount
;
112 bool m_bSelectFilesForCommit
;
113 CComPtr
<IBugTraqProvider
> m_BugTraqProvider
;
114 CString m_NoAmendStr
;
118 CWinThread
* m_pThread
;
119 std::set
<CString
> m_autolist
;
120 CGitStatusListCtrl m_ListCtrl
;
121 BOOL m_bShowUnversioned
;
122 volatile LONG m_bBlock
;
123 volatile LONG m_bThreadRunning
;
124 volatile LONG m_bRunThread
;
125 CToolTips m_tooltips
;
126 CRegDWORD m_regAddBeforeCommit
;
127 CRegDWORD m_regKeepChangelists
;
128 ProjectProperties m_ProjectProperties
;
130 CString m_sWindowTitle
;
131 static UINT WM_AUTOLISTREADY
;
132 int m_nPopupPasteListCmd
;
133 int m_nPopupPasteLastMessage
;
134 CRegHistory m_History
;
136 CSplitterControl m_wndSplitter
;
138 CRect m_LogMsgOrigRect
;
139 CPathWatcher m_pathwatcher
;
141 CBugTraqAssociation m_bugtraq_association
;
144 afx_msg
void OnBnClickedSignOff();
145 afx_msg
void OnStnClickedCommitlabel();
146 afx_msg
void OnBnClickedCommitAmend();
147 afx_msg
void OnBnClickedWholeProject();
148 afx_msg
void OnStnClickedBugidlabel();