OSDN Git Service

Push dialog: Save last remote name.
authorFrank Li <lznuaa@gmail.com>
Wed, 1 Apr 2009 14:10:35 +0000 (22:10 +0800)
committerFrank Li <lznuaa@gmail.com>
Wed, 1 Apr 2009 14:10:35 +0000 (22:10 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/TortoiseProc/PushDlg.cpp
src/TortoiseProc/PushDlg.h

index d72ff80..4aa0418 100644 (file)
@@ -6,6 +6,7 @@
 #include "PushDlg.h"\r
 \r
 #include "Git.h"\r
+#include "registry.h"\r
 // CPushDlg dialog\r
 \r
 IMPLEMENT_DYNAMIC(CPushDlg, CResizableStandAloneDialog)\r
@@ -85,12 +86,20 @@ BOOL CPushDlg::OnInitDialog()
        CheckRadioButton(IDC_RD_REMOTE,IDC_RD_URL,IDC_RD_REMOTE);\r
 \r
        STRING_VECTOR list;\r
+       CRegString remote(CString(_T("Software\\TortoiseGit\\History\\PushRemote\\")+WorkingDir));\r
+       m_RemoteReg = remote;\r
+       int sel=0;\r
 \r
        if(!g_Git.GetRemoteList(list))\r
        {       \r
                for(unsigned int i=0;i<list.size();i++)\r
+               {\r
                        m_Remote.AddString(list[i]);\r
+                       if(list[i] == remote)\r
+                               sel = i;\r
+               }\r
        }\r
+       m_Remote.SetCurSel(sel);\r
 \r
        int current=0;\r
        list.clear();\r
@@ -154,5 +163,8 @@ void CPushDlg::OnBnClickedOk()
 \r
        this->m_RemoteURL.SaveHistory();\r
        this->m_BranchRemote.SaveHistory();\r
+       \r
+       m_RemoteReg = m_Remote.GetString();\r
+\r
        CResizableStandAloneDialog::OnOK();\r
 }\r
index 3b2bb44..586a0ba 100644 (file)
@@ -2,6 +2,7 @@
 \r
 #include "StandAloneDlg.h"\r
 #include "HistoryCombo.h"\r
+#include "registry.h"\r
 // CPushDlg dialog\r
 \r
 class CPushDlg : public CResizableStandAloneDialog\r
@@ -20,6 +21,7 @@ public:
        CString m_URL;\r
        CString m_BranchSourceName;\r
        CString m_BranchRemoteName;\r
+       CRegString m_RemoteReg;\r
 \r
        BOOL                    m_bTags;\r
        BOOL                    m_bForce;\r