1 // TortoiseGit - a Windows shell extension for easy version control
\r
3 // Copyright (C) 2008-2009 - TortoiseGit
\r
5 // This program is free software; you can redistribute it and/or
\r
6 // modify it under the terms of the GNU General Public License
\r
7 // as published by the Free Software Foundation; either version 2
\r
8 // of the License, or (at your option) any later version.
\r
10 // This program is distributed in the hope that it will be useful,
\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 // GNU General Public License for more details.
\r
15 // You should have received a copy of the GNU General Public License
\r
16 // along with this program; if not, write to the Free Software Foundation,
\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
20 // SyncDlg.cpp : implementation file
\r
24 #include "TortoiseProc.h"
\r
25 #include "SyncDlg.h"
\r
30 IMPLEMENT_DYNAMIC(CSyncDlg, CResizableStandAloneDialog)
\r
32 CSyncDlg::CSyncDlg(CWnd* pParent /*=NULL*/)
\r
33 : CResizableStandAloneDialog(CSyncDlg::IDD, pParent)
\r
34 , m_bAutoLoadPuttyKey(FALSE)
\r
39 CSyncDlg::~CSyncDlg()
\r
43 void CSyncDlg::DoDataExchange(CDataExchange* pDX)
\r
45 CDialog::DoDataExchange(pDX);
\r
46 DDX_Check(pDX, IDC_CHECK_PUTTY_KEY, m_bAutoLoadPuttyKey);
\r
47 DDX_Control(pDX, IDC_COMBOBOXEX_LOCAL_BRANCH, m_ctrlLocalBranch);
\r
48 DDX_Control(pDX, IDC_COMBOBOXEX_REMOTE_BRANCH, m_ctrlRemoteBranch);
\r
49 DDX_Control(pDX, IDC_COMBOBOXEX_URL, m_ctrlURL);
\r
50 DDX_Control(pDX, IDC_BUTTON_TABCTRL, m_ctrlDumyButton);
\r
51 DDX_Control(pDX, IDC_BUTTON_PULL, m_ctrlPull);
\r
52 DDX_Control(pDX, IDC_BUTTON_PUSH, m_ctrlPush);
\r
53 DDX_Control(pDX, IDC_STATIC_STATUS, m_ctrlStatus);
\r
54 DDX_Control(pDX, IDC_PROGRESS_SYNC, m_ctrlProgress);
\r
55 DDX_Control(pDX, IDC_ANIMATE_SYNC, m_ctrlAnimate);
\r
59 BEGIN_MESSAGE_MAP(CSyncDlg, CResizableStandAloneDialog)
\r
60 ON_BN_CLICKED(IDC_BUTTON_PULL, &CSyncDlg::OnBnClickedButtonPull)
\r
61 ON_BN_CLICKED(IDC_BUTTON_PUSH, &CSyncDlg::OnBnClickedButtonPush)
\r
62 ON_BN_CLICKED(IDC_BUTTON_APPLY, &CSyncDlg::OnBnClickedButtonApply)
\r
63 ON_BN_CLICKED(IDC_BUTTON_EMAIL, &CSyncDlg::OnBnClickedButtonEmail)
\r
67 // CSyncDlg message handlers
\r
69 void CSyncDlg::OnBnClickedButtonPull()
\r
71 // TODO: Add your control notification handler code here
\r
72 this->m_regPullButton =this->m_ctrlPull.GetCurrentEntry();
\r
75 void CSyncDlg::OnBnClickedButtonPush()
\r
77 // TODO: Add your control notification handler code here
\r
78 this->m_regPushButton=this->m_ctrlPush.GetCurrentEntry();
\r
82 void CSyncDlg::OnBnClickedButtonApply()
\r
84 // TODO: Add your control notification handler code here
\r
87 void CSyncDlg::OnBnClickedButtonEmail()
\r
89 // TODO: Add your control notification handler code here
\r
92 BOOL CSyncDlg::OnInitDialog()
\r
94 CResizableStandAloneDialog::OnInitDialog();
\r
96 AddAnchor(IDC_STATIC_REMOTE_BRANCH,TOP_RIGHT);
\r
97 AddAnchor(IDC_COMBOBOXEX_REMOTE_BRANCH,TOP_RIGHT);
\r
98 AddAnchor(IDC_BUTTON_REMOTE_BRANCH,TOP_RIGHT);
\r
99 AddAnchor(IDC_GROUP_INFO,TOP_LEFT,TOP_RIGHT);
\r
100 AddAnchor(IDC_COMBOBOXEX_URL,TOP_LEFT,TOP_RIGHT);
\r
101 AddAnchor(IDC_BUTTON_MANAGE,TOP_RIGHT);
\r
102 AddAnchor(IDC_BUTTON_PULL,BOTTOM_LEFT);
\r
103 AddAnchor(IDC_BUTTON_PUSH,BOTTOM_LEFT);
\r
104 AddAnchor(IDC_BUTTON_APPLY,BOTTOM_LEFT);
\r
105 AddAnchor(IDC_BUTTON_EMAIL,BOTTOM_LEFT);
\r
106 AddAnchor(IDC_PROGRESS_SYNC,BOTTOM_LEFT,BOTTOM_RIGHT);
\r
107 AddAnchor(IDOK,BOTTOM_RIGHT);
\r
108 AddAnchor(IDHELP,BOTTOM_RIGHT);
\r
109 AddAnchor(IDC_STATIC_STATUS,BOTTOM_LEFT);
\r
110 AddAnchor(IDC_ANIMATE_SYNC,TOP_RIGHT);
\r
112 this->AddOthersToAnchor();
\r
113 // TODO: Add extra initialization here
\r
115 this->m_ctrlPush.AddEntry(CString(_T("Push")));
\r
116 this->m_ctrlPush.AddEntry(CString(_T("Push tags")));
\r
117 this->m_ctrlPush.AddEntry(CString(_T("Push All")));
\r
119 this->m_ctrlPull.AddEntry(CString(_T("&Pull")));
\r
120 this->m_ctrlPull.AddEntry(CString(_T("&Fetch")));
\r
121 this->m_ctrlPull.AddEntry(CString(_T("Fetch&&Rebase")));
\r
123 CString WorkingDir=g_Git.m_CurrentDir;
\r
124 WorkingDir.Replace(_T(':'),_T('_'));
\r
127 regkey.Format(_T("Software\\TortoiseGit\\TortoiseProc\\Sync\\%s"),WorkingDir);
\r
129 this->m_regPullButton = CRegDWORD(regkey+_T("\\Pull"),0);
\r
130 this->m_regPushButton = CRegDWORD(regkey+_T("\\Push"),0);
\r
132 this->m_ctrlPull.SetCurrentEntry(this->m_regPullButton);
\r
133 this->m_ctrlPush.SetCurrentEntry(this->m_regPushButton);
\r
136 this->GetWindowText(str);
\r
137 str += _T(" - ") + g_Git.m_CurrentDir;
\r
138 this->SetWindowText(str);
\r
140 EnableSaveRestore(_T("SyncDlg"));
\r
142 return TRUE; // return TRUE unless you set the focus to a control
\r
143 // EXCEPTION: OCX Property Pages should return FALSE
\r