PathChooser migration for external app debug lanuching

This commit is contained in:
goro
2008-12-19 16:39:02 +01:00
parent 3396f824e0
commit 12bcc11389
4 changed files with 43 additions and 53 deletions

View File

@@ -138,8 +138,7 @@ QString PathChooser::path() const
void PathChooser::setPath(const QString &path)
{
const QString defaultPath = path.isEmpty() ? homePath() : path;
m_d->m_lineEdit->setText(QDir::toNativeSeparators(defaultPath));
m_d->m_lineEdit->setText(QDir::toNativeSeparators(path));
}
void PathChooser::slotBrowse()

View File

@@ -42,6 +42,8 @@ StartExternalDialog::StartExternalDialog(QWidget *parent)
: QDialog(parent)
{
setupUi(this);
execFile->setExpectedKind(Core::Utils::PathChooser::File);
execFile->setPromptDialogTitle(tr("Select Executable"));
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
//execLabel->setHidden(false);
@@ -53,14 +55,11 @@ StartExternalDialog::StartExternalDialog(QWidget *parent)
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(browseButton, SIGNAL(clicked()),
this, SLOT(onBrowseButton()));
}
void StartExternalDialog::setExecutableFile(const QString &str)
{
execEdit->setText(str);
execFile->setPath(str);
}
void StartExternalDialog::setExecutableArguments(const QString &str)
@@ -70,7 +69,7 @@ void StartExternalDialog::setExecutableArguments(const QString &str)
QString StartExternalDialog::executableFile() const
{
return execEdit->text();
return execFile->path();
}
QString StartExternalDialog::executableArguments() const
@@ -116,10 +115,3 @@ QString StartExternalDialog::executableArguments() const
return result;
*/
}
void StartExternalDialog::onBrowseButton()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Executable"),
execEdit->text());
execEdit->setText(fileName);
}

View File

@@ -53,9 +53,6 @@ public:
QString executableFile() const;
QString executableArguments() const;
private slots:
void onBrowseButton();
};
} // namespace Debugger

View File

@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>StartExternalDialog</class>
<widget class="QDialog" name="StartExternalDialog">
@@ -27,12 +28,6 @@
<property name="spacing">
<number>6</number>
</property>
<item row="1" column="1" >
<widget class="QLineEdit" name="argsEdit" />
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="execEdit" />
</item>
<item row="0" column="0">
<widget class="QLabel" name="execLabel">
<property name="text">
@@ -40,13 +35,6 @@
</property>
</widget>
</item>
<item row="0" column="2" >
<widget class="QToolButton" name="browseButton" >
<property name="text" >
<string>...</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="argLabel">
<property name="text">
@@ -54,6 +42,12 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="argsEdit"/>
</item>
<item row="0" column="1">
<widget class="Core::Utils::PathChooser" name="execFile" native="true"/>
</item>
</layout>
</item>
<item>
@@ -88,6 +82,14 @@
</item>
</layout>
</widget>
<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>