Make sounds for indicating a warning or error work
[TortoiseGit.git] / src / TortoiseProc / GitProgressDlg.h
blob532d69cf8ed0bd862c7078a515152227c39b6230
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 "ProjectProperties.h"
25 #include "Git.h"
26 #include "GitStatus.h"
27 #include "Colors.h"
28 //#include "..\IBugTraqProvider\IBugTraqProvider_h.h"
29 #include "afxwin.h"
30 #include "Win7.h"
31 #include "UnicodeUtils.h"
32 #include "GitProgressList.h"
34 typedef int (__cdecl *GENERICCOMPAREFN)(const void * elem1, const void * elem2);
36 /**
37 * \ingroup TortoiseProc
38 * Handles different Subversion commands and shows the notify messages
39 * in a listbox. Since several Subversion commands have similar notify
40 * messages they are grouped together in this single class.
42 class CGitProgressDlg : public CResizableStandAloneDialog
44 public:
46 DECLARE_DYNAMIC(CGitProgressDlg)
48 public:
50 CGitProgressDlg(CWnd* pParent = NULL);
51 virtual ~CGitProgressDlg();
54 void SetCommand(CGitProgressList::Command cmd) {m_ProgList.SetCommand(cmd);}
55 void SetAutoClose(DWORD ac) {m_dwCloseOnEnd = ac;}
56 void SetOptions(DWORD opts) {m_ProgList.SetOptions(opts);}
57 void SetPathList(const CTGitPathList& pathList) {m_ProgList.SetPathList(pathList);}
58 void SetUrl(const CString& url) {m_ProgList.SetUrl(url);}
59 void SetSecondUrl(const CString& url) {m_ProgList.SetSecondUrl(url);}
60 void SetCommitMessage(const CString& msg) {m_ProgList.SetCommitMessage(msg);}
61 void SetIsBare(bool b) { m_ProgList.SetIsBare(b); }
62 void SetNoCheckout(bool b){ m_ProgList.SetNoCheckout(b); }
63 void SetRefSpec(CString spec){ m_ProgList.SetRefSpec(spec); }
64 void SetAutoTag(int tag){ m_ProgList.SetAutoTag(tag); }
66 // void SetRevision(const GitRev& rev) {m_Revision = rev;}
67 // void SetRevisionEnd(const GitRev& rev) {m_RevisionEnd = rev;}
69 void SetDiffOptions(const CString& opts) {m_ProgList.SetDiffOptions(opts);}
70 void SetSendMailOption(CSendMail *sendmail) { m_ProgList.SetSendMailOption(sendmail); }
71 void SetDepth(git_depth_t depth = git_depth_unknown) {m_ProgList.SetDepth(depth);}
72 void SetPegRevision(GitRev pegrev = GitRev()) {m_ProgList.SetPegRevision(pegrev);}
73 void SetProjectProperties(ProjectProperties props) {m_ProgList.SetProjectProperties(props);}
74 void SetChangeList(const CString& changelist, bool keepchangelist) {m_ProgList.SetChangeList(changelist, keepchangelist);}
75 void SetSelectedList(const CTGitPathList& selPaths) {m_ProgList.SetSelectedList(selPaths);};
76 // void SetRevisionRanges(const GitRevRangeArray& revArray) {m_revisionArray = revArray;}
77 // void SetBugTraqProvider(const CComPtr<IBugTraqProvider> pBugtraqProvider) { m_BugTraqProvider = pBugtraqProvider;}
78 /**
79 * If the number of items for which the operation is done on is known
80 * beforehand, that number can be set here. It is then used to show a more
81 * accurate progress bar during the operation.
83 void SetItemCount(long count) {if(count) m_ProgList.SetItemCountTotal(count);}
85 bool DidErrorsOccur() {return m_ProgList.m_bErrorsOccurred;}
87 enum { IDD = IDD_SVNPROGRESS };
90 protected:
92 virtual BOOL OnInitDialog();
93 virtual void OnCancel();
94 virtual BOOL PreTranslateMessage(MSG* pMsg);
95 virtual void DoDataExchange(CDataExchange* pDX);
97 afx_msg void OnBnClickedLogbutton();
98 afx_msg void OnBnClickedOk();
99 afx_msg void OnBnClickedNoninteractive();
100 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
101 afx_msg void OnClose();
102 afx_msg void OnEnSetfocusInfotext();
103 afx_msg LRESULT OnCtlColorStatic(WPARAM wParam, LPARAM lParam);
104 afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
105 afx_msg LRESULT OnTaskbarBtnCreated(WPARAM wParam, LPARAM lParam);
106 LRESULT OnCmdEnd(WPARAM wParam, LPARAM lParam);
107 LRESULT OnCmdStart(WPARAM wParam, LPARAM lParam);
109 DECLARE_MESSAGE_MAP()
111 private:
112 virtual void OnOK();
114 CAnimateCtrl m_Animate;
115 CProgressCtrl m_ProgCtrl;
116 CGitProgressList m_ProgList;
117 CEdit m_InfoCtrl;
118 CStatic m_ProgLableCtrl;
120 CBrush m_background_brush;
121 DWORD m_dwCloseOnEnd;