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) void PathChooser::setPath(const QString &path)
{ {
const QString defaultPath = path.isEmpty() ? homePath() : path; m_d->m_lineEdit->setText(QDir::toNativeSeparators(path));
m_d->m_lineEdit->setText(QDir::toNativeSeparators(defaultPath));
} }
void PathChooser::slotBrowse() void PathChooser::slotBrowse()

View File

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

View File

@@ -1,7 +1,8 @@
<ui version="4.0" > <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>StartExternalDialog</class> <class>StartExternalDialog</class>
<widget class="QDialog" name="StartExternalDialog" > <widget class="QDialog" name="StartExternalDialog">
<property name="geometry" > <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
@@ -9,59 +10,52 @@
<height>127</height> <height>127</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle">
<string>Start Debugger</string> <string>Start Debugger</string>
</property> </property>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout">
<property name="spacing" > <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<property name="margin" > <property name="margin">
<number>9</number> <number>9</number>
</property> </property>
<item> <item>
<layout class="QGridLayout" > <layout class="QGridLayout">
<property name="margin" > <property name="margin">
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing" > <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<item row="1" column="1" > <item row="0" column="0">
<widget class="QLineEdit" name="argsEdit" /> <widget class="QLabel" name="execLabel">
</item> <property name="text">
<item row="0" column="1" >
<widget class="QLineEdit" name="execEdit" />
</item>
<item row="0" column="0" >
<widget class="QLabel" name="execLabel" >
<property name="text" >
<string>Executable:</string> <string>Executable:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2" > <item row="1" column="0">
<widget class="QToolButton" name="browseButton" > <widget class="QLabel" name="argLabel">
<property name="text" > <property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="argLabel" >
<property name="text" >
<string>Arguments:</string> <string>Arguments:</string>
</property> </property>
</widget> </widget>
</item> </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> </layout>
</item> </item>
<item> <item>
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0" > <property name="sizeHint" stdset="0">
<size> <size>
<width>407</width> <width>407</width>
<height>16</height> <height>16</height>
@@ -70,24 +64,32 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="Line" name="line" > <widget class="Line" name="line">
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox" > <widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="standardButtons" > <property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>Core::Utils::PathChooser</class>
<extends>QWidget</extends>
<header location="global">utils/pathchooser.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>