コード例 #1
0
ファイル: PushDlg.cpp プロジェクト: heyanshukla/TortoiseGit
void CPushDlg::OnBnClickedPushall()
{
	this->UpdateData();
	this->GetDlgItem(IDC_BRANCH_REMOTE)->EnableWindow(!m_bPushAllBranches);
	this->GetDlgItem(IDC_BRANCH_SOURCE)->EnableWindow(!m_bPushAllBranches);
	this->GetDlgItem(IDC_BUTTON_BROWSE_SOURCE_BRANCH)->EnableWindow(!m_bPushAllBranches);
	this->GetDlgItem(IDC_BUTTON_BROWSE_DEST_BRANCH)->EnableWindow(!m_bPushAllBranches);
	EnDisablePushRemoteArchiveBranch();
}
コード例 #2
0
ファイル: PushDlg.cpp プロジェクト: hfeeki/TortoiseGit
void CPushDlg::OnBnClickedRd()
{
	if( GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_REMOTE)
	{
		m_Remote.EnableWindow(TRUE);
		GetDlgItem(IDC_REMOTE_MANAGE)->EnableWindow(TRUE);
		m_RemoteURL.EnableWindow(FALSE);
	}
	if( GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_URL)
	{
		m_Remote.EnableWindow(FALSE);
		GetDlgItem(IDC_REMOTE_MANAGE)->EnableWindow(FALSE);
		m_RemoteURL.EnableWindow(TRUE);
	}
	EnDisablePushRemoteArchiveBranch();
}
コード例 #3
0
ファイル: PushDlg.cpp プロジェクト: heyanshukla/TortoiseGit
void CPushDlg::OnBnClickedRd()
{
	if( GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_REMOTE)
	{
		m_Remote.EnableWindow(TRUE);
		GetDlgItem(IDC_REMOTE_MANAGE)->EnableWindow(TRUE);
		m_RemoteURL.EnableWindow(FALSE);
	}
	if( GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_URL)
	{
		CString clippath = CAppUtils::GetClipboardLink();
		if (clippath.IsEmpty())
			m_RemoteURL.SetCurSel(0);
		else
			m_RemoteURL.SetWindowText(clippath);
		m_Remote.EnableWindow(FALSE);
		GetDlgItem(IDC_REMOTE_MANAGE)->EnableWindow(FALSE);
		m_RemoteURL.EnableWindow(TRUE);
	}
	EnDisablePushRemoteArchiveBranch();
}
コード例 #4
0
ファイル: PushDlg.cpp プロジェクト: hfeeki/TortoiseGit
void CPushDlg::GetRemoteBranch(CString currentBranch)
{
	CString WorkingDir=g_Git.m_CurrentDir;
	WorkingDir.Replace(_T(':'), _T('_'));

	if (currentBranch.IsEmpty())
	{
		EnDisablePushRemoteArchiveBranch();
		return;
	}

	CString configName;

	configName.Format(L"branch.%s.pushremote", currentBranch);
	CString pushRemote = g_Git.GetConfigValue(configName);
	if( pushRemote.IsEmpty() )
	{
		configName.Format(L"branch.%s.remote", currentBranch);
		pushRemote = g_Git.GetConfigValue(configName);
	}

	CRegString remote(CString(_T("Software\\TortoiseGit\\History\\PushRemote\\")+WorkingDir));

	if (!pushRemote.IsEmpty())
	{
		remote = pushRemote;
		// if a pushRemote exists, select it
		for (int i = 0; i < m_Remote.GetCount(); ++i)
		{
			CString str;
			int n = m_Remote.GetLBTextLen(i);
			m_Remote.GetLBText(i, str.GetBuffer(n));
			str.ReleaseBuffer();
			if (str == pushRemote)
			{
				m_Remote.SetCurSel(i);
				break;
			}
		}
	}
	// select the only remote if only one exists
	else if (m_Remote.GetCount() == 1)
		m_Remote.SetCurSel(0);
	// select no remote if no push-remote is specified AND push to all remotes is not selected
	else if (!(m_Remote.GetCount() > 1 && m_Remote.GetCurSel() == 0))
	{
		m_Remote.SetCurSel(-1);
	}

	//Select pull-branch from current branch
	configName.Format(L"branch.%s.pushbranch", currentBranch);
	CString pushBranch = CGit::StripRefName(g_Git.GetConfigValue(configName));
	if( pushBranch.IsEmpty() )
	{
		configName.Format(L"branch.%s.merge", currentBranch);
		pushBranch = CGit::StripRefName(g_Git.GetConfigValue(configName));
	}

	m_BranchRemote.LoadHistory(CString(_T("Software\\TortoiseGit\\History\\RemoteBranch\\"))+WorkingDir, _T("branch"));
	if( !pushBranch.IsEmpty() )
		m_BranchRemote.AddString(pushBranch);

	EnDisablePushRemoteArchiveBranch();
}