If there are submodule changes in the file list when resolving conflicts while rebasi...
authorSup Yut Sum <ch3cooli@gmail.com>
Thu, 7 Feb 2013 23:38:57 +0000 (8 00:38 +0100)
committerSven Strickroth <email@cs-ware.de>
Thu, 7 Feb 2013 23:39:09 +0000 (8 00:39 +0100)
Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>
Languages/Tortoise.pot
src/Resources/TortoiseProcENG.rc
src/TortoiseProc/RebaseDlg.cpp
src/TortoiseProc/RebaseDlg.h
src/TortoiseProc/resource.h

index 794ea75..fe20384 100644 (file)
@@ -7936,6 +7936,10 @@ msgstr ""
 msgid "Tags:"
 msgstr ""
 
+#. Resource IDs: (1386)
+msgid "take care of submodule changes"
+msgstr ""
+
 #. Resource IDs: (64)
 msgid "Tasks"
 msgstr ""
index b1d3420..bf67c1c 100644 (file)
@@ -1355,7 +1355,7 @@ BEGIN
     CONTROL         "",IDC_REBASE_SPLIT,"Static",SS_OWNERDRAW,7,129,402,6,WS_EX_TRANSPARENT\r
     PUSHBUTTON      "Dumy Group For locat TabCtr",IDC_REBASE_DUMY_TAB,7,137,402,64,NOT WS_VISIBLE\r
     CONTROL         "",IDC_REBASE_PROGRESS,"msctls_progress32",WS_BORDER,7,204,402,7\r
-    LTEXT           "",IDC_STATUS_STATIC,7,215,101,8\r
+    LTEXT           "",IDC_STATUS_STATIC,7,215,201,8\r
     DEFPUSHBUTTON   "Continue",IDC_REBASE_CONTINUE,213,217,63,14\r
     PUSHBUTTON      "Abort",IDC_REBASE_ABORT,285,217,57,14\r
     PUSHBUTTON      "Help",IDHELP,351,217,58,14\r
@@ -3976,6 +3976,7 @@ BEGIN
     IDS_SETTINGS_ENABLELOGCACHE_TT \r
                             "Enable loading/saving log cache files (tortoisegit.data, tortoisegit.index)"\r
     IDS_LOG_FILTER_EMAILS   "Emails"\r
+    IDS_CARE_SUBMODULE_CHANGES "take care of submodule changes"\r
 END\r
 \r
 #endif    // English (U.S.) resources\r
index 2746bf7..070e5e8 100644 (file)
@@ -45,6 +45,7 @@ CRebaseDlg::CRebaseDlg(CWnd* pParent /*=NULL*/)
        , m_bSquashAll(FALSE)\r
        , m_bEditAll(FALSE)\r
        , m_bAddCherryPickedFrom(FALSE)\r
+       , m_bStatusWarning(false)\r
 {\r
        m_RebaseStage=CHOOSE_BRANCH;\r
        m_CurrentRebaseIndex=-1;\r
@@ -96,6 +97,7 @@ BEGIN_MESSAGE_MAP(CRebaseDlg, CResizableStandAloneDialog)
        ON_BN_CLICKED(IDC_BUTTON_DOWN2, &CRebaseDlg::OnBnClickedButtonDown2)\r
        ON_REGISTERED_MESSAGE(WM_TASKBARBTNCREATED, OnTaskbarBtnCreated)\r
        ON_NOTIFY(LVN_ITEMCHANGED, IDC_COMMIT_LIST, OnLvnItemchangedLoglist)\r
+       ON_WM_CTLCOLOR()\r
 END_MESSAGE_MAP()\r
 \r
 void CRebaseDlg::AddRebaseAnchor()\r
@@ -309,6 +311,18 @@ BOOL CRebaseDlg::OnInitDialog()
 }\r
 // CRebaseDlg message handlers\r
 \r
