Centralize Open-With handling
[TortoiseGit.git] / src / TortoiseProc / GitProgressDlg.h
bloba5c004989047acd2da97b28b0396c5c3bedf7def
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2008-2014 - 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 "GitProgressList.h"
24 #include "MenuButton.h"
26 /**
27 * \ingroup TortoiseProc
28 * Handles different git commands and shows the notify messages
29 * in a listbox. Since several git commands have similar notify
30 * messages they are grouped together in this single class.
32 class CGitProgressDlg : public CResizableStandAloneDialog
34 public:
36 DECLARE_DYNAMIC(CGitProgressDlg)
38 public:
40 CGitProgressDlg(CWnd* pParent = NULL);
41 virtual ~CGitProgressDlg();
44 void SetCommand(ProgressCommand* cmd) { m_ProgList.SetCommand(cmd); }
45 void SetAutoClose(DWORD ac) {m_dwCloseOnEnd = ac;}
46 void SetOptions(DWORD opts) {m_ProgList.SetOptions(opts);}
48 /**
49 * If the number of items for which the operation is done on is known
50 * beforehand, that number can be set here. It is then used to show a more
51 * accurate progress bar during the operation.
53 void SetItemCount(long count) {if(count) m_ProgList.SetItemCountTotal(count);}
55 bool DidErrorsOccur() {return m_ProgList.m_bErrorsOccurred;}
57 enum { IDD = IDD_SVNPROGRESS };
60 protected:
62 virtual BOOL OnInitDialog();
63 virtual void OnCancel();
64 virtual BOOL PreTranslateMessage(MSG* pMsg);
65 virtual void DoDataExchange(CDataExchange* pDX);
67 afx_msg void OnBnClickedLogbutton();
68 afx_msg void OnBnClickedOk();
69 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
70 afx_msg void OnClose();
71 afx_msg void OnEnSetfocusInfotext();
72 afx_msg LRESULT OnCtlColorStatic(WPARAM wParam, LPARAM lParam);
73 afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
74 afx_msg LRESULT OnTaskbarBtnCreated(WPARAM wParam, LPARAM lParam);
75 LRESULT OnCmdEnd(WPARAM wParam, LPARAM lParam);
76 LRESULT OnCmdStart(WPARAM wParam, LPARAM lParam);
78 DECLARE_MESSAGE_MAP()
80 private:
81 virtual void OnOK();
83 CAnimateCtrl m_Animate;
84 CProgressCtrl m_ProgCtrl;
85 CGitProgressList m_ProgList;
86 CEdit m_InfoCtrl;
87 CStatic m_ProgLableCtrl;
88 CMenuButton m_cMenuButton;
89 PostCmdList m_PostCmdList;
91 CBrush m_background_brush;
92 DWORD m_dwCloseOnEnd;