OSDN Git Service

Record Push and Pull button at sync dialog
authorFrank Li <lznuaa@gmail.com>
Sun, 19 Jul 2009 07:09:07 +0000 (15:09 +0800)
committerFrank Li <lznuaa@gmail.com>
Sun, 19 Jul 2009 07:09:07 +0000 (15:09 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/Resources/TortoiseProcENG.rc
src/TortoiseProc/SyncDlg.cpp
src/TortoiseProc/SyncDlg.h

index ac49141..0ed1f0e 100644 (file)
Binary files a/src/Resources/TortoiseProcENG.rc and b/src/Resources/TortoiseProcENG.rc differ
index f0a9700..8a52e21 100644 (file)
@@ -69,11 +69,14 @@ END_MESSAGE_MAP()
 void CSyncDlg::OnBnClickedButtonPull()\r
 {\r
        // TODO: Add your control notification handler code here\r
 void CSyncDlg::OnBnClickedButtonPull()\r
 {\r
        // TODO: Add your control notification handler code here\r
+       this->m_regPullButton =this->m_ctrlPull.GetCurrentEntry();\r
 }\r
 \r
 void CSyncDlg::OnBnClickedButtonPush()\r
 {\r
        // TODO: Add your control notification handler code here\r
 }\r
 \r
 void CSyncDlg::OnBnClickedButtonPush()\r
 {\r
        // TODO: Add your control notification handler code here\r
+       this->m_regPushButton=this->m_ctrlPush.GetCurrentEntry();\r
+\r
 }\r
 \r
 void CSyncDlg::OnBnClickedButtonApply()\r
 }\r
 \r
 void CSyncDlg::OnBnClickedButtonApply()\r
@@ -109,6 +112,33 @@ BOOL CSyncDlg::OnInitDialog()
        this->AddOthersToAnchor();\r
        // TODO:  Add extra initialization here\r
 \r
        this->AddOthersToAnchor();\r
        // TODO:  Add extra initialization here\r
 \r
+       this->m_ctrlPush.AddEntry(CString(_T("Push")));\r
+       this->m_ctrlPush.AddEntry(CString(_T("Push tags")));\r
+       this->m_ctrlPush.AddEntry(CString(_T("Push All")));\r
+\r
+       this->m_ctrlPull.AddEntry(CString(_T("&Pull")));\r
+       this->m_ctrlPull.AddEntry(CString(_T("&Fetch")));\r
+       this->m_ctrlPull.AddEntry(CString(_T("Fetch&&Rebase")));\r
+\r
+       CString WorkingDir=g_Git.m_CurrentDir;\r
+       WorkingDir.Replace(_T(':'),_T('_'));\r
+\r
+       CString regkey ;\r
+       regkey.Format(_T("Software\\TortoiseGit\\TortoiseProc\\Sync\\%s"),WorkingDir);\r
+\r
+       this->m_regPullButton = CRegDWORD(regkey+_T("\\Pull"),0);\r
+       this->m_regPushButton = CRegDWORD(regkey+_T("\\Push"),0);\r
+\r
+       this->m_ctrlPull.SetCurrentEntry(this->m_regPullButton);\r
+       this->m_ctrlPush.SetCurrentEntry(this->m_regPushButton);\r
+\r
+       CString str;\r
+       this->GetWindowText(str);\r
+       str += _T(" - ") + g_Git.m_CurrentDir;\r
+       this->SetWindowText(str);\r
+\r
+       EnableSaveRestore(_T("SyncDlg"));\r
+\r
        return TRUE;  // return TRUE unless you set the focus to a control\r
        // EXCEPTION: OCX Property Pages should return FALSE\r
 }\r
        return TRUE;  // return TRUE unless you set the focus to a control\r
        // EXCEPTION: OCX Property Pages should return FALSE\r
 }\r
index 144b87c..bf3c94b 100644 (file)
@@ -23,7 +23,8 @@
 \r
 #include "StandAloneDlg.h"\r
 #include "HistoryCombo.h"\r
 \r
 #include "StandAloneDlg.h"\r
 #include "HistoryCombo.h"\r
-\r
+#include "MenuButton.h"\r
+#include "registry.h"\r
 // CSyncDlg dialog\r
 \r
 class CSyncDlg : public CResizableStandAloneDialog\r
 // CSyncDlg dialog\r
 \r
 class CSyncDlg : public CResizableStandAloneDialog\r
@@ -40,6 +41,9 @@ public:
 protected:\r
        virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support\r
 \r
 protected:\r
        virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support\r
 \r
+       CRegDWORD m_regPullButton;\r
+       CRegDWORD m_regPushButton;\r
+\r
        DECLARE_MESSAGE_MAP()\r
 public:\r
        BOOL m_bAutoLoadPuttyKey;\r
        DECLARE_MESSAGE_MAP()\r
 public:\r
        BOOL m_bAutoLoadPuttyKey;\r
@@ -47,9 +51,9 @@ public:
        CComboBoxEx m_ctrlRemoteBranch;\r
        CComboBoxEx m_ctrlURL;\r
        CButton m_ctrlDumyButton;\r
        CComboBoxEx m_ctrlRemoteBranch;\r
        CComboBoxEx m_ctrlURL;\r
        CButton m_ctrlDumyButton;\r
-       CButton m_ctrlPull;\r
-       CButton m_ctrlPush;\r
-       CStatic m_ctrlStatus;\r
+       CMenuButton m_ctrlPull;\r
+       CMenuButton m_ctrlPush;\r
+       CMenuButton m_ctrlStatus;\r
        afx_msg void OnBnClickedButtonPull();\r
        afx_msg void OnBnClickedButtonPush();\r
        afx_msg void OnBnClickedButtonApply();\r
        afx_msg void OnBnClickedButtonPull();\r
        afx_msg void OnBnClickedButtonPush();\r
        afx_msg void OnBnClickedButtonApply();\r