Beispiel #1
0
bool CMergeDlg::HandleMenuItemClick(int cmd, CSciEdit * pSciEdit)
{
	if (m_History.IsEmpty())
		return false;

	if (cmd == m_nPopupPasteLastMessage)
	{
		if (pSciEdit->GetText() == CString(m_pDefaultText))
			pSciEdit->SetText(L"");
		CString logmsg (m_History.GetEntry(0));
		pSciEdit->InsertText(logmsg);
		return true;
	}

	if (cmd == m_nPopupRecentMessage)
	{
		CHistoryDlg historyDlg;
		historyDlg.SetHistory(m_History);
		if (historyDlg.DoModal() != IDOK)
			return false;

		if (pSciEdit->GetText() == CString(m_pDefaultText))
			pSciEdit->SetText(L"");
		m_cLogMessage.InsertText(historyDlg.GetSelectedText(), !m_cLogMessage.GetText().IsEmpty());
		GetDlgItem(IDC_LOGMESSAGE)->SetFocus();
		return true;
	}
	return false;
}
Beispiel #2
0
void CCopyDlg::OnBnClickedHistory()
{
    m_tooltips.Pop();   // hide the tooltips
    SVN svn;
    CHistoryDlg historyDlg;
    historyDlg.SetHistory(m_History);
    if (historyDlg.DoModal()==IDOK)
    {
        if (historyDlg.GetSelectedText().Compare(m_cLogMessage.GetText().Left(historyDlg.GetSelectedText().GetLength()))!=0)
        {
            if (m_ProjectProperties.GetLogMsgTemplate(PROJECTPROPNAME_LOGTEMPLATEBRANCH).Compare(m_cLogMessage.GetText())!=0)
                m_cLogMessage.InsertText(historyDlg.GetSelectedText(), !m_cLogMessage.GetText().IsEmpty());
            else
                m_cLogMessage.SetText(historyDlg.GetSelectedText());
        }
        DialogEnableWindow(IDOK, m_ProjectProperties.nMinLogSize <= m_cLogMessage.GetText().GetLength());
    }
}
Beispiel #3
0
void CLockDlg::OnBnClickedHistory()
{
    m_tooltips.Pop();   // hide the tooltips
    if (m_pathList.GetCount() == 0)
        return;
    SVN svn;
    CHistoryDlg historyDlg;
    historyDlg.SetHistory(m_History);
    if (historyDlg.DoModal()==IDOK)
    {
        if (historyDlg.GetSelectedText().Compare(m_cEdit.GetText().Left(historyDlg.GetSelectedText().GetLength()))!=0)
        {
            if ((m_ProjectProperties)&&(m_ProjectProperties->GetLogMsgTemplate(PROJECTPROPNAME_LOGTEMPLATELOCK).Compare(m_cEdit.GetText())!=0))
                m_cEdit.InsertText(historyDlg.GetSelectedText(), !m_cEdit.GetText().IsEmpty());
            else
                m_cEdit.SetText(historyDlg.GetSelectedText());
        }

        OnEnChangeLockmessage();
        GetDlgItem(IDC_LOCKMESSAGE)->SetFocus();
    }
}
Beispiel #4
0
void CInputLogDlg::OnBnClickedHistory()
{
	CString reg;
	reg.Format(_T("Software\\TortoiseGit\\History\\commit%s"), (LPCTSTR)m_sUUID);
	CRegHistory history;
	history.Load(reg, _T("logmsgs"));
	CHistoryDlg HistoryDlg;
	HistoryDlg.SetHistory(history);
	if (HistoryDlg.DoModal()==IDOK)
	{
		if (HistoryDlg.GetSelectedText().Compare(m_cInput.GetText().Left(HistoryDlg.GetSelectedText().GetLength()))!=0)
		{
			if ((m_pProjectProperties)&&(m_pProjectProperties->sLogTemplate.Compare(m_cInput.GetText())!=0))
				m_cInput.InsertText(HistoryDlg.GetSelectedText(), !m_cInput.GetText().IsEmpty());
			else
				m_cInput.SetText(HistoryDlg.GetSelectedText());
		}

		UpdateOKButton();
		GetDlgItem(IDC_INPUTTEXT)->SetFocus();
	}
}