forked from qt-creator/qt-creator
Debugger: Describe the "Override server address/channel" field better
Change-Id: I2bd112d1d2f46904513fa668a17f0a07ebe26e12 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
This commit is contained in:
@@ -71,8 +71,8 @@ class StartApplicationDialogPrivate
|
|||||||
public:
|
public:
|
||||||
KitChooser *kitChooser;
|
KitChooser *kitChooser;
|
||||||
QLabel *serverPortLabel;
|
QLabel *serverPortLabel;
|
||||||
QLabel *serverAddressLabel;
|
QLabel *channelOverrideLabel;
|
||||||
QLineEdit *serverAddressEdit;
|
QLineEdit *channelOverrideEdit;
|
||||||
QSpinBox *serverPortSpinBox;
|
QSpinBox *serverPortSpinBox;
|
||||||
PathChooser *localExecutablePathChooser;
|
PathChooser *localExecutablePathChooser;
|
||||||
FancyLineEdit *arguments;
|
FancyLineEdit *arguments;
|
||||||
@@ -235,8 +235,11 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
|
|||||||
d->serverPortSpinBox = new QSpinBox(this);
|
d->serverPortSpinBox = new QSpinBox(this);
|
||||||
d->serverPortSpinBox->setRange(1, 65535);
|
d->serverPortSpinBox->setRange(1, 65535);
|
||||||
|
|
||||||
d->serverAddressLabel = new QLabel(tr("Override server address"), this);
|
d->channelOverrideLabel = new QLabel(tr("Override server channel:"), this);
|
||||||
d->serverAddressEdit = new QLineEdit(this);
|
d->channelOverrideEdit = new QLineEdit(this);
|
||||||
|
//: "For example, /dev/ttyS0, COM1, 127.0.0.1:1234"
|
||||||
|
d->channelOverrideEdit->setPlaceholderText(
|
||||||
|
tr("For example, %1").arg("/dev/ttyS0, COM1, 127.0.0.1:1234"));
|
||||||
|
|
||||||
d->localExecutablePathChooser = new PathChooser(this);
|
d->localExecutablePathChooser = new PathChooser(this);
|
||||||
d->localExecutablePathChooser->setExpectedKind(PathChooser::File);
|
d->localExecutablePathChooser->setExpectedKind(PathChooser::File);
|
||||||
@@ -292,7 +295,6 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
|
|||||||
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
||||||
formLayout->addRow(tr("&Kit:"), d->kitChooser);
|
formLayout->addRow(tr("&Kit:"), d->kitChooser);
|
||||||
formLayout->addRow(d->serverPortLabel, d->serverPortSpinBox);
|
formLayout->addRow(d->serverPortLabel, d->serverPortSpinBox);
|
||||||
formLayout->addRow(d->serverAddressLabel, d->serverAddressEdit);
|
|
||||||
formLayout->addRow(tr("Local &executable:"), d->localExecutablePathChooser);
|
formLayout->addRow(tr("Local &executable:"), d->localExecutablePathChooser);
|
||||||
formLayout->addRow(tr("Command line &arguments:"), d->arguments);
|
formLayout->addRow(tr("Command line &arguments:"), d->arguments);
|
||||||
formLayout->addRow(tr("&Working directory:"), d->workingDirectory);
|
formLayout->addRow(tr("&Working directory:"), d->workingDirectory);
|
||||||
@@ -300,6 +302,11 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
|
|||||||
formLayout->addRow(tr("Break at \"&main\":"), d->breakAtMainCheckBox);
|
formLayout->addRow(tr("Break at \"&main\":"), d->breakAtMainCheckBox);
|
||||||
formLayout->addRow(d->serverStartScriptLabel, d->serverStartScriptPathChooser);
|
formLayout->addRow(d->serverStartScriptLabel, d->serverStartScriptPathChooser);
|
||||||
formLayout->addRow(tr("Debug &information:"), d->debuginfoPathChooser);
|
formLayout->addRow(tr("Debug &information:"), d->debuginfoPathChooser);
|
||||||
|
formLayout->addRow(new QLabel(tr("Normally, the running server is identified by the IP of the "
|
||||||
|
"device in the kit and the server port selected above.\n"
|
||||||
|
"You can choose another communication channel here, such as "
|
||||||
|
"a serial line or custom ip:port.")));
|
||||||
|
formLayout->addRow(d->channelOverrideLabel, d->channelOverrideEdit);
|
||||||
formLayout->addRow(line2);
|
formLayout->addRow(line2);
|
||||||
formLayout->addRow(tr("&Recent:"), d->historyComboBox);
|
formLayout->addRow(tr("&Recent:"), d->historyComboBox);
|
||||||
|
|
||||||
@@ -316,6 +323,9 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
|
|||||||
connect(d->historyComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
connect(d->historyComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||||
this, &StartApplicationDialog::historyIndexChanged);
|
this, &StartApplicationDialog::historyIndexChanged);
|
||||||
|
|
||||||
|
connect(d->channelOverrideEdit, &QLineEdit::textChanged,
|
||||||
|
this, &StartApplicationDialog::onChannelOverrideChanged);
|
||||||
|
|
||||||
updateState();
|
updateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,6 +344,12 @@ void StartApplicationDialog::setHistory(const QList<StartApplicationParameters>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StartApplicationDialog::onChannelOverrideChanged(const QString &channel)
|
||||||
|
{
|
||||||
|
d->serverPortSpinBox->setEnabled(channel.isEmpty());
|
||||||
|
d->serverPortLabel->setEnabled(channel.isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
void StartApplicationDialog::historyIndexChanged(int index)
|
void StartApplicationDialog::historyIndexChanged(int index)
|
||||||
{
|
{
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
@@ -379,8 +395,8 @@ bool StartApplicationDialog::run(QWidget *parent, DebuggerRunParameters *rp, Kit
|
|||||||
dialog.d->serverStartScriptLabel->setVisible(false);
|
dialog.d->serverStartScriptLabel->setVisible(false);
|
||||||
dialog.d->serverPortSpinBox->setVisible(false);
|
dialog.d->serverPortSpinBox->setVisible(false);
|
||||||
dialog.d->serverPortLabel->setVisible(false);
|
dialog.d->serverPortLabel->setVisible(false);
|
||||||
dialog.d->serverAddressLabel->setVisible(false);
|
dialog.d->channelOverrideLabel->setVisible(false);
|
||||||
dialog.d->serverAddressEdit->setVisible(false);
|
dialog.d->channelOverrideEdit->setVisible(false);
|
||||||
}
|
}
|
||||||
if (dialog.exec() != QDialog::Accepted)
|
if (dialog.exec() != QDialog::Accepted)
|
||||||
return false;
|
return false;
|
||||||
@@ -404,7 +420,7 @@ bool StartApplicationDialog::run(QWidget *parent, DebuggerRunParameters *rp, Kit
|
|||||||
}
|
}
|
||||||
|
|
||||||
rp->inferior.executable = newParameters.runnable.executable;
|
rp->inferior.executable = newParameters.runnable.executable;
|
||||||
const QString inputAddress = dialog.d->serverAddressEdit->text();
|
const QString inputAddress = dialog.d->channelOverrideEdit->text();
|
||||||
if (!inputAddress.isEmpty())
|
if (!inputAddress.isEmpty())
|
||||||
rp->remoteChannel = inputAddress;
|
rp->remoteChannel = inputAddress;
|
||||||
else
|
else
|
||||||
@@ -430,7 +446,7 @@ StartApplicationParameters StartApplicationDialog::parameters() const
|
|||||||
{
|
{
|
||||||
StartApplicationParameters result;
|
StartApplicationParameters result;
|
||||||
result.serverPort = d->serverPortSpinBox->value();
|
result.serverPort = d->serverPortSpinBox->value();
|
||||||
result.serverAddress = d->serverAddressEdit->text();
|
result.serverAddress = d->channelOverrideEdit->text();
|
||||||
result.runnable.executable = d->localExecutablePathChooser->path();
|
result.runnable.executable = d->localExecutablePathChooser->path();
|
||||||
result.serverStartScript = d->serverStartScriptPathChooser->path();
|
result.serverStartScript = d->serverStartScriptPathChooser->path();
|
||||||
result.kitId = d->kitChooser->currentKitId();
|
result.kitId = d->kitChooser->currentKitId();
|
||||||
@@ -447,7 +463,7 @@ void StartApplicationDialog::setParameters(const StartApplicationParameters &p)
|
|||||||
{
|
{
|
||||||
d->kitChooser->setCurrentKitId(p.kitId);
|
d->kitChooser->setCurrentKitId(p.kitId);
|
||||||
d->serverPortSpinBox->setValue(p.serverPort);
|
d->serverPortSpinBox->setValue(p.serverPort);
|
||||||
d->serverAddressEdit->setText(p.serverAddress);
|
d->channelOverrideEdit->setText(p.serverAddress);
|
||||||
d->localExecutablePathChooser->setPath(p.runnable.executable);
|
d->localExecutablePathChooser->setPath(p.runnable.executable);
|
||||||
d->serverStartScriptPathChooser->setPath(p.serverStartScript);
|
d->serverStartScriptPathChooser->setPath(p.serverStartScript);
|
||||||
d->debuginfoPathChooser->setPath(p.debugInfoLocation);
|
d->debuginfoPathChooser->setPath(p.debugInfoLocation);
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ private:
|
|||||||
StartApplicationParameters parameters() const;
|
StartApplicationParameters parameters() const;
|
||||||
void setParameters(const StartApplicationParameters &p);
|
void setParameters(const StartApplicationParameters &p);
|
||||||
void setHistory(const QList<StartApplicationParameters> &l);
|
void setHistory(const QList<StartApplicationParameters> &l);
|
||||||
|
void onChannelOverrideChanged(const QString &channel);
|
||||||
|
|
||||||
StartApplicationDialogPrivate *d;
|
StartApplicationDialogPrivate *d;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user