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();
}
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));
			}
		}
	}
}
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);
}