Debugger: Move StartApplicationDialog implementation to .cpp

Change-Id: I70422f55f0189da0ee5a369b31688a87bd4b595e
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
hjk
2024-11-18 13:46:27 +01:00
parent b62bd26bd9
commit 10685ae911
3 changed files with 166 additions and 185 deletions

View File

@@ -44,38 +44,6 @@ using namespace Utils;
namespace Debugger::Internal { namespace Debugger::Internal {
///////////////////////////////////////////////////////////////////////
//
// StartApplicationDialogPrivate
//
///////////////////////////////////////////////////////////////////////
class StartApplicationDialogPrivate
{
public:
KitChooser *kitChooser;
QLabel *serverPortLabel;
QLabel *channelOverrideHintLabel;
QLabel *channelOverrideLabel;
QLineEdit *channelOverrideEdit;
QSpinBox *serverPortSpinBox;
PathChooser *localExecutablePathChooser;
FancyLineEdit *arguments;
PathChooser *workingDirectory;
QCheckBox *breakAtMainCheckBox;
QCheckBox *runInTerminalCheckBox;
QCheckBox *useTargetExtendedRemoteCheckBox;
PathChooser *debuginfoPathChooser;
QLabel *sysRootLabel;
PathChooser *sysRootPathChooser;
QLabel *serverInitCommandsLabel;
QPlainTextEdit *serverInitCommandsTextEdit;
QLabel *serverResetCommandsLabel;
QPlainTextEdit *serverResetCommandsTextEdit;
QComboBox *historyComboBox;
QDialogButtonBox *buttonBox;
};
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// //
// StartApplicationParameters // StartApplicationParameters
@@ -181,166 +149,198 @@ void StartApplicationParameters::fromSettings(const QtcSettings *settings)
// //
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
StartApplicationDialog::StartApplicationDialog(QWidget *parent) class StartApplicationDialog final : public QDialog
: QDialog(parent), d(new StartApplicationDialogPrivate) {
public:
StartApplicationDialog();
static void run(bool);
private:
void historyIndexChanged(int);
void updateState();
StartApplicationParameters parameters() const;
void setParameters(const StartApplicationParameters &p);
void setHistory(const QList<StartApplicationParameters> &l);
void onChannelOverrideChanged(const QString &channel);
KitChooser *kitChooser;
QLabel *serverPortLabel;
QLabel *channelOverrideHintLabel;
QLabel *channelOverrideLabel;
QLineEdit *channelOverrideEdit;
QSpinBox *serverPortSpinBox;
PathChooser *localExecutablePathChooser;
FancyLineEdit *arguments;
PathChooser *workingDirectory;
QCheckBox *breakAtMainCheckBox;
QCheckBox *runInTerminalCheckBox;
QCheckBox *useTargetExtendedRemoteCheckBox;
PathChooser *debuginfoPathChooser;
QLabel *sysRootLabel;
PathChooser *sysRootPathChooser;
QLabel *serverInitCommandsLabel;
QPlainTextEdit *serverInitCommandsTextEdit;
QLabel *serverResetCommandsLabel;
QPlainTextEdit *serverResetCommandsTextEdit;
QComboBox *historyComboBox;
QDialogButtonBox *buttonBox;
};
StartApplicationDialog::StartApplicationDialog()
: QDialog(ICore::dialogParent())
{ {
setWindowTitle(Tr::tr("Start Debugger")); setWindowTitle(Tr::tr("Start Debugger"));
d->kitChooser = new KitChooser(this); kitChooser = new KitChooser(this);
d->kitChooser->setShowIcons(true); kitChooser->setShowIcons(true);
d->kitChooser->populate(); kitChooser->populate();
d->serverPortLabel = new QLabel(Tr::tr("Server port:"), this); serverPortLabel = new QLabel(Tr::tr("Server port:"), this);
d->serverPortSpinBox = new QSpinBox(this); serverPortSpinBox = new QSpinBox(this);
d->serverPortSpinBox->setRange(1, 65535); serverPortSpinBox->setRange(1, 65535);
d->channelOverrideHintLabel = channelOverrideHintLabel =
new QLabel(Tr::tr("Normally, the running server is identified by the IP of the " new QLabel(Tr::tr("Normally, the running server is identified by the IP of the "
"device in the kit and the server port selected above.\n" "device in the kit and the server port selected above.\n"
"You can choose another communication channel here, such as " "You can choose another communication channel here, such as "
"a serial line or custom ip:port.")); "a serial line or custom ip:port."));
d->channelOverrideLabel = new QLabel(Tr::tr("Override server channel:"), this); channelOverrideLabel = new QLabel(Tr::tr("Override server channel:"), this);
d->channelOverrideEdit = new QLineEdit(this); channelOverrideEdit = new QLineEdit(this);
//: "For example, /dev/ttyS0, COM1, 127.0.0.1:1234" //: "For example, /dev/ttyS0, COM1, 127.0.0.1:1234"
d->channelOverrideEdit->setPlaceholderText( channelOverrideEdit->setPlaceholderText(
Tr::tr("For example, %1").arg("/dev/ttyS0, COM1, 127.0.0.1:1234")); Tr::tr("For example, %1").arg("/dev/ttyS0, COM1, 127.0.0.1:1234"));
d->localExecutablePathChooser = new PathChooser(this); localExecutablePathChooser = new PathChooser(this);
d->localExecutablePathChooser->setExpectedKind(PathChooser::File); localExecutablePathChooser->setExpectedKind(PathChooser::File);
d->localExecutablePathChooser->setPromptDialogTitle(Tr::tr("Select Executable")); localExecutablePathChooser->setPromptDialogTitle(Tr::tr("Select Executable"));
d->localExecutablePathChooser->setHistoryCompleter("LocalExecutable"); localExecutablePathChooser->setHistoryCompleter("LocalExecutable");
d->arguments = new FancyLineEdit(this); arguments = new FancyLineEdit(this);
d->arguments->setClearButtonEnabled(true); arguments->setClearButtonEnabled(true);
d->arguments->setHistoryCompleter("CommandlineArguments"); arguments->setHistoryCompleter("CommandlineArguments");
d->workingDirectory = new PathChooser(this); workingDirectory = new PathChooser(this);
d->workingDirectory->setExpectedKind(PathChooser::ExistingDirectory); workingDirectory->setExpectedKind(PathChooser::ExistingDirectory);
d->workingDirectory->setPromptDialogTitle(Tr::tr("Select Working Directory")); workingDirectory->setPromptDialogTitle(Tr::tr("Select Working Directory"));
d->workingDirectory->setHistoryCompleter("WorkingDirectory"); workingDirectory->setHistoryCompleter("WorkingDirectory");
d->runInTerminalCheckBox = new QCheckBox(this); runInTerminalCheckBox = new QCheckBox(this);
d->breakAtMainCheckBox = new QCheckBox(this); breakAtMainCheckBox = new QCheckBox(this);
d->breakAtMainCheckBox->setText(QString()); breakAtMainCheckBox->setText(QString());
d->useTargetExtendedRemoteCheckBox = new QCheckBox(this); useTargetExtendedRemoteCheckBox = new QCheckBox(this);
d->sysRootPathChooser = new PathChooser(this); sysRootPathChooser = new PathChooser(this);
d->sysRootPathChooser->setExpectedKind(PathChooser::Directory); sysRootPathChooser->setExpectedKind(PathChooser::Directory);
d->sysRootPathChooser->setHistoryCompleter("Debugger.SysRoot.History"); sysRootPathChooser->setHistoryCompleter("Debugger.SysRoot.History");
d->sysRootPathChooser->setPromptDialogTitle(Tr::tr("Select SysRoot Directory")); sysRootPathChooser->setPromptDialogTitle(Tr::tr("Select SysRoot Directory"));
d->sysRootPathChooser->setToolTip(Tr::tr( sysRootPathChooser->setToolTip(Tr::tr(
"This option can be used to override the kit's SysRoot setting.")); "This option can be used to override the kit's SysRoot setting."));
d->sysRootLabel = new QLabel(Tr::tr("Override S&ysRoot:"), this); sysRootLabel = new QLabel(Tr::tr("Override S&ysRoot:"), this);
d->sysRootLabel->setBuddy(d->sysRootPathChooser); sysRootLabel->setBuddy(sysRootPathChooser);
d->sysRootLabel->setToolTip(d->sysRootPathChooser->toolTip()); sysRootLabel->setToolTip(sysRootPathChooser->toolTip());
d->serverInitCommandsTextEdit = new QPlainTextEdit(this); serverInitCommandsTextEdit = new QPlainTextEdit(this);
d->serverInitCommandsTextEdit->setToolTip(Tr::tr( serverInitCommandsTextEdit->setToolTip(Tr::tr(
"This option can be used to send the target init commands.")); "This option can be used to send the target init commands."));
d->serverInitCommandsLabel = new QLabel(Tr::tr("&Init commands:"), this); serverInitCommandsLabel = new QLabel(Tr::tr("&Init commands:"), this);
d->serverInitCommandsLabel->setBuddy(d->serverInitCommandsTextEdit); serverInitCommandsLabel->setBuddy(serverInitCommandsTextEdit);
d->serverInitCommandsLabel->setToolTip(d->serverInitCommandsTextEdit->toolTip()); serverInitCommandsLabel->setToolTip(serverInitCommandsTextEdit->toolTip());
d->serverResetCommandsTextEdit = new QPlainTextEdit(this); serverResetCommandsTextEdit = new QPlainTextEdit(this);
d->serverResetCommandsTextEdit->setToolTip(Tr::tr( serverResetCommandsTextEdit->setToolTip(Tr::tr(
"This option can be used to send the target reset commands.")); "This option can be used to send the target reset commands."));
d->serverResetCommandsLabel = new QLabel(Tr::tr("&Reset commands:"), this); serverResetCommandsLabel = new QLabel(Tr::tr("&Reset commands:"), this);
d->serverResetCommandsLabel->setBuddy(d->serverResetCommandsTextEdit); serverResetCommandsLabel->setBuddy(serverResetCommandsTextEdit);
d->serverResetCommandsLabel->setToolTip(d->serverResetCommandsTextEdit->toolTip()); serverResetCommandsLabel->setToolTip(serverResetCommandsTextEdit->toolTip());
d->debuginfoPathChooser = new PathChooser(this); debuginfoPathChooser = new PathChooser(this);
d->debuginfoPathChooser->setPromptDialogTitle(Tr::tr("Select Location of Debugging Information")); debuginfoPathChooser->setPromptDialogTitle(Tr::tr("Select Location of Debugging Information"));
d->debuginfoPathChooser->setToolTip(Tr::tr( debuginfoPathChooser->setToolTip(Tr::tr(
"Base path for external debug information and debug sources. " "Base path for external debug information and debug sources. "
"If empty, $SYSROOT/usr/lib/debug will be chosen.")); "If empty, $SYSROOT/usr/lib/debug will be chosen."));
d->debuginfoPathChooser->setHistoryCompleter("Debugger.DebugLocation.History"); debuginfoPathChooser->setHistoryCompleter("Debugger.DebugLocation.History");
d->historyComboBox = new QComboBox(this); historyComboBox = new QComboBox(this);
d->buttonBox = new QDialogButtonBox(this); buttonBox = new QDialogButtonBox(this);
d->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
d->buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
auto formLayout = new QFormLayout(); auto formLayout = new QFormLayout();
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
formLayout->addRow(Tr::tr("&Kit:"), d->kitChooser); formLayout->addRow(Tr::tr("&Kit:"), kitChooser);
formLayout->addRow(d->serverPortLabel, d->serverPortSpinBox); formLayout->addRow(serverPortLabel, serverPortSpinBox);
formLayout->addRow(Tr::tr("Local &executable:"), d->localExecutablePathChooser); formLayout->addRow(Tr::tr("Local &executable:"), localExecutablePathChooser);
formLayout->addRow(Tr::tr("Command line &arguments:"), d->arguments); formLayout->addRow(Tr::tr("Command line &arguments:"), arguments);
formLayout->addRow(Tr::tr("&Working directory:"), d->workingDirectory); formLayout->addRow(Tr::tr("&Working directory:"), workingDirectory);
formLayout->addRow(Tr::tr("Run in &terminal:"), d->runInTerminalCheckBox); formLayout->addRow(Tr::tr("Run in &terminal:"), runInTerminalCheckBox);
formLayout->addRow(Tr::tr("Break at \"&main\":"), d->breakAtMainCheckBox); formLayout->addRow(Tr::tr("Break at \"&main\":"), breakAtMainCheckBox);
formLayout->addRow(Tr::tr("Use target extended-remote to connect:"), d->useTargetExtendedRemoteCheckBox); formLayout->addRow(Tr::tr("Use target extended-remote to connect:"), useTargetExtendedRemoteCheckBox);
formLayout->addRow(d->sysRootLabel, d->sysRootPathChooser); formLayout->addRow(sysRootLabel, sysRootPathChooser);
formLayout->addRow(d->serverInitCommandsLabel, d->serverInitCommandsTextEdit); formLayout->addRow(serverInitCommandsLabel, serverInitCommandsTextEdit);
formLayout->addRow(d->serverResetCommandsLabel, d->serverResetCommandsTextEdit); formLayout->addRow(serverResetCommandsLabel, serverResetCommandsTextEdit);
formLayout->addRow(Tr::tr("Debug &information:"), d->debuginfoPathChooser); formLayout->addRow(Tr::tr("Debug &information:"), debuginfoPathChooser);
formLayout->addRow(d->channelOverrideHintLabel); formLayout->addRow(channelOverrideHintLabel);
formLayout->addRow(d->channelOverrideLabel, d->channelOverrideEdit); formLayout->addRow(channelOverrideLabel, channelOverrideEdit);
formLayout->addRow(Layouting::createHr()); formLayout->addRow(Layouting::createHr());
formLayout->addRow(Tr::tr("&Recent:"), d->historyComboBox); formLayout->addRow(Tr::tr("&Recent:"), historyComboBox);
auto verticalLayout = new QVBoxLayout(this); auto verticalLayout = new QVBoxLayout(this);
verticalLayout->addLayout(formLayout); verticalLayout->addLayout(formLayout);
verticalLayout->addStretch(); verticalLayout->addStretch();
verticalLayout->addWidget(Layouting::createHr()); verticalLayout->addWidget(Layouting::createHr());
verticalLayout->addWidget(d->buttonBox); verticalLayout->addWidget(buttonBox);
connect(d->localExecutablePathChooser, connect(localExecutablePathChooser, &PathChooser::validChanged,
&PathChooser::validChanged, this, &StartApplicationDialog::updateState);
this,
&StartApplicationDialog::updateState);
connect(d->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); connect(historyComboBox, &QComboBox::currentIndexChanged,
connect(d->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(d->historyComboBox, &QComboBox::currentIndexChanged,
this, &StartApplicationDialog::historyIndexChanged); this, &StartApplicationDialog::historyIndexChanged);
connect(d->channelOverrideEdit, &QLineEdit::textChanged, connect(channelOverrideEdit, &QLineEdit::textChanged,
this, &StartApplicationDialog::onChannelOverrideChanged); this, &StartApplicationDialog::onChannelOverrideChanged);
updateState(); updateState();
}
StartApplicationDialog::~StartApplicationDialog() connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
{ connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
delete d;
} }
void StartApplicationDialog::setHistory(const QList<StartApplicationParameters> &l) void StartApplicationDialog::setHistory(const QList<StartApplicationParameters> &l)
{ {
d->historyComboBox->clear(); historyComboBox->clear();
for (int i = l.size(); --i >= 0; ) { for (int i = l.size(); --i >= 0; ) {
const StartApplicationParameters &p = l.at(i); const StartApplicationParameters &p = l.at(i);
if (!p.runnable.command.isEmpty()) if (!p.runnable.command.isEmpty())
d->historyComboBox->addItem(p.displayName(), QVariant::fromValue(p)); historyComboBox->addItem(p.displayName(), QVariant::fromValue(p));
} }
} }
void StartApplicationDialog::onChannelOverrideChanged(const QString &channel) void StartApplicationDialog::onChannelOverrideChanged(const QString &channel)
{ {
d->serverPortSpinBox->setEnabled(channel.isEmpty()); serverPortSpinBox->setEnabled(channel.isEmpty());
d->serverPortLabel->setEnabled(channel.isEmpty()); serverPortLabel->setEnabled(channel.isEmpty());
} }
void StartApplicationDialog::historyIndexChanged(int index) void StartApplicationDialog::historyIndexChanged(int index)
{ {
if (index < 0) if (index < 0)
return; return;
const QVariant v = d->historyComboBox->itemData(index); const QVariant v = historyComboBox->itemData(index);
QTC_ASSERT(v.canConvert<StartApplicationParameters>(), return); QTC_ASSERT(v.canConvert<StartApplicationParameters>(), return);
setParameters(v.value<StartApplicationParameters>()); setParameters(v.value<StartApplicationParameters>());
} }
void StartApplicationDialog::updateState() void StartApplicationDialog::updateState()
{ {
bool okEnabled = d->localExecutablePathChooser->isValid(); bool okEnabled = localExecutablePathChooser->isValid();
d->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(okEnabled); buttonBox->button(QDialogButtonBox::Ok)->setEnabled(okEnabled);
} }
void StartApplicationDialog::run(bool attachRemote) void StartApplicationDialog::run(bool attachRemote)
@@ -364,24 +364,24 @@ void StartApplicationDialog::run(bool attachRemote)
settings->endArray(); settings->endArray();
settings->endGroup(); settings->endGroup();
StartApplicationDialog dialog(ICore::dialogParent()); StartApplicationDialog dialog;
dialog.setHistory(history); dialog.setHistory(history);
dialog.setParameters(history.back()); dialog.setParameters(history.back());
if (!attachRemote) { if (!attachRemote) {
dialog.d->serverInitCommandsTextEdit->setVisible(false); dialog.serverInitCommandsTextEdit->setVisible(false);
dialog.d->serverInitCommandsLabel->setVisible(false); dialog.serverInitCommandsLabel->setVisible(false);
dialog.d->serverResetCommandsTextEdit->setVisible(false); dialog.serverResetCommandsTextEdit->setVisible(false);
dialog.d->serverResetCommandsLabel->setVisible(false); dialog.serverResetCommandsLabel->setVisible(false);
dialog.d->serverPortSpinBox->setVisible(false); dialog.serverPortSpinBox->setVisible(false);
dialog.d->serverPortLabel->setVisible(false); dialog.serverPortLabel->setVisible(false);
dialog.d->channelOverrideHintLabel->setVisible(false); dialog.channelOverrideHintLabel->setVisible(false);
dialog.d->channelOverrideLabel->setVisible(false); dialog.channelOverrideLabel->setVisible(false);
dialog.d->channelOverrideEdit->setVisible(false); dialog.channelOverrideEdit->setVisible(false);
} }
if (dialog.exec() != QDialog::Accepted) if (dialog.exec() != QDialog::Accepted)
return; return;
Kit *k = dialog.d->kitChooser->currentKit(); Kit *k = dialog.kitChooser->currentKit();
auto runControl = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE); auto runControl = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE);
runControl->setKit(k); runControl->setKit(k);
@@ -409,7 +409,7 @@ void StartApplicationDialog::run(bool attachRemote)
return; return;
} }
ProcessRunData inferior = newParameters.runnable; ProcessRunData inferior = newParameters.runnable;
const QString inputAddress = dialog.d->channelOverrideEdit->text(); const QString inputAddress = dialog.channelOverrideEdit->text();
if (!inputAddress.isEmpty()) if (!inputAddress.isEmpty())
debugger->setRemoteChannel(inputAddress); debugger->setRemoteChannel(inputAddress);
else else
@@ -441,50 +441,50 @@ void StartApplicationDialog::run(bool attachRemote)
debugger->startRunControl(); debugger->startRunControl();
} }
void StartApplicationDialog::attachToRemoteServer() void runAttachToRemoteServerDialog()
{ {
run(true); StartApplicationDialog::run(true);
} }
void StartApplicationDialog::startAndDebugApplication() void runStartAndDebugApplicationDialog()
{ {
run(false); StartApplicationDialog::run(false);
} }
StartApplicationParameters StartApplicationDialog::parameters() const StartApplicationParameters StartApplicationDialog::parameters() const
{ {
StartApplicationParameters result; StartApplicationParameters result;
result.serverPort = d->serverPortSpinBox->value(); result.serverPort = serverPortSpinBox->value();
result.serverAddress = d->channelOverrideEdit->text(); result.serverAddress = channelOverrideEdit->text();
result.runnable.command.setExecutable(d->localExecutablePathChooser->filePath()); result.runnable.command.setExecutable(localExecutablePathChooser->filePath());
result.sysRoot = d->sysRootPathChooser->filePath(); result.sysRoot = sysRootPathChooser->filePath();
result.serverInitCommands = d->serverInitCommandsTextEdit->toPlainText(); result.serverInitCommands = serverInitCommandsTextEdit->toPlainText();
result.serverResetCommands = d->serverResetCommandsTextEdit->toPlainText(); result.serverResetCommands = serverResetCommandsTextEdit->toPlainText();
result.kitId = d->kitChooser->currentKitId(); result.kitId = kitChooser->currentKitId();
result.debugInfoLocation = d->debuginfoPathChooser->filePath(); result.debugInfoLocation = debuginfoPathChooser->filePath();
result.runnable.command.setArguments(d->arguments->text()); result.runnable.command.setArguments(arguments->text());
result.runnable.workingDirectory = d->workingDirectory->filePath(); result.runnable.workingDirectory = workingDirectory->filePath();
result.breakAtMain = d->breakAtMainCheckBox->isChecked(); result.breakAtMain = breakAtMainCheckBox->isChecked();
result.runInTerminal = d->runInTerminalCheckBox->isChecked(); result.runInTerminal = runInTerminalCheckBox->isChecked();
result.useTargetExtendedRemote = d->useTargetExtendedRemoteCheckBox->isChecked(); result.useTargetExtendedRemote = useTargetExtendedRemoteCheckBox->isChecked();
return result; return result;
} }
void StartApplicationDialog::setParameters(const StartApplicationParameters &p) void StartApplicationDialog::setParameters(const StartApplicationParameters &p)
{ {
d->kitChooser->setCurrentKitId(p.kitId); kitChooser->setCurrentKitId(p.kitId);
d->serverPortSpinBox->setValue(p.serverPort); serverPortSpinBox->setValue(p.serverPort);
d->channelOverrideEdit->setText(p.serverAddress); channelOverrideEdit->setText(p.serverAddress);
d->localExecutablePathChooser->setFilePath(p.runnable.command.executable()); localExecutablePathChooser->setFilePath(p.runnable.command.executable());
d->sysRootPathChooser->setFilePath(p.sysRoot); sysRootPathChooser->setFilePath(p.sysRoot);
d->serverInitCommandsTextEdit->setPlainText(p.serverInitCommands); serverInitCommandsTextEdit->setPlainText(p.serverInitCommands);
d->serverResetCommandsTextEdit->setPlainText(p.serverResetCommands); serverResetCommandsTextEdit->setPlainText(p.serverResetCommands);
d->debuginfoPathChooser->setFilePath(p.debugInfoLocation); debuginfoPathChooser->setFilePath(p.debugInfoLocation);
d->arguments->setText(p.runnable.command.arguments()); arguments->setText(p.runnable.command.arguments());
d->workingDirectory->setFilePath(p.runnable.workingDirectory); workingDirectory->setFilePath(p.runnable.workingDirectory);
d->breakAtMainCheckBox->setChecked(p.breakAtMain); breakAtMainCheckBox->setChecked(p.breakAtMain);
d->runInTerminalCheckBox->setChecked(p.runInTerminal); runInTerminalCheckBox->setChecked(p.runInTerminal);
d->useTargetExtendedRemoteCheckBox->setChecked(p.useTargetExtendedRemote); useTargetExtendedRemoteCheckBox->setChecked(p.useTargetExtendedRemote);
updateState(); updateState();
} }

