예제 #1
0
void CGitSwitchDlg::OnBnClickedOk()
{
	this->UpdateData(TRUE);

	// make sure a valid branch has been entered if a new branch is required
	m_NewBranch.Trim();
	if (m_bBranch)
	{
		if (!g_Git.IsBranchNameValid(m_NewBranch))
		{
			// new branch requested but name is empty or contains spaces
			ShowEditBalloon(IDC_EDIT_BRANCH, IDS_B_T_NOTEMPTY, IDS_ERR_ERROR, TTI_ERROR);
			return;
		}
		else if (!m_bBranchOverride && g_Git.BranchTagExists(m_NewBranch))
		{
			// branch already exists
			CString msg;
			msg.LoadString(IDS_B_EXISTS);
			ShowEditBalloon(IDC_EDIT_BRANCH, msg + L' ' + CString(MAKEINTRESOURCE(IDS_B_DIFFERENTNAMEOROVERRIDE)), CString(MAKEINTRESOURCE(IDS_WARN_WARNING)));
			return;
		}
		else if (g_Git.BranchTagExists(m_NewBranch, false))
		{
			// tag with the same name exists -> shortref is ambiguous
			if (CMessageBox::Show(m_hWnd, IDS_B_SAMETAGNAMEEXISTS, IDS_APPNAME, 2, IDI_EXCLAMATION, IDS_CONTINUEBUTTON, IDS_ABORTBUTTON) == 2)
				return;
		}
	}

	UpdateRevsionName();
	//this->m_Version.SaveHistory();
	OnOK();
}
예제 #2
0
void CResetDlg::OnOK()
{
	this->UpdateData(TRUE);
	UpdateRevsionName();
	m_ResetToVersion = m_VersionName;
	m_ResetType=this->GetCheckedRadioButton(IDC_RADIO_RESET_SOFT,IDC_RADIO_RESET_HARD)-IDC_RADIO_RESET_SOFT;
	return CHorizontalResizableStandAloneDialog::OnOK();
}
예제 #3
0
void CGitSwitchDlg::OnBnClickedOk()
{
	this->UpdateData(TRUE);

	// make sure a valid branch has been entered if a new branch is required
	m_NewBranch.Trim();
	if ( m_bBranch && (!g_Git.IsBranchNameValid(m_NewBranch)))
	{
		// new branch requested but name is empty or contains spaces
		CMessageBox::Show(NULL, IDS_B_T_NOTEMPTY, IDS_TORTOISEGIT, MB_OK);
	}
	else
	{
		UpdateRevsionName();
		//this->m_Version.SaveHistory();
		OnOK();
	}
}
예제 #4
0
void CExportDlg::OnOK()
{
	if (!UpdateData(TRUE))
		return; // don't dismiss dialog (error message already shown by MFC framework)

	// check it the export path is a valid windows path
	UpdateRevsionName();

	if (m_VersionName.IsEmpty())
	{
		m_tooltips.ShowBalloon(IDC_COMBOBOXEX_VERSION, IDS_ERR_INVALIDREV, IDS_ERR_ERROR, TTI_ERROR);
		return;
	}

	m_bAutoCreateTargetName = false;

//	m_URLCombo.SaveHistory();
//	m_URL = m_URLCombo.GetString();


	if(::PathFileExists(this->m_strExportDirectory))
	{
		if(::PathIsDirectory(m_strExportDirectory))
		{
			CMessageBox::Show(NULL, _T("You selected a folder.\r\nExports are only possible to a (zip) file."),
				_T("TortoiseGit"), MB_OK|MB_ICONERROR);
			return;
		}
		if (CMessageBox::Show(NULL, _T("\"") + m_strExportDirectory + _T("\" already exists.\r\nDo you want to overwrite it?"),
				_T("TortoiseGit"), MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2) != IDYES)
		{
			return ;
		}
	}
	else if (m_strExportDirectory.IsEmpty())
	{
		CMessageBox::Show(NULL,_T("You must select a filename for the zip-file!"), _T("TortoiseGit"), MB_OK|MB_ICONERROR);
		return;
	}

	UpdateData(FALSE);
	CHorizontalResizableStandAloneDialog::OnOK();
}
예제 #5
0
void CExportDlg::OnOK()
{
	if (!UpdateData(TRUE))
		return; // don't dismiss dialog (error message already shown by MFC framework)

	// check it the export path is a valid windows path
	UpdateRevsionName();

	if (m_VersionName.IsEmpty())
	{
		m_tooltips.ShowBalloon(IDC_COMBOBOXEX_VERSION, IDS_ERR_INVALIDREV, IDS_ERR_ERROR, TTI_ERROR);
		return;
	}

	if(::PathFileExists(m_strFile))
	{
		if(::PathIsDirectory(m_strFile))
		{
			CMessageBox::Show(NULL, IDS_PROCEXPORTERRFOLDER, IDS_APPNAME, MB_OK | MB_ICONERROR);
			return;
		}
		CString sMessage;
		sMessage.Format(IDS_PROC_OVERWRITE_CONFIRM, (LPCTSTR)m_strFile);
		if (CMessageBox::Show(NULL, sMessage, _T("TortoiseGit"), MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2) != IDYES)
		{
			return ;
		}
	}
	else if (m_strFile.IsEmpty())
	{
		CMessageBox::Show(NULL, IDS_PROC_NOZIPFILE, IDS_APPNAME, MB_OK | MB_ICONERROR);
		return;
	}

	UpdateData(FALSE);
	CHorizontalResizableStandAloneDialog::OnOK();
}
예제 #6
0
void CResetDlg::OnVersionChanged()
{
	UpdateData(TRUE);
	UpdateRevsionName();
	UpdateData(FALSE);
}