Use Rebase Dialog For cherry pick ant log dialog actions.
[TortoiseGit.git] / src / TortoiseProc / RebaseDlg.h
blob05523c8fc90f0d8ab0c03a1fe68da7a857de8517
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,
45 protected:
46 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
47 virtual BOOL OnInitDialog();
48 DECLARE_MESSAGE_MAP()
49 virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
50 LRESULT OnRebaseUpdateUI(WPARAM wParam, LPARAM lParam);
51 void DoSize(int delta);
52 void AddRebaseAnchor();
53 void RemoveAnchor();
55 void SetSplitterRange();
56 void SaveSplitterPos();
58 void LoadBranchInfo();
59 void FetchLogList();
60 void SetAllRebaseAction(int action);
61 void OnCancel();
63 CRect m_DlgOrigRect;
64 CRect m_CommitListOrigRect;
65 BOOL PreTranslateMessage(MSG* pMsg);
67 CSciEdit m_wndOutputRebase;
68 void SetContinueButtonText();
69 void SetControlEnable();
70 void UpdateProgress();
71 void UpdateCurrentStatus();
72 void ListConflictFile();
73 int DoRebase();
74 volatile LONG m_bThreadRunning;
75 int RebaseThread();
76 static UINT RebaseThreadEntry(LPVOID pVoid){return ((CRebaseDlg *)pVoid)->RebaseThread();};
77 BOOL IsEnd();
79 CString m_OrigBranchHash;
80 CString m_OrigUpstreamHash;
82 int VerifyNoConflict();
83 CString GetRebaseModeName(int rebasemode);
85 CString m_SquashMessage;
87 int CheckNextCommitIsSquash();
88 int GetCurrentCommitID();
90 public:
92 afx_msg void OnBnClickedPickAll();
93 afx_msg void OnBnClickedSquashAll();
94 afx_msg void OnBnClickedEditAll();
95 afx_msg void OnBnClickedRebaseSplit();
96 afx_msg void OnSize(UINT nType, int cx, int cy);
97 afx_msg void OnCbnSelchangeBranch();
98 afx_msg void OnCbnSelchangeUpstream();
99 afx_msg void OnBnClickedContinue();
100 afx_msg void OnBnClickedAbort();
102 CProgressCtrl m_ProgressBar;
103 CStatic m_CtrlStatusText;
104 CBalloon m_tooltips;
106 BOOL m_bPickAll;
107 BOOL m_bSquashAll;
108 BOOL m_bEditAll;
110 CSplitterControl m_wndSplitter;
111 CMFCTabCtrl m_ctrlTabCtrl;
112 CGitStatusListCtrl m_FileListCtrl;
113 CSciEdit m_LogMessageCtrl;
115 CGitLogList m_CommitList;
117 CHistoryCombo m_BranchCtrl;
118 CHistoryCombo m_UpstreamCtrl;
120 CString m_Upstream;
121 BOOL m_IsCherryPick;
123 REBASE_STAGE m_RebaseStage;
125 void AddBranchToolTips(CHistoryCombo *pBranch);
126 void AddLogString(CString str);
127 int StartRebase();
128 int CheckRebaseCondition();
129 int m_CurrentRebaseIndex;
130 int StateAction();
131 int GoNext();