summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/remotelinux/remotelinuxrunconfiguration.cpp45
-rw-r--r--src/plugins/remotelinux/remotelinuxrunconfiguration.h5
-rw-r--r--src/plugins/remotelinux/remotelinuxrunconfigurationwidget.cpp33
-rw-r--r--src/plugins/remotelinux/remotelinuxrunconfigurationwidget.h2
4 files changed, 81 insertions, 4 deletions
diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp
index 5b3b5e1ad4..e8a697edda 100644
--- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp
+++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp
@@ -60,6 +60,9 @@ const char ProFileKey[] = "Qt4ProjectManager.MaemoRunConfiguration.ProFile";
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 {
@@ -68,7 +71,8 @@ public:
: proFilePath(proFilePath),
baseEnvironmentType(RemoteLinuxRunConfiguration::SystemBaseEnvironment),
validParse(target->qt4Project()->validParse(proFilePath)),
- parseInProgress(target->qt4Project()->parseInProgress(proFilePath))
+ parseInProgress(target->qt4Project()->parseInProgress(proFilePath)),
+ useAlternateRemoteExecutable(false)
{
}
@@ -78,7 +82,9 @@ public:
systemEnvironment(other->systemEnvironment),
userEnvironmentChanges(other->userEnvironmentChanges),
validParse(other->validParse),
- parseInProgress(other->parseInProgress)
+ parseInProgress(other->parseInProgress),
+ useAlternateRemoteExecutable(other->useAlternateRemoteExecutable),
+ alternateRemoteExecutable(other->alternateRemoteExecutable)
{
}
@@ -91,7 +97,10 @@ public:
bool validParse;
bool parseInProgress;
QString disabledReason;
+ bool useAlternateRemoteExecutable;
+ QString alternateRemoteExecutable;
};
+
} // namespace Internal
using namespace Internal;
@@ -205,6 +214,8 @@ QVariantMap RemoteLinuxRunConfiguration::toMap() const
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;
}
@@ -221,6 +232,8 @@ bool RemoteLinuxRunConfiguration::fromMap(const QVariantMap &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);
@@ -286,13 +299,19 @@ QString RemoteLinuxRunConfiguration::localExecutableFilePath() const
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();
@@ -306,6 +325,26 @@ void RemoteLinuxRunConfiguration::setArguments(const QString &args)
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()) {
diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.h b/src/plugins/remotelinux/remotelinuxrunconfiguration.h
index e1ad02154f..406850ebe5 100644
--- a/src/plugins/remotelinux/remotelinuxrunconfiguration.h
+++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.h
@@ -89,9 +89,14 @@ public:
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;
diff --git a/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.cpp b/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.cpp
index db8d832925..b12ee175c6 100644
--- a/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.cpp
+++ b/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.cpp
@@ -47,6 +47,7 @@
#include <QtGui/QButtonGroup>
#include <QtCore/QCoreApplication>
#include <QtCore/QDir>
+#include <QtGui/QCheckBox>
#include <QtGui/QComboBox>
#include <QtGui/QFormLayout>
#include <QtGui/QGroupBox>
@@ -85,6 +86,8 @@ public:
QLineEdit argsLineEdit;
QLabel localExecutableLabel;
QLabel remoteExecutableLabel;
+ QCheckBox useAlternateCommandBox;
+ QLineEdit alternateCommand;
QLabel devConfLabel;
QLabel debuggingLanguagesLabel;
QRadioButton debugCppOnlyButton;
@@ -177,6 +180,16 @@ void RemoteLinuxRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayou
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);
@@ -214,7 +227,12 @@ void RemoteLinuxRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayou
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)
@@ -267,7 +285,20 @@ void RemoteLinuxRunConfigurationWidget::updateTargetInformation()
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)
diff --git a/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.h b/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.h
index 41f7e5415d..06393c8e89 100644
--- a/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.h
+++ b/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.h
@@ -77,6 +77,8 @@ private slots:
void userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &userChanges);
void handleDebuggingTypeChanged();
void handleDeploySpecsChanged();
+ void handleUseAlternateCommandChanged();
+ void handleAlternateCommandChanged();
private:
void addGenericWidgets(QVBoxLayout *mainLayout);