OSDN Git Service

Rebase: Add branch to list
authorFrank Li <lznuaa@gmail.com>
Fri, 13 Feb 2009 09:56:08 +0000 (17:56 +0800)
committerFrank Li <lznuaa@gmail.com>
Fri, 13 Feb 2009 09:56:08 +0000 (17:56 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/TortoiseProc/RebaseDlg.cpp
src/TortoiseProc/RebaseDlg.h

index f9848b8..f717127 100644 (file)
@@ -16,7 +16,7 @@ CRebaseDlg::CRebaseDlg(CWnd* pParent /*=NULL*/)
     , m_bSquashAll(FALSE)\r
     , m_bEditAll(FALSE)\r
 {\r
-\r
+       m_RebaseStage=CHOOSE_BRANCH;\r
 }\r
 \r
 CRebaseDlg::~CRebaseDlg()\r
@@ -136,6 +136,15 @@ BOOL CRebaseDlg::OnInitDialog()
                }\r
        }\r
 \r
+       if( this->m_RebaseStage == CHOOSE_BRANCH)\r
+       {\r
+               this->LoadBranchInfo();\r
+\r
+       }else\r
+       {\r
+               this->m_BranchCtrl.EnableWindow(FALSE);\r
+               this->m_UpstreamCtrl.EnableWindow(FALSE);\r
+       }\r
 \r
        return TRUE;\r
 }\r
@@ -242,4 +251,20 @@ void CRebaseDlg::SaveSplitterPos()
                ScreenToClient(&rectSplitter);\r
                regPos = rectSplitter.top;\r
        }\r
+}\r
+\r
+void CRebaseDlg::LoadBranchInfo()\r
+{\r
+       m_BranchCtrl.SetMaxHistoryItems(0x7FFFFFFF);\r
+       m_UpstreamCtrl.SetMaxHistoryItems(0x7FFFFFFF);\r
+\r
+       STRING_VECTOR list;\r
+       list.clear();\r
+       int current;\r
+       g_Git.GetBranchList(list,&current,CGit::BRANCH_ALL);\r
+       m_BranchCtrl.AddString(list);\r
+       m_UpstreamCtrl.AddString(list);\r
+\r
+       m_BranchCtrl.SetCurSel(current);\r
+\r
 }
\ No newline at end of file
index 77943a5..e00cc4f 100644 (file)
@@ -20,6 +20,15 @@ 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
+       };\r
+\r
 protected:\r
        virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support\r
        virtual BOOL OnInitDialog();\r
@@ -32,6 +41,8 @@ protected:
        void SetSplitterRange();\r
        void SaveSplitterPos();\r
        \r
+       void LoadBranchInfo();\r
+\r
        CRect                           m_DlgOrigRect;\r
        CRect                           m_CommitListOrigRect;\r
 \r
@@ -57,4 +68,9 @@ public:
 \r
        CHistoryCombo      m_BranchCtrl;\r
        CHistoryCombo      m_UpstreamCtrl;\r
+\r
+       REBASE_STAGE       m_RebaseStage;\r
+\r
+\r
+\r
 };\r