OSDN Git Service

Fixed issue #187: Allow start new rebase after finish rebase
authorFrank Li <lznuaa@gmail.com>
Sun, 11 Oct 2009 13:15:13 +0000 (21:15 +0800)
committerFrank Li <lznuaa@gmail.com>
Sun, 11 Oct 2009 13:15:13 +0000 (21:15 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/Resources/TortoiseProcENG.rc
src/TortoiseProc/Commands/FetchCommand.cpp
src/TortoiseProc/Commands/RebaseCommand.cpp
src/TortoiseProc/RebaseDlg.cpp
src/TortoiseProc/RebaseDlg.h
src/TortoiseProc/SyncDlg.cpp
src/Utils/MiscUI/MenuButton.cpp
src/Utils/MiscUI/MenuButton.h

index bf0974a..9d4d196 100644 (file)
Binary files a/src/Resources/TortoiseProcENG.rc and b/src/Resources/TortoiseProcENG.rc differ
index 6bf4946..1f544bb 100644 (file)
@@ -60,7 +60,7 @@ bool FetchCommand::Execute()
                if( (userResponse==IDC_PROGRESS_BUTTON1) || ( progress.m_GitStatus ==0 && dlg.m_bRebase) )\r
                {\r
                        CRebaseDlg dlg;\r
                if( (userResponse==IDC_PROGRESS_BUTTON1) || ( progress.m_GitStatus ==0 && dlg.m_bRebase) )\r
                {\r
                        CRebaseDlg dlg;\r
-                       dlg.m_PostButtonText=_T("Email &Patch...");\r
+                       dlg.m_PostButtonTexts.Add(_T("Email &Patch..."));\r
                        int response = dlg.DoModal();\r
                        if(response == IDOK)\r
                        {\r
                        int response = dlg.DoModal();\r
                        if(response == IDOK)\r
                        {\r
index 33e03bf..01e3744 100644 (file)
@@ -50,10 +50,21 @@ bool RebaseCommand::Execute()
                }\r
        }\r
 \r
                }\r
        }\r
 \r
-       CRebaseDlg dlg;\r
-       if(dlg.DoModal() == IDOK)\r
+       while(1)\r
        {\r
        {\r
-               bRet=true;\r
+               CRebaseDlg dlg;\r
+               dlg.m_PostButtonTexts.Add(_T("Restart Rebase"));\r
+               int ret = dlg.DoModal();\r
+               if( ret == IDOK)\r
+               {\r
+                       bRet=true;\r
+                       return bRet;\r
+               }\r
+               if( ret == IDCANCEL)\r
+               {\r
+                       bRet=false;\r
+                       return bRet;\r
+               }\r
        }\r
        return bRet;\r
 }\r
        }\r
        return bRet;\r
 }\r
index 8b21ef6..0e6d8eb 100644 (file)
@@ -44,7 +44,7 @@ void CRebaseDlg::DoDataExchange(CDataExchange* pDX)
        DDX_Control(pDX,IDC_REBASE_COMBOXEX_BRANCH, this->m_BranchCtrl);\r
        DDX_Control(pDX,IDC_REBASE_COMBOXEX_UPSTREAM,   this->m_UpstreamCtrl);\r
        DDX_Check(pDX, IDC_REBASE_CHECK_FORCE,m_bForce);\r
        DDX_Control(pDX,IDC_REBASE_COMBOXEX_BRANCH, this->m_BranchCtrl);\r
        DDX_Control(pDX,IDC_REBASE_COMBOXEX_UPSTREAM,   this->m_UpstreamCtrl);\r
        DDX_Check(pDX, IDC_REBASE_CHECK_FORCE,m_bForce);\r
-\r
+       DDX_Control(pDX,IDC_REBASE_POST_BUTTON,m_PostButton);\r
 }\r
 \r
 \r
 }\r
 \r
 \r
@@ -1014,11 +1014,13 @@ void CRebaseDlg::SetControlEnable()
                                                                                                m_CommitList.GetContextMenuBit(CGitLogListBase::ID_REBASE_EDIT)|\r
                                                                                                m_CommitList.GetContextMenuBit(CGitLogListBase::ID_REBASE_SKIP));\r
 \r
                                                                                                m_CommitList.GetContextMenuBit(CGitLogListBase::ID_REBASE_EDIT)|\r
                                                                                                m_CommitList.GetContextMenuBit(CGitLogListBase::ID_REBASE_SKIP));\r
 \r
