forked from qt-creator/qt-creator
Maemo: New project widget.
Most attributes have moved into the settings page.
This commit is contained in:
@@ -38,11 +38,14 @@
|
|||||||
|
|
||||||
#include <QtCore/QSettings>
|
#include <QtCore/QSettings>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const QLatin1String SettingsGroup("MaemoDeviceConfigs");
|
const QLatin1String SettingsGroup("MaemoDeviceConfigs");
|
||||||
|
const QLatin1String IdCounterKey("IdCounter");
|
||||||
const QLatin1String ConfigListKey("ConfigList");
|
const QLatin1String ConfigListKey("ConfigList");
|
||||||
const QLatin1String NameKey("Name");
|
const QLatin1String NameKey("Name");
|
||||||
const QLatin1String TypeKey("Type");
|
const QLatin1String TypeKey("Type");
|
||||||
@@ -51,10 +54,27 @@ namespace {
|
|||||||
const QLatin1String UserNameKey("Uname");
|
const QLatin1String UserNameKey("Uname");
|
||||||
const QLatin1String PasswordKey("Password");
|
const QLatin1String PasswordKey("Password");
|
||||||
const QLatin1String TimeoutKey("Timeout");
|
const QLatin1String TimeoutKey("Timeout");
|
||||||
|
const QLatin1String InternalIdKey("InternalId");
|
||||||
|
};
|
||||||
|
|
||||||
|
class DevConfIdMatcher
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DevConfIdMatcher(quint64 id) : m_id(id) {}
|
||||||
|
bool operator()(const MaemoDeviceConfigurations::DeviceConfig &devConfig)
|
||||||
|
{
|
||||||
|
return devConfig.internalId == m_id;
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
const quint64 m_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
MaemoDeviceConfigurations::DeviceConfig::DeviceConfig(const QString &name)
|
MaemoDeviceConfigurations::DeviceConfig::DeviceConfig(const QString &name)
|
||||||
: name(name), type(Physical), port(22), timeout(30)
|
: name(name),
|
||||||
|
type(Physical),
|
||||||
|
port(22),
|
||||||
|
timeout(30),
|
||||||
|
internalId(MaemoDeviceConfigurations::instance().m_nextId++)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,8 +85,22 @@ MaemoDeviceConfigurations::DeviceConfig::DeviceConfig(const QSettings &settings)
|
|||||||
port(settings.value(PortKey, 22).toInt()),
|
port(settings.value(PortKey, 22).toInt()),
|
||||||
uname(settings.value(UserNameKey).toString()),
|
uname(settings.value(UserNameKey).toString()),
|
||||||
pwd(settings.value(PasswordKey).toString()),
|
pwd(settings.value(PasswordKey).toString()),
|
||||||
timeout(settings.value(TimeoutKey, 30).toInt())
|
timeout(settings.value(TimeoutKey, 30).toInt()),
|
||||||
|
internalId(settings.value(InternalIdKey, MaemoDeviceConfigurations::instance().m_nextId).toInt())
|
||||||
{
|
{
|
||||||
|
if (internalId == MaemoDeviceConfigurations::instance().m_nextId)
|
||||||
|
++MaemoDeviceConfigurations::instance().m_nextId;
|
||||||
|
qDebug("%s: name = %s, id = %llu", Q_FUNC_INFO, qPrintable(name), internalId);
|
||||||
|
}
|
||||||
|
|
||||||
|
MaemoDeviceConfigurations::DeviceConfig::DeviceConfig()
|
||||||
|
: internalId(InvalidId)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MaemoDeviceConfigurations::DeviceConfig::isValid() const
|
||||||
|
{
|
||||||
|
return internalId != InvalidId;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoDeviceConfigurations::DeviceConfig::save(QSettings &settings) const
|
void MaemoDeviceConfigurations::DeviceConfig::save(QSettings &settings) const
|
||||||
@@ -78,24 +112,28 @@ void MaemoDeviceConfigurations::DeviceConfig::save(QSettings &settings) const
|
|||||||
settings.setValue(UserNameKey, uname);
|
settings.setValue(UserNameKey, uname);
|
||||||
settings.setValue(PasswordKey, pwd);
|
settings.setValue(PasswordKey, pwd);
|
||||||
settings.setValue(TimeoutKey, timeout);
|
settings.setValue(TimeoutKey, timeout);
|
||||||
|
settings.setValue(InternalIdKey, internalId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoDeviceConfigurations::setDevConfigs(const QList<DeviceConfig> &devConfigs)
|
void MaemoDeviceConfigurations::setDevConfigs(const QList<DeviceConfig> &devConfigs)
|
||||||
{
|
{
|
||||||
m_devConfigs = devConfigs;
|
m_devConfigs = devConfigs;
|
||||||
save();
|
save();
|
||||||
|
emit updated();
|
||||||
}
|
}
|
||||||
|
|
||||||
MaemoDeviceConfigurations &MaemoDeviceConfigurations::instance()
|
MaemoDeviceConfigurations &MaemoDeviceConfigurations::instance(QObject *parent)
|
||||||
{
|
{
|
||||||
static MaemoDeviceConfigurations configs;
|
if (m_instance == 0)
|
||||||
return configs;
|
m_instance = new MaemoDeviceConfigurations(parent);
|
||||||
|
return *m_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoDeviceConfigurations::save()
|
void MaemoDeviceConfigurations::save()
|
||||||
{
|
{
|
||||||
QSettings *settings = Core::ICore::instance()->settings();
|
QSettings *settings = Core::ICore::instance()->settings();
|
||||||
settings->beginGroup(SettingsGroup);
|
settings->beginGroup(SettingsGroup);
|
||||||
|
settings->setValue(IdCounterKey, m_nextId);
|
||||||
settings->beginWriteArray(ConfigListKey, m_devConfigs.count());
|
settings->beginWriteArray(ConfigListKey, m_devConfigs.count());
|
||||||
for (int i = 0; i < m_devConfigs.count(); ++i) {
|
for (int i = 0; i < m_devConfigs.count(); ++i) {
|
||||||
settings->setArrayIndex(i);
|
settings->setArrayIndex(i);
|
||||||
@@ -105,7 +143,8 @@ void MaemoDeviceConfigurations::save()
|
|||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
MaemoDeviceConfigurations::MaemoDeviceConfigurations()
|
MaemoDeviceConfigurations::MaemoDeviceConfigurations(QObject *parent)
|
||||||
|
: QObject(parent)
|
||||||
{
|
{
|
||||||
load();
|
load();
|
||||||
}
|
}
|
||||||
@@ -114,6 +153,7 @@ MaemoDeviceConfigurations::MaemoDeviceConfigurations()
|
|||||||
void MaemoDeviceConfigurations::load()
|
void MaemoDeviceConfigurations::load()
|
||||||
{
|
{
|
||||||
QSettings *settings = Core::ICore::instance()->settings();
|
QSettings *settings = Core::ICore::instance()->settings();
|
||||||
|
m_nextId = settings->value(IdCounterKey, 1).toULongLong();
|
||||||
settings->beginGroup(SettingsGroup);
|
settings->beginGroup(SettingsGroup);
|
||||||
int count = settings->beginReadArray(ConfigListKey);
|
int count = settings->beginReadArray(ConfigListKey);
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
@@ -124,5 +164,27 @@ void MaemoDeviceConfigurations::load()
|
|||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MaemoDeviceConfigurations::DeviceConfig MaemoDeviceConfigurations::find(const QString &name) const
|
||||||
|
{
|
||||||
|
qDebug("%s: Looking for name %s", Q_FUNC_INFO, qPrintable(name));
|
||||||
|
QList<DeviceConfig>::ConstIterator resultIt =
|
||||||
|
std::find_if(m_devConfigs.constBegin(), m_devConfigs.constEnd(),
|
||||||
|
DevConfNameMatcher(name));
|
||||||
|
qDebug("Found: %d", resultIt != m_devConfigs.constEnd());
|
||||||
|
return resultIt == m_devConfigs.constEnd() ? DeviceConfig() : *resultIt;
|
||||||
|
}
|
||||||
|
|
||||||
|
MaemoDeviceConfigurations::DeviceConfig MaemoDeviceConfigurations::find(int id) const
|
||||||
|
{
|
||||||
|
qDebug("%s: Looking for id %d", Q_FUNC_INFO, id);
|
||||||
|
QList<DeviceConfig>::ConstIterator resultIt =
|
||||||
|
std::find_if(m_devConfigs.constBegin(), m_devConfigs.constEnd(),
|
||||||
|
DevConfIdMatcher(id));
|
||||||
|
qDebug("Found: %d", resultIt != m_devConfigs.constEnd());
|
||||||
|
return resultIt == m_devConfigs.constEnd() ? DeviceConfig() : *resultIt;
|
||||||
|
}
|
||||||
|
|
||||||
|
MaemoDeviceConfigurations *MaemoDeviceConfigurations::m_instance = 0;
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
@@ -36,6 +36,7 @@
|
|||||||
#define MAEMODEVICECONFIGURATIONS_H
|
#define MAEMODEVICECONFIGURATIONS_H
|
||||||
|
|
||||||
#include <QtCore/QList>
|
#include <QtCore/QList>
|
||||||
|
#include <QtCore/QObject>
|
||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
#include <QtCore/QtGlobal>
|
#include <QtCore/QtGlobal>
|
||||||
|
|
||||||
@@ -46,16 +47,20 @@ QT_END_NAMESPACE
|
|||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class MaemoDeviceConfigurations
|
class MaemoDeviceConfigurations : public QObject
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_DISABLE_COPY(MaemoDeviceConfigurations)
|
||||||
public:
|
public:
|
||||||
class DeviceConfig
|
class DeviceConfig
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum DeviceType { Physical, Simulator };
|
enum DeviceType { Physical, Simulator };
|
||||||
|
DeviceConfig();
|
||||||
DeviceConfig(const QString &name);
|
DeviceConfig(const QString &name);
|
||||||
DeviceConfig(const QSettings &settings);
|
DeviceConfig(const QSettings &settings);
|
||||||
void save(QSettings &settings) const;
|
void save(QSettings &settings) const;
|
||||||
|
bool isValid() const;
|
||||||
QString name;
|
QString name;
|
||||||
DeviceType type;
|
DeviceType type;
|
||||||
QString host;
|
QString host;
|
||||||
@@ -63,12 +68,16 @@ public:
|
|||||||
QString uname;
|
QString uname;
|
||||||
QString pwd;
|
QString pwd;
|
||||||
int timeout;
|
int timeout;
|
||||||
|
quint64 internalId;
|
||||||
|
|
||||||
|
private:
|
||||||
|
static const quint64 InvalidId = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DevConfMatcher
|
class DevConfNameMatcher
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DevConfMatcher(const QString &name) : m_name(name) {}
|
DevConfNameMatcher(const QString &name) : m_name(name) {}
|
||||||
bool operator()(const MaemoDeviceConfigurations::DeviceConfig &devConfig)
|
bool operator()(const MaemoDeviceConfigurations::DeviceConfig &devConfig)
|
||||||
{
|
{
|
||||||
return devConfig.name == m_name;
|
return devConfig.name == m_name;
|
||||||
@@ -77,18 +86,24 @@ public:
|
|||||||
const QString m_name;
|
const QString m_name;
|
||||||
};
|
};
|
||||||
|
|
||||||
static MaemoDeviceConfigurations &instance();
|
static MaemoDeviceConfigurations &instance(QObject *parent = 0);
|
||||||
QList<DeviceConfig> devConfigs() const { return m_devConfigs; }
|
QList<DeviceConfig> devConfigs() const { return m_devConfigs; }
|
||||||
void setDevConfigs(const QList<DeviceConfig> &devConfigs);
|
void setDevConfigs(const QList<DeviceConfig> &devConfigs);
|
||||||
|
DeviceConfig find(const QString &name) const;
|
||||||
|
DeviceConfig find(int id) const;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void updated();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MaemoDeviceConfigurations();
|
MaemoDeviceConfigurations(QObject *parent);
|
||||||
MaemoDeviceConfigurations(const MaemoDeviceConfigurations &);
|
|
||||||
MaemoDeviceConfigurations& operator=(const MaemoDeviceConfigurations &);
|
|
||||||
void load();
|
void load();
|
||||||
void save();
|
void save();
|
||||||
|
|
||||||
|
static MaemoDeviceConfigurations *m_instance;
|
||||||
QList<DeviceConfig> m_devConfigs;
|
QList<DeviceConfig> m_devConfigs;
|
||||||
|
quint64 m_nextId;
|
||||||
|
friend class MaemoDeviceConfigurations::DeviceConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include "maemomanager.h"
|
#include "maemomanager.h"
|
||||||
|
|
||||||
|
#include "maemodeviceconfigurations.h"
|
||||||
#include "maemosettingspage.h"
|
#include "maemosettingspage.h"
|
||||||
#include "maemotoolchain.h"
|
#include "maemotoolchain.h"
|
||||||
#include "maemorunconfiguration.h"
|
#include "maemorunconfiguration.h"
|
||||||
@@ -68,6 +69,7 @@ MaemoManager::MaemoManager()
|
|||||||
ExtensionSystem::PluginManager::instance()->addObject(m_runControlFactory);
|
ExtensionSystem::PluginManager::instance()->addObject(m_runControlFactory);
|
||||||
ExtensionSystem::PluginManager::instance()->addObject(m_runConfigurationFactory);
|
ExtensionSystem::PluginManager::instance()->addObject(m_runConfigurationFactory);
|
||||||
ExtensionSystem::PluginManager::instance()->addObject(m_settingsPage);
|
ExtensionSystem::PluginManager::instance()->addObject(m_settingsPage);
|
||||||
|
MaemoDeviceConfigurations::instance(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
MaemoManager::~MaemoManager()
|
MaemoManager::~MaemoManager()
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include "maemorunconfiguration.h"
|
#include "maemorunconfiguration.h"
|
||||||
|
|
||||||
|
#include "maemodeviceconfigurations.h"
|
||||||
#include "maemomanager.h"
|
#include "maemomanager.h"
|
||||||
#include "maemotoolchain.h"
|
#include "maemotoolchain.h"
|
||||||
#include "profilereader.h"
|
#include "profilereader.h"
|
||||||
@@ -48,6 +49,7 @@
|
|||||||
#include <QtCore/QProcess>
|
#include <QtCore/QProcess>
|
||||||
#include <QtCore/QSharedPointer>
|
#include <QtCore/QSharedPointer>
|
||||||
|
|
||||||
|
#include <QtGui/QComboBox>
|
||||||
#include <QtGui/QCheckBox>
|
#include <QtGui/QCheckBox>
|
||||||
#include <QtGui/QFormLayout>
|
#include <QtGui/QFormLayout>
|
||||||
#include <QtGui/QFrame>
|
#include <QtGui/QFrame>
|
||||||
@@ -66,21 +68,14 @@ class MaemoRunConfigurationWidget : public QWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
MaemoRunConfigurationWidget(
|
MaemoRunConfigurationWidget(MaemoRunConfiguration *runConfiguration,
|
||||||
MaemoRunConfiguration *runConfiguration, QWidget *parent = 0);
|
QWidget *parent = 0);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void configNameEdited(const QString &text);
|
void configNameEdited(const QString &text);
|
||||||
void argumentsEdited(const QString &args);
|
void argumentsEdited(const QString &args);
|
||||||
void hostNameEdited(const QString &name);
|
void deviceConfigurationChanged(const QString &name);
|
||||||
void userNameEdited(const QString &name);
|
void resetDeviceConfigurations();
|
||||||
void portEdited(const QString &port);
|
|
||||||
void hostTypeChanged();
|
|
||||||
|
|
||||||
#if USE_SSL_PASSWORD
|
|
||||||
void passwordUseChanged();
|
|
||||||
void passwordEdited(const QString &password);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void updateTargetInformation();
|
void updateTargetInformation();
|
||||||
|
|
||||||
@@ -88,22 +83,15 @@ private slots:
|
|||||||
void updateVisibleSimulatorParameter();
|
void updateVisibleSimulatorParameter();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void setSimInfoVisible(const MaemoDeviceConfigurations::DeviceConfig &devConf);
|
||||||
|
|
||||||
QLineEdit *m_configNameLineEdit;
|
QLineEdit *m_configNameLineEdit;
|
||||||
QLineEdit *m_argsLineEdit;
|
QLineEdit *m_argsLineEdit;
|
||||||
QLineEdit *m_hostNameLineEdit;
|
|
||||||
QLineEdit *m_userLineEdit;
|
|
||||||
QLineEdit *m_passwordLineEdit;
|
|
||||||
QLineEdit *m_portLineEdit;
|
|
||||||
QLabel *m_executableLabel;
|
QLabel *m_executableLabel;
|
||||||
QLabel *m_debuggerLabel;
|
QLabel *m_debuggerLabel;
|
||||||
QLabel *m_simParamsValueLabel;
|
QComboBox *m_devConfBox;
|
||||||
QLabel *m_chooseSimPathLabel;
|
QLabel *m_simPathNameLabel;
|
||||||
QLabel *m_simParamsNameLabel;
|
QLabel *m_simPathValueLabel;
|
||||||
QCheckBox *m_passwordCheckBox;
|
|
||||||
QRadioButton *m_hwButton;
|
|
||||||
QRadioButton *m_simButton;
|
|
||||||
QToolButton *m_resetButton;
|
|
||||||
Utils::PathChooser *m_simPathChooser;
|
|
||||||
MaemoRunConfiguration *m_runConfiguration;
|
MaemoRunConfiguration *m_runConfiguration;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -124,9 +112,9 @@ protected:
|
|||||||
const QString executableFileName() const;
|
const QString executableFileName() const;
|
||||||
const QString port() const;
|
const QString port() const;
|
||||||
const QString targetCmdLinePrefix() const;
|
const QString targetCmdLinePrefix() const;
|
||||||
|
const QString remoteDir() const;
|
||||||
virtual void deploymentFinished(bool success)=0;
|
virtual void deploymentFinished(bool success)=0;
|
||||||
virtual bool setProcessEnvironment(QProcess &process);
|
virtual bool setProcessEnvironment(QProcess &process);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void readStandardError();
|
void readStandardError();
|
||||||
void readStandardOutput();
|
void readStandardOutput();
|
||||||
@@ -140,6 +128,9 @@ private:
|
|||||||
QProcess deployProcess;
|
QProcess deployProcess;
|
||||||
bool deployingExecutable;
|
bool deployingExecutable;
|
||||||
bool deployingDumperLib;
|
bool deployingDumperLib;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
const MaemoDeviceConfigurations::DeviceConfig devConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MaemoRunControl : public AbstractMaemoRunControl
|
class MaemoRunControl : public AbstractMaemoRunControl
|
||||||
@@ -239,39 +230,19 @@ void ErrorDumper::printToStream(QProcess::ProcessError error)
|
|||||||
// #pragma mark -- MaemoRunConfiguration
|
// #pragma mark -- MaemoRunConfiguration
|
||||||
|
|
||||||
|
|
||||||
static const QLatin1String RemoteHostIsSimulatorKey("RemoteHostIsSimulator");
|
static const QLatin1String ArgumentsKey("Arguments");
|
||||||
static const QLatin1String ArgumentsKeySim("ArgumentsSim");
|
static const QLatin1String SimulatorPathKey("Simulator");
|
||||||
static const QLatin1String RemoteHostNameKeySim("RemoteHostNameSim");
|
static const QLatin1String DeviceIdKey("DeviceId");
|
||||||
static const QLatin1String RemoteUserNameKeySim("RemoteUserNameSim");
|
|
||||||
static const QLatin1String RemotePortKeySim("RemotePortSim");
|
|
||||||
|
|
||||||
static const QLatin1String ArgumentsKeyDevice("ArgumentsDevice");
|
|
||||||
static const QLatin1String RemoteHostNameKeyDevice("RemoteHostNameDevice");
|
|
||||||
static const QLatin1String RemoteUserNameKeyDevice("RemoteUserNameDevice");
|
|
||||||
static const QLatin1String RemotePortKeyDevice("RemotePortDevice");
|
|
||||||
|
|
||||||
static const QLatin1String LastDeployedKey("LastDeployed");
|
static const QLatin1String LastDeployedKey("LastDeployed");
|
||||||
static const QLatin1String DebuggingHelpersLastDeployedKey(
|
static const QLatin1String DebuggingHelpersLastDeployedKey(
|
||||||
"DebuggingHelpersLastDeployed");
|
"DebuggingHelpersLastDeployed");
|
||||||
|
|
||||||
static const QLatin1String SimulatorPath("SimulatorPath");
|
|
||||||
static const QLatin1String IsUserSetSimulator("IsUserSetSimulator");
|
|
||||||
|
|
||||||
#if USE_SSL_PASSWORD
|
|
||||||
static const QLatinString RemoteUserPasswordKey("RemoteUserPassword");
|
|
||||||
static const QLatinString RemoteHostRequiresPasswordKey(
|
|
||||||
"RemoteHostRequiresPassword");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MaemoRunConfiguration::MaemoRunConfiguration(Project *project,
|
MaemoRunConfiguration::MaemoRunConfiguration(Project *project,
|
||||||
const QString &proFilePath)
|
const QString &proFilePath)
|
||||||
: RunConfiguration(project)
|
: RunConfiguration(project)
|
||||||
, m_proFilePath(proFilePath)
|
, m_proFilePath(proFilePath)
|
||||||
, m_cachedTargetInformationValid(false)
|
, m_cachedTargetInformationValid(false)
|
||||||
, m_cachedSimulatorInformationValid(false)
|
, m_cachedSimulatorInformationValid(false)
|
||||||
, m_isUserSetSimulator(false)
|
|
||||||
, m_remotePortSim(22)
|
|
||||||
, m_remotePortDevice(22)
|
|
||||||
, qemu(0)
|
, qemu(0)
|
||||||
{
|
{
|
||||||
if (!m_proFilePath.isEmpty()) {
|
if (!m_proFilePath.isEmpty()) {
|
||||||
@@ -281,6 +252,9 @@ MaemoRunConfiguration::MaemoRunConfiguration(Project *project,
|
|||||||
setName(tr("MaemoRunConfiguration"));
|
setName(tr("MaemoRunConfiguration"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connect(&MaemoDeviceConfigurations::instance(), SIGNAL(updated()),
|
||||||
|
this, SLOT(updateDeviceConfigurations()));
|
||||||
|
|
||||||
connect(project, SIGNAL(targetInformationChanged()), this,
|
connect(project, SIGNAL(targetInformationChanged()), this,
|
||||||
SLOT(invalidateCachedTargetInformation()));
|
SLOT(invalidateCachedTargetInformation()));
|
||||||
connect(project, SIGNAL(activeBuildConfigurationChanged()), this,
|
connect(project, SIGNAL(activeBuildConfigurationChanged()), this,
|
||||||
@@ -336,28 +310,14 @@ QWidget *MaemoRunConfiguration::configurationWidget()
|
|||||||
|
|
||||||
void MaemoRunConfiguration::save(PersistentSettingsWriter &writer) const
|
void MaemoRunConfiguration::save(PersistentSettingsWriter &writer) const
|
||||||
{
|
{
|
||||||
writer.saveValue(RemoteHostIsSimulatorKey, m_remoteHostIsSimulator);
|
writer.saveValue(DeviceIdKey, m_devConfig.internalId);
|
||||||
writer.saveValue(ArgumentsKeySim, m_argumentsSim);
|
writer.saveValue(ArgumentsKey, m_arguments);
|
||||||
writer.saveValue(RemoteHostNameKeySim, m_remoteHostNameSim);
|
|
||||||
writer.saveValue(RemoteUserNameKeySim, m_remoteUserNameSim);
|
|
||||||
writer.saveValue(RemotePortKeySim, m_remotePortSim);
|
|
||||||
|
|
||||||
writer.saveValue(ArgumentsKeyDevice, m_argumentsDevice);
|
|
||||||
writer.saveValue(RemoteHostNameKeyDevice, m_remoteHostNameDevice);
|
|
||||||
writer.saveValue(RemoteUserNameKeyDevice, m_remoteUserNameDevice);
|
|
||||||
writer.saveValue(RemotePortKeyDevice, m_remotePortDevice);
|
|
||||||
|
|
||||||
#if USE_SSL_PASSWORD
|
|
||||||
writer.saveValue(RemoteUserPasswordKey, m_remoteUserPassword);
|
|
||||||
writer.saveValue(RemoteHostRequiresPasswordKey, m_remoteHostRequiresPassword);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
writer.saveValue(LastDeployedKey, m_lastDeployed);
|
writer.saveValue(LastDeployedKey, m_lastDeployed);
|
||||||
writer.saveValue(DebuggingHelpersLastDeployedKey,
|
writer.saveValue(DebuggingHelpersLastDeployedKey,
|
||||||
m_debuggingHelpersLastDeployed);
|
m_debuggingHelpersLastDeployed);
|
||||||
|
|
||||||
writer.saveValue(SimulatorPath, m_simulatorPath);
|
writer.saveValue(SimulatorPathKey, m_simulatorPath);
|
||||||
writer.saveValue(IsUserSetSimulator, m_isUserSetSimulator);
|
|
||||||
|
|
||||||
const QDir &dir = QFileInfo(project()->file()->fileName()).absoluteDir();
|
const QDir &dir = QFileInfo(project()->file()->fileName()).absoluteDir();
|
||||||
writer.saveValue("ProFile", dir.relativeFilePath(m_proFilePath));
|
writer.saveValue("ProFile", dir.relativeFilePath(m_proFilePath));
|
||||||
@@ -369,32 +329,15 @@ void MaemoRunConfiguration::restore(const PersistentSettingsReader &reader)
|
|||||||
{
|
{
|
||||||
RunConfiguration::restore(reader);
|
RunConfiguration::restore(reader);
|
||||||
|
|
||||||
m_remoteHostIsSimulator = reader.restoreValue(RemoteHostIsSimulatorKey)
|
setDeviceConfig(MaemoDeviceConfigurations::instance().
|
||||||
.toBool();
|
find(reader.restoreValue(DeviceIdKey).toInt()));
|
||||||
m_argumentsSim = reader.restoreValue(ArgumentsKeySim).toStringList();
|
m_arguments = reader.restoreValue(ArgumentsKey).toStringList();
|
||||||
m_remoteHostNameSim = reader.restoreValue(RemoteHostNameKeySim).toString();
|
|
||||||
m_remoteUserNameSim = reader.restoreValue(RemoteUserNameKeySim).toString();
|
|
||||||
m_remotePortSim = reader.restoreValue(RemotePortKeySim).toInt();
|
|
||||||
|
|
||||||
m_argumentsDevice = reader.restoreValue(ArgumentsKeyDevice).toStringList();
|
|
||||||
m_remoteHostNameDevice = reader.restoreValue(RemoteHostNameKeyDevice)
|
|
||||||
.toString();
|
|
||||||
m_remoteUserNameDevice = reader.restoreValue(RemoteUserNameKeyDevice)
|
|
||||||
.toString();
|
|
||||||
m_remotePortDevice = reader.restoreValue(RemotePortKeyDevice).toInt();
|
|
||||||
|
|
||||||
#if USE_SSL_PASSWORD
|
|
||||||
m_remoteUserPassword = reader.restoreValue(RemoteUserPasswordKey).toString();
|
|
||||||
m_remoteHostRequiresPassword =
|
|
||||||
reader.restoreValue(RemoteHostRequiresPasswordKey).toBool();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_lastDeployed = reader.restoreValue(LastDeployedKey).toDateTime();
|
m_lastDeployed = reader.restoreValue(LastDeployedKey).toDateTime();
|
||||||
m_debuggingHelpersLastDeployed =
|
m_debuggingHelpersLastDeployed =
|
||||||
reader.restoreValue(DebuggingHelpersLastDeployedKey).toDateTime();
|
reader.restoreValue(DebuggingHelpersLastDeployedKey).toDateTime();
|
||||||
|
|
||||||
m_simulatorPath = reader.restoreValue(SimulatorPath).toString();
|
m_simulatorPath = reader.restoreValue(SimulatorPathKey).toString();
|
||||||
m_isUserSetSimulator = reader.restoreValue(IsUserSetSimulator).toBool();
|
|
||||||
|
|
||||||
const QDir &dir = QFileInfo(project()->file()->fileName()).absoluteDir();
|
const QDir &dir = QFileInfo(project()->file()->fileName()).absoluteDir();
|
||||||
m_proFilePath = dir.filePath(reader.restoreValue("ProFile").toString());
|
m_proFilePath = dir.filePath(reader.restoreValue("ProFile").toString());
|
||||||
@@ -435,29 +378,15 @@ bool MaemoRunConfiguration::fileNeedsDeployment(const QString &path,
|
|||||||
|| QFileInfo(path).lastModified() > lastDeployed;
|
|| QFileInfo(path).lastModified() > lastDeployed;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString MaemoRunConfiguration::remoteHostName() const
|
void MaemoRunConfiguration::setDeviceConfig(
|
||||||
|
const MaemoDeviceConfigurations::DeviceConfig &devConf)
|
||||||
{
|
{
|
||||||
return m_remoteHostIsSimulator ? m_remoteHostNameSim
|
m_devConfig = devConf;
|
||||||
: m_remoteHostNameDevice;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString MaemoRunConfiguration::remoteUserName() const
|
MaemoDeviceConfigurations::DeviceConfig MaemoRunConfiguration::deviceConfig() const
|
||||||
{
|
{
|
||||||
return m_remoteHostIsSimulator ? m_remoteUserNameSim
|
return m_devConfig;
|
||||||
: m_remoteUserNameDevice;
|
|
||||||
}
|
|
||||||
|
|
||||||
int MaemoRunConfiguration::remotePort() const
|
|
||||||
{
|
|
||||||
int port = m_remoteHostIsSimulator ? m_remotePortSim : m_remotePortDevice;
|
|
||||||
return port > 0 ? port : 22;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString MaemoRunConfiguration::remoteDir() const
|
|
||||||
{
|
|
||||||
return remoteUserName() == QString::fromLocal8Bit("root")
|
|
||||||
? QString::fromLocal8Bit("/root")
|
|
||||||
: QString::fromLocal8Bit("/home/") + remoteUserName();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString MaemoRunConfiguration::sshCmd() const
|
const QString MaemoRunConfiguration::sshCmd() const
|
||||||
@@ -507,13 +436,13 @@ QString MaemoRunConfiguration::maddeRoot() const
|
|||||||
const QString MaemoRunConfiguration::sysRoot() const
|
const QString MaemoRunConfiguration::sysRoot() const
|
||||||
{
|
{
|
||||||
if (const MaemoToolChain *tc = toolchain())
|
if (const MaemoToolChain *tc = toolchain())
|
||||||
return toolchain()->sysrootRoot();
|
return tc->sysrootRoot();
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QStringList MaemoRunConfiguration::arguments() const
|
const QStringList MaemoRunConfiguration::arguments() const
|
||||||
{
|
{
|
||||||
return m_remoteHostIsSimulator ? m_argumentsSim : m_argumentsDevice;
|
return m_arguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString MaemoRunConfiguration::dumperLib() const
|
const QString MaemoRunConfiguration::dumperLib() const
|
||||||
@@ -559,62 +488,9 @@ QString MaemoRunConfiguration::simulatorArgs() const
|
|||||||
|
|
||||||
void MaemoRunConfiguration::setArguments(const QStringList &args)
|
void MaemoRunConfiguration::setArguments(const QStringList &args)
|
||||||
{
|
{
|
||||||
if (m_remoteHostIsSimulator)
|
m_arguments = args;
|
||||||
m_argumentsSim = args;
|
|
||||||
else
|
|
||||||
m_argumentsDevice = args;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfiguration::setRemoteHostIsSimulator(bool isSimulator)
|
|
||||||
{
|
|
||||||
m_remoteHostIsSimulator = isSimulator;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoRunConfiguration::setRemoteHostName(const QString &hostName)
|
|
||||||
{
|
|
||||||
m_lastDeployed = QDateTime();
|
|
||||||
m_debuggingHelpersLastDeployed = QDateTime();
|
|
||||||
|
|
||||||
if (m_remoteHostIsSimulator)
|
|
||||||
m_remoteHostNameSim = hostName;
|
|
||||||
else
|
|
||||||
m_remoteHostNameDevice = hostName;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoRunConfiguration::setRemoteUserName(const QString &userName)
|
|
||||||
{
|
|
||||||
m_lastDeployed = QDateTime();
|
|
||||||
m_debuggingHelpersLastDeployed = QDateTime();
|
|
||||||
|
|
||||||
if (m_remoteHostIsSimulator)
|
|
||||||
m_remoteUserNameSim = userName;
|
|
||||||
else
|
|
||||||
m_remoteUserNameDevice = userName;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoRunConfiguration::setRemotePort(int port)
|
|
||||||
{
|
|
||||||
m_lastDeployed = QDateTime();
|
|
||||||
m_debuggingHelpersLastDeployed = QDateTime();
|
|
||||||
|
|
||||||
if (m_remoteHostIsSimulator)
|
|
||||||
m_remotePortSim = port;
|
|
||||||
else
|
|
||||||
m_remotePortDevice = port;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if USE_SSL_PASSWORD
|
|
||||||
void MaemoRunConfiguration::setRemotePassword(const QString &password)
|
|
||||||
{
|
|
||||||
Q_ASSERT(remoteHostRequiresPassword());
|
|
||||||
m_remoteUserPassword = password;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoRunConfiguration::setRemoteHostRequiresPassword(bool requiresPassword)
|
|
||||||
{
|
|
||||||
m_remoteHostRequiresPassword = requiresPassword;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool MaemoRunConfiguration::isQemuRunning() const
|
bool MaemoRunConfiguration::isQemuRunning() const
|
||||||
{
|
{
|
||||||
@@ -860,6 +736,15 @@ void MaemoRunConfiguration::enabledStateChanged()
|
|||||||
MaemoManager::instance()->setQemuSimulatorStarterEnabled(isEnabled());
|
MaemoManager::instance()->setQemuSimulatorStarterEnabled(isEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MaemoRunConfiguration::updateDeviceConfigurations()
|
||||||
|
{
|
||||||
|
qDebug("%s: Current devid = %llu", Q_FUNC_INFO, m_devConfig.internalId);
|
||||||
|
m_devConfig =
|
||||||
|
MaemoDeviceConfigurations::instance().find(m_devConfig.internalId);
|
||||||
|
qDebug("%s: new devid = %llu", Q_FUNC_INFO, m_devConfig.internalId);
|
||||||
|
emit deviceConfigurationsUpdated();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -- MaemoRunConfigurationWidget
|
// #pragma mark -- MaemoRunConfigurationWidget
|
||||||
|
|
||||||
@@ -874,6 +759,8 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
|
|||||||
mainLayout->setFormAlignment(Qt::AlignLeft | Qt::AlignVCenter);
|
mainLayout->setFormAlignment(Qt::AlignLeft | Qt::AlignVCenter);
|
||||||
m_configNameLineEdit = new QLineEdit(m_runConfiguration->name());
|
m_configNameLineEdit = new QLineEdit(m_runConfiguration->name());
|
||||||
mainLayout->addRow(tr("Run configuration name:"), m_configNameLineEdit);
|
mainLayout->addRow(tr("Run configuration name:"), m_configNameLineEdit);
|
||||||
|
m_devConfBox = new QComboBox;
|
||||||
|
mainLayout->addRow(new QLabel(tr("Device Configuration:")), m_devConfBox);
|
||||||
m_executableLabel = new QLabel(m_runConfiguration->executable());
|
m_executableLabel = new QLabel(m_runConfiguration->executable());
|
||||||
mainLayout->addRow(tr("Executable:"), m_executableLabel);
|
mainLayout->addRow(tr("Executable:"), m_executableLabel);
|
||||||
m_argsLineEdit = new QLineEdit(m_runConfiguration->arguments().join(" "));
|
m_argsLineEdit = new QLineEdit(m_runConfiguration->arguments().join(" "));
|
||||||
@@ -881,83 +768,24 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
|
|||||||
m_debuggerLabel = new QLabel(m_runConfiguration->gdbCmd());
|
m_debuggerLabel = new QLabel(m_runConfiguration->gdbCmd());
|
||||||
mainLayout->addRow(tr("Debugger:"), m_debuggerLabel);
|
mainLayout->addRow(tr("Debugger:"), m_debuggerLabel);
|
||||||
mainLayout->addItem(new QSpacerItem(10, 10));
|
mainLayout->addItem(new QSpacerItem(10, 10));
|
||||||
|
m_simPathNameLabel = new QLabel(tr("Simulator Path:"));
|
||||||
|
m_simPathValueLabel = new QLabel(m_runConfiguration->simulatorPath());
|
||||||
|
mainLayout->addRow(m_simPathNameLabel, m_simPathValueLabel);
|
||||||
|
resetDeviceConfigurations();
|
||||||
|
|
||||||
QHBoxLayout *hostTypeLayout = new QHBoxLayout;
|
|
||||||
m_hwButton = new QRadioButton(tr("Physical device"));
|
|
||||||
hostTypeLayout->addWidget(m_hwButton);
|
|
||||||
m_simButton = new QRadioButton(tr("Simulator"));
|
|
||||||
hostTypeLayout->addWidget(m_simButton);
|
|
||||||
hostTypeLayout->addStretch(1);
|
|
||||||
mainLayout->addRow(tr("Remote host type:"), hostTypeLayout);
|
|
||||||
|
|
||||||
m_chooseSimPathLabel = new QLabel(tr("Choose simulator:"));
|
|
||||||
m_simPathChooser = new Utils::PathChooser;
|
|
||||||
m_simPathChooser->setPath(m_runConfiguration->simulatorPath());
|
|
||||||
|
|
||||||
QHBoxLayout *pathLayout = new QHBoxLayout;
|
|
||||||
pathLayout->addWidget(m_simPathChooser);
|
|
||||||
|
|
||||||
m_resetButton = new QToolButton();
|
|
||||||
m_resetButton->setToolTip(tr("Reset to default"));
|
|
||||||
m_resetButton->setIcon(QIcon(":/core/images/reset.png"));
|
|
||||||
pathLayout->addWidget(m_resetButton);
|
|
||||||
|
|
||||||
mainLayout->addRow(m_chooseSimPathLabel, pathLayout);
|
|
||||||
m_simParamsNameLabel = new QLabel(tr("Simulator command line:"));
|
|
||||||
m_simParamsValueLabel= new QLabel(m_runConfiguration->visibleSimulatorParameter());
|
|
||||||
mainLayout->addRow(m_simParamsNameLabel, m_simParamsValueLabel);
|
|
||||||
|
|
||||||
connect(m_simPathChooser, SIGNAL(changed(QString)), m_runConfiguration,
|
|
||||||
SLOT(setUserSimulatorPath(QString)));
|
|
||||||
connect(m_runConfiguration, SIGNAL(cachedSimulatorInformationChanged()),
|
connect(m_runConfiguration, SIGNAL(cachedSimulatorInformationChanged()),
|
||||||
this, SLOT(updateSimulatorPath()));
|
this, SLOT(updateSimulatorPath()));
|
||||||
connect(m_runConfiguration, SIGNAL(cachedSimulatorInformationChanged()),
|
connect(m_runConfiguration, SIGNAL(deviceConfigurationsUpdated()),
|
||||||
this, SLOT(updateVisibleSimulatorParameter()));
|
this, SLOT(resetDeviceConfigurations()));
|
||||||
connect(m_resetButton, SIGNAL(clicked()), m_runConfiguration,
|
|
||||||
SLOT(resetCachedSimulatorInformation()));
|
|
||||||
|
|
||||||
m_hostNameLineEdit = new QLineEdit(m_runConfiguration->remoteHostName());
|
|
||||||
mainLayout->addRow(tr("Remote host name:"), m_hostNameLineEdit);
|
|
||||||
m_userLineEdit = new QLineEdit(m_runConfiguration->remoteUserName());
|
|
||||||
mainLayout->addRow(tr("Remote user name:"), m_userLineEdit);
|
|
||||||
m_portLineEdit = new QLineEdit(QString::number(m_runConfiguration->remotePort()));
|
|
||||||
mainLayout->addRow(tr("Remote SSH port:"), m_portLineEdit);
|
|
||||||
|
|
||||||
// Unlikely to ever work: ssh uses /dev/tty directly instead of stdin/out
|
|
||||||
#if USE_SSL_PASSWORD
|
|
||||||
m_passwordCheckBox = new QCheckBox(tr("Remote password:"));
|
|
||||||
m_passwordCheckBox->setToolTip(tr("Uncheck for passwordless login"));
|
|
||||||
m_passwordCheckBox->setChecked(m_runConfiguration
|
|
||||||
->remoteHostRequiresPassword());
|
|
||||||
m_passwordLineEdit = new QLineEdit(m_runConfiguration->remoteUserPassword());
|
|
||||||
m_passwordLineEdit->setEchoMode(QLineEdit::Password);
|
|
||||||
m_passwordLineEdit->setEnabled(m_passwordCheckBox->isChecked());
|
|
||||||
mainLayout->addRow(m_passwordCheckBox, m_passwordLineEdit);
|
|
||||||
|
|
||||||
connect(m_passwordCheckBox, SIGNAL(stateChanged(int)), this,
|
|
||||||
SLOT(passwordUseChanged()));
|
|
||||||
connect(m_passwordLineEdit, SIGNAL(textEdited(QString)), this,
|
|
||||||
SLOT(passwordEdited(QString)));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
connect(m_configNameLineEdit, SIGNAL(textEdited(QString)), this,
|
connect(m_configNameLineEdit, SIGNAL(textEdited(QString)), this,
|
||||||
SLOT(configNameEdited(QString)));
|
SLOT(configNameEdited(QString)));
|
||||||
connect(m_argsLineEdit, SIGNAL(textEdited(QString)), this,
|
connect(m_argsLineEdit, SIGNAL(textEdited(QString)), this,
|
||||||
SLOT(argumentsEdited(QString)));
|
SLOT(argumentsEdited(QString)));
|
||||||
|
connect(m_devConfBox, SIGNAL(activated(QString)), this,
|
||||||
|
SLOT(deviceConfigurationChanged(QString)));
|
||||||
connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this,
|
connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this,
|
||||||
SLOT(updateTargetInformation()));
|
SLOT(updateTargetInformation()));
|
||||||
connect(m_hwButton, SIGNAL(toggled(bool)), this, SLOT(hostTypeChanged()));
|
|
||||||
connect(m_simButton, SIGNAL(toggled(bool)), this, SLOT(hostTypeChanged()));
|
|
||||||
connect(m_hostNameLineEdit, SIGNAL(textEdited(QString)), this,
|
|
||||||
SLOT(hostNameEdited(QString)));
|
|
||||||
connect(m_userLineEdit, SIGNAL(textEdited(QString)), this,
|
|
||||||
SLOT(userNameEdited(QString)));
|
|
||||||
connect(m_portLineEdit, SIGNAL(textEdited(QString)), this,
|
|
||||||
SLOT(portEdited(QString)));
|
|
||||||
if (m_runConfiguration->remoteHostIsSimulator())
|
|
||||||
m_simButton->setChecked(true);
|
|
||||||
else
|
|
||||||
m_hwButton->setChecked(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfigurationWidget::configNameEdited(const QString &text)
|
void MaemoRunConfigurationWidget::configNameEdited(const QString &text)
|
||||||
@@ -977,66 +805,40 @@ void MaemoRunConfigurationWidget::updateTargetInformation()
|
|||||||
|
|
||||||
void MaemoRunConfigurationWidget::updateSimulatorPath()
|
void MaemoRunConfigurationWidget::updateSimulatorPath()
|
||||||
{
|
{
|
||||||
m_simPathChooser->setPath(m_runConfiguration->simulatorPath());
|
m_simPathValueLabel->setText(m_runConfiguration->simulatorPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfigurationWidget::updateVisibleSimulatorParameter()
|
void MaemoRunConfigurationWidget::deviceConfigurationChanged(const QString &name)
|
||||||
{
|
{
|
||||||
m_simParamsValueLabel->setText(m_runConfiguration->visibleSimulatorParameter());
|
const MaemoDeviceConfigurations::DeviceConfig &devConfig =
|
||||||
|
MaemoDeviceConfigurations::instance().find(name);
|
||||||
|
setSimInfoVisible(devConfig);
|
||||||
|
m_runConfiguration->setDeviceConfig(devConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfigurationWidget::hostTypeChanged()
|
void MaemoRunConfigurationWidget::setSimInfoVisible(
|
||||||
|
const MaemoDeviceConfigurations::DeviceConfig &devConf)
|
||||||
{
|
{
|
||||||
const bool isSimulator = m_simButton->isChecked();
|
const bool isSimulator =
|
||||||
|
devConf.type == MaemoDeviceConfigurations::DeviceConfig::Simulator;
|
||||||
m_chooseSimPathLabel->setVisible(isSimulator);
|
m_simPathNameLabel->setVisible(isSimulator);
|
||||||
m_simPathChooser->setVisible(isSimulator);
|
m_simPathValueLabel->setVisible(isSimulator);
|
||||||
m_simParamsNameLabel->setVisible(isSimulator);
|
|
||||||
m_simParamsValueLabel->setVisible(isSimulator);
|
|
||||||
m_resetButton->setVisible(isSimulator);
|
|
||||||
|
|
||||||
m_runConfiguration->setRemoteHostIsSimulator(isSimulator);
|
|
||||||
m_argsLineEdit->setText(m_runConfiguration->arguments().join(" "));
|
|
||||||
m_hostNameLineEdit->setText(m_runConfiguration->remoteHostName());
|
|
||||||
m_userLineEdit->setText(m_runConfiguration->remoteUserName());
|
|
||||||
m_portLineEdit->setText(QString::number(m_runConfiguration->remotePort()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfigurationWidget::hostNameEdited(const QString &hostName)
|
void MaemoRunConfigurationWidget::resetDeviceConfigurations()
|
||||||
{
|
{
|
||||||
m_runConfiguration->setRemoteHostName(hostName);
|
m_devConfBox->clear();
|
||||||
|
const QList<MaemoDeviceConfigurations::DeviceConfig> &devConfs =
|
||||||
|
MaemoDeviceConfigurations::instance().devConfigs();
|
||||||
|
foreach (const MaemoDeviceConfigurations::DeviceConfig &devConf, devConfs)
|
||||||
|
m_devConfBox->addItem(devConf.name);
|
||||||
|
m_devConfBox->addItem(MaemoDeviceConfigurations::DeviceConfig().name);
|
||||||
|
const MaemoDeviceConfigurations::DeviceConfig &devConf =
|
||||||
|
m_runConfiguration->deviceConfig();
|
||||||
|
m_devConfBox->setCurrentIndex(m_devConfBox->findText(devConf.name));
|
||||||
|
setSimInfoVisible(devConf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfigurationWidget::userNameEdited(const QString &userName)
|
|
||||||
{
|
|
||||||
m_runConfiguration->setRemoteUserName(userName);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if USE_SSL_PASSWORD
|
|
||||||
void MaemoRunConfigurationWidget::passwordUseChanged()
|
|
||||||
{
|
|
||||||
const bool usePassword = m_passwordCheckBox->checkState() == Qt::Checked;
|
|
||||||
m_passwordLineEdit->setEnabled(usePassword);
|
|
||||||
m_runConfiguration->setRemoteHostRequiresPassword(usePassword);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoRunConfigurationWidget::passwordEdited(const QString &password)
|
|
||||||
{
|
|
||||||
m_runConfiguration->setRemotePassword(password);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void MaemoRunConfigurationWidget::portEdited(const QString &portString)
|
|
||||||
{
|
|
||||||
bool isValidString;
|
|
||||||
int port = portString.toInt(&isValidString);
|
|
||||||
if (isValidString)
|
|
||||||
m_runConfiguration->setRemotePort(port);
|
|
||||||
else
|
|
||||||
m_portLineEdit->setText(QString::number(m_runConfiguration->remotePort()));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -- MaemoRunConfigurationFactory
|
// #pragma mark -- MaemoRunConfigurationFactory
|
||||||
|
|
||||||
|
|
||||||
@@ -1219,6 +1021,8 @@ QWidget* MaemoRunControlFactory::configurationWidget(RunConfiguration *config)
|
|||||||
AbstractMaemoRunControl::AbstractMaemoRunControl(RunConfiguration *rc)
|
AbstractMaemoRunControl::AbstractMaemoRunControl(RunConfiguration *rc)
|
||||||
: RunControl(rc)
|
: RunControl(rc)
|
||||||
, runConfig(qobject_cast<MaemoRunConfiguration *>(rc))
|
, runConfig(qobject_cast<MaemoRunConfiguration *>(rc))
|
||||||
|
, devConfig(runConfig ? runConfig->deviceConfig()
|
||||||
|
: MaemoDeviceConfigurations::DeviceConfig())
|
||||||
{
|
{
|
||||||
setProcessEnvironment(deployProcess);
|
setProcessEnvironment(deployProcess);
|
||||||
|
|
||||||
@@ -1235,6 +1039,8 @@ AbstractMaemoRunControl::AbstractMaemoRunControl(RunConfiguration *rc)
|
|||||||
void AbstractMaemoRunControl::startDeployment(bool forDebugging)
|
void AbstractMaemoRunControl::startDeployment(bool forDebugging)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(runConfig, return);
|
QTC_ASSERT(runConfig, return);
|
||||||
|
if (!devConfig.isValid())
|
||||||
|
deploymentFinished(false);
|
||||||
QStringList deployables;
|
QStringList deployables;
|
||||||
if (runConfig->currentlyNeedsDeployment()) {
|
if (runConfig->currentlyNeedsDeployment()) {
|
||||||
deployingExecutable = true;
|
deployingExecutable = true;
|
||||||
@@ -1252,8 +1058,8 @@ void AbstractMaemoRunControl::startDeployment(bool forDebugging)
|
|||||||
emit addToOutputWindow(this, tr("Files to deploy: %1.")
|
emit addToOutputWindow(this, tr("Files to deploy: %1.")
|
||||||
.arg(deployables.join(" ")));
|
.arg(deployables.join(" ")));
|
||||||
QStringList cmdArgs;
|
QStringList cmdArgs;
|
||||||
cmdArgs << "-P" << port() << deployables << (runConfig->remoteUserName()
|
cmdArgs << "-P" << port() << deployables << (devConfig.uname
|
||||||
+ "@" + runConfig->remoteHostName() + ":" + runConfig->remoteDir());
|
+ "@" + devConfig.host + ":" + remoteDir());
|
||||||
deployProcess.setWorkingDirectory(QFileInfo(executableOnHost()).absolutePath());
|
deployProcess.setWorkingDirectory(QFileInfo(executableOnHost()).absolutePath());
|
||||||
deployProcess.start(runConfig->scpCmd(), cmdArgs);
|
deployProcess.start(runConfig->scpCmd(), cmdArgs);
|
||||||
if (!deployProcess.waitForStarted()) {
|
if (!deployProcess.waitForStarted()) {
|
||||||
@@ -1301,7 +1107,7 @@ const QString AbstractMaemoRunControl::executableOnHost() const
|
|||||||
|
|
||||||
const QString AbstractMaemoRunControl::port() const
|
const QString AbstractMaemoRunControl::port() const
|
||||||
{
|
{
|
||||||
return QString::number(runConfig->remotePort());
|
return QString::number(devConfig.port);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString AbstractMaemoRunControl::executableFileName() const
|
const QString AbstractMaemoRunControl::executableFileName() const
|
||||||
@@ -1309,9 +1115,16 @@ const QString AbstractMaemoRunControl::executableFileName() const
|
|||||||
return QFileInfo(executableOnHost()).fileName();
|
return QFileInfo(executableOnHost()).fileName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QString AbstractMaemoRunControl::remoteDir() const
|
||||||
|
{
|
||||||
|
return devConfig.uname == QString::fromLocal8Bit("root")
|
||||||
|
? QString::fromLocal8Bit("/root")
|
||||||
|
: QString::fromLocal8Bit("/home/") + devConfig.uname;
|
||||||
|
}
|
||||||
|
|
||||||
const QString AbstractMaemoRunControl::executableOnTarget() const
|
const QString AbstractMaemoRunControl::executableOnTarget() const
|
||||||
{
|
{
|
||||||
return QString::fromLocal8Bit("%1/%2").arg(runConfig->remoteDir()).
|
return QString::fromLocal8Bit("%1/%2").arg(remoteDir()).
|
||||||
arg(executableFileName());
|
arg(executableFileName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1397,8 +1210,8 @@ void MaemoRunControl::startExecution()
|
|||||||
.arg(runConfig->arguments().join(" "));
|
.arg(runConfig->arguments().join(" "));
|
||||||
|
|
||||||
QStringList cmdArgs;
|
QStringList cmdArgs;
|
||||||
cmdArgs << "-n" << "-p" << port() << "-l" << runConfig->remoteUserName()
|
cmdArgs << "-n" << "-p" << port() << "-l" << devConfig.uname
|
||||||
<< runConfig->remoteHostName() << remoteCall;
|
<< devConfig.host << remoteCall;
|
||||||
sshProcess.start(runConfig->sshCmd(), cmdArgs);
|
sshProcess.start(runConfig->sshCmd(), cmdArgs);
|
||||||
|
|
||||||
sshProcess.start(runConfig->sshCmd(), cmdArgs);
|
sshProcess.start(runConfig->sshCmd(), cmdArgs);
|
||||||
@@ -1432,8 +1245,8 @@ void MaemoRunControl::stop()
|
|||||||
QStringList cmdArgs;
|
QStringList cmdArgs;
|
||||||
const QString remoteCall = QString::fromLocal8Bit("pkill -x %1; "
|
const QString remoteCall = QString::fromLocal8Bit("pkill -x %1; "
|
||||||
"sleep 1; pkill -x -9 %1").arg(executableFileName());
|
"sleep 1; pkill -x -9 %1").arg(executableFileName());
|
||||||
cmdArgs << "-n" << "-p" << port() << "-l" << runConfig->remoteUserName()
|
cmdArgs << "-n" << "-p" << port() << "-l" << devConfig.uname
|
||||||
<< runConfig->remoteHostName() << remoteCall;
|
<< devConfig.host << remoteCall;
|
||||||
stopProcess.start(runConfig->sshCmd(), cmdArgs);
|
stopProcess.start(runConfig->sshCmd(), cmdArgs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1462,16 +1275,14 @@ MaemoDebugRunControl::MaemoDebugRunControl(RunConfiguration *runConfiguration)
|
|||||||
QTC_ASSERT(debuggerManager != 0, return);
|
QTC_ASSERT(debuggerManager != 0, return);
|
||||||
startParams->startMode = Debugger::StartRemote;
|
startParams->startMode = Debugger::StartRemote;
|
||||||
startParams->executable = executableOnHost();
|
startParams->executable = executableOnHost();
|
||||||
startParams->remoteChannel = runConfig->remoteHostName() + ":"
|
startParams->remoteChannel = devConfig.host + ":" + gdbServerPort;
|
||||||
+ gdbServerPort;
|
|
||||||
startParams->remoteArchitecture = "arm";
|
startParams->remoteArchitecture = "arm";
|
||||||
startParams->sysRoot = runConfig->sysRoot();
|
startParams->sysRoot = runConfig->sysRoot();
|
||||||
startParams->toolChainType = ToolChain::GCC_MAEMO;
|
startParams->toolChainType = ToolChain::GCC_MAEMO;
|
||||||
startParams->debuggerCommand = runConfig->gdbCmd();
|
startParams->debuggerCommand = runConfig->gdbCmd();
|
||||||
startParams->dumperLibrary = runConfig->dumperLib();
|
startParams->dumperLibrary = runConfig->dumperLib();
|
||||||
startParams->remoteDumperLib = QString::fromLocal8Bit("%1/%2")
|
startParams->remoteDumperLib = QString::fromLocal8Bit("%1/%2")
|
||||||
.arg(runConfig->remoteDir()).arg(QFileInfo(runConfig->dumperLib())
|
.arg(remoteDir()).arg(QFileInfo(runConfig->dumperLib()).fileName());
|
||||||
.fileName());
|
|
||||||
|
|
||||||
connect(this, SIGNAL(stopRequested()), debuggerManager, SLOT(exitDebugger()));
|
connect(this, SIGNAL(stopRequested()), debuggerManager, SLOT(exitDebugger()));
|
||||||
connect(debuggerManager, SIGNAL(debuggingFinished()), this,
|
connect(debuggerManager, SIGNAL(debuggingFinished()), this,
|
||||||
@@ -1508,8 +1319,8 @@ void MaemoDebugRunControl::startGdbServer()
|
|||||||
arg(targetCmdLinePrefix()).arg(gdbServerPort). arg(executableOnTarget())
|
arg(targetCmdLinePrefix()).arg(gdbServerPort). arg(executableOnTarget())
|
||||||
.arg(runConfig->arguments().join(" ")));
|
.arg(runConfig->arguments().join(" ")));
|
||||||
QStringList sshArgs;
|
QStringList sshArgs;
|
||||||
sshArgs << "-t" << "-n" << "-l" << runConfig->remoteUserName() << "-p"
|
sshArgs << "-t" << "-n" << "-l" << devConfig.uname << "-p"
|
||||||
<< port() << runConfig->remoteHostName() << remoteCall;
|
<< port() << devConfig.host << remoteCall;
|
||||||
inferiorPid = -1;
|
inferiorPid = -1;
|
||||||
disconnect(&gdbServer, SIGNAL(readyReadStandardError()), 0, 0);
|
disconnect(&gdbServer, SIGNAL(readyReadStandardError()), 0, 0);
|
||||||
connect(&gdbServer, SIGNAL(readyReadStandardError()), this,
|
connect(&gdbServer, SIGNAL(readyReadStandardError()), this,
|
||||||
@@ -1591,8 +1402,8 @@ void MaemoDebugRunControl::debuggingFinished()
|
|||||||
const QString remoteCall = QString::fromLocal8Bit("kill %1; sleep 1; "
|
const QString remoteCall = QString::fromLocal8Bit("kill %1; sleep 1; "
|
||||||
"kill -9 %1; pkill -x -9 gdbserver").arg(inferiorPid);
|
"kill -9 %1; pkill -x -9 gdbserver").arg(inferiorPid);
|
||||||
QStringList sshArgs;
|
QStringList sshArgs;
|
||||||
sshArgs << "-n" << "-l" << runConfig->remoteUserName() << "-p" << port()
|
sshArgs << "-n" << "-l" << devConfig.uname << "-p" << port()
|
||||||
<< runConfig->remoteHostName() << remoteCall;
|
<< devConfig.host << remoteCall;
|
||||||
stopProcess.start(runConfig->sshCmd(), sshArgs);
|
stopProcess.start(runConfig->sshCmd(), sshArgs);
|
||||||
}
|
}
|
||||||
qDebug("ssh return code is %d", gdbServer.exitCode());
|
qDebug("ssh return code is %d", gdbServer.exitCode());
|
||||||
|
@@ -30,6 +30,8 @@
|
|||||||
#ifndef MAEMORUNCONFIGURATION_H
|
#ifndef MAEMORUNCONFIGURATION_H
|
||||||
#define MAEMORUNCONFIGURATION_H
|
#define MAEMORUNCONFIGURATION_H
|
||||||
|
|
||||||
|
#include "maemodeviceconfigurations.h"
|
||||||
|
|
||||||
#include <QtCore/QDateTime>
|
#include <QtCore/QDateTime>
|
||||||
#include <QtGui/QWidget>
|
#include <QtGui/QWidget>
|
||||||
|
|
||||||
@@ -87,28 +89,19 @@ public:
|
|||||||
const QString sysRoot() const;
|
const QString sysRoot() const;
|
||||||
const QStringList arguments() const;
|
const QStringList arguments() const;
|
||||||
void setArguments(const QStringList &args);
|
void setArguments(const QStringList &args);
|
||||||
|
void setDeviceConfig(const MaemoDeviceConfigurations::DeviceConfig &deviceConfig);
|
||||||
|
MaemoDeviceConfigurations::DeviceConfig deviceConfig() const;
|
||||||
|
|
||||||
QString simulator() const;
|
QString simulator() const;
|
||||||
QString simulatorArgs() const;
|
QString simulatorArgs() const;
|
||||||
QString simulatorPath() const;
|
QString simulatorPath() const;
|
||||||
QString visibleSimulatorParameter() const;
|
QString visibleSimulatorParameter() const;
|
||||||
|
|
||||||
bool remoteHostIsSimulator() const { return m_remoteHostIsSimulator; }
|
|
||||||
const QString remoteHostName() const;
|
|
||||||
const QString remoteUserName() const;
|
|
||||||
int remotePort() const;
|
|
||||||
|
|
||||||
const QString remoteDir() const;
|
|
||||||
const QString sshCmd() const;
|
const QString sshCmd() const;
|
||||||
const QString scpCmd() const;
|
const QString scpCmd() const;
|
||||||
const QString gdbCmd() const;
|
const QString gdbCmd() const;
|
||||||
const QString dumperLib() const;
|
const QString dumperLib() const;
|
||||||
|
|
||||||
void setRemoteHostIsSimulator(bool isSimulator);
|
|
||||||
void setRemoteHostName(const QString &hostName);
|
|
||||||
void setRemoteUserName(const QString &userName);
|
|
||||||
void setRemotePort(int port);
|
|
||||||
|
|
||||||
bool isQemuRunning() const;
|
bool isQemuRunning() const;
|
||||||
|
|
||||||
#if USE_SSL_PASSWORD
|
#if USE_SSL_PASSWORD
|
||||||
@@ -121,11 +114,13 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
void deviceConfigurationsUpdated();
|
||||||
void targetInformationChanged();
|
void targetInformationChanged();
|
||||||
void cachedSimulatorInformationChanged();
|
void cachedSimulatorInformationChanged();
|
||||||
void qemuProcessStatus(bool running);
|
void qemuProcessStatus(bool running);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void updateDeviceConfigurations();
|
||||||
void invalidateCachedTargetInformation();
|
void invalidateCachedTargetInformation();
|
||||||
|
|
||||||
void setUserSimulatorPath(const QString &path);
|
void setUserSimulatorPath(const QString &path);
|
||||||
@@ -145,7 +140,6 @@ private:
|
|||||||
bool fileNeedsDeployment(const QString &path, const QDateTime &lastDeployed) const;
|
bool fileNeedsDeployment(const QString &path, const QDateTime &lastDeployed) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Keys for saving/loading attributes.
|
|
||||||
QString m_executable;
|
QString m_executable;
|
||||||
QString m_proFilePath;
|
QString m_proFilePath;
|
||||||
bool m_cachedTargetInformationValid;
|
bool m_cachedTargetInformationValid;
|
||||||
@@ -161,18 +155,8 @@ private:
|
|||||||
|
|
||||||
QString m_gdbPath;
|
QString m_gdbPath;
|
||||||
|
|
||||||
// Information about the remote host.
|
MaemoDeviceConfigurations::DeviceConfig m_devConfig;
|
||||||
bool m_remoteHostIsSimulator;
|
QStringList m_arguments;
|
||||||
|
|
||||||
QStringList m_argumentsSim;
|
|
||||||
QString m_remoteHostNameSim;
|
|
||||||
QString m_remoteUserNameSim;
|
|
||||||
int m_remotePortSim;
|
|
||||||
|
|
||||||
QStringList m_argumentsDevice;
|
|
||||||
QString m_remoteHostNameDevice;
|
|
||||||
QString m_remoteUserNameDevice;
|
|
||||||
int m_remotePortDevice;
|
|
||||||
|
|
||||||
QDateTime m_lastDeployed;
|
QDateTime m_lastDeployed;
|
||||||
QDateTime m_debuggingHelpersLastDeployed;
|
QDateTime m_debuggingHelpersLastDeployed;
|
||||||
|
@@ -60,7 +60,7 @@ bool configNameExists(const QList<MaemoDeviceConfigurations::DeviceConfig> &devC
|
|||||||
const QString &name)
|
const QString &name)
|
||||||
{
|
{
|
||||||
return std::find_if(devConfs.constBegin(), devConfs.constEnd(),
|
return std::find_if(devConfs.constBegin(), devConfs.constEnd(),
|
||||||
MaemoDeviceConfigurations::DevConfMatcher(name)) != devConfs.constEnd();
|
MaemoDeviceConfigurations::DevConfNameMatcher(name)) != devConfs.constEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
class PortAndTimeoutValidator : public QIntValidator
|
class PortAndTimeoutValidator : public QIntValidator
|
||||||
@@ -193,7 +193,7 @@ void MaemoSettingsPage::apply()
|
|||||||
|
|
||||||
void MaemoSettingsPage::finish()
|
void MaemoSettingsPage::finish()
|
||||||
{
|
{
|
||||||
apply();
|
// apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
MaemoSettingsWidget::MaemoSettingsWidget(QWidget *parent)
|
MaemoSettingsWidget::MaemoSettingsWidget(QWidget *parent)
|
||||||
@@ -262,9 +262,9 @@ void MaemoSettingsWidget::display(const MaemoDeviceConfigurations::DeviceConfig
|
|||||||
{
|
{
|
||||||
m_ui->nameLineEdit->setText(devConfig.name);
|
m_ui->nameLineEdit->setText(devConfig.name);
|
||||||
if (devConfig.type == MaemoDeviceConfigurations::DeviceConfig::Physical)
|
if (devConfig.type == MaemoDeviceConfigurations::DeviceConfig::Physical)
|
||||||
m_ui->deviceButton->setEnabled(true);
|
m_ui->deviceButton->setChecked(true);
|
||||||
else
|
else
|
||||||
m_ui->simulatorButton->setEnabled(true);
|
m_ui->simulatorButton->setChecked(true);
|
||||||
m_ui->hostLineEdit->setText(devConfig.host);
|
m_ui->hostLineEdit->setText(devConfig.host);
|
||||||
m_ui->portLineEdit->setText(QString::number(devConfig.port));
|
m_ui->portLineEdit->setText(QString::number(devConfig.port));
|
||||||
m_ui->timeoutLineEdit->setText(QString::number(devConfig.timeout));
|
m_ui->timeoutLineEdit->setText(QString::number(devConfig.timeout));
|
||||||
|
Reference in New Issue
Block a user