OSDN Git Service

Sync Dialog branch select basic work.
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / SyncDlg.cpp
index 8a52e21..2ba67e9 100644 (file)
@@ -33,7 +33,7 @@ CSyncDlg::CSyncDlg(CWnd* pParent /*=NULL*/)
        : CResizableStandAloneDialog(CSyncDlg::IDD, pParent)\r
        , m_bAutoLoadPuttyKey(FALSE)\r
 {\r
-\r
+       m_pTooltip=&this->m_tooltips;\r
 }\r
 \r
 CSyncDlg::~CSyncDlg()\r
@@ -44,8 +44,6 @@ void CSyncDlg::DoDataExchange(CDataExchange* pDX)
 {\r
        CDialog::DoDataExchange(pDX);\r
        DDX_Check(pDX, IDC_CHECK_PUTTY_KEY, m_bAutoLoadPuttyKey);\r
-       DDX_Control(pDX, IDC_COMBOBOXEX_LOCAL_BRANCH, m_ctrlLocalBranch);\r
-       DDX_Control(pDX, IDC_COMBOBOXEX_REMOTE_BRANCH, m_ctrlRemoteBranch);\r
        DDX_Control(pDX, IDC_COMBOBOXEX_URL, m_ctrlURL);\r
        DDX_Control(pDX, IDC_BUTTON_TABCTRL, m_ctrlDumyButton);\r
        DDX_Control(pDX, IDC_BUTTON_PULL, m_ctrlPull);\r
@@ -53,6 +51,8 @@ void CSyncDlg::DoDataExchange(CDataExchange* pDX)
        DDX_Control(pDX, IDC_STATIC_STATUS, m_ctrlStatus);\r
        DDX_Control(pDX, IDC_PROGRESS_SYNC, m_ctrlProgress);\r
        DDX_Control(pDX, IDC_ANIMATE_SYNC, m_ctrlAnimate);\r
+\r
+       BRANCH_COMBOX_DDX;\r
 }\r
 \r
 \r
@@ -61,6 +61,8 @@ BEGIN_MESSAGE_MAP(CSyncDlg, CResizableStandAloneDialog)
        ON_BN_CLICKED(IDC_BUTTON_PUSH, &CSyncDlg::OnBnClickedButtonPush)\r
        ON_BN_CLICKED(IDC_BUTTON_APPLY, &CSyncDlg::OnBnClickedButtonApply)\r
        ON_BN_CLICKED(IDC_BUTTON_EMAIL, &CSyncDlg::OnBnClickedButtonEmail)\r
+       ON_BN_CLICKED(IDC_BUTTON_MANAGE, &CSyncDlg::OnBnClickedButtonManage)\r
+       BRANCH_COMBOX_EVENT\r
 END_MESSAGE_MAP()\r
 \r
 \r
@@ -93,9 +95,23 @@ BOOL CSyncDlg::OnInitDialog()
 {\r
        CResizableStandAloneDialog::OnInitDialog();\r
 \r
-       AddAnchor(IDC_STATIC_REMOTE_BRANCH,TOP_RIGHT);\r
-       AddAnchor(IDC_COMBOBOXEX_REMOTE_BRANCH,TOP_RIGHT);\r
-       AddAnchor(IDC_BUTTON_REMOTE_BRANCH,TOP_RIGHT);\r
+       //Create Tabctrl\r
+       CWnd *pwnd=this->GetDlgItem(IDC_BUTTON_TABCTRL);\r
+       CRect rectDummy;\r
+       pwnd->GetWindowRect(&rectDummy);\r
+       this->ScreenToClient(rectDummy);\r
+\r
+       if (!m_ctrlTabCtrl.Create(CMFCTabCtrl::STYLE_FLAT, rectDummy, this, IDC_SYNC_TAB))\r
+       {\r
+               TRACE0("Failed to create output tab window\n");\r
+               return FALSE;      // fail to create\r
+       }\r
+       m_ctrlTabCtrl.SetResizeMode(CMFCTabCtrl::RESIZE_NO);\r
+\r
+       this->m_tooltips.Create(this);\r
+\r
+       AddAnchor(IDC_SYNC_TAB,TOP_LEFT,BOTTOM_RIGHT);\r
+\r
        AddAnchor(IDC_GROUP_INFO,TOP_LEFT,TOP_RIGHT);\r
        AddAnchor(IDC_COMBOBOXEX_URL,TOP_LEFT,TOP_RIGHT);\r
        AddAnchor(IDC_BUTTON_MANAGE,TOP_RIGHT);\r
@@ -108,6 +124,13 @@ BOOL CSyncDlg::OnInitDialog()
        AddAnchor(IDHELP,BOTTOM_RIGHT);\r
        AddAnchor(IDC_STATIC_STATUS,BOTTOM_LEFT);\r
        AddAnchor(IDC_ANIMATE_SYNC,TOP_RIGHT);\r
+       \r
+       BRANCH_COMBOX_ADD_ANCHOR();\r
+\r
+       CString WorkingDir=g_Git.m_CurrentDir;\r
+       WorkingDir.Replace(_T(':'),_T('_'));\r
+       m_RegKeyRemoteBranch = CString(_T("Software\\TortoiseGit\\History\\SyncBranch\\"))+WorkingDir;\r
+\r
 \r
        this->AddOthersToAnchor();\r
        // TODO:  Add extra initialization here\r
@@ -120,7 +143,7 @@ BOOL CSyncDlg::OnInitDialog()
        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
+       \r
        WorkingDir.Replace(_T(':'),_T('_'));\r
 \r
        CString regkey ;\r
@@ -139,6 +162,20 @@ BOOL CSyncDlg::OnInitDialog()
 \r
        EnableSaveRestore(_T("SyncDlg"));\r
 \r
+       this->LoadBranchInfo();\r
        return TRUE;  // return TRUE unless you set the focus to a control\r
        // EXCEPTION: OCX Property Pages should return FALSE\r
 }\r
+\r
+void CSyncDlg::OnBnClickedButtonManage()\r
+{\r
+       // TODO: Add your control notification handler code here\r
+       CAppUtils::LaunchRemoteSetting();\r
+}\r
+\r
+BOOL CSyncDlg::PreTranslateMessage(MSG* pMsg)\r
+{\r
+       // TODO: Add your specialized code here and/or call the base class\r
+       m_tooltips.RelayEvent(pMsg);\r
+       return __super::PreTranslateMessage(pMsg);\r
+}\r