forked from qt-creator/qt-creator
Migrate subversion plugin to extended PathChooser
This commit is contained in:
@@ -39,20 +39,24 @@
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <utils/pathchooser.h>
|
||||
|
||||
using namespace Subversion::Internal;
|
||||
using namespace Core::Utils;
|
||||
|
||||
|
||||
SettingsPageWidget::SettingsPageWidget(QWidget *parent) :
|
||||
QWidget(parent)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
connect(m_ui.browseButton, SIGNAL(clicked()), this, SLOT(browseForCommand()));
|
||||
m_ui.pathChooser->setExpectedKind(PathChooser::Command);
|
||||
m_ui.pathChooser->setPromptDialogTitle(tr("Subversion Command"));
|
||||
}
|
||||
|
||||
SubversionSettings SettingsPageWidget::settings() const
|
||||
{
|
||||
SubversionSettings rc;
|
||||
rc.svnCommand = m_ui.svnCmdLineEdit->text();
|
||||
rc.svnCommand = m_ui.pathChooser->path();
|
||||
rc.useAuthentication = m_ui.userGroupBox->isChecked();
|
||||
rc.user = m_ui.usernameLineEdit->text();
|
||||
rc.password = m_ui.passwordLineEdit->text();
|
||||
@@ -63,19 +67,12 @@ SubversionSettings SettingsPageWidget::settings() const
|
||||
|
||||
void SettingsPageWidget::setSettings(const SubversionSettings &s)
|
||||
{
|
||||
m_ui.svnCmdLineEdit->setText(s.svnCommand);
|
||||
m_ui.pathChooser->setPath(s.svnCommand);
|
||||
m_ui.usernameLineEdit->setText(s.user);
|
||||
m_ui.passwordLineEdit->setText(s.password);
|
||||
m_ui.userGroupBox->setChecked(s.useAuthentication);
|
||||
}
|
||||
|
||||
void SettingsPageWidget::browseForCommand()
|
||||
{
|
||||
QString cmd = QFileDialog::getOpenFileName(window(), tr("Subversion Command"));
|
||||
if (!cmd.isEmpty())
|
||||
m_ui.svnCmdLineEdit->setText(cmd);
|
||||
}
|
||||
|
||||
SettingsPage::SettingsPage()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -59,9 +59,6 @@ public:
|
||||
SubversionSettings settings() const;
|
||||
void setSettings(const SubversionSettings &);
|
||||
|
||||
private slots:;
|
||||
void browseForCommand();
|
||||
|
||||
private:
|
||||
Ui::SettingsPage m_ui;
|
||||
};
|
||||
|
||||
@@ -32,14 +32,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="svnCmdLineEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="browseButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Core::Utils::PathChooser" name="pathChooser" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
@@ -109,9 +102,14 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>svnCmdLineEdit</tabstop>
|
||||
</tabstops>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Core::Utils::PathChooser</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">utils/pathchooser.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
Reference in New Issue
Block a user