forked from qt-creator/qt-creator
debugger: remove channel lineedit in StartRemote dialog
The information can be retrieved from the Profile information nowadays. Change-Id: I964cb4a782bb746bb97edbdb03cc99d64153106c Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -706,14 +706,12 @@ class StartRemoteParameters
|
|||||||
public:
|
public:
|
||||||
StartRemoteParameters();
|
StartRemoteParameters();
|
||||||
bool equals(const StartRemoteParameters &rhs) const;
|
bool equals(const StartRemoteParameters &rhs) const;
|
||||||
QString displayName() const { return remoteChannel; }
|
QString displayName() const;
|
||||||
bool isValid() const { return !remoteChannel.isEmpty(); }
|
|
||||||
|
|
||||||
void toSettings(QSettings *) const;
|
void toSettings(QSettings *) const;
|
||||||
void fromSettings(const QSettings *settings);
|
void fromSettings(const QSettings *settings);
|
||||||
|
|
||||||
QString localExecutable;
|
QString localExecutable;
|
||||||
QString remoteChannel;
|
|
||||||
QString remoteArchitecture;
|
QString remoteArchitecture;
|
||||||
QString overrideStartScript;
|
QString overrideStartScript;
|
||||||
bool useServerStartScript;
|
bool useServerStartScript;
|
||||||
@@ -747,7 +745,7 @@ StartRemoteParameters::StartRemoteParameters() :
|
|||||||
|
|
||||||
bool StartRemoteParameters::equals(const StartRemoteParameters &rhs) const
|
bool StartRemoteParameters::equals(const StartRemoteParameters &rhs) const
|
||||||
{
|
{
|
||||||
return localExecutable == rhs.localExecutable && remoteChannel ==rhs.remoteChannel
|
return localExecutable == rhs.localExecutable
|
||||||
&& remoteArchitecture == rhs.remoteArchitecture
|
&& remoteArchitecture == rhs.remoteArchitecture
|
||||||
&& overrideStartScript == rhs.overrideStartScript
|
&& overrideStartScript == rhs.overrideStartScript
|
||||||
&& useServerStartScript == rhs.useServerStartScript
|
&& useServerStartScript == rhs.useServerStartScript
|
||||||
@@ -756,9 +754,14 @@ bool StartRemoteParameters::equals(const StartRemoteParameters &rhs) const
|
|||||||
&& debugInfoLocation == rhs.debugInfoLocation;
|
&& debugInfoLocation == rhs.debugInfoLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString StartRemoteParameters::displayName() const
|
||||||
|
{
|
||||||
|
Profile *profile = ProfileManager::instance()->find(profileId);
|
||||||
|
return profile ? profile->displayName() : QString();
|
||||||
|
}
|
||||||
|
|
||||||
void StartRemoteParameters::toSettings(QSettings *settings) const
|
void StartRemoteParameters::toSettings(QSettings *settings) const
|
||||||
{
|
{
|
||||||
settings->setValue(_("LastRemoteChannel"), remoteChannel);
|
|
||||||
settings->setValue(_("LastLocalExecutable"), localExecutable);
|
settings->setValue(_("LastLocalExecutable"), localExecutable);
|
||||||
settings->setValue(_("LastRemoteArchitecture"), remoteArchitecture);
|
settings->setValue(_("LastRemoteArchitecture"), remoteArchitecture);
|
||||||
settings->setValue(_("LastServerStartScript"), serverStartScript);
|
settings->setValue(_("LastServerStartScript"), serverStartScript);
|
||||||
@@ -770,7 +773,6 @@ void StartRemoteParameters::toSettings(QSettings *settings) const
|
|||||||
|
|
||||||
void StartRemoteParameters::fromSettings(const QSettings *settings)
|
void StartRemoteParameters::fromSettings(const QSettings *settings)
|
||||||
{
|
{
|
||||||
remoteChannel = settings->value(_("LastRemoteChannel")).toString();
|
|
||||||
localExecutable = settings->value(_("LastLocalExecutable")).toString();
|
localExecutable = settings->value(_("LastLocalExecutable")).toString();
|
||||||
const QString profileIdString = settings->value(_("LastProfileId")).toString();
|
const QString profileIdString = settings->value(_("LastProfileId")).toString();
|
||||||
if (profileIdString.isEmpty()) {
|
if (profileIdString.isEmpty()) {
|
||||||
@@ -791,7 +793,6 @@ class StartRemoteDialogPrivate
|
|||||||
public:
|
public:
|
||||||
ProfileChooser *profileChooser;
|
ProfileChooser *profileChooser;
|
||||||
PathChooser *executablePathChooser;
|
PathChooser *executablePathChooser;
|
||||||
QLineEdit *channelLineEdit;
|
|
||||||
QComboBox *architectureComboBox;
|
QComboBox *architectureComboBox;
|
||||||
PathChooser *debuginfoPathChooser;
|
PathChooser *debuginfoPathChooser;
|
||||||
PathChooser *overrideStartScriptPathChooser;
|
PathChooser *overrideStartScriptPathChooser;
|
||||||
@@ -815,9 +816,6 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent, bool enableStartScript)
|
|||||||
d->executablePathChooser->setExpectedKind(PathChooser::File);
|
d->executablePathChooser->setExpectedKind(PathChooser::File);
|
||||||
d->executablePathChooser->setPromptDialogTitle(tr("Select Executable"));
|
d->executablePathChooser->setPromptDialogTitle(tr("Select Executable"));
|
||||||
|
|
||||||
d->channelLineEdit = new QLineEdit(this);
|
|
||||||
d->channelLineEdit->setText(QString::fromUtf8("localhost:5115"));
|
|
||||||
|
|
||||||
d->architectureComboBox = new QComboBox(this);
|
d->architectureComboBox = new QComboBox(this);
|
||||||
d->architectureComboBox->setEditable(true);
|
d->architectureComboBox->setEditable(true);
|
||||||
|
|
||||||
@@ -857,7 +855,6 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent, bool enableStartScript)
|
|||||||
formLayout->addRow(tr("Target:"), d->profileChooser);
|
formLayout->addRow(tr("Target:"), d->profileChooser);
|
||||||
formLayout->addRow(tr("Local &executable:"), d->executablePathChooser);
|
formLayout->addRow(tr("Local &executable:"), d->executablePathChooser);
|
||||||
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
||||||
formLayout->addRow(tr("&Host and port:"), d->channelLineEdit);
|
|
||||||
formLayout->addRow(tr("&Architecture:"), d->architectureComboBox);
|
formLayout->addRow(tr("&Architecture:"), d->architectureComboBox);
|
||||||
formLayout->addRow(tr("Location of debugging &information:"), d->debuginfoPathChooser);
|
formLayout->addRow(tr("Location of debugging &information:"), d->debuginfoPathChooser);
|
||||||
formLayout->addRow(tr("Override host GDB s&tart script:"), d->overrideStartScriptPathChooser);
|
formLayout->addRow(tr("Override host GDB s&tart script:"), d->overrideStartScriptPathChooser);
|
||||||
@@ -920,7 +917,6 @@ bool StartRemoteDialog::run(QWidget *parent, QSettings *settings,
|
|||||||
}
|
}
|
||||||
|
|
||||||
fillParameters(sp, dialog.profileId());
|
fillParameters(sp, dialog.profileId());
|
||||||
sp->remoteChannel = newParameters.remoteChannel;
|
|
||||||
sp->remoteArchitecture = newParameters.remoteArchitecture;
|
sp->remoteArchitecture = newParameters.remoteArchitecture;
|
||||||
sp->executable = newParameters.localExecutable;
|
sp->executable = newParameters.localExecutable;
|
||||||
sp->displayName = tr("Remote: \"%1\"").arg(sp->remoteChannel);
|
sp->displayName = tr("Remote: \"%1\"").arg(sp->remoteChannel);
|
||||||
@@ -934,7 +930,6 @@ bool StartRemoteDialog::run(QWidget *parent, QSettings *settings,
|
|||||||
StartRemoteParameters StartRemoteDialog::parameters() const
|
StartRemoteParameters StartRemoteDialog::parameters() const
|
||||||
{
|
{
|
||||||
StartRemoteParameters result;
|
StartRemoteParameters result;
|
||||||
result.remoteChannel = d->channelLineEdit->text();
|
|
||||||
result.localExecutable = d->executablePathChooser->path();
|
result.localExecutable = d->executablePathChooser->path();
|
||||||
result.remoteArchitecture = d->architectureComboBox->currentText();
|
result.remoteArchitecture = d->architectureComboBox->currentText();
|
||||||
result.overrideStartScript = d->overrideStartScriptPathChooser->path();
|
result.overrideStartScript = d->overrideStartScriptPathChooser->path();
|
||||||
@@ -947,7 +942,6 @@ StartRemoteParameters StartRemoteDialog::parameters() const
|
|||||||
|
|
||||||
void StartRemoteDialog::setParameters(const StartRemoteParameters &p)
|
void StartRemoteDialog::setParameters(const StartRemoteParameters &p)
|
||||||
{
|
{
|
||||||
d->channelLineEdit->setText(p.remoteChannel);
|
|
||||||
d->executablePathChooser->setPath(p.localExecutable);
|
d->executablePathChooser->setPath(p.localExecutable);
|
||||||
const int index = d->architectureComboBox->findText(p.remoteArchitecture);
|
const int index = d->architectureComboBox->findText(p.remoteArchitecture);
|
||||||
if (index != -1)
|
if (index != -1)
|
||||||
@@ -962,10 +956,8 @@ void StartRemoteDialog::setParameters(const StartRemoteParameters &p)
|
|||||||
void StartRemoteDialog::setHistory(const QList<StartRemoteParameters> &l)
|
void StartRemoteDialog::setHistory(const QList<StartRemoteParameters> &l)
|
||||||
{
|
{
|
||||||
d->historyComboBox->clear();
|
d->historyComboBox->clear();
|
||||||
for (int i = l.size() - 1; i >= 0; --i)
|
for (int i = l.size(); --i >= 0; )
|
||||||
if (l.at(i).isValid())
|
d->historyComboBox->addItem(l.at(i).displayName(), QVariant::fromValue(l.at(i)));
|
||||||
d->historyComboBox->addItem(l.at(i).displayName(),
|
|
||||||
QVariant::fromValue(l.at(i)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartRemoteDialog::historyIndexChanged(int index)
|
void StartRemoteDialog::historyIndexChanged(int index)
|
||||||
|
@@ -550,9 +550,16 @@ void fillParameters(DebuggerStartParameters *sp, Id id)
|
|||||||
QTC_ASSERT(profile, return);
|
QTC_ASSERT(profile, return);
|
||||||
sp->sysRoot = SysRootProfileInformation::sysRoot(profile).toString();
|
sp->sysRoot = SysRootProfileInformation::sysRoot(profile).toString();
|
||||||
sp->debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString();
|
sp->debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString();
|
||||||
|
|
||||||
ToolChain *tc = ToolChainProfileInformation::toolChain(profile);
|
ToolChain *tc = ToolChainProfileInformation::toolChain(profile);
|
||||||
if (tc)
|
if (tc)
|
||||||
sp->toolChainAbi = tc->targetAbi();
|
sp->toolChainAbi = tc->targetAbi();
|
||||||
|
|
||||||
|
IDevice::ConstPtr device = DeviceProfileInformation::device(profile);
|
||||||
|
if (device) {
|
||||||
|
sp->connParams = device->sshParameters();
|
||||||
|
sp->remoteChannel = QString("%1:%2").arg(sp->connParams.host).arg(sp->connParams.port);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static TextEditor::ITextEditor *currentTextEditor()
|
static TextEditor::ITextEditor *currentTextEditor()
|
||||||
|
Reference in New Issue
Block a user