Exemplo n.º 1
0
void SubversionView::OnFileAdded(wxCommandEvent& event)
{
	event.Skip();
	SvnSettingsData ssd = m_plugin->GetSettings();
	if(ssd.GetFlags() & SvnAddFileToSvn) {
		wxArrayString *files = (wxArrayString*)event.GetClientData();
		if(files) {
			bool     addToSvn(false);
			wxString command;
			command << m_plugin->GetSvnExeName() << wxT(" add ");
			for(size_t i=0; i<files->GetCount(); i++){

				if(m_plugin->IsPathUnderSvn(files->Item(i))) {
					command << wxT("\"") << files->Item(i) << wxT("\" ");
					addToSvn = true;
				}

			}

			if(addToSvn) {
				command.RemoveLast();
				m_plugin->GetConsole()->Execute(command, m_textCtrlRootDir->GetValue(), new SvnDefaultCommandHandler(m_plugin, event.GetId(), this));
			}
		}
	}
}
Exemplo n.º 2
0
void SubversionView::OnLinkEditor(wxCommandEvent& event)
{
	SvnSettingsData ssd = m_plugin->GetSettings();
	if(event.IsChecked())
		ssd.SetFlags(ssd.GetFlags() | SvnLinkEditor);
	else
		ssd.SetFlags(ssd.GetFlags() & ~SvnLinkEditor);
	
	m_plugin->SetSettings(ssd);
	
	DoLinkEditor();
}
Exemplo n.º 3
0
SvnCommitDialog::~SvnCommitDialog()
{
    wxDELETE(m_process);

    wxString message = m_stcMessage->GetText();
    m_plugin->GetCommitMessagesCache().AddMessage(message);

    int sashPos = m_splitterH->GetSashPosition();
    int sashPosH = m_splitterV->GetSashPosition();
    SvnSettingsData ssd = m_plugin->GetSettings();
    ssd.SetCommitDlgSashPos(sashPos);
    ssd.SetCommitDlgHSashPos(sashPosH);
    m_plugin->SetSettings(ssd);
}
Exemplo n.º 4
0
SvnCheckoutDialog::~SvnCheckoutDialog()
{
    SvnSettingsData ssd = m_plugin->GetSettings();
    wxArrayString urls;
    wxString selection = m_comboBoxRepoURL->GetValue();

    urls = ssd.GetUrls();
    selection.Trim().Trim(false);
    if(urls.Index(selection) == wxNOT_FOUND && selection.IsEmpty() == false) {
        urls.Add(selection);
    }
    ssd.SetUrls(urls);
    m_plugin->SetSettings(ssd);
}
Exemplo n.º 5
0
SvnCheckoutDialog::~SvnCheckoutDialog()
{
	SvnSettingsData ssd = m_plugin->GetSettings();
	wxArrayString   urls;
	wxString        selection = m_comboBoxRepoURL->GetValue();

	urls = ssd.GetUrls();
	selection.Trim().Trim(false);
	if (urls.Index(selection) == wxNOT_FOUND && selection.IsEmpty() == false) {
		urls.Add(selection);
	}
	ssd.SetUrls(urls);
	m_plugin->SetSettings(ssd);
	WindowAttrManager::Save(this, wxT("SvnCheckoutDialog"), m_plugin->GetManager()->GetConfigTool());
}
Exemplo n.º 6
0
SvnCommitDialog::~SvnCommitDialog()
{
    wxDELETE( m_process );

    wxString message = m_stcMessage->GetText();
    m_plugin->GetCommitMessagesCache().AddMessage(message);

    int sashPos = m_splitterH->GetSashPosition();
    int sashPosH = m_splitterV->GetSashPosition();
    SvnSettingsData ssd = m_plugin->GetSettings();
    ssd.SetCommitDlgSashPos(sashPos);
    ssd.SetCommitDlgHSashPos(sashPosH);
    m_plugin->SetSettings( ssd );
    WindowAttrManager::Save(this, wxT("SvnCommitDialog"), m_plugin->GetManager()->GetConfigTool());
}
Exemplo n.º 7
0
void SvnPreferencesDialog::OnButtonOK(wxCommandEvent& event)
{
    event.Skip();

    SvnSettingsData ssd;
    ssd.SetExternalDiffViewer(m_textCtrlDiffViewer->GetValue());
    ssd.SetIgnoreFilePattern(m_textCtrlIgnorePattern->GetValue());
    ssd.SetSshClient(m_textCtrlSSHClient->GetValue());
    ssd.SetSshClientArgs(m_textCtrlSshClientArgs->GetValue());
    ssd.SetExecutable(m_textCtrlSvnExecutable->GetValue());
    ssd.SetRevisionMacroName(m_textCtrlMacroName->GetValue());

    // Link Editor flag is not set via this dialog
    // so read its current value before adding the other
    // flags
    size_t flags(0);
    if(m_plugin->GetSettings().GetFlags() & SvnLinkEditor) flags = SvnLinkEditor;

    if(m_checkBoxAddToSvn->IsChecked()) {
        flags |= SvnAddFileToSvn;
    }

    if(m_checkBoxRetag->IsChecked()) {
        flags |= SvnRetagWorkspace;
    }

    if(m_checkBoxUseExternalDiff->IsChecked()) {
        flags |= SvnUseExternalDiff;
    }

    if(m_checkBoxExposeRevisionMacro->IsChecked()) {
        flags |= SvnExposeRevisionMacro;
    }

    if(m_checkBoxRenameFile->IsChecked()) {
        flags |= SvnRenameFileInRepo;
    }

    if(m_checkBoxUsePosixLocale->IsChecked()) {
        flags |= SvnUsePosixLocale;
    }

    ssd.SetFlags(flags);
    m_plugin->SetSettings(ssd);
}
Exemplo n.º 8
0
SvnPreferencesDialog::SvnPreferencesDialog(wxWindow* parent, Subversion2* plugin)
    : SvnPreferencesDialogBase(parent)
    , m_plugin(plugin)
{
    SvnSettingsData ssd;
    ssd = m_plugin->GetSettings();

    m_textCtrlDiffViewer->SetValue(ssd.GetExternalDiffViewer());
    m_textCtrlIgnorePattern->SetValue(ssd.GetIgnoreFilePattern());
    m_textCtrlSshClientArgs->SetValue(ssd.GetSshClientArgs());
    m_textCtrlSSHClient->SetValue(ssd.GetSshClient());
    m_textCtrlSvnExecutable->SetValue(ssd.GetExecutable());
    m_textCtrlMacroName->SetValue(ssd.GetRevisionMacroName());

    m_checkBoxAddToSvn->SetValue(ssd.GetFlags() & SvnAddFileToSvn);
    m_checkBoxRetag->SetValue(ssd.GetFlags() & SvnRetagWorkspace);
    m_checkBoxUseExternalDiff->SetValue(ssd.GetFlags() & SvnUseExternalDiff);
    m_checkBoxExposeRevisionMacro->SetValue(ssd.GetFlags() & SvnExposeRevisionMacro);
    m_checkBoxRenameFile->SetValue(ssd.GetFlags() & SvnRenameFileInRepo);
    m_checkBoxUsePosixLocale->SetValue(ssd.GetFlags() & SvnUsePosixLocale);

    SetName("SvnPreferencesDialog");
    WindowAttrManager::Load(this);
}