4 #include "StandAloneDlg.h"
5 #include "GitStatusListCtrl.h"
7 #include "SplitterControl.h"
8 #include "HistoryCombo.h"
10 #include "GitLogList.h"
11 #include "MenuButton.h"
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
)
26 CRebaseDlg(CWnd
* pParent
= NULL
); // standard constructor
27 virtual ~CRebaseDlg();
30 enum { IDD
= IDD_REBASE
};
35 CHOOSE_COMMIT_PICK_MODE
,
43 REBASE_SQUASH_CONFLICT
,
48 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
49 virtual BOOL
OnInitDialog();
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();
57 void SetSplitterRange();
58 void SaveSplitterPos();
60 void LoadBranchInfo();
62 void SetAllRebaseAction(int action
);
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();
76 volatile LONG m_bThreadRunning
;
78 static UINT
RebaseThreadEntry(LPVOID pVoid
){return ((CRebaseDlg
*)pVoid
)->RebaseThread();};
83 CString m_OrigBranchHash
;
84 CString m_OrigUpstreamHash
;
86 int VerifyNoConflict();
87 CString
GetRebaseModeName(int rebasemode
);
89 CString m_SquashMessage
;
91 int CheckNextCommitIsSquash();
92 int GetCurrentCommitID();
95 CMenuButton m_PostButton
;
99 afx_msg
void OnBnClickedPickAll();
100 afx_msg
void OnBnClickedSquashAll();
101 afx_msg
void OnBnClickedEditAll();
102 afx_msg
void OnBnClickedRebaseSplit();
103 afx_msg
void OnSize(UINT nType
, int cx
, int cy
);
104 afx_msg
void OnCbnSelchangeBranch();
105 afx_msg
void OnCbnSelchangeUpstream();
106 afx_msg
void OnBnClickedContinue();
107 afx_msg
void OnBnClickedAbort();
109 CProgressCtrl m_ProgressBar
;
110 CStatic m_CtrlStatusText
;
120 CStringArray m_PostButtonTexts
;
122 CSplitterControl m_wndSplitter
;
123 CMFCTabCtrl m_ctrlTabCtrl
;
124 CGitStatusListCtrl m_FileListCtrl
;
125 CSciEdit m_LogMessageCtrl
;
127 CGitLogList m_CommitList
;
129 CHistoryCombo m_BranchCtrl
;
130 CHistoryCombo m_UpstreamCtrl
;
137 REBASE_STAGE m_RebaseStage
;
139 void AddBranchToolTips(CHistoryCombo
*pBranch
);
140 void AddLogString(CString str
);
142 int CheckRebaseCondition();
143 int m_CurrentRebaseIndex
;
146 afx_msg
void OnBnClickedButtonBrowse();
147 afx_msg
void OnBnClickedRebaseCheckForce();
148 afx_msg
void OnStnClickedStatusStatic();
149 afx_msg
void OnBnClickedRebasePostButton();