Fetch+Rebase: Don't error out if no remote tracked branch is configured for current...
[TortoiseGit.git] / src / TortoiseProc / GitProgressDlg.h
blob932feb29a5d5127d955370a20ac09f4293068325
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2008-2016 - 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 = nullptr);
41 virtual ~CGitProgressDlg();
44 void SetCommand(ProgressCommand* cmd) { m_ProgList.SetCommand(cmd); }
45 void SetOptions(DWORD opts) {m_ProgList.SetOptions(opts);}
47 /**
48 * If the number of items for which the operation is done on is known
49 * beforehand, that number can be set here. It is then used to show a more
50 * accurate progress bar during the operation.
52 void SetItemCount(long count) {if(count) m_ProgList.SetItemCountTotal(count);}
54 bool DidErrorsOccur() {return m_ProgList.m_bErrorsOccurred;}
56 enum { IDD = IDD_SVNPROGRESS };
59 protected:
61 virtual BOOL OnInitDialog();
62 virtual void OnCancel();
63 virtual BOOL PreTranslateMessage(MSG* pMsg);
64 virtual void DoDataExchange(CDataExchange* pDX);
66 afx_msg void OnBnClickedLogbutton();
67 afx_msg void OnBnClickedOk();
68 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
69 afx_msg void OnClose();
70 afx_msg void OnEnSetfocusInfotext();
71 afx_msg LRESULT OnCtlColorStatic(WPARAM wParam, LPARAM lParam);
72 afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
73 afx_msg LRESULT OnTaskbarBtnCreated(WPARAM wParam, LPARAM lParam);
74 LRESULT OnCmdEnd(WPARAM wParam, LPARAM lParam);
75 LRESULT OnCmdStart(WPARAM wParam, LPARAM lParam);
77 DECLARE_MESSAGE_MAP()
79 private:
80 virtual void OnOK();
82 CAnimateCtrl m_Animate;
83 CProgressCtrl m_ProgCtrl;
84 CGitProgressList m_ProgList;
85 CEdit m_InfoCtrl;
86 CStatic m_ProgLableCtrl;
87 CMenuButton m_cMenuButton;
88 PostCmdList m_PostCmdList;
90 CBrush m_background_brush;
91 DWORD m_AutoClose;
93 typedef struct {
94 int id;
95 int cnt;
96 int wmid;
97 } ACCELLERATOR;
98 std::map<TCHAR, ACCELLERATOR> m_accellerators;
99 HACCEL m_hAccel;
100 virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);