Commit ca7f4907 authored by ck's avatar ck

Maemo: Complete support for debugging via remote gdb.

1) Make sources available on device.
2) Enable users to switch between gdb and gdbserver approach (users may not be able to use the former if they have no control over their firewall).

Reviewed-by: kh1
parent 933d23bc
......@@ -75,20 +75,23 @@ public:
bool useTerminal;
bool breakAtMain;
QString crashParameter; // for AttachCrashedExternal
// for remote debugging
QString remoteChannel;
QString remoteArchitecture;
QString symbolFileName;
QString serverStartScript;
QString sysRoot;
QByteArray remoteDumperLib;
QByteArray remoteSourcesDir;
Core::SshConnectionParameters connParams;
QString debuggerCommand;
int toolChainType;
QByteArray remoteDumperLib;
QString qtInstallPath;
QString dumperLibrary;
QStringList dumperLibraryLocations;
Core::SshConnectionParameters connParams;
DebuggerStartMode startMode;
};
......
......@@ -43,7 +43,7 @@ class AbstractPlainGdbAdapter : public AbstractGdbAdapter
public:
AbstractPlainGdbAdapter(GdbEngine *engine, QObject *parent = 0);
void setupInferior();
virtual void setupInferior();
void runEngine();
protected:
......
......@@ -51,6 +51,13 @@ void RemotePlainGdbAdapter::startAdapter()
emit requestSetup();
}
void RemotePlainGdbAdapter::setupInferior()
{
AbstractPlainGdbAdapter::setupInferior();
m_engine->postCommand("directory "
+ m_engine->startParameters().remoteSourcesDir);
}
void RemotePlainGdbAdapter::interruptInferior()
{
m_gdbProc.interruptInferior();
......
......@@ -51,6 +51,7 @@ signals:
private:
void startAdapter();
void setupInferior();
void interruptInferior();
void shutdownInferior();
void shutdownAdapter();
......
......@@ -72,6 +72,8 @@ static const QLatin1String MountPortsKey(PREFIX ".MountPorts");
static const QLatin1String HostAddressFromDeviceKey(PREFIX ".HostAddressFromDevice");
static const QLatin1String BaseEnvironmentBaseKey(PREFIX ".BaseEnvironmentBase");
static const QLatin1String UserEnvironmentChangesKey(PREFIX ".UserEnvironmentChanges");
static const QLatin1String UseRemoteGdbKey(PREFIX ".UseRemoteGdb");
static const QLatin1String GdbMountPortKey(PREFIX ".GdbMountPort");
} // namespace Internal
} // namespace Qt4ProjectManager
......
......@@ -48,6 +48,7 @@
#include <debugger/gdb/remoteplaingdbadapter.h>
#include <projectexplorer/toolchain.h>
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
using namespace Core;
......@@ -62,20 +63,28 @@ RunControl *MaemoDebugSupport::createDebugRunControl(MaemoRunConfiguration *runC
{
DebuggerStartParameters params;
const MaemoDeviceConfig &devConf = runConfig->deviceConfig();
#ifdef USE_GDBSERVER
params.startMode = AttachToRemote;
params.executable = runConfig->localExecutableFilePath();
params.debuggerCommand = runConfig->gdbCmd();
params.remoteChannel = devConf.server.host + QLatin1Char(':')
+ gdbServerPort(runConfig, devConf);
params.remoteArchitecture = QLatin1String("arm");
#else
params.startMode = StartRemoteGdb;
params.executable = runConfig->remoteExecutableFilePath();
params.debuggerCommand = MaemoGlobal::remoteCommandPrefix(runConfig->remoteExecutableFilePath())
+ QLatin1String(" /usr/bin/gdb");
params.connParams = devConf.server;
#endif
if (runConfig->useRemoteGdb()) {
params.startMode = StartRemoteGdb;
params.executable = runConfig->remoteExecutableFilePath();
params.debuggerCommand
= MaemoGlobal::remoteCommandPrefix(runConfig->remoteExecutableFilePath())
+ QLatin1String(" /usr/bin/gdb");
params.connParams = devConf.server;
const QString execDirAbs
= QDir::fromNativeSeparators(QFileInfo(runConfig->localExecutableFilePath()).path());
const QString execDirRel
= QDir(runConfig->localDirToMountForRemoteGdb()).relativeFilePath(execDirAbs);
params.remoteSourcesDir
= QString(MaemoGlobal::remoteProjectSourcesMountPoint()
+ QLatin1Char('/') + execDirRel).toUtf8();
} else {
params.startMode = AttachToRemote;
params.executable = runConfig->localExecutableFilePath();
params.debuggerCommand = runConfig->gdbCmd();
params.remoteChannel = devConf.server.host + QLatin1Char(':')
+ gdbServerPort(runConfig, devConf);
params.remoteArchitecture = QLatin1String("arm");
}
params.processArgs = runConfig->arguments();
params.sysRoot = runConfig->sysRoot();
params.toolChainType = ToolChain::GCC_MAEMO;
......@@ -93,24 +102,22 @@ MaemoDebugSupport::MaemoDebugSupport(MaemoRunConfiguration *runConfig,
DebuggerRunControl *runControl)
: QObject(runControl), m_runControl(runControl), m_runConfig(runConfig),
m_deviceConfig(m_runConfig->deviceConfig()),
m_runner(new MaemoSshRunner(this, m_runConfig))
m_runner(new MaemoSshRunner(this, m_runConfig, true))
{
GdbEngine *engine = qobject_cast<GdbEngine *>(m_runControl->engine());
Q_ASSERT(engine);
m_gdbAdapter = qobject_cast<GdbAdapter *>(engine->gdbAdapter());
m_gdbAdapter = engine->gdbAdapter();
Q_ASSERT(m_gdbAdapter);
connect(m_gdbAdapter, SIGNAL(requestSetup()), this,
SLOT(handleAdapterSetupRequested()));
connect(m_runControl, SIGNAL(finished()), this,
SLOT(handleDebuggingFinished()));
#ifdef USE_GDBSERVER
m_runner->addProcsToKill(QStringList() << QLatin1String("gdbserver"));
#else
m_runner->addProcsToKill(QStringList() << QLatin1String("gdb"));
#endif
}
MaemoDebugSupport::~MaemoDebugSupport() {}
MaemoDebugSupport::~MaemoDebugSupport()
{
stopSsh();
}
void MaemoDebugSupport::handleAdapterSetupRequested()
{
......@@ -209,23 +216,22 @@ void MaemoDebugSupport::handleSftpJobFinished(Core::SftpJobId job,
void MaemoDebugSupport::startDebugging()
{
#ifdef USE_GDBSERVER
connect(m_runner, SIGNAL(remoteErrorOutput(QByteArray)), this,
SLOT(handleRemoteErrorOutput(QByteArray)));
connect(m_runner, SIGNAL(remoteOutput(QByteArray)), this,
SLOT(handleRemoteOutput(QByteArray)));
connect(m_runner, SIGNAL(remoteProcessStarted()), this,
SLOT(handleRemoteProcessStarted()));
const QString &remoteExe = m_runConfig->remoteExecutableFilePath();
m_runner->startExecution(QString::fromLocal8Bit("%1 gdbserver :%2 %3 %4")
.arg(MaemoGlobal::remoteCommandPrefix(remoteExe))
.arg(gdbServerPort(m_runConfig, m_deviceConfig))
.arg(remoteExe).arg(m_runConfig->arguments()
.join(QLatin1String(" "))).toUtf8());
#else
stopSsh();
handleAdapterSetupDone();
#endif
if (useGdb()) {
handleAdapterSetupDone();
} else {
connect(m_runner, SIGNAL(remoteErrorOutput(QByteArray)), this,
SLOT(handleRemoteErrorOutput(QByteArray)));
connect(m_runner, SIGNAL(remoteOutput(QByteArray)), this,
SLOT(handleRemoteOutput(QByteArray)));
connect(m_runner, SIGNAL(remoteProcessStarted()), this,
SLOT(handleRemoteProcessStarted()));
const QString &remoteExe = m_runConfig->remoteExecutableFilePath();
m_runner->startExecution(QString::fromLocal8Bit("%1 gdbserver :%2 %3 %4")
.arg(MaemoGlobal::remoteCommandPrefix(remoteExe))
.arg(gdbServerPort(m_runConfig, m_deviceConfig))
.arg(remoteExe).arg(m_runConfig->arguments()
.join(QLatin1String(" "))).toUtf8());
}
}
void MaemoDebugSupport::handleRemoteProcessStarted()
......@@ -261,7 +267,11 @@ void MaemoDebugSupport::stopSsh()
void MaemoDebugSupport::handleAdapterSetupFailed(const QString &error)
{
m_gdbAdapter->handleSetupFailed(tr("Initial setup failed: %1").arg(error));
const QString msg = tr("Initial setup failed: %1").arg(error);
if (useGdb())
qobject_cast<RemotePlainGdbAdapter *>(m_gdbAdapter)->handleSetupFailed(msg);
else
qobject_cast<RemoteGdbServerAdapter*>(m_gdbAdapter)->handleSetupFailed(msg);
m_stopped = true;
stopSsh();
}
......@@ -269,7 +279,10 @@ void MaemoDebugSupport::handleAdapterSetupFailed(const QString &error)
void MaemoDebugSupport::handleAdapterSetupDone()
{
m_adapterStarted = true;
m_gdbAdapter->handleSetupDone();
if (useGdb())
qobject_cast<RemotePlainGdbAdapter *>(m_gdbAdapter)->handleSetupDone();
else
qobject_cast<RemoteGdbServerAdapter*>(m_gdbAdapter)->handleSetupDone();
}
QString MaemoDebugSupport::gdbServerPort(const MaemoRunConfiguration *rc,
......@@ -288,5 +301,10 @@ QString MaemoDebugSupport::uploadDir(const MaemoDeviceConfig &devConf)
return MaemoGlobal::homeDirOnDevice(devConf.server.uname);
}
bool MaemoDebugSupport::useGdb() const
{
return m_runControl->engine()->startParameters().startMode == StartRemoteGdb;
}
} // namespace Internal
} // namespace Qt4ProjectManager
......@@ -42,15 +42,12 @@
#include <QtCore/QObject>
#include <QtCore/QSharedPointer>
#define USE_GDBSERVER
namespace Core { class SftpChannel; }
namespace Debugger {
class DebuggerRunControl;
namespace Internal {
class RemoteGdbServerAdapter;
class RemotePlainGdbAdapter;
class AbstractGdbAdapter;
}
}
......@@ -93,19 +90,14 @@ private:
void handleAdapterSetupFailed(const QString &error);
void handleAdapterSetupDone();
void startDebugging();
bool useGdb() const;
Debugger::DebuggerRunControl *m_runControl;
MaemoRunConfiguration * const m_runConfig;
const MaemoDeviceConfig m_deviceConfig;
MaemoSshRunner * const m_runner;
#ifdef USE_GDBSERVER
typedef Debugger::Internal::RemoteGdbServerAdapter GdbAdapter;
#else
typedef Debugger::Internal::RemotePlainGdbAdapter GdbAdapter;
#endif
GdbAdapter *m_gdbAdapter;
Debugger::Internal::AbstractGdbAdapter *m_gdbAdapter;
QSharedPointer<Core::SftpChannel> m_uploader;
Core::SftpJobId m_uploadJob;
......
......@@ -61,5 +61,10 @@ QString MaemoGlobal::remoteEnvironment(const QList<ProjectExplorer::EnvironmentI
return env.mid(0, env.size() - 1);
}
QString MaemoGlobal::remoteProjectSourcesMountPoint()
{
return QLatin1String("/tmp/gdbSourcesDir");
}
} // namespace Internal
} // namespace Qt4ProjectManager
......@@ -49,6 +49,7 @@ public:
static QString remoteSudo();
static QString remoteCommandPrefix(const QString &commandFilePath);
static QString remoteEnvironment(const QList<ProjectExplorer::EnvironmentItem> &list);
static QString remoteProjectSourcesMountPoint();
template<class T> static T *buildStep(const ProjectExplorer::BuildConfiguration *bc)
{
......
......@@ -55,7 +55,11 @@
namespace Qt4ProjectManager {
namespace Internal {
namespace { const QLatin1String DefaultHostAddress("192.168.2.14"); }
namespace {
const QLatin1String DefaultHostAddress("192.168.2.14");
const bool DefaultUseRemoteGdbValue = false; // TODO: Make true once utfs-server works on Windows.
const int DefaultGdbMountPort = 10100;
} // anonymous namespace
using namespace ProjectExplorer;
......@@ -63,6 +67,9 @@ MaemoRunConfiguration::MaemoRunConfiguration(Qt4Target *parent,
const QString &proFilePath)
: RunConfiguration(parent, QLatin1String(MAEMO_RC_ID))
, m_proFilePath(proFilePath)
, m_hostAddressFromDevice(DefaultHostAddress)
, m_useRemoteGdb(DefaultUseRemoteGdbValue)
, m_gdbMountPort(DefaultGdbMountPort)
, m_baseEnvironmentBase(SystemEnvironmentBase)
{
init();
......@@ -74,6 +81,9 @@ MaemoRunConfiguration::MaemoRunConfiguration(Qt4Target *parent,
, m_proFilePath(source->m_proFilePath)
, m_gdbPath(source->m_gdbPath)
, m_arguments(source->m_arguments)
, m_hostAddressFromDevice(source->localHostAddressFromDevice())
, m_useRemoteGdb(source->useRemoteGdb())
, m_gdbMountPort(source->gdbMountPort())
, m_baseEnvironmentBase(source->m_baseEnvironmentBase)
, m_systemEnvironment(source->m_systemEnvironment)
, m_userEnvironmentChanges(source->m_userEnvironmentChanges)
......@@ -85,7 +95,6 @@ void MaemoRunConfiguration::init()
{
m_devConfigModel = new MaemoDeviceConfigListModel(this);
m_remoteMounts = new MaemoRemoteMountsModel(this);
m_hostAddressFromDevice = DefaultHostAddress;
setDisplayName(QFileInfo(m_proFilePath).completeBaseName());
updateDeviceConfigurations();
......@@ -144,6 +153,8 @@ QVariantMap MaemoRunConfiguration::toMap() const
const QDir dir = QDir(target()->project()->projectDirectory());
map.insert(ProFileKey, dir.relativeFilePath(m_proFilePath));
map.insert(HostAddressFromDeviceKey, m_hostAddressFromDevice);
map.insert(UseRemoteGdbKey, useRemoteGdb());
map.insert(GdbMountPortKey, gdbMountPort());
map.insert(BaseEnvironmentBaseKey, m_baseEnvironmentBase);
map.insert(UserEnvironmentChangesKey,
ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges));
......@@ -162,6 +173,8 @@ bool MaemoRunConfiguration::fromMap(const QVariantMap &map)
m_proFilePath = dir.filePath(map.value(ProFileKey).toString());
m_hostAddressFromDevice = map.value(HostAddressFromDeviceKey,
DefaultHostAddress).toString();
m_useRemoteGdb = map.value(UseRemoteGdbKey, DefaultUseRemoteGdbValue).toBool();
m_gdbMountPort = map.value(GdbMountPortKey, DefaultGdbMountPort).toInt();
m_userEnvironmentChanges =
ProjectExplorer::EnvironmentItem::fromStringList(map.value(UserEnvironmentChangesKey)
.toStringList());
......@@ -250,6 +263,26 @@ const QString MaemoRunConfiguration::dumperLib() const
return qt4bc->qtVersion()->debuggingHelperLibrary();
}
QString MaemoRunConfiguration::localDirToMountForRemoteGdb() const
{
const QString projectDir
= QDir::fromNativeSeparators(QDir::cleanPath(activeBuildConfiguration()
->target()->project()->projectDirectory()));
const QString execDir
= QDir::fromNativeSeparators(QFileInfo(localExecutableFilePath()).path());
const int length = qMin(projectDir.length(), execDir.length());
int lastSeparatorPos = 0;
for (int i = 0; i < length; ++i) {
if (projectDir.at(i) != execDir.at(i))
return projectDir.left(lastSeparatorPos);
if (projectDir.at(i) == QLatin1Char('/'))
lastSeparatorPos = i;
}
return projectDir.length() == execDir.length()
? projectDir : projectDir.left(lastSeparatorPos);
}
QString MaemoRunConfiguration::localExecutableFilePath() const
{
TargetInformation ti = qt4Target()->qt4Project()->rootProjectNode()
......
......@@ -96,9 +96,14 @@ public:
MaemoDeviceConfig deviceConfig() const;
MaemoDeviceConfigListModel *deviceConfigModel() const;
QString runtimeGdbServerPort() const;
bool useRemoteGdb() const { return m_useRemoteGdb; }
void setUseRemoteGdb(bool useRemoteGdb) { m_useRemoteGdb = useRemoteGdb; }
int gdbMountPort() const { return m_gdbMountPort; }
void setGdbMountPort(int port) { m_gdbMountPort = port; }
const QString gdbCmd() const;
const QString dumperLib() const;
QString localDirToMountForRemoteGdb() const;
virtual QVariantMap toMap() const;
......@@ -141,6 +146,8 @@ private:
MaemoRemoteMountsModel *m_remoteMounts;
QStringList m_arguments;
QString m_hostAddressFromDevice;
bool m_useRemoteGdb;
int m_gdbMountPort;
BaseEnvironmentBase m_baseEnvironmentBase;
ProjectExplorer::Environment m_systemEnvironment;
......
......@@ -54,6 +54,8 @@
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QPushButton>
#include <QtGui/QRadioButton>
#include <QtGui/QSpinBox>
#include <QtGui/QTableView>
#include <QtGui/QToolButton>
......@@ -69,7 +71,15 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
{
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
addGenericWidgets(mainLayout);
mainLayout->addSpacing(20);
addDebuggingWidgets(mainLayout);
addMountWidgets(mainLayout);
addEnvironmentWidgets(mainLayout);
}
void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
{
QFormLayout *formLayout = new QFormLayout;
mainLayout->addLayout(formLayout);
formLayout->setFormAlignment(Qt::AlignLeft | Qt::AlignVCenter);
......@@ -80,7 +90,7 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
QHBoxLayout *devConfLayout = new QHBoxLayout(devConfWidget);
m_devConfBox = new QComboBox;
m_devConfBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
m_devConfBox->setModel(runConfiguration->deviceConfigModel());
m_devConfBox->setModel(m_runConfiguration->deviceConfigModel());
devConfLayout->setMargin(0);
devConfLayout->addWidget(m_devConfBox);
QLabel *addDevConfLabel= new QLabel(tr("<a href=\"%1\">Manage device configurations</a>")
......@@ -99,24 +109,86 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
m_argsLineEdit = new QLineEdit(m_runConfiguration->arguments().join(" "));
formLayout->addRow(tr("Arguments:"), m_argsLineEdit);
mainLayout->addSpacing(20);
m_detailsContainer = new Utils::DetailsWidget(this);
connect(addDevConfLabel, SIGNAL(linkActivated(QString)), this,
SLOT(showSettingsDialog(QString)));
connect(debuggerConfLabel, SIGNAL(linkActivated(QString)), this,
SLOT(showSettingsDialog(QString)));
connect(m_configNameLineEdit, SIGNAL(textEdited(QString)), this,
SLOT(configNameEdited(QString)));
connect(m_argsLineEdit, SIGNAL(textEdited(QString)), this,
SLOT(argumentsEdited(QString)));
connect(m_devConfBox, SIGNAL(activated(int)), this,
SLOT(setCurrentDeviceConfig(int)));
connect(m_runConfiguration->deviceConfigModel(), SIGNAL(currentChanged()),
this, SLOT(handleCurrentDeviceConfigChanged()));
connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this,
SLOT(updateTargetInformation()));
handleCurrentDeviceConfigChanged();
}
void MaemoRunConfigurationWidget::addDebuggingWidgets(QVBoxLayout *mainLayout)
{
m_debugDetailsContainer = new Utils::DetailsWidget(this);
QWidget *debugWidget = new QWidget;
m_debugDetailsContainer->setWidget(debugWidget);
#ifndef Q_OS_WIN
mainLayout->addWidget(m_debugDetailsContainer);
#endif
QFormLayout *debugLayout = new QFormLayout(debugWidget);
QHBoxLayout *debugRadioButtonsLayout = new QHBoxLayout;
debugLayout->addRow(debugRadioButtonsLayout);
QRadioButton *gdbButton = new QRadioButton(tr("Use remote gdb"));
QRadioButton *gdbServerButton = new QRadioButton(tr("Use remote gdbserver"));
debugRadioButtonsLayout->addWidget(gdbButton);
debugRadioButtonsLayout->addWidget(gdbServerButton);
debugRadioButtonsLayout->addStretch(1);
QHBoxLayout *debugHostAddressLayout = new QHBoxLayout;
m_hostAddressLineEdit2 = new QLineEdit;
debugHostAddressLayout->addWidget(m_hostAddressLineEdit2);
debugHostAddressLayout->addStretch(1);
debugLayout->addRow(tr("This host's address from the device:"),
debugHostAddressLayout);
m_hostAddressLineEdit2->setText(m_runConfiguration->localHostAddressFromDevice());
gdbButton->setChecked(m_runConfiguration->useRemoteGdb());
gdbServerButton->setChecked(!gdbButton->isChecked());
connect(m_hostAddressLineEdit2, SIGNAL(textEdited(QString)), this,
SLOT(handleHostAddressChanged(QString)));
connect(gdbButton, SIGNAL(toggled(bool)), this,
SLOT(handleDebuggingTypeChanged(bool)));
QHBoxLayout *spinBoxLayout = new QHBoxLayout;
m_gdbMountPortSpinBox = new QSpinBox;
m_gdbMountPortSpinBox->setMinimum(1024);
m_gdbMountPortSpinBox->setMaximum((1 << 16) - 1);
spinBoxLayout->addWidget(m_gdbMountPortSpinBox);
spinBoxLayout->addStretch(1);
debugLayout->addRow(tr("Local port for mounting the project directory:"),
spinBoxLayout);
m_gdbMountPortSpinBox->setValue(m_runConfiguration->gdbMountPort());
connect(m_gdbMountPortSpinBox, SIGNAL(valueChanged(int)), this,
SLOT(handleGdbMountPortChanged(int)));
handleDebuggingTypeChanged(gdbButton->isChecked());
}
void MaemoRunConfigurationWidget::addMountWidgets(QVBoxLayout *mainLayout)
{
m_mountDetailsContainer = new Utils::DetailsWidget(this);
QWidget *mountViewWidget = new QWidget;
m_detailsContainer->setWidget(mountViewWidget);
m_mountDetailsContainer->setWidget(mountViewWidget);
#ifndef Q_OS_WIN
mainLayout->addWidget(m_detailsContainer);
mainLayout->addWidget(m_mountDetailsContainer);
#endif
QVBoxLayout *mountViewLayout = new QVBoxLayout(mountViewWidget);
QHBoxLayout *hostAddressLayout = new QHBoxLayout;
mountViewLayout->addLayout(hostAddressLayout);
QLabel *hostNameLabel
= new QLabel(tr("This host's address from the device:"));
m_hostAddressLineEdit = new QLineEdit;
m_hostAddressLineEdit->setText(m_runConfiguration->localHostAddressFromDevice());
connect(m_hostAddressLineEdit, SIGNAL(editingFinished()), this,
SLOT(handleHostAddressChanged()));
m_hostAddressLineEdit1 = new QLineEdit;
m_hostAddressLineEdit1->setText(m_runConfiguration->localHostAddressFromDevice());
connect(m_hostAddressLineEdit1, SIGNAL(textEdited(QString)), this,
SLOT(handleHostAddressChanged(QString)));
hostAddressLayout->addWidget(hostNameLabel);
hostAddressLayout->addWidget(m_hostAddressLineEdit);
hostAddressLayout->addWidget(m_hostAddressLineEdit1);
hostAddressLayout->addStretch(1);
QHBoxLayout *tableLayout = new QHBoxLayout;
mountViewLayout->addLayout(tableLayout);
......@@ -139,10 +211,34 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
mountViewButtonsLayout->addWidget(m_removeMountButton);
mountViewButtonsLayout->addStretch(1);
connect(addMountButton, SIGNAL(clicked()), this, SLOT(addMount()));
connect(m_removeMountButton, SIGNAL(clicked()), this, SLOT(removeMount()));
connect(m_mountView, SIGNAL(doubleClicked(QModelIndex)), this,
SLOT(changeLocalMountDir(QModelIndex)));
connect(m_mountView->selectionModel(),
SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this,
SLOT(enableOrDisableRemoveMountSpecButton()));
connect(m_runConfiguration->remoteMounts(),
SIGNAL(rowsInserted(QModelIndex, int, int)), this,
SLOT(handleRemoteMountsChanged()));
connect(m_runConfiguration->remoteMounts(),
SIGNAL(rowsRemoved(QModelIndex, int, int)), this,
SLOT(handleRemoteMountsChanged()));
connect(m_runConfiguration->remoteMounts(),
SIGNAL(dataChanged(QModelIndex, QModelIndex)), this,
SLOT(handleRemoteMountsChanged()));
connect(m_runConfiguration->remoteMounts(), SIGNAL(modelReset()), this,
SLOT(handleRemoteMountsChanged()));
enableOrDisableRemoveMountSpecButton();
handleRemoteMountsChanged();
}
void MaemoRunConfigurationWidget::addEnvironmentWidgets(QVBoxLayout *mainLayout)
{
QWidget *baseEnvironmentWidget = new QWidget;
QHBoxLayout *baseEnvironmentLayout = new QHBoxLayout(baseEnvironmentWidget);
baseEnvironmentLayout->setMargin(0);
QLabel *label = new QLabel(tr("Base environment for this runconfiguration:"), this);
QLabel *label = new QLabel(tr("Base environment for this run configuration:"), this);
baseEnvironmentLayout->addWidget(label);
m_baseEnvironmentComboBox = new QComboBox(this);
m_baseEnvironmentComboBox->addItems(QStringList() << tr("Clean Environment")
......@@ -160,44 +256,6 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
m_environmentWidget->setUserChanges(m_runConfiguration->userEnvironmentChanges());
mainLayout->addWidget(m_environmentWidget);
handleCurrentDeviceConfigChanged();
enableOrDisableRemoveButton();
handleRemoteMountsChanged();
connect(m_configNameLineEdit, SIGNAL(textEdited(QString)), this,
SLOT(configNameEdited(QString)));
connect(m_argsLineEdit, SIGNAL(textEdited(QString)), this,
SLOT(argumentsEdited(QString)));
connect(m_devConfBox, SIGNAL(activated(int)), this,
SLOT(setCurrentDeviceConfig(int)));
connect(runConfiguration->deviceConfigModel(), SIGNAL(currentChanged()),
this, SLOT(handleCurrentDeviceConfigChanged()));
connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this,
SLOT(updateTargetInformation()));
connect(addDevConfLabel, SIGNAL(linkActivated(QString)), this,
SLOT(showSettingsDialog(QString)));
connect(debuggerConfLabel, SIGNAL(linkActivated(QString)), this,