View File

@@ -21,29 +21,10 @@ namespace Debugger::Internal {
class AttachToQmlPortDialogPrivate; class AttachToQmlPortDialogPrivate;
class DebuggerRunParameters; class DebuggerRunParameters;
class StartApplicationParameters; class StartApplicationParameters;
class StartApplicationDialogPrivate;
class StartRemoteEngineDialogPrivate; class StartRemoteEngineDialogPrivate;
class StartApplicationDialog : public QDialog void runAttachToRemoteServerDialog();
{ void runStartAndDebugApplicationDialog();
public:
explicit StartApplicationDialog(QWidget *parent);
~StartApplicationDialog() override;
static void attachToRemoteServer();
static void startAndDebugApplication();
private:
void historyIndexChanged(int);
void updateState();
StartApplicationParameters parameters() const;
void setParameters(const StartApplicationParameters &p);
void setHistory(const QList<StartApplicationParameters> &l);
void onChannelOverrideChanged(const QString &channel);
static void run(bool);
StartApplicationDialogPrivate *d;
};
class AttachToQmlPortDialog : public QDialog class AttachToQmlPortDialog : public QDialog
{ {

View File

@@ -872,7 +872,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
}); });
connect(&m_startAndDebugApplicationAction, &QAction::triggered, connect(&m_startAndDebugApplicationAction, &QAction::triggered,
this, &StartApplicationDialog::startAndDebugApplication); this, [] { runStartAndDebugApplicationDialog(); });
connect(&m_attachToCoreAction, &QAction::triggered, connect(&m_attachToCoreAction, &QAction::triggered,
this, &DebuggerPluginPrivate::attachCore); this, &DebuggerPluginPrivate::attachCore);
@@ -881,7 +881,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
this, &DebuggerPluginPrivate::attachToLastCore); this, &DebuggerPluginPrivate::attachToLastCore);
connect(&m_attachToRemoteServerAction, &QAction::triggered, connect(&m_attachToRemoteServerAction, &QAction::triggered,
this, &StartApplicationDialog::attachToRemoteServer); this, [] { runAttachToRemoteServerDialog(); });
connect(&m_attachToRunningApplication, &QAction::triggered, connect(&m_attachToRunningApplication, &QAction::triggered,
this, &DebuggerPluginPrivate::attachToRunningApplication); this, &DebuggerPluginPrivate::attachToRunningApplication);