Fixed issue #507: Help Spell error and push wrongly link to sync
[TortoiseGit.git] / src / TortoiseProc / RebaseDlg.h
blobb0afd61bd94ecf54667c536ef38203b291b6b16c
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 #include "MenuButton.h"
12 // CRebaseDlg dialog
13 #define IDC_REBASE_TAB 0x1000000
15 #define REBASE_TAB_CONFLICT 0
16 #define REBASE_TAB_MESSAGE 1
17 #define REBASE_TAB_LOG 2
19 #define MSG_REBASE_UPDATE_UI (WM_USER+151)
21 class CRebaseDlg : public CResizableStandAloneDialog
23 DECLARE_DYNAMIC(CRebaseDlg)
25 public:
26 CRebaseDlg(CWnd* pParent = NULL); // standard constructor
27 virtual ~CRebaseDlg();
29 // Dialog Data
30 enum { IDD = IDD_REBASE };
32 enum REBASE_STAGE
34 CHOOSE_BRANCH,
35 CHOOSE_COMMIT_PICK_MODE,
36 REBASE_START,
37 REBASE_CONTINUE,
38 REBASE_ABORT,
39 REBASE_FINISH,
40 REBASE_CONFLICT,
41 REBASE_EDIT,
42 REBASE_SQUASH_EDIT,
43 REBASE_SQUASH_CONFLICT,
44 REBASE_DONE,
47 protected:
48 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
49 virtual BOOL OnInitDialog();
50 DECLARE_MESSAGE_MAP()
51 virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
52 LRESULT OnRebaseUpdateUI(WPARAM wParam, LPARAM lParam);
53 void DoSize(int delta);
54 void AddRebaseAnchor();
55 void RemoveAnchor();
57 void SetSplitterRange();
58 void SaveSplitterPos();
60 void LoadBranchInfo();
61 void FetchLogList();
62 void SetAllRebaseAction(int action);
63 void OnCancel();
65 CRect m_DlgOrigRect;
66 CRect m_CommitListOrigRect;
67 BOOL PreTranslateMessage(MSG* pMsg);
69 CSciEdit m_wndOutputRebase;
70 void SetContinueButtonText();
71 void SetControlEnable();
72 void UpdateProgress();
73 void UpdateCurrentStatus();
74 void ListConflictFile();
75 int DoRebase();
76 void Refresh();
77 volatile LONG m_bThreadRunning;
78 int RebaseThread();
79 static UINT RebaseThreadEntry(LPVOID pVoid){return ((CRebaseDlg *)pVoid)->RebaseThread();};
80 BOOL IsEnd();
82 BOOL m_IsFastForward;
84 CString m_OrigBranchHash;
85 CString m_OrigUpstreamHash;
87 int VerifyNoConflict();
88 CString GetRebaseModeName(int rebasemode);
90 CString m_SquashMessage;
92 int CheckNextCommitIsSquash();
93 int GetCurrentCommitID();
94 int FinishRebase();
96 CMenuButton m_PostButton;
98 public:
100 afx_msg void OnBnClickedPickAll();
101 afx_msg void OnBnClickedSquashAll();
102 afx_msg void OnBnClickedEditAll();
103 afx_msg void OnBnClickedRebaseSplit();
104 afx_msg void OnSize(UINT nType, int cx, int cy);
105 afx_msg void OnCbnSelchangeBranch();
106 afx_msg void OnCbnSelchangeUpstream();
107 afx_msg void OnBnClickedContinue();
108 afx_msg void OnBnClickedAbort();
110 CProgressCtrl m_ProgressBar;
111 CStatic m_CtrlStatusText;
112 CBalloon m_tooltips;
114 CString m_PreCmd;
116 BOOL m_bPickAll;
117 BOOL m_bSquashAll;
118 BOOL m_bEditAll;
120 BOOL m_bForce;
121 CStringArray m_PostButtonTexts;
123 CSplitterControl m_wndSplitter;
124 CMFCTabCtrl m_ctrlTabCtrl;
125 CGitStatusListCtrl m_FileListCtrl;
126 CSciEdit m_LogMessageCtrl;
128 CGitLogList m_CommitList;
130 CHistoryCombo m_BranchCtrl;
131 CHistoryCombo m_UpstreamCtrl;
133 CString m_Upstream;
134 CString m_Branch;
136 BOOL m_IsCherryPick;
138 REBASE_STAGE m_RebaseStage;
140 void AddBranchToolTips(CHistoryCombo *pBranch);
141 void AddLogString(CString str);
142 int StartRebase();
143 int CheckRebaseCondition();
144 int m_CurrentRebaseIndex;
145 int StateAction();
146 int GoNext();
147 afx_msg void OnBnClickedButtonBrowse();
148 afx_msg void OnBnClickedRebaseCheckForce();
149 afx_msg void OnStnClickedStatusStatic();
150 afx_msg void OnBnClickedRebasePostButton();