1 // PullFetchDlg.cpp : implementation file
\r
5 #include "TortoiseProc.h"
\r
6 #include "PullFetchDlg.h"
\r
9 // CPullFetchDlg dialog
\r
11 IMPLEMENT_DYNAMIC(CPullFetchDlg, CResizableStandAloneDialog)
\r
13 CPullFetchDlg::CPullFetchDlg(CWnd* pParent /*=NULL*/)
\r
14 : CResizableStandAloneDialog(CPullFetchDlg::IDD, pParent)
\r
19 CPullFetchDlg::~CPullFetchDlg()
\r
23 void CPullFetchDlg::DoDataExchange(CDataExchange* pDX)
\r
25 CDialog::DoDataExchange(pDX);
\r
26 DDX_Control(pDX, IDC_REMOTE_COMBO, this->m_Remote);
\r
27 DDX_Control(pDX, IDC_OTHER, this->m_Other);
\r
28 DDX_Control(pDX, IDC_REMOTE_BRANCH, this->m_RemoteBranch);
\r
33 BEGIN_MESSAGE_MAP(CPullFetchDlg,CResizableStandAloneDialog )
\r
34 ON_BN_CLICKED(IDC_REMOTE_RD, &CPullFetchDlg::OnBnClickedRd)
\r
35 ON_BN_CLICKED(IDC_OTHER_RD, &CPullFetchDlg::OnBnClickedRd)
\r
36 ON_BN_CLICKED(IDOK, &CPullFetchDlg::OnBnClickedOk)
\r
39 BOOL CPullFetchDlg::OnInitDialog()
\r
41 CResizableStandAloneDialog::OnInitDialog();
\r
42 AddAnchor(IDC_REMOTE_COMBO, TOP_LEFT, TOP_RIGHT);
\r
43 AddAnchor(IDC_OTHER, TOP_LEFT,TOP_RIGHT);
\r
45 AddAnchor(IDC_REMOTE_BRANCH, TOP_LEFT,TOP_RIGHT);
\r
47 AddAnchor(IDOK,BOTTOM_RIGHT);
\r
48 AddAnchor(IDCANCEL,BOTTOM_RIGHT);
\r
50 CheckRadioButton(IDC_REMOTE_RD,IDC_OTHER_RD,IDC_REMOTE_RD);
\r
51 m_Remote.EnableWindow(TRUE);
\r
52 m_Other.EnableWindow(FALSE);
\r
53 m_RemoteBranch.EnableWindow(FALSE);
\r
55 m_Other.SetURLHistory(TRUE);
\r
56 m_Other.LoadHistory(_T("Software\\TortoiseGit\\History\\PullURLS"), _T("url"));
\r
57 m_Other.SetCurSel(0);
\r
59 m_RemoteBranch.LoadHistory(_T("Software\\TortoiseGit\\History\\PullRemoteBranch"), _T("br"));
\r
60 m_RemoteBranch.SetCurSel(0);
\r
63 this->SetWindowTextW(_T("Pull"));
\r
65 this->SetWindowTextW(_T("Fetch"));
\r
69 if(!g_Git.GetRemoteList(list))
\r
71 for(unsigned int i=0;i<list.size();i++)
\r
72 m_Remote.AddString(list[i]);
\r
77 // CPullFetchDlg message handlers
\r
79 void CPullFetchDlg::OnBnClickedRd()
\r
82 // TODO: Add your control notification handler code here
\r
83 if( GetCheckedRadioButton(IDC_REMOTE_RD,IDC_OTHER_RD) == IDC_REMOTE_RD)
\r
85 m_Remote.EnableWindow(TRUE);
\r
86 m_Other.EnableWindow(FALSE);
\r
87 m_RemoteBranch.EnableWindow(FALSE);
\r
90 if( GetCheckedRadioButton(IDC_REMOTE_RD,IDC_OTHER_RD) == IDC_OTHER_RD)
\r
92 m_Remote.EnableWindow(FALSE);
\r
93 m_Other.EnableWindow(TRUE);;
\r
94 m_RemoteBranch.EnableWindow(TRUE);
\r
100 void CPullFetchDlg::OnBnClickedOk()
\r
102 // TODO: Add your control notification handler code here
\r
103 if( GetCheckedRadioButton(IDC_REMOTE_RD,IDC_OTHER_RD) == IDC_REMOTE_RD)
\r
105 m_RemoteURL=m_Remote.GetString();
\r
106 m_RemoteBranchName.Empty();
\r
109 if( GetCheckedRadioButton(IDC_REMOTE_RD,IDC_OTHER_RD) == IDC_OTHER_RD)
\r
111 m_Other.GetWindowTextW(m_RemoteURL);
\r
112 m_RemoteBranchName=m_RemoteBranch.GetString();
\r
116 m_Other.SaveHistory();
\r
117 m_RemoteBranch.SaveHistory();
\r