OSDN Git Service

Use Rebase Dialog For cherry pick ant log dialog actions.
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / RebaseDlg.h
index e3a7d60..05523c8 100644 (file)
@@ -5,9 +5,18 @@
 #include "GitStatusListCtrl.h"\r
 #include "SciEdit.h"\r
 #include "SplitterControl.h"\r
+#include "HistoryCombo.h"\r
+#include "Balloon.h"\r
+#include "GitLogList.h"\r
 // CRebaseDlg dialog\r
 #define IDC_REBASE_TAB 0x1000000\r
 \r
+#define REBASE_TAB_CONFLICT  0\r
+#define REBASE_TAB_MESSAGE   1\r
+#define REBASE_TAB_LOG          2\r
+\r
+#define MSG_REBASE_UPDATE_UI   (WM_USER+151)\r
+\r
 class CRebaseDlg : public CResizableStandAloneDialog\r
 {\r
        DECLARE_DYNAMIC(CRebaseDlg)\r
@@ -19,11 +28,26 @@ public:
 // Dialog Data\r
        enum { IDD = IDD_REBASE };\r
 \r
+       enum REBASE_STAGE\r
+       {\r
+               CHOOSE_BRANCH,\r
+               CHOOSE_COMMIT_PICK_MODE,\r
+               REBASE_START,\r
+               REBASE_CONTINUE,\r
+               REBASE_ABORT,\r
+               REBASE_FINISH,\r
+               REBASE_CONFLICT,\r
+               REBASE_EDIT,\r
+               REBASE_SQUASH_EDIT,\r
+               REBASE_SQUASH_CONFLICT,\r
+       };\r
+\r
 protected:\r
        virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support\r
        virtual BOOL OnInitDialog();\r
        DECLARE_MESSAGE_MAP()\r
        virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);\r
+       LRESULT OnRebaseUpdateUI(WPARAM wParam, LPARAM lParam);\r
        void DoSize(int delta);\r
        void AddRebaseAnchor();\r
        void RemoveAnchor();\r
@@ -31,8 +55,37 @@ protected:
        void SetSplitterRange();\r
        void SaveSplitterPos();\r
        \r
+       void LoadBranchInfo();\r
+       void FetchLogList();\r
+       void SetAllRebaseAction(int action);\r
+       void OnCancel();\r
+\r
        CRect                           m_DlgOrigRect;\r
        CRect                           m_CommitListOrigRect;\r
+       BOOL PreTranslateMessage(MSG* pMsg);\r
+\r
+       CSciEdit m_wndOutputRebase;\r
+       void SetContinueButtonText();\r
+       void SetControlEnable();\r
+       void UpdateProgress();\r
+       void UpdateCurrentStatus();\r
+       void ListConflictFile();\r
+       int  DoRebase();\r
+       volatile LONG           m_bThreadRunning;\r
+       int  RebaseThread();\r
+       static UINT RebaseThreadEntry(LPVOID pVoid){return ((CRebaseDlg *)pVoid)->RebaseThread();};\r
+       BOOL IsEnd();\r
+\r
+       CString m_OrigBranchHash;\r
+       CString m_OrigUpstreamHash;\r
+\r
+       int VerifyNoConflict();\r
+       CString GetRebaseModeName(int rebasemode);\r
+\r
+       CString m_SquashMessage;\r
+\r
+       int CheckNextCommitIsSquash();\r
+       int GetCurrentCommitID();\r
 \r
 public:\r
    \r
@@ -41,9 +94,15 @@ public:
     afx_msg void OnBnClickedEditAll();\r
     afx_msg void OnBnClickedRebaseSplit();\r
        afx_msg void OnSize(UINT nType, int cx, int cy);\r
+       afx_msg void OnCbnSelchangeBranch();\r
+       afx_msg void OnCbnSelchangeUpstream();\r
+       afx_msg void OnBnClickedContinue();\r
+       afx_msg void OnBnClickedAbort();\r
 \r
     CProgressCtrl m_ProgressBar;\r
     CStatic m_CtrlStatusText;\r
+       CBalloon                        m_tooltips;\r
+\r
     BOOL m_bPickAll;\r
     BOOL m_bSquashAll;\r
     BOOL m_bEditAll;\r
@@ -52,5 +111,22 @@ public:
        CMFCTabCtrl m_ctrlTabCtrl;\r
        CGitStatusListCtrl m_FileListCtrl;\r
        CSciEdit                   m_LogMessageCtrl;\r
-       CListCtrl                  m_CommitList;\r
+       \r
+       CGitLogList                m_CommitList;\r
+\r
+       CHistoryCombo m_BranchCtrl;\r
+       CHistoryCombo m_UpstreamCtrl;\r
+       \r
+       CString           m_Upstream;\r
+       BOOL              m_IsCherryPick;\r
+\r
+       REBASE_STAGE       m_RebaseStage;\r
+\r
+       void AddBranchToolTips(CHistoryCombo *pBranch);\r
+       void AddLogString(CString str);\r
+       int      StartRebase();\r
+       int  CheckRebaseCondition();\r
+       int  m_CurrentRebaseIndex;\r
+       int  StateAction();\r
+       int  GoNext();\r
 };\r