Show Push Dialog after close commit dialog
[TortoiseGit.git] / src / TortoiseProc / RebaseDlg.h
blobeb2ed75feb8989a920b4fe822f45c05bde65c640
1 #pragma once
2 #include "afxcmn.h"
3 #include "afxwin.h"
4 #include "StandAloneDlg.h"
5 #include "GitStatusListCtrl.h"
6 #include "SciEdit.h"
7 #include "SplitterControl.h"
8 #include "HistoryCombo.h"
9 #include "Balloon.h"
10 #include "GitLogList.h"
11 // CRebaseDlg dialog
12 #define IDC_REBASE_TAB 0x1000000
14 #define REBASE_TAB_CONFLICT 0
15 #define REBASE_TAB_MESSAGE 1
16 #define REBASE_TAB_LOG 2
18 #define MSG_REBASE_UPDATE_UI (WM_USER+151)
20 class CRebaseDlg : public CResizableStandAloneDialog
22 DECLARE_DYNAMIC(CRebaseDlg)
24 public:
25 CRebaseDlg(CWnd* pParent = NULL); // standard constructor
26 virtual ~CRebaseDlg();
28 // Dialog Data
29 enum { IDD = IDD_REBASE };
31 enum REBASE_STAGE
33 CHOOSE_BRANCH,
34 CHOOSE_COMMIT_PICK_MODE,
35 REBASE_START,
36 REBASE_CONTINUE,
37 REBASE_ABORT,
38 REBASE_FINISH,
39 REBASE_CONFLICT,
40 REBASE_EDIT,
41 REBASE_SQUASH_EDIT,
42 REBASE_SQUASH_CONFLICT,
43 REBASE_DONE,
46 protected:
47 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
48 virtual BOOL OnInitDialog();
49 DECLARE_MESSAGE_MAP()
50 virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
51 LRESULT OnRebaseUpdateUI(WPARAM wParam, LPARAM lParam);
52 void DoSize(int delta);
53 void AddRebaseAnchor();
54 void RemoveAnchor();
56 void SetSplitterRange();
57 void SaveSplitterPos();
59 void LoadBranchInfo();
60 void FetchLogList();
61 void SetAllRebaseAction(int action);
62 void OnCancel();
64 CRect m_DlgOrigRect;
65 CRect m_CommitListOrigRect;
66 BOOL PreTranslateMessage(MSG* pMsg);
68 CSciEdit m_wndOutputRebase;
69 void SetContinueButtonText();
70 void SetControlEnable();
71 void UpdateProgress();
72 void UpdateCurrentStatus();
73 void ListConflictFile();
74 int DoRebase();
75 volatile LONG m_bThreadRunning;
76 int RebaseThread();
77 static UINT RebaseThreadEntry(LPVOID pVoid){return ((CRebaseDlg *)pVoid)->RebaseThread();};
78 BOOL IsEnd();
80 CString m_OrigBranchHash;
81 CString m_OrigUpstreamHash;
83 int VerifyNoConflict();
84 CString GetRebaseModeName(int rebasemode);
86 CString m_SquashMessage;
88 int CheckNextCommitIsSquash();
89 int GetCurrentCommitID();
90 int FinishRebase();
92 public:
94 afx_msg void OnBnClickedPickAll();
95 afx_msg void OnBnClickedSquashAll();
96 afx_msg void OnBnClickedEditAll();
97 afx_msg void OnBnClickedRebaseSplit();
98 afx_msg void OnSize(UINT nType, int cx, int cy);
99 afx_msg void OnCbnSelchangeBranch();
100 afx_msg void OnCbnSelchangeUpstream();
101 afx_msg void OnBnClickedContinue();
102 afx_msg void OnBnClickedAbort();
104 CProgressCtrl m_ProgressBar;
105 CStatic m_CtrlStatusText;
106 CBalloon m_tooltips;
108 BOOL m_bPickAll;
109 BOOL m_bSquashAll;
110 BOOL m_bEditAll;
112 CSplitterControl m_wndSplitter;
113 CMFCTabCtrl m_ctrlTabCtrl;
114 CGitStatusListCtrl m_FileListCtrl;
115 CSciEdit m_LogMessageCtrl;
117 CGitLogList m_CommitList;
119 CHistoryCombo m_BranchCtrl;
120 CHistoryCombo m_UpstreamCtrl;
122 CString m_Upstream;
123 BOOL m_IsCherryPick;
125 REBASE_STAGE m_RebaseStage;
127 void AddBranchToolTips(CHistoryCombo *pBranch);
128 void AddLogString(CString str);
129 int StartRebase();
130 int CheckRebaseCondition();
131 int m_CurrentRebaseIndex;
132 int StateAction();
133 int GoNext();
134 afx_msg void OnBnClickedButtonBrowse();