Add support for "project" config level
[TortoiseGit.git] / src / TortoiseProc / GitProgressDlg.h
blob47cf52f8bd43a5f62e25487f28ca509cb2b5923d
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2008-2013 - TortoiseGit
4 // Copyright (C) 2003-2008 - TortoiseSVN
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 "TGitPath.h"
24 #include "GitProgressList.h"
26 typedef int (__cdecl *GENERICCOMPAREFN)(const void * elem1, const void * elem2);
28 /**
29 * \ingroup TortoiseProc
30 * Handles different Subversion commands and shows the notify messages
31 * in a listbox. Since several Subversion commands have similar notify
32 * messages they are grouped together in this single class.
34 class CGitProgressDlg : public CResizableStandAloneDialog
36 public:
38 DECLARE_DYNAMIC(CGitProgressDlg)
40 public:
42 CGitProgressDlg(CWnd* pParent = NULL);
43 virtual ~CGitProgressDlg();
46 void SetCommand(CGitProgressList::Command cmd) {m_ProgList.SetCommand(cmd);}
47 void SetAutoClose(DWORD ac) {m_dwCloseOnEnd = ac;}
48 void SetOptions(DWORD opts) {m_ProgList.SetOptions(opts);}
49 void SetPathList(const CTGitPathList& pathList) {m_ProgList.SetPathList(pathList);}
50 void SetUrl(const CString& url) {m_ProgList.SetUrl(url);}
51 void SetSecondUrl(const CString& url) {m_ProgList.SetSecondUrl(url);}
52 void SetCommitMessage(const CString& msg) {m_ProgList.SetCommitMessage(msg);}
53 void SetIsBare(bool b) { m_ProgList.SetIsBare(b); }
54 void SetNoCheckout(bool b){ m_ProgList.SetNoCheckout(b); }
55 void SetRefSpec(CString spec){ m_ProgList.SetRefSpec(spec); }
56 void SetRemote(const CString& remote) { m_ProgList.SetRemote(remote); }
57 void SetAutoTag(int tag){ m_ProgList.SetAutoTag(tag); }
58 void SetRevision(CString revision){ m_ProgList.SetRevision(revision); }
59 void SetResetType(int resetType){ m_ProgList.SetResetType(resetType); }
61 // void SetRevision(const GitRev& rev) {m_Revision = rev;}
62 // void SetRevisionEnd(const GitRev& rev) {m_RevisionEnd = rev;}
64 void SetDiffOptions(const CString& opts) {m_ProgList.SetDiffOptions(opts);}
65 void SetSendMailOption(CSendMail *sendmail) { m_ProgList.SetSendMailOption(sendmail); }
66 void SetPegRevision(GitRev pegrev = GitRev()) {m_ProgList.SetPegRevision(pegrev);}
67 void SetProjectProperties(ProjectProperties props) {m_ProgList.SetProjectProperties(props);}
68 void SetChangeList(const CString& changelist, bool keepchangelist) {m_ProgList.SetChangeList(changelist, keepchangelist);}
69 void SetSelectedList(const CTGitPathList& selPaths) {m_ProgList.SetSelectedList(selPaths);};
70 // void SetRevisionRanges(const GitRevRangeArray& revArray) {m_revisionArray = revArray;}
71 // void SetBugTraqProvider(const CComPtr<IBugTraqProvider> pBugtraqProvider) { m_BugTraqProvider = pBugtraqProvider;}
72 /**
73 * If the number of items for which the operation is done on is known
74 * beforehand, that number can be set here. It is then used to show a more
75 * accurate progress bar during the operation.
77 void SetItemCount(long count) {if(count) m_ProgList.SetItemCountTotal(count);}
79 bool DidErrorsOccur() {return m_ProgList.m_bErrorsOccurred;}
81 enum { IDD = IDD_SVNPROGRESS };
84 protected:
86 virtual BOOL OnInitDialog();
87 virtual void OnCancel();
88 virtual BOOL PreTranslateMessage(MSG* pMsg);
89 virtual void DoDataExchange(CDataExchange* pDX);
91 afx_msg void OnBnClickedLogbutton();
92 afx_msg void OnBnClickedOk();
93 afx_msg void OnBnClickedNoninteractive();
94 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
95 afx_msg void OnClose();
96 afx_msg void OnEnSetfocusInfotext();
97 afx_msg LRESULT OnCtlColorStatic(WPARAM wParam, LPARAM lParam);
98 afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
99 afx_msg LRESULT OnTaskbarBtnCreated(WPARAM wParam, LPARAM lParam);
100 LRESULT OnCmdEnd(WPARAM wParam, LPARAM lParam);
101 LRESULT OnCmdStart(WPARAM wParam, LPARAM lParam);
103 DECLARE_MESSAGE_MAP()
105 private:
106 virtual void OnOK();
108 CAnimateCtrl m_Animate;
109 CProgressCtrl m_ProgCtrl;
110 CGitProgressList m_ProgList;
111 CEdit m_InfoCtrl;
112 CStatic m_ProgLableCtrl;
114 CBrush m_background_brush;
115 DWORD m_dwCloseOnEnd;