Fixed issue #406: Putty key can't save when clone.
[TortoiseGit.git] / src / TortoiseProc / RebaseDlg.h
blob19e818f39630cac5811a1d461d1520eb51b7ee92
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 volatile LONG m_bThreadRunning;
77 int RebaseThread();
78 static UINT RebaseThreadEntry(LPVOID pVoid){return ((CRebaseDlg *)pVoid)->RebaseThread();};
79 BOOL IsEnd();
81 BOOL m_IsFastForward;
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();
93 int FinishRebase();
95 CMenuButton m_PostButton;
97 public:
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;
111 CBalloon m_tooltips;
113 CString m_PreCmd;
115 BOOL m_bPickAll;
116 BOOL m_bSquashAll;
117 BOOL m_bEditAll;
119 BOOL m_bForce;
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;
132 CString m_Upstream;
133 CString m_Branch;
135 BOOL m_IsCherryPick;
137 REBASE_STAGE m_RebaseStage;
139 void AddBranchToolTips(CHistoryCombo *pBranch);
140 void AddLogString(CString str);
141 int StartRebase();
142 int CheckRebaseCondition();
143 int m_CurrentRebaseIndex;
144 int StateAction();
145 int GoNext();
146 afx_msg void OnBnClickedButtonBrowse();
147 afx_msg void OnBnClickedRebaseCheckForce();
148 afx_msg void OnStnClickedStatusStatic();
149 afx_msg void OnBnClickedRebasePostButton();