OSDN Git Service

Add "F5" refresh remote and branch info at push dialog
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / PushDlg.cpp
index 9272245..37e2521 100644 (file)
@@ -102,11 +102,30 @@ BOOL CPushDlg::OnInitDialog()
        m_RemoteURL.EnableWindow(FALSE);\r
        CheckRadioButton(IDC_RD_REMOTE,IDC_RD_URL,IDC_RD_REMOTE);\r
 \r
-       STRING_VECTOR list;\r
+\r
+       Refresh();\r
+\r
+       m_BranchRemote.LoadHistory(CString(_T("Software\\TortoiseGit\\History\\RemoteBranch\\"))+WorkingDir, _T("branch"));\r
+       m_BranchRemote.SetCurSel(0);\r
+\r
+       //m_BranchRemote.SetWindowTextW(m_BranchSource.GetString());\r
+\r
+       \r
+       return TRUE;\r
+}\r
+\r
+void CPushDlg::Refresh()\r
+{\r
+       CString WorkingDir=g_Git.m_CurrentDir;\r
+       WorkingDir.Replace(_T(':'),_T('_'));\r
+\r
        CRegString remote(CString(_T("Software\\TortoiseGit\\History\\PushRemote\\")+WorkingDir));\r
        m_RemoteReg = remote;\r
        int sel=0;\r
 \r
+       STRING_VECTOR list;\r
+       m_Remote.Reset();\r
+\r
        if(!g_Git.GetRemoteList(list))\r
        {       \r
                for(unsigned int i=0;i<list.size();i++)\r
@@ -120,22 +139,15 @@ BOOL CPushDlg::OnInitDialog()
 \r
        int current=0;\r
        list.clear();\r
+       m_BranchSource.Reset();\r
        if(!g_Git.GetBranchList(list,&current))\r
        {\r
                for(unsigned int i=0;i<list.size();i++)\r
                        m_BranchSource.AddString(list[i]);\r
        }\r
        m_BranchSource.SetCurSel(current);\r
-       \r
-       m_BranchRemote.LoadHistory(CString(_T("Software\\TortoiseGit\\History\\RemoteBranch\\"))+WorkingDir, _T("branch"));\r
-       m_BranchRemote.SetCurSel(0);\r
 \r
-       //m_BranchRemote.SetWindowTextW(m_BranchSource.GetString());\r
-\r
-       \r
-       return TRUE;\r
 }\r
-\r
 // CPushDlg message handlers\r
 \r
 void CPushDlg::OnBnClickedRd()\r
@@ -221,3 +233,20 @@ void CPushDlg::OnBnClickedButtonBrowseDestBranch()
        //Select branch\r
        m_BranchRemote.AddString(remoteBranchName);\r
 }\r
+\r
+BOOL CPushDlg::PreTranslateMessage(MSG* pMsg)\r
+{\r
+       if (pMsg->message == WM_KEYDOWN)\r
+       {\r
+               switch (pMsg->wParam)\r
+               {\r
+               case VK_F5:\r
+                       {\r
+                               Refresh();\r
+                       }\r
+                       break;\r
+               }\r
+       }\r
+\r
+       return CResizableStandAloneDialog::PreTranslateMessage(pMsg);\r
+}\r