doc: updated images
[TortoiseGit.git] / src / TortoiseProc / RebaseDlg.h
blobed8d3ba4208e8a7ef27115c3a0193524e42bac25
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2008-2012 - TortoiseGit
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #pragma once
21 #include "afxcmn.h"
22 #include "afxwin.h"
23 #include "StandAloneDlg.h"
24 #include "GitStatusListCtrl.h"
25 #include "SciEdit.h"
26 #include "SplitterControl.h"
27 #include "HistoryCombo.h"
28 #include "GitLogList.h"
29 #include "MenuButton.h"
30 #include "Win7.h"
31 #include "Tooltip.h"
33 // CRebaseDlg dialog
34 #define IDC_REBASE_TAB 0x1000000
36 #define REBASE_TAB_CONFLICT 0
37 #define REBASE_TAB_MESSAGE 1
38 #define REBASE_TAB_LOG 2
40 #define MSG_REBASE_UPDATE_UI (WM_USER+151)
42 class CRebaseDlg : public CResizableStandAloneDialog
44 DECLARE_DYNAMIC(CRebaseDlg)
46 public:
47 CRebaseDlg(CWnd* pParent = NULL); // standard constructor
48 virtual ~CRebaseDlg();
50 // Dialog Data
51 enum { IDD = IDD_REBASE };
53 enum REBASE_STAGE
55 CHOOSE_BRANCH,
56 CHOOSE_COMMIT_PICK_MODE,
57 REBASE_START,
58 REBASE_CONTINUE,
59 REBASE_ABORT,
60 REBASE_FINISH,
61 REBASE_CONFLICT,
62 REBASE_EDIT,
63 REBASE_SQUASH_EDIT,
64 REBASE_SQUASH_CONFLICT,
65 REBASE_DONE,
68 protected:
69 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
70 virtual BOOL OnInitDialog();
71 DECLARE_MESSAGE_MAP()
72 virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
73 LRESULT OnRebaseUpdateUI(WPARAM wParam, LPARAM lParam);
74 void DoSize(int delta);
75 void AddRebaseAnchor();
76 void RemoveAnchor();
78 void SetSplitterRange();
79 void SaveSplitterPos();
81 void LoadBranchInfo();
82 void FetchLogList();
83 void SetAllRebaseAction(int action);
84 void OnCancel();
86 CRect m_DlgOrigRect;
87 CRect m_CommitListOrigRect;
88 BOOL PreTranslateMessage(MSG* pMsg);
89 bool LogListHasFocus(HWND hwnd);
91 CSciEdit m_wndOutputRebase;
92 void SetContinueButtonText();
93 void SetControlEnable();
94 void UpdateProgress();
95 void UpdateCurrentStatus();
96 void ListConflictFile();
97 int DoRebase();
98 void Refresh();
99 volatile LONG m_bThreadRunning;
100 int RebaseThread();
101 static UINT RebaseThreadEntry(LPVOID pVoid){return ((CRebaseDlg *)pVoid)->RebaseThread();};
102 BOOL IsEnd();
104 BOOL m_IsFastForward;
106 CGitHash m_OrigBranchHash;
107 CGitHash m_OrigUpstreamHash;
109 int VerifyNoConflict();
110 CString GetRebaseModeName(int rebasemode);
112 CString m_SquashMessage;
114 int CheckNextCommitIsSquash();
115 int GetCurrentCommitID();
116 int FinishRebase();
118 CMenuButton m_PostButton;
120 afx_msg void OnBnClickedPickAll();
121 afx_msg void OnBnClickedSquashAll();
122 afx_msg void OnBnClickedEditAll();
123 afx_msg void OnBnClickedRebaseSplit();
124 afx_msg void OnSize(UINT nType, int cx, int cy);
125 afx_msg void OnCbnSelchangeBranch();
126 afx_msg void OnCbnSelchangeUpstream();
127 afx_msg void OnBnClickedContinue();
128 afx_msg void OnBnClickedAbort();
129 afx_msg void OnLvnItemchangedLoglist(NMHDR *pNMHDR, LRESULT *pResult);
130 void FillLogMessageCtrl();
132 CProgressCtrl m_ProgressBar;
133 CStatic m_CtrlStatusText;
134 CToolTips m_tooltips;
136 CString m_PreCmd;
138 BOOL m_bPickAll;
139 BOOL m_bSquashAll;
140 BOOL m_bEditAll;
142 BOOL m_bForce;
143 BOOL m_bAddCherryPickedFrom;
145 public:
146 CStringArray m_PostButtonTexts;
147 CGitLogList m_CommitList;
149 CString m_Upstream;
150 CString m_Branch;
152 BOOL m_IsCherryPick;
154 protected:
155 CSplitterControl m_wndSplitter;
156 CMFCTabCtrl m_ctrlTabCtrl;
157 CGitStatusListCtrl m_FileListCtrl;
158 CSciEdit m_LogMessageCtrl;
160 CHistoryCombo m_BranchCtrl;
161 CHistoryCombo m_UpstreamCtrl;
163 REBASE_STAGE m_RebaseStage;
165 void AddBranchToolTips(CHistoryCombo *pBranch);
166 void AddLogString(CString str);
167 int StartRebase();
168 int CheckRebaseCondition();
169 int m_CurrentRebaseIndex;
170 int StateAction();
171 int GoNext();
172 afx_msg void OnBnClickedButtonBrowse();
173 afx_msg void OnBnClickedRebaseCheckForce();
174 afx_msg void OnBnClickedCheckCherryPickedFrom();
175 afx_msg void OnBnClickedRebasePostButton();
176 afx_msg void OnBnClickedButtonUp2();
177 afx_msg void OnBnClickedButtonDown2();
179 afx_msg LRESULT OnTaskbarBtnCreated(WPARAM wParam, LPARAM lParam);
180 CComPtr<ITaskbarList3> m_pTaskbarList;