Sometimes, it is not the deployed binary that we want to call, but e.g.
some wrapper.
Change-Id: Ic8fe8f865cc29bf01e64b3781a92362b4521d8e4
Reviewed-on: http://codereview.qt-project.org/5642
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
const char BaseEnvironmentBaseKey[] = "Qt4ProjectManager.MaemoRunConfiguration.BaseEnvironmentBase";
const char UserEnvironmentChangesKey[]
= "Qt4ProjectManager.MaemoRunConfiguration.UserEnvironmentChanges";
+const char UseAlternateExeKey[] = "RemoteLinux.RunConfig.UseAlternateRemoteExecutable";
+const char AlternateExeKey[] = "RemoteLinux.RunConfig.AlternateRemoteExecutable";
+
} // anonymous namespace
class RemoteLinuxRunConfigurationPrivate {
: proFilePath(proFilePath),
baseEnvironmentType(RemoteLinuxRunConfiguration::SystemBaseEnvironment),
validParse(target->qt4Project()->validParse(proFilePath)),
- parseInProgress(target->qt4Project()->parseInProgress(proFilePath))
+ parseInProgress(target->qt4Project()->parseInProgress(proFilePath)),
+ useAlternateRemoteExecutable(false)
{
}
systemEnvironment(other->systemEnvironment),
userEnvironmentChanges(other->userEnvironmentChanges),
validParse(other->validParse),
- parseInProgress(other->parseInProgress)
+ parseInProgress(other->parseInProgress),
+ useAlternateRemoteExecutable(other->useAlternateRemoteExecutable),
+ alternateRemoteExecutable(other->alternateRemoteExecutable)
{
}
bool validParse;
bool parseInProgress;
QString disabledReason;
+ bool useAlternateRemoteExecutable;
+ QString alternateRemoteExecutable;
};
+
} // namespace Internal
using namespace Internal;
map.insert(QLatin1String(BaseEnvironmentBaseKey), d->baseEnvironmentType);
map.insert(QLatin1String(UserEnvironmentChangesKey),
Utils::EnvironmentItem::toStringList(d->userEnvironmentChanges));
+ map.insert(QLatin1String(UseAlternateExeKey), d->useAlternateRemoteExecutable);
+ map.insert(QLatin1String(AlternateExeKey), d->alternateRemoteExecutable);
return map;
}
.toStringList());
d->baseEnvironmentType = static_cast<BaseEnvironmentType>(map.value(QLatin1String(BaseEnvironmentBaseKey),
SystemBaseEnvironment).toInt());
+ d->useAlternateRemoteExecutable = map.value(QLatin1String(UseAlternateExeKey), false).toBool();
+ d->alternateRemoteExecutable = map.value(QLatin1String(AlternateExeKey)).toString();
d->validParse = qt4Target()->qt4Project()->validParse(d->proFilePath);
d->parseInProgress = qt4Target()->qt4Project()->parseInProgress(d->proFilePath);
return QDir::cleanPath(ti.workingDir + QLatin1Char('/') + ti.target);
}
-QString RemoteLinuxRunConfiguration::remoteExecutableFilePath() const
+QString RemoteLinuxRunConfiguration::defaultRemoteExecutableFilePath() const
{
return deployConfig()
? deployConfig()->deploymentInfo()->remoteExecutableFilePath(localExecutableFilePath())
: QString();
}
+QString RemoteLinuxRunConfiguration::remoteExecutableFilePath() const
+{
+ return d->useAlternateRemoteExecutable
+ ? alternateRemoteExecutable() : defaultRemoteExecutableFilePath();
+}
+
PortList RemoteLinuxRunConfiguration::freePorts() const
{
const LinuxDeviceConfiguration::ConstPtr &devConf = deviceConfig();
d->arguments = args;
}
+void RemoteLinuxRunConfiguration::setUseAlternateExecutable(bool useAlternate)
+{
+ d->useAlternateRemoteExecutable = useAlternate;
+}
+
+bool RemoteLinuxRunConfiguration::useAlternateExecutable() const
+{
+ return d->useAlternateRemoteExecutable;
+}
+
+void RemoteLinuxRunConfiguration::setAlternateRemoteExecutable(const QString &exe)
+{
+ d->alternateRemoteExecutable = exe;
+}
+
+QString RemoteLinuxRunConfiguration::alternateRemoteExecutable() const
+{
+ return d->alternateRemoteExecutable;
+}
+
RemoteLinuxRunConfiguration::DebuggingType RemoteLinuxRunConfiguration::debuggingType() const
{
if (useCppDebugger()) {
virtual DebuggingType debuggingType() const;
QString localExecutableFilePath() const;
+ QString defaultRemoteExecutableFilePath() const;
QString remoteExecutableFilePath() const;
QString arguments() const;
void setArguments(const QString &args);
+ void setAlternateRemoteExecutable(const QString &exe);
+ QString alternateRemoteExecutable() const;
+ void setUseAlternateExecutable(bool useAlternate);
+ bool useAlternateExecutable() const;
QSharedPointer<const LinuxDeviceConfiguration> deviceConfig() const;
QString gdbCmd() const;
#include <QtGui/QButtonGroup>
#include <QtCore/QCoreApplication>
#include <QtCore/QDir>
+#include <QtGui/QCheckBox>
#include <QtGui/QComboBox>
#include <QtGui/QFormLayout>
#include <QtGui/QGroupBox>
QLineEdit argsLineEdit;
QLabel localExecutableLabel;
QLabel remoteExecutableLabel;
+ QCheckBox useAlternateCommandBox;
+ QLineEdit alternateCommand;
QLabel devConfLabel;
QLabel debuggingLanguagesLabel;
QRadioButton debugCppOnlyButton;
d->localExecutableLabel.setText(d->runConfiguration->localExecutableFilePath());
formLayout->addRow(tr("Executable on host:"), &d->localExecutableLabel);
formLayout->addRow(tr("Executable on device:"), &d->remoteExecutableLabel);
+ QWidget * const altRemoteExeWidget = new QWidget;
+ QHBoxLayout * const altRemoteExeLayout = new QHBoxLayout(altRemoteExeWidget);
+ altRemoteExeLayout->setContentsMargins(0, 0, 0, 0);
+ d->alternateCommand.setText(d->runConfiguration->alternateRemoteExecutable());
+ altRemoteExeLayout->addWidget(&d->alternateCommand);
+ d->useAlternateCommandBox.setText(tr("Use this command instead"));
+ d->useAlternateCommandBox.setChecked(d->runConfiguration->useAlternateExecutable());
+ altRemoteExeLayout->addWidget(&d->useAlternateCommandBox);
+ formLayout->addRow(tr("Alternate executable on device:"), altRemoteExeWidget);
+
d->argsLineEdit.setText(d->runConfiguration->arguments());
formLayout->addRow(tr("Arguments:"), &d->argsLineEdit);
connect(d->runConfiguration, SIGNAL(targetInformationChanged()), this,
SLOT(updateTargetInformation()));
connect(d->runConfiguration, SIGNAL(deploySpecsChanged()), SLOT(handleDeploySpecsChanged()));
+ connect(&d->useAlternateCommandBox, SIGNAL(toggled(bool)),
+ SLOT(handleUseAlternateCommandChanged()));
+ connect(&d->alternateCommand, SIGNAL(textEdited(QString)),
+ SLOT(handleAlternateCommandChanged()));
handleDeploySpecsChanged();
+ handleUseAlternateCommandChanged();
}
void RemoteLinuxRunConfigurationWidget::addEnvironmentWidgets(QVBoxLayout *mainLayout)
void RemoteLinuxRunConfigurationWidget::handleDeploySpecsChanged()
{
- d->remoteExecutableLabel.setText(d->runConfiguration->remoteExecutableFilePath());
+ d->remoteExecutableLabel.setText(d->runConfiguration->defaultRemoteExecutableFilePath());
+}
+
+void RemoteLinuxRunConfigurationWidget::handleUseAlternateCommandChanged()
+{
+ const bool useAltExe = d->useAlternateCommandBox.isChecked();
+ d->remoteExecutableLabel.setEnabled(!useAltExe);
+ d->alternateCommand.setEnabled(useAltExe);
+ d->runConfiguration->setUseAlternateExecutable(useAltExe);
+}
+
+void RemoteLinuxRunConfigurationWidget::handleAlternateCommandChanged()
+{
+ d->runConfiguration->setAlternateRemoteExecutable(d->alternateCommand.text().trimmed());
}
void RemoteLinuxRunConfigurationWidget::showDeviceConfigurationsDialog(const QString &link)
void userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &userChanges);
void handleDebuggingTypeChanged();
void handleDeploySpecsChanged();
+ void handleUseAlternateCommandChanged();
+ void handleAlternateCommandChanged();
private:
void addGenericWidgets(QVBoxLayout *mainLayout);