-               if( m_RebaseStage == REBASE_DONE && (!this->m_PostButtonText.IsEmpty()) )\r
+               if( m_RebaseStage == REBASE_DONE && (this->m_PostButtonTexts.GetCount() != 0) )\r
                {\r
                        this->GetDlgItem(IDC_STATUS_STATIC)->ShowWindow(SW_HIDE);\r
                        this->GetDlgItem(IDC_REBASE_POST_BUTTON)->ShowWindow(SW_SHOWNORMAL);\r
                {\r
                        this->GetDlgItem(IDC_STATUS_STATIC)->ShowWindow(SW_HIDE);\r
                        this->GetDlgItem(IDC_REBASE_POST_BUTTON)->ShowWindow(SW_SHOWNORMAL);\r
-                       this->GetDlgItem(IDC_REBASE_POST_BUTTON)->SetWindowText(this->m_PostButtonText);\r
+                       this->m_PostButton.RemoveAll();\r
+                       this->m_PostButton.AddEntries(m_PostButtonTexts);\r
+                       //this->GetDlgItem(IDC_REBASE_POST_BUTTON)->SetWindowText(this->m_PostButtonText);\r
                }\r
                break;\r
        }\r
                }\r
                break;\r
        }\r
index 15ef958..19e818f 100644 (file)
@@ -8,6 +8,7 @@
 #include "HistoryCombo.h"\r
 #include "Balloon.h"\r
 #include "GitLogList.h"\r
 #include "HistoryCombo.h"\r
 #include "Balloon.h"\r
 #include "GitLogList.h"\r
+#include "MenuButton.h"\r
 // CRebaseDlg dialog\r
 #define IDC_REBASE_TAB 0x1000000\r
 \r
 // CRebaseDlg dialog\r
 #define IDC_REBASE_TAB 0x1000000\r
 \r
@@ -91,6 +92,8 @@ protected:
        int GetCurrentCommitID();\r
        int FinishRebase();\r
 \r
        int GetCurrentCommitID();\r
        int FinishRebase();\r
 \r
+       CMenuButton m_PostButton;\r
+\r
 public:\r
    \r
     afx_msg void OnBnClickedPickAll();\r
 public:\r
    \r
     afx_msg void OnBnClickedPickAll();\r
@@ -114,7 +117,7 @@ public:
     BOOL m_bEditAll;\r
        \r
        BOOL m_bForce;\r
     BOOL m_bEditAll;\r
        \r
        BOOL m_bForce;\r
-       CString m_PostButtonText;\r
+       CStringArray m_PostButtonTexts;\r
 \r
        CSplitterControl        m_wndSplitter;\r
        CMFCTabCtrl m_ctrlTabCtrl;\r
 \r
        CSplitterControl        m_wndSplitter;\r
        CMFCTabCtrl m_ctrlTabCtrl;\r
index 16e7297..1ab41f8 100644 (file)
@@ -267,7 +267,7 @@ void CSyncDlg::FetchComplete()
        if( (!this->m_GitCmdStatus) && this->m_CurrentCmd == GIT_COMMAND_FETCHANDREBASE)\r
        {\r
                CRebaseDlg dlg;\r
        if( (!this->m_GitCmdStatus) && this->m_CurrentCmd == GIT_COMMAND_FETCHANDREBASE)\r
        {\r
                CRebaseDlg dlg;\r
-               dlg.m_PostButtonText=_T("Email &Patch...");\r
+               dlg.m_PostButtonTexts.Add(_T("Email &Patch..."));\r
                int response = dlg.DoModal();\r
                if(response == IDOK)\r
                {\r
                int response = dlg.DoModal();\r
                if(response == IDOK)\r
                {\r
index d9610fc..399b4b5 100644 (file)
@@ -61,6 +61,12 @@ bool CMenuButton::SetCurrentEntry(INT_PTR entry)
        return true;\r
 }\r
 \r
        return true;\r
 }\r
 \r
+void CMenuButton::RemoveAll()\r
+{\r
+       m_sEntries.RemoveAll();\r
+       m_currentEntry = -1;\r
+}\r
+\r
 INT_PTR CMenuButton::AddEntry(const CString& sEntry)\r
 {\r
        INT_PTR ret = m_sEntries.Add(sEntry);\r
 INT_PTR CMenuButton::AddEntry(const CString& sEntry)\r
 {\r
        INT_PTR ret = m_sEntries.Add(sEntry);\r
index fab20ae..0e47a46 100644 (file)
@@ -74,6 +74,8 @@ public:
         */\r
        void    UseThemes(bool bUseThemes);\r
 \r
         */\r
        void    UseThemes(bool bUseThemes);\r
 \r
+       void    RemoveAll();\r
+\r
 public:\r
        virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);\r
 protected:\r
 public:\r
        virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);\r
 protected:\r