1 // GitSwitch.cpp : implementation file
\r
6 #include "TortoiseProc.h"
\r
7 #include "GitSwitchDlg.h"
\r
10 #include "Messagebox.h"
\r
12 // CGitSwitchDlg dialog
\r
14 IMPLEMENT_DYNAMIC(CGitSwitchDlg, CResizableStandAloneDialog)
\r
16 CGitSwitchDlg::CGitSwitchDlg(CWnd* pParent /*=NULL*/)
\r
17 : CResizableStandAloneDialog(CGitSwitchDlg::IDD, pParent)
\r
18 ,CChooseVersion(this)
\r
23 CGitSwitchDlg::~CGitSwitchDlg()
\r
27 void CGitSwitchDlg::DoDataExchange(CDataExchange* pDX)
\r
29 CDialog::DoDataExchange(pDX);
\r
32 DDX_Check(pDX,IDC_CHECK_FORCE,this->m_bForce);
\r
33 DDX_Check(pDX,IDC_CHECK_TRACK,this->m_bTrack);
\r
34 DDX_Check(pDX,IDC_CHECK_BRANCH,this->m_bBranch);
\r
36 DDX_Text(pDX,IDC_EDIT_BRANCH,this->m_NewBranch);
\r
40 BEGIN_MESSAGE_MAP(CGitSwitchDlg, CResizableStandAloneDialog)
\r
42 CHOOSE_VERSION_EVENT
\r
43 ON_BN_CLICKED(IDC_CHECK_BRANCH, &CGitSwitchDlg::OnBnClickedCheckBranch)
\r
44 ON_BN_CLICKED(IDOK, &CGitSwitchDlg::OnBnClickedOk)
\r
45 ON_CBN_SELCHANGE(IDC_COMBOBOXEX_BRANCH, &CGitSwitchDlg::OnCbnSelchangeComboboxexBranch)
\r
48 BOOL CGitSwitchDlg::OnInitDialog()
\r
50 CResizableStandAloneDialog::OnInitDialog();
\r
52 AddAnchor(IDC_GROUP_OPTION, TOP_LEFT, TOP_RIGHT);
\r
54 AddAnchor(IDC_EDIT_BRANCH, TOP_LEFT, TOP_RIGHT);
\r
56 AddAnchor(IDOK,BOTTOM_RIGHT);
\r
57 AddAnchor(IDCANCEL,BOTTOM_RIGHT);
\r
60 CHOOSE_VERSION_ADDANCHOR;
\r
63 if(m_Base.IsEmpty())
\r
64 SetDefaultChoose(IDC_RADIO_BRANCH);
\r
67 this->GetDlgItem(IDC_COMBOBOXEX_VERSION)->SetWindowTextW(m_Base);
\r
68 SetDefaultChoose(IDC_RADIO_VERSION);
\r
71 OnBnClickedCheckBranch();
\r
72 this->GetDlgItem(IDC_CHECK_TRACK)->EnableWindow(FALSE);
\r
78 // CCreateBranchTagDlg message handlers
\r
80 void CGitSwitchDlg::OnBnClickedChooseRadioHost()
\r
82 // TODO: Add your control notification handler code here
\r
83 OnBnClickedChooseRadio();
\r
84 OnCbnSelchangeComboboxexBranch();
\r
85 OnBnClickedCheckBranch();
\r
89 void CGitSwitchDlg::OnBnClickedOk()
\r
91 // TODO: Add your control notification handler code here
\r
92 this->UpdateData(TRUE);
\r
95 //this->m_Version.SaveHistory();
\r
99 void CGitSwitchDlg::OnBnClickedCheckBranch()
\r
101 // TODO: Add your control notification handler code here
\r
102 this->UpdateData(TRUE);
\r
103 this->UpdateRevsionName();
\r
104 GetDlgItem(IDC_EDIT_BRANCH)->SetWindowTextW(CString(_T("Branch_"))+this->m_VersionName);
\r
107 int radio=GetCheckedRadioButton(IDC_RADIO_BRANCH,IDC_RADIO_VERSION);
\r
108 if(radio==IDC_RADIO_TAGS || radio==IDC_RADIO_VERSION)
\r
110 this->m_bBranch=TRUE;
\r
111 this->UpdateData(FALSE);
\r
112 this->UpdateRevsionName();
\r
116 this->m_bBranch=FALSE;
\r
117 this->UpdateData(FALSE);
\r
120 this->GetDlgItem(IDC_EDIT_BRANCH)->EnableWindow(this->m_bBranch);
\r
123 void CGitSwitchDlg::OnCbnSelchangeComboboxexBranch()
\r
125 // TODO: Add your control notification handler code here
\r
126 int radio=GetCheckedRadioButton(IDC_RADIO_BRANCH,IDC_RADIO_VERSION);
\r
127 if(this->m_ChooseVersioinBranch.GetString().Left(6)==_T("origin") && radio==IDC_RADIO_BRANCH )
\r
128 this->GetDlgItem(IDC_CHECK_TRACK)->EnableWindow(TRUE);
\r
130 this->GetDlgItem(IDC_CHECK_TRACK)->EnableWindow(FALSE);
\r