forked from qt-creator/qt-creator
PathChooser migration for external app debug lanuching
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -53,9 +53,6 @@ public:
|
||||
|
||||
QString executableFile() const;
|
||||
QString executableArguments() const;
|
||||
|
||||
private slots:
|
||||
void onBrowseButton();
|
||||
};
|
||||
|
||||
} // namespace Debugger
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<ui version="4.0" >
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>StartExternalDialog</class>
|
||||
<widget class="QDialog" name="StartExternalDialog" >
|
||||
<property name="geometry" >
|
||||
<widget class="QDialog" name="StartExternalDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
@@ -9,59 +10,52 @@
|
||||
<height>127</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<property name="windowTitle">
|
||||
<string>Start Debugger</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="spacing" >
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin" >
|
||||
<property name="margin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<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" >
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="execLabel">
|
||||
<property name="text">
|
||||
<string>Executable:</string>
|
||||
</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" >
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="argLabel">
|
||||
<property name="text">
|
||||
<string>Arguments:</string>
|
||||
</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>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>407</width>
|
||||
<height>16</height>
|
||||
@@ -70,24 +64,32 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line" >
|
||||
<property name="orientation" >
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox" >
|
||||
<property name="orientation" >
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons" >
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
|
||||
Reference in New Issue
Block a user