+HBRUSH CRebaseDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)\r
+{\r
+       if (pWnd->GetDlgCtrlID() == IDC_STATUS_STATIC && nCtlColor == CTLCOLOR_STATIC && m_bStatusWarning)\r
+       {\r
+               pDC->SetBkColor(RGB(255, 0, 0));\r
+               pDC->SetTextColor(RGB(255, 255, 255));\r
+               return CreateSolidBrush(RGB(255, 0, 0));\r
+       }\r
+\r
+       return CResizableStandAloneDialog::OnCtlColor(pDC, pWnd, nCtlColor);\r
+}\r
+\r
 void CRebaseDlg::OnBnClickedPickAll()\r
 {\r
        this->UpdateData();\r
@@ -921,6 +935,9 @@ int CRebaseDlg::FinishRebase()
        while (m_ctrlTabCtrl.GetTabsNum() > 1)\r
                m_ctrlTabCtrl.RemoveTab(0);\r
        m_CtrlStatusText.SetWindowText(CString(MAKEINTRESOURCE(IDS_PROC_REBASEFINISHED)));\r
+       m_sStatusText = CString(MAKEINTRESOURCE(IDS_PROC_REBASEFINISHED));\r
+       m_bStatusWarning = false;\r
+       m_CtrlStatusText.Invalidate();\r
 \r
        return 0;\r
 }\r
@@ -1385,8 +1402,10 @@ void CRebaseDlg::UpdateProgress()
        {\r
                CString text;\r
                text.Format(IDS_PROC_REBASING_PROGRESS, index, m_CommitList.GetItemCount());\r
+               m_sStatusText = text;\r
                m_CtrlStatusText.SetWindowText(text);\r
-\r
+               m_bStatusWarning = false;\r
+               m_CtrlStatusText.Invalidate();\r
        }\r
 \r
        GitRev *prevRev=NULL, *curRev=NULL;\r
@@ -1641,6 +1660,29 @@ void CRebaseDlg::ListConflictFile()
                                                           CTGitPath::LOGACTIONS_UNMERGED);\r
 \r
        m_FileListCtrl.Check(GITSLC_SHOWFILES);\r
+       bool hasSubmoduleChange = false;\r
+       for (int i = 0; i < m_FileListCtrl.GetItemCount(); i++)\r
+       {\r
+               CTGitPath *entry = (CTGitPath *)m_FileListCtrl.GetItemData(i);\r
+               if (entry->IsDirectory())\r
+               {\r
+                       hasSubmoduleChange = true;\r
+                       break;\r
+               }\r
+       }\r
+\r
+       if (hasSubmoduleChange)\r
+       {\r
+               m_CtrlStatusText.SetWindowText(m_sStatusText + _T(", ") + CString(MAKEINTRESOURCE(IDS_CARE_SUBMODULE_CHANGES)));\r
+               m_bStatusWarning = true;\r
+               m_CtrlStatusText.Invalidate();\r
+       }\r
+       else\r
+       {\r
+               m_CtrlStatusText.SetWindowText(m_sStatusText);\r
+               m_bStatusWarning = false;\r
+               m_CtrlStatusText.Invalidate();\r
+       }\r
 }\r
 \r
 LRESULT CRebaseDlg::OnRebaseUpdateUI(WPARAM,LPARAM)\r
index 82f1741..ba2f9e1 100644 (file)
@@ -71,6 +71,7 @@ protected:
        virtual BOOL OnInitDialog();\r
        DECLARE_MESSAGE_MAP()\r
        virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);\r
+       virtual HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);\r
        LRESULT OnRebaseUpdateUI(WPARAM wParam, LPARAM lParam);\r
        void DoSize(int delta);\r
        void AddRebaseAnchor();\r
@@ -86,6 +87,8 @@ protected:
 \r
        CRect m_DlgOrigRect;\r
        CRect m_CommitListOrigRect;\r
+       CString m_sStatusText;\r
+       bool m_bStatusWarning;\r
        BOOL PreTranslateMessage(MSG* pMsg);\r
        bool LogListHasFocus(HWND hwnd);\r
 \r
index bff184e..a6ae7ed 100644 (file)
 #define IDS_PROC_BROWSEREFS_DELETEALLTAGS 1387\r
 #define IDS_SETTINGS_ENABLELOGCACHE_TT  1388\r
 #define IDS_LOG_FILTER_EMAILS           1389\r
+#define IDS_CARE_SUBMODULE_CHANGES      1390\r
 #define IDC_REVISIONGROUP               1393\r
 #define IDC_REPOLABEL                   1394\r
 #define IDS_WARN_FOLDERNOTEXIST         1400\r