forked from qt-creator/qt-creator
RemoteLinux: Move current device configuration to deploy configuration.
It used to be in the deploy steps itself, which is theoretically more flexible, but offers no advantage in practice and also causes a lot of hassle. Change-Id: I0eafaf8477067fced86b7a05fd94d72a35e02bb7 Reviewed-on: http://codereview.qt.nokia.com/654 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -31,10 +31,7 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
#include "abstractlinuxdevicedeploystep.h"
|
#include "abstractlinuxdevicedeploystep.h"
|
||||||
|
|
||||||
#include "linuxdeviceconfigurations.h"
|
#include "linuxdeviceconfiguration.h"
|
||||||
#include "maemoconstants.h"
|
|
||||||
#include "maemodeploystepwidget.h"
|
|
||||||
#include "maemopertargetdeviceconfigurationlistmodel.h"
|
|
||||||
#include "qt4maemodeployconfiguration.h"
|
#include "qt4maemodeployconfiguration.h"
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
@@ -44,13 +41,22 @@ namespace Internal {
|
|||||||
|
|
||||||
|
|
||||||
AbstractLinuxDeviceDeployStep::AbstractLinuxDeviceDeployStep(DeployConfiguration *dc)
|
AbstractLinuxDeviceDeployStep::AbstractLinuxDeviceDeployStep(DeployConfiguration *dc)
|
||||||
: m_helper(qobject_cast<Qt4MaemoDeployConfiguration *>(dc))
|
: m_deployConfiguration(qobject_cast<Qt4MaemoDeployConfiguration *>(dc))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AbstractLinuxDeviceDeployStep::~AbstractLinuxDeviceDeployStep()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
LinuxDeviceConfiguration::ConstPtr AbstractLinuxDeviceDeployStep::deviceConfiguration() const
|
||||||
|
{
|
||||||
|
return m_deviceConfiguration;
|
||||||
|
}
|
||||||
|
|
||||||
bool AbstractLinuxDeviceDeployStep::isDeploymentPossible(QString &whyNot) const
|
bool AbstractLinuxDeviceDeployStep::isDeploymentPossible(QString &whyNot) const
|
||||||
{
|
{
|
||||||
if (!m_helper.deviceConfig()) {
|
if (!m_deployConfiguration->deviceConfiguration()) {
|
||||||
whyNot = tr("No valid device set.");
|
whyNot = tr("No valid device set.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -61,49 +67,7 @@ bool AbstractLinuxDeviceDeployStep::initialize(QString &errorMsg)
|
|||||||
{
|
{
|
||||||
if (!isDeploymentPossible(errorMsg))
|
if (!isDeploymentPossible(errorMsg))
|
||||||
return false;
|
return false;
|
||||||
m_helper.prepareDeployment();
|
m_deviceConfiguration = m_deployConfiguration->deviceConfiguration();
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
LinuxDeviceDeployStepHelper::LinuxDeviceDeployStepHelper(Qt4MaemoDeployConfiguration *dc)
|
|
||||||
: m_deployConfiguration(dc)
|
|
||||||
{
|
|
||||||
m_deviceConfig = dc->deviceConfigModel()->defaultDeviceConfig();
|
|
||||||
connect(dc->deviceConfigModel().data(), SIGNAL(updated()),
|
|
||||||
SLOT(handleDeviceConfigurationsUpdated()));
|
|
||||||
}
|
|
||||||
|
|
||||||
LinuxDeviceDeployStepHelper::~LinuxDeviceDeployStepHelper() {}
|
|
||||||
|
|
||||||
void LinuxDeviceDeployStepHelper::handleDeviceConfigurationsUpdated()
|
|
||||||
{
|
|
||||||
setDeviceConfig(LinuxDeviceConfigurations::instance()->internalId(m_deviceConfig));
|
|
||||||
}
|
|
||||||
|
|
||||||
void LinuxDeviceDeployStepHelper::setDeviceConfig(LinuxDeviceConfiguration::Id internalId)
|
|
||||||
{
|
|
||||||
m_deviceConfig = deployConfiguration()->deviceConfigModel()->find(internalId);
|
|
||||||
emit deviceConfigChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LinuxDeviceDeployStepHelper::setDeviceConfig(int i)
|
|
||||||
{
|
|
||||||
m_deviceConfig = deployConfiguration()->deviceConfigModel()->deviceAt(i);
|
|
||||||
emit deviceConfigChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariantMap LinuxDeviceDeployStepHelper::toMap() const
|
|
||||||
{
|
|
||||||
QVariantMap map;
|
|
||||||
map.insert(DeviceIdKey,
|
|
||||||
LinuxDeviceConfigurations::instance()->internalId(m_deviceConfig));
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LinuxDeviceDeployStepHelper::fromMap(const QVariantMap &map)
|
|
||||||
{
|
|
||||||
setDeviceConfig(map.value(DeviceIdKey, LinuxDeviceConfiguration::InvalidId).toULongLong());
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,68 +32,37 @@
|
|||||||
#ifndef ABSTRACTLINUXDEVICEDEPLOYSTEP_H
|
#ifndef ABSTRACTLINUXDEVICEDEPLOYSTEP_H
|
||||||
#define ABSTRACTLINUXDEVICEDEPLOYSTEP_H
|
#define ABSTRACTLINUXDEVICEDEPLOYSTEP_H
|
||||||
|
|
||||||
#include "linuxdeviceconfiguration.h"
|
|
||||||
|
|
||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
#include <QtCore/QSharedPointer>
|
#include <QtCore/QSharedPointer>
|
||||||
#include <QtCore/QVariantMap>
|
|
||||||
|
|
||||||
namespace ProjectExplorer { class DeployConfiguration; }
|
namespace ProjectExplorer { class DeployConfiguration; }
|
||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
|
class LinuxDeviceConfiguration;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class Qt4MaemoDeployConfiguration;
|
class Qt4MaemoDeployConfiguration;
|
||||||
|
|
||||||
|
|
||||||
class LinuxDeviceDeployStepHelper : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
LinuxDeviceDeployStepHelper(Qt4MaemoDeployConfiguration *dc);
|
|
||||||
~LinuxDeviceDeployStepHelper();
|
|
||||||
|
|
||||||
QSharedPointer<const LinuxDeviceConfiguration> deviceConfig() const { return m_deviceConfig; }
|
|
||||||
QSharedPointer<const LinuxDeviceConfiguration> cachedDeviceConfig() const { return m_cachedDeviceConfig; }
|
|
||||||
Qt4MaemoDeployConfiguration *deployConfiguration() const { return m_deployConfiguration; }
|
|
||||||
|
|
||||||
void setDeviceConfig(int i);
|
|
||||||
void prepareDeployment() { m_cachedDeviceConfig = m_deviceConfig; }
|
|
||||||
|
|
||||||
QVariantMap toMap() const;
|
|
||||||
bool fromMap(const QVariantMap &map);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void deviceConfigChanged();
|
|
||||||
|
|
||||||
private:
|
|
||||||
void setDeviceConfig(LinuxDeviceConfiguration::Id internalId);
|
|
||||||
Q_SLOT void handleDeviceConfigurationsUpdated();
|
|
||||||
|
|
||||||
QSharedPointer<const LinuxDeviceConfiguration> m_deviceConfig;
|
|
||||||
QSharedPointer<const LinuxDeviceConfiguration> m_cachedDeviceConfig;
|
|
||||||
Qt4MaemoDeployConfiguration * const m_deployConfiguration;
|
|
||||||
};
|
|
||||||
|
|
||||||
class AbstractLinuxDeviceDeployStep
|
class AbstractLinuxDeviceDeployStep
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(AbstractLinuxDeviceDeployStep)
|
Q_DECLARE_TR_FUNCTIONS(AbstractLinuxDeviceDeployStep)
|
||||||
public:
|
public:
|
||||||
virtual ~AbstractLinuxDeviceDeployStep() {}
|
virtual ~AbstractLinuxDeviceDeployStep();
|
||||||
|
|
||||||
Qt4MaemoDeployConfiguration *maemoDeployConfig() const { return m_helper.deployConfiguration(); }
|
Qt4MaemoDeployConfiguration *maemoDeployConfig() const { return m_deployConfiguration; }
|
||||||
bool isDeploymentPossible(QString &whyNot) const;
|
bool isDeploymentPossible(QString &whyNot) const;
|
||||||
LinuxDeviceDeployStepHelper &helper() { return m_helper; }
|
|
||||||
const LinuxDeviceDeployStepHelper &helper() const { return m_helper; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
AbstractLinuxDeviceDeployStep(ProjectExplorer::DeployConfiguration *dc);
|
AbstractLinuxDeviceDeployStep(ProjectExplorer::DeployConfiguration *dc);
|
||||||
|
|
||||||
|
QSharedPointer<const LinuxDeviceConfiguration> deviceConfiguration() const;
|
||||||
bool initialize(QString &errorMsg);
|
bool initialize(QString &errorMsg);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual bool isDeploymentPossibleInternal(QString &whynot) const=0;
|
virtual bool isDeploymentPossibleInternal(QString &whynot) const=0;
|
||||||
|
|
||||||
LinuxDeviceDeployStepHelper m_helper;
|
Qt4MaemoDeployConfiguration * const m_deployConfiguration;
|
||||||
|
mutable QSharedPointer<const LinuxDeviceConfiguration> m_deviceConfiguration;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -129,14 +129,13 @@ void AbstractMaemoDeployStep::run(QFutureInterface<bool> &fi)
|
|||||||
|
|
||||||
BuildStepConfigWidget *AbstractMaemoDeployStep::createConfigWidget()
|
BuildStepConfigWidget *AbstractMaemoDeployStep::createConfigWidget()
|
||||||
{
|
{
|
||||||
return new MaemoDeployStepWidget(this);
|
return new MaemoDeployStepBaseWidget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariantMap AbstractMaemoDeployStep::toMap() const
|
QVariantMap AbstractMaemoDeployStep::toMap() const
|
||||||
{
|
{
|
||||||
QVariantMap map(BuildStep::toMap());
|
QVariantMap map(BuildStep::toMap());
|
||||||
addDeployTimesToMap(map);
|
addDeployTimesToMap(map);
|
||||||
map.unite(helper().toMap());
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,8 +162,6 @@ bool AbstractMaemoDeployStep::fromMap(const QVariantMap &map)
|
|||||||
{
|
{
|
||||||
if (!BuildStep::fromMap(map))
|
if (!BuildStep::fromMap(map))
|
||||||
return false;
|
return false;
|
||||||
if (!helper().fromMap(map))
|
|
||||||
return false;
|
|
||||||
getDeployTimesFromMap(map);
|
getDeployTimesFromMap(map);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -247,8 +244,8 @@ void AbstractMaemoDeployStep::start()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_hasError = false;
|
m_hasError = false;
|
||||||
if (isDeploymentNeeded(helper().cachedDeviceConfig()->sshParameters().host)) {
|
if (isDeploymentNeeded(deviceConfiguration()->sshParameters().host)) {
|
||||||
if (helper().cachedDeviceConfig()->type() == LinuxDeviceConfiguration::Emulator
|
if (deviceConfiguration()->type() == LinuxDeviceConfiguration::Emulator
|
||||||
&& !MaemoQemuManager::instance().qemuIsRunning()) {
|
&& !MaemoQemuManager::instance().qemuIsRunning()) {
|
||||||
MaemoQemuManager::instance().startRuntime();
|
MaemoQemuManager::instance().startRuntime();
|
||||||
raiseError(tr("Cannot deploy: Qemu was not running. "
|
raiseError(tr("Cannot deploy: Qemu was not running. "
|
||||||
@@ -271,7 +268,7 @@ void AbstractMaemoDeployStep::handleConnectionFailure()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
const QString errorMsg = m_baseState == Connecting
|
const QString errorMsg = m_baseState == Connecting
|
||||||
? MaemoGlobal::failedToConnectToServerMessage(m_connection, helper().cachedDeviceConfig())
|
? MaemoGlobal::failedToConnectToServerMessage(m_connection, deviceConfiguration())
|
||||||
: tr("Connection error: %1").arg(m_connection->errorString());
|
: tr("Connection error: %1").arg(m_connection->errorString());
|
||||||
raiseError(errorMsg);
|
raiseError(errorMsg);
|
||||||
setDeploymentFinished();
|
setDeploymentFinished();
|
||||||
@@ -282,7 +279,7 @@ void AbstractMaemoDeployStep::connectToDevice()
|
|||||||
ASSERT_STATE(QList<BaseState>() << BaseInactive);
|
ASSERT_STATE(QList<BaseState>() << BaseInactive);
|
||||||
setBaseState(Connecting);
|
setBaseState(Connecting);
|
||||||
|
|
||||||
m_connection = SshConnectionManager::instance().acquireConnection(helper().cachedDeviceConfig()->sshParameters());
|
m_connection = SshConnectionManager::instance().acquireConnection(deviceConfiguration()->sshParameters());
|
||||||
connect(m_connection.data(), SIGNAL(error(Utils::SshError)), this,
|
connect(m_connection.data(), SIGNAL(error(Utils::SshError)), this,
|
||||||
SLOT(handleConnectionFailure()));
|
SLOT(handleConnectionFailure()));
|
||||||
if (m_connection->state() == SshConnection::Connected) {
|
if (m_connection->state() == SshConnection::Connected) {
|
||||||
@@ -374,6 +371,11 @@ const Qt4BuildConfiguration *AbstractMaemoDeployStep::qt4BuildConfiguration() co
|
|||||||
return static_cast<Qt4BuildConfiguration *>(buildConfiguration());
|
return static_cast<Qt4BuildConfiguration *>(buildConfiguration());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SshConnection::Ptr AbstractMaemoDeployStep::connection() const
|
||||||
|
{
|
||||||
|
return m_connection;
|
||||||
|
}
|
||||||
|
|
||||||
MaemoDeployEventHandler::MaemoDeployEventHandler(AbstractMaemoDeployStep *deployStep,
|
MaemoDeployEventHandler::MaemoDeployEventHandler(AbstractMaemoDeployStep *deployStep,
|
||||||
QFutureInterface<bool> &future)
|
QFutureInterface<bool> &future)
|
||||||
: m_deployStep(deployStep), m_future(future), m_eventLoop(new QEventLoop),
|
: m_deployStep(deployStep), m_future(future), m_eventLoop(new QEventLoop),
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ protected:
|
|||||||
|
|
||||||
QString deployMountPoint() const;
|
QString deployMountPoint() const;
|
||||||
const Qt4ProjectManager::Qt4BuildConfiguration *qt4BuildConfiguration() const;
|
const Qt4ProjectManager::Qt4BuildConfiguration *qt4BuildConfiguration() const;
|
||||||
QSharedPointer<Utils::SshConnection> connection() const { return m_connection; }
|
QSharedPointer<Utils::SshConnection> connection() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void start();
|
void start();
|
||||||
|
|||||||
@@ -30,6 +30,8 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
#include "maemodebugsupport.h"
|
#include "maemodebugsupport.h"
|
||||||
|
|
||||||
|
#include <remotelinux/linuxdeviceconfiguration.h>
|
||||||
|
|
||||||
#include "maemosshrunner.h"
|
#include "maemosshrunner.h"
|
||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ void AbstractMaemoDeployByMountStep::handleMountDebugOutput(const QString &outpu
|
|||||||
void AbstractMaemoDeployByMountStep::mount()
|
void AbstractMaemoDeployByMountStep::mount()
|
||||||
{
|
{
|
||||||
m_extendedState = Mounting;
|
m_extendedState = Mounting;
|
||||||
m_mounter->setupMounts(connection(), helper().cachedDeviceConfig(),
|
m_mounter->setupMounts(connection(), deviceConfiguration(),
|
||||||
mountSpecifications(), qt4BuildConfiguration());
|
mountSpecifications(), qt4BuildConfiguration());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -259,8 +259,7 @@ void MaemoMountAndInstallDeployStep::deploy()
|
|||||||
{
|
{
|
||||||
const QString remoteFilePath = deployMountPoint() + QLatin1Char('/')
|
const QString remoteFilePath = deployMountPoint() + QLatin1Char('/')
|
||||||
+ QFileInfo(packagingStep()->packageFilePath()).fileName();
|
+ QFileInfo(packagingStep()->packageFilePath()).fileName();
|
||||||
m_installer->installPackage(connection(), helper().cachedDeviceConfig(),
|
m_installer->installPackage(connection(), deviceConfiguration(), remoteFilePath, false);
|
||||||
remoteFilePath, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoMountAndInstallDeployStep::cancelInstallation()
|
void MaemoMountAndInstallDeployStep::cancelInstallation()
|
||||||
@@ -367,7 +366,7 @@ QList<MaemoMountSpecification> MaemoMountAndCopyDeployStep::mountSpecifications(
|
|||||||
|
|
||||||
void MaemoMountAndCopyDeployStep::deploy()
|
void MaemoMountAndCopyDeployStep::deploy()
|
||||||
{
|
{
|
||||||
m_copyFacility->copyFiles(connection(), helper().cachedDeviceConfig(),
|
m_copyFacility->copyFiles(connection(), deviceConfiguration(),
|
||||||
m_filesToCopy, deployMountPoint());
|
m_filesToCopy, deployMountPoint());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,10 +33,15 @@
|
|||||||
#include "maemodeployconfigurationwidget.h"
|
#include "maemodeployconfigurationwidget.h"
|
||||||
#include "ui_maemodeployconfigurationwidget.h"
|
#include "ui_maemodeployconfigurationwidget.h"
|
||||||
|
|
||||||
|
#include "linuxdeviceconfigurations.h"
|
||||||
#include "maemodeployablelistmodel.h"
|
#include "maemodeployablelistmodel.h"
|
||||||
#include "maemodeployables.h"
|
#include "maemodeployables.h"
|
||||||
|
#include "maemoglobal.h"
|
||||||
|
#include "maemopertargetdeviceconfigurationlistmodel.h"
|
||||||
|
#include "maemosettingspages.h"
|
||||||
#include "qt4maemodeployconfiguration.h"
|
#include "qt4maemodeployconfiguration.h"
|
||||||
|
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QtGui/QFileDialog>
|
#include <QtGui/QFileDialog>
|
||||||
@@ -65,7 +70,16 @@ void MaemoDeployConfigurationWidget::init(DeployConfiguration *dc)
|
|||||||
m_deployConfig = qobject_cast<Qt4MaemoDeployConfiguration *>(dc);
|
m_deployConfig = qobject_cast<Qt4MaemoDeployConfiguration *>(dc);
|
||||||
Q_ASSERT(m_deployConfig);
|
Q_ASSERT(m_deployConfig);
|
||||||
|
|
||||||
ui->modelComboBox->setModel(m_deployConfig->deployables().data());
|
connect(ui->manageDevConfsLabel, SIGNAL(linkActivated(QString)),
|
||||||
|
SLOT(showDeviceConfigurations()));
|
||||||
|
|
||||||
|
ui->deviceConfigsComboBox->setModel(m_deployConfig->deviceConfigModel().data());
|
||||||
|
connect(ui->deviceConfigsComboBox, SIGNAL(activated(int)),
|
||||||
|
SLOT(handleSelectedDeviceConfigurationChanged(int)));
|
||||||
|
connect(m_deployConfig, SIGNAL(deviceConfigurationListChanged()),
|
||||||
|
SLOT(handleDeviceConfigurationListChanged()));
|
||||||
|
|
||||||
|
ui->projectsComboBox->setModel(m_deployConfig->deployables().data());
|
||||||
connect(m_deployConfig->deployables().data(), SIGNAL(modelAboutToBeReset()),
|
connect(m_deployConfig->deployables().data(), SIGNAL(modelAboutToBeReset()),
|
||||||
SLOT(handleModelListToBeReset()));
|
SLOT(handleModelListToBeReset()));
|
||||||
|
|
||||||
@@ -74,7 +88,7 @@ void MaemoDeployConfigurationWidget::init(DeployConfiguration *dc)
|
|||||||
connect(m_deployConfig->deployables().data(), SIGNAL(modelReset()),
|
connect(m_deployConfig->deployables().data(), SIGNAL(modelReset()),
|
||||||
SLOT(handleModelListReset()), Qt::QueuedConnection);
|
SLOT(handleModelListReset()), Qt::QueuedConnection);
|
||||||
|
|
||||||
connect(ui->modelComboBox, SIGNAL(currentIndexChanged(int)),
|
connect(ui->projectsComboBox, SIGNAL(currentIndexChanged(int)),
|
||||||
SLOT(setModel(int)));
|
SLOT(setModel(int)));
|
||||||
connect(ui->addDesktopFileButton, SIGNAL(clicked()),
|
connect(ui->addDesktopFileButton, SIGNAL(clicked()),
|
||||||
SLOT(addDesktopFile()));
|
SLOT(addDesktopFile()));
|
||||||
@@ -92,12 +106,12 @@ void MaemoDeployConfigurationWidget::handleModelListToBeReset()
|
|||||||
|
|
||||||
void MaemoDeployConfigurationWidget::handleModelListReset()
|
void MaemoDeployConfigurationWidget::handleModelListReset()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_deployConfig->deployables()->modelCount() == ui->modelComboBox->count(), return);
|
QTC_ASSERT(m_deployConfig->deployables()->modelCount() == ui->projectsComboBox->count(), return);
|
||||||
if (m_deployConfig->deployables()->modelCount() > 0) {
|
if (m_deployConfig->deployables()->modelCount() > 0) {
|
||||||
if (ui->modelComboBox->currentIndex() == -1)
|
if (ui->projectsComboBox->currentIndex() == -1)
|
||||||
ui->modelComboBox->setCurrentIndex(0);
|
ui->projectsComboBox->setCurrentIndex(0);
|
||||||
else
|
else
|
||||||
setModel(ui->modelComboBox->currentIndex());
|
setModel(ui->projectsComboBox->currentIndex());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,9 +131,27 @@ void MaemoDeployConfigurationWidget::setModel(int row)
|
|||||||
ui->addIconButton->setEnabled(canAddIconFile);
|
ui->addIconButton->setEnabled(canAddIconFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MaemoDeployConfigurationWidget::handleSelectedDeviceConfigurationChanged(int index)
|
||||||
|
{
|
||||||
|
disconnect(m_deployConfig, SIGNAL(deviceConfigurationListChanged()), this,
|
||||||
|
SLOT(handleDeviceConfigurationListChanged()));
|
||||||
|
m_deployConfig->setDeviceConfiguration(index);
|
||||||
|
connect(m_deployConfig, SIGNAL(deviceConfigurationListChanged()),
|
||||||
|
SLOT(handleDeviceConfigurationListChanged()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaemoDeployConfigurationWidget::handleDeviceConfigurationListChanged()
|
||||||
|
{
|
||||||
|
const LinuxDeviceConfiguration::ConstPtr &devConf = m_deployConfig->deviceConfiguration();
|
||||||
|
const LinuxDeviceConfiguration::Id internalId
|
||||||
|
= LinuxDeviceConfigurations::instance()->internalId(devConf);
|
||||||
|
const int newIndex = m_deployConfig->deviceConfigModel()->indexForInternalId(internalId);
|
||||||
|
ui->deviceConfigsComboBox->setCurrentIndex(newIndex);
|
||||||
|
}
|
||||||
|
|
||||||
void MaemoDeployConfigurationWidget::addDesktopFile()
|
void MaemoDeployConfigurationWidget::addDesktopFile()
|
||||||
{
|
{
|
||||||
const int modelRow = ui->modelComboBox->currentIndex();
|
const int modelRow = ui->projectsComboBox->currentIndex();
|
||||||
if (modelRow == -1)
|
if (modelRow == -1)
|
||||||
return;
|
return;
|
||||||
MaemoDeployableListModel *const model
|
MaemoDeployableListModel *const model
|
||||||
@@ -131,7 +163,7 @@ void MaemoDeployConfigurationWidget::addDesktopFile()
|
|||||||
|
|
||||||
void MaemoDeployConfigurationWidget::addIcon()
|
void MaemoDeployConfigurationWidget::addIcon()
|
||||||
{
|
{
|
||||||
const int modelRow = ui->modelComboBox->currentIndex();
|
const int modelRow = ui->projectsComboBox->currentIndex();
|
||||||
if (modelRow == -1)
|
if (modelRow == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -167,5 +199,11 @@ void MaemoDeployConfigurationWidget::addIcon()
|
|||||||
ui->tableView->resizeRowsToContents();
|
ui->tableView->resizeRowsToContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MaemoDeployConfigurationWidget::showDeviceConfigurations()
|
||||||
|
{
|
||||||
|
Core::ICore::instance()->showOptionsDialog(MaemoDeviceConfigurationsSettingsPage::Category,
|
||||||
|
MaemoDeviceConfigurationsSettingsPage::Id);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace RemoteLinux
|
} // namespace RemoteLinux
|
||||||
|
|||||||
@@ -59,8 +59,11 @@ private:
|
|||||||
Q_SLOT void handleModelListToBeReset();
|
Q_SLOT void handleModelListToBeReset();
|
||||||
Q_SLOT void handleModelListReset();
|
Q_SLOT void handleModelListReset();
|
||||||
Q_SLOT void setModel(int row);
|
Q_SLOT void setModel(int row);
|
||||||
|
Q_SLOT void handleSelectedDeviceConfigurationChanged(int index);
|
||||||
|
Q_SLOT void handleDeviceConfigurationListChanged();
|
||||||
Q_SLOT void addDesktopFile();
|
Q_SLOT void addDesktopFile();
|
||||||
Q_SLOT void addIcon();
|
Q_SLOT void addIcon();
|
||||||
|
Q_SLOT void showDeviceConfigurations();
|
||||||
|
|
||||||
Ui::MaemoDeployConfigurationWidget *ui;
|
Ui::MaemoDeployConfigurationWidget *ui;
|
||||||
Qt4MaemoDeployConfiguration * m_deployConfig;
|
Qt4MaemoDeployConfiguration * m_deployConfig;
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>584</width>
|
<width>570</width>
|
||||||
<height>315</height>
|
<height>407</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -15,36 +15,74 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
<item>
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Device configuration:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="deviceConfigsComboBox"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="manageDevConfsLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string><a href="irrelevant">Manage device configurations</a></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="installLabel">
|
<widget class="QLabel" name="installLabel">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>These show the INSTALLS settings from the project file(s).</string>
|
<string>These show the INSTALLS settings from the project file(s).</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><b>Files to install for subproject:</b></string>
|
<string>Files to install for subproject:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="1" column="1">
|
||||||
<widget class="QComboBox" name="modelComboBox">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="sizeAdjustPolicy">
|
<item>
|
||||||
<enum>QComboBox::AdjustToContents</enum>
|
<widget class="QComboBox" name="projectsComboBox">
|
||||||
</property>
|
<property name="sizeAdjustPolicy">
|
||||||
</widget>
|
<enum>QComboBox::AdjustToContents</enum>
|
||||||
</item>
|
</property>
|
||||||
<item>
|
</widget>
|
||||||
<spacer name="horizontalSpacer_2">
|
</item>
|
||||||
<property name="orientation">
|
<item>
|
||||||
<enum>Qt::Horizontal</enum>
|
<spacer name="horizontalSpacer_2">
|
||||||
</property>
|
<property name="orientation">
|
||||||
<property name="sizeHint" stdset="0">
|
<enum>Qt::Horizontal</enum>
|
||||||
<size>
|
</property>
|
||||||
<width>40</width>
|
<property name="sizeHint" stdset="0">
|
||||||
<height>20</height>
|
<size>
|
||||||
</size>
|
<width>40</width>
|
||||||
</property>
|
<height>20</height>
|
||||||
</spacer>
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -31,32 +31,24 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "maemodeploystepwidget.h"
|
#include "maemodeploystepwidget.h"
|
||||||
#include "ui_maemodeploystepwidget.h"
|
|
||||||
|
|
||||||
#include "abstractmaemodeploystep.h"
|
#include "abstractmaemodeploystep.h"
|
||||||
#include "linuxdeviceconfigurations.h"
|
|
||||||
#include "maemosettingspages.h"
|
|
||||||
#include "maemoglobal.h"
|
#include "maemoglobal.h"
|
||||||
#include "maemopertargetdeviceconfigurationlistmodel.h"
|
|
||||||
#include "remotelinuxrunconfiguration.h"
|
|
||||||
#include "qt4maemodeployconfiguration.h"
|
#include "qt4maemodeployconfiguration.h"
|
||||||
#include "qt4maemotarget.h"
|
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/target.h>
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
|
#include <QtGui/QVBoxLayout>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
MaemoDeployStepBaseWidget::MaemoDeployStepBaseWidget(AbstractLinuxDeviceDeployStep *step) :
|
MaemoDeployStepBaseWidget::MaemoDeployStepBaseWidget(AbstractLinuxDeviceDeployStep *step)
|
||||||
ui(new Ui::MaemoDeployStepWidget),
|
: m_step(step)
|
||||||
m_step(step)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
|
||||||
BuildStepList * const list = step->maemoDeployConfig()->stepList();
|
BuildStepList * const list = step->maemoDeployConfig()->stepList();
|
||||||
connect(list, SIGNAL(stepInserted(int)), SIGNAL(updateSummary()));
|
connect(list, SIGNAL(stepInserted(int)), SIGNAL(updateSummary()));
|
||||||
connect(list, SIGNAL(stepMoved(int,int)), SIGNAL(updateSummary()));
|
connect(list, SIGNAL(stepMoved(int,int)), SIGNAL(updateSummary()));
|
||||||
@@ -64,30 +56,12 @@ MaemoDeployStepBaseWidget::MaemoDeployStepBaseWidget(AbstractLinuxDeviceDeploySt
|
|||||||
connect(list, SIGNAL(aboutToRemoveStep(int)),
|
connect(list, SIGNAL(aboutToRemoveStep(int)),
|
||||||
SLOT(handleStepToBeRemoved(int)));
|
SLOT(handleStepToBeRemoved(int)));
|
||||||
|
|
||||||
ui->deviceConfigComboBox->setModel(m_step->maemoDeployConfig()->deviceConfigModel().data());
|
connect(m_step->maemoDeployConfig(), SIGNAL(currentDeviceConfigurationChanged()),
|
||||||
connect(&m_step->helper(), SIGNAL(deviceConfigChanged()),
|
SIGNAL(updateSummary()));
|
||||||
SLOT(handleDeviceUpdate()));
|
|
||||||
handleDeviceUpdate();
|
|
||||||
connect(ui->deviceConfigComboBox, SIGNAL(activated(int)), this,
|
|
||||||
SLOT(setCurrentDeviceConfig(int)));
|
|
||||||
connect(ui->manageDevConfsLabel, SIGNAL(linkActivated(QString)),
|
|
||||||
SLOT(showDeviceConfigurations()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MaemoDeployStepBaseWidget::~MaemoDeployStepBaseWidget()
|
MaemoDeployStepBaseWidget::~MaemoDeployStepBaseWidget()
|
||||||
{
|
{
|
||||||
delete ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoDeployStepBaseWidget::handleDeviceUpdate()
|
|
||||||
{
|
|
||||||
const LinuxDeviceConfiguration::ConstPtr &devConf = m_step->helper().deviceConfig();
|
|
||||||
const LinuxDeviceConfiguration::Id internalId
|
|
||||||
= LinuxDeviceConfigurations::instance()->internalId(devConf);
|
|
||||||
const int newIndex = m_step->maemoDeployConfig()->deviceConfigModel()
|
|
||||||
->indexForInternalId(internalId);
|
|
||||||
ui->deviceConfigComboBox->setCurrentIndex(newIndex);
|
|
||||||
emit updateSummary();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoDeployStepBaseWidget::handleStepToBeRemoved(int step)
|
void MaemoDeployStepBaseWidget::handleStepToBeRemoved(int step)
|
||||||
@@ -108,31 +82,7 @@ QString MaemoDeployStepBaseWidget::summaryText() const
|
|||||||
+ QLatin1String("</font>");
|
+ QLatin1String("</font>");
|
||||||
}
|
}
|
||||||
return tr("<b>%1 using device</b>: %2").arg(dynamic_cast<BuildStep *>(m_step)->displayName(),
|
return tr("<b>%1 using device</b>: %2").arg(dynamic_cast<BuildStep *>(m_step)->displayName(),
|
||||||
MaemoGlobal::deviceConfigurationName(m_step->helper().deviceConfig()));
|
MaemoGlobal::deviceConfigurationName(m_step->maemoDeployConfig()->deviceConfiguration()));
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoDeployStepBaseWidget::setCurrentDeviceConfig(int index)
|
|
||||||
{
|
|
||||||
disconnect(&m_step->helper(), SIGNAL(deviceConfigChanged()), this,
|
|
||||||
SLOT(handleDeviceUpdate()));
|
|
||||||
m_step->helper().setDeviceConfig(index);
|
|
||||||
connect(&m_step->helper(), SIGNAL(deviceConfigChanged()),
|
|
||||||
SLOT(handleDeviceUpdate()));
|
|
||||||
updateSummary();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoDeployStepBaseWidget::showDeviceConfigurations()
|
|
||||||
{
|
|
||||||
Core::ICore::instance()->showOptionsDialog(MaemoDeviceConfigurationsSettingsPage::Category,
|
|
||||||
MaemoDeviceConfigurationsSettingsPage::Id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
MaemoDeployStepWidget::MaemoDeployStepWidget(AbstractMaemoDeployStep *step)
|
|
||||||
: m_baseWidget(step)
|
|
||||||
{
|
|
||||||
connect(&m_baseWidget, SIGNAL(updateSummary()), SIGNAL(updateSummary()));
|
|
||||||
(new QVBoxLayout(this))->addWidget(&m_baseWidget);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -35,18 +35,12 @@
|
|||||||
|
|
||||||
#include <projectexplorer/buildstep.h>
|
#include <projectexplorer/buildstep.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
namespace Ui {
|
|
||||||
class MaemoDeployStepWidget;
|
|
||||||
}
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class AbstractLinuxDeviceDeployStep;
|
class AbstractLinuxDeviceDeployStep;
|
||||||
class AbstractMaemoDeployStep;
|
class AbstractMaemoDeployStep;
|
||||||
|
|
||||||
class MaemoDeployStepBaseWidget : public QWidget
|
class MaemoDeployStepBaseWidget : public ProjectExplorer::BuildStepConfigWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -55,33 +49,14 @@ public:
|
|||||||
~MaemoDeployStepBaseWidget();
|
~MaemoDeployStepBaseWidget();
|
||||||
|
|
||||||
QString summaryText() const;
|
QString summaryText() const;
|
||||||
|
QString displayName() const { return QString(); }
|
||||||
signals:
|
|
||||||
void updateSummary();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_SLOT void handleDeviceUpdate();
|
|
||||||
Q_SLOT void setCurrentDeviceConfig(int index);
|
|
||||||
Q_SLOT void showDeviceConfigurations();
|
|
||||||
Q_SLOT void handleStepToBeRemoved(int step);
|
Q_SLOT void handleStepToBeRemoved(int step);
|
||||||
|
|
||||||
Ui::MaemoDeployStepWidget *ui;
|
|
||||||
AbstractLinuxDeviceDeployStep *const m_step;
|
AbstractLinuxDeviceDeployStep *const m_step;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MaemoDeployStepWidget : public ProjectExplorer::BuildStepConfigWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
MaemoDeployStepWidget(AbstractMaemoDeployStep *step);
|
|
||||||
|
|
||||||
private:
|
|
||||||
virtual QString summaryText() const { return m_baseWidget.summaryText(); }
|
|
||||||
virtual QString displayName() const { return QString(); }
|
|
||||||
|
|
||||||
MaemoDeployStepBaseWidget m_baseWidget;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace RemoteLinux
|
} // namespace RemoteLinux
|
||||||
|
|
||||||
|
|||||||
@@ -1,72 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>MaemoDeployStepWidget</class>
|
|
||||||
<widget class="QWidget" name="MaemoDeployStepWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>597</width>
|
|
||||||
<height>74</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Form</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="deviceConfigLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Device configuration:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="deviceConfigComboBox">
|
|
||||||
<property name="sizeAdjustPolicy">
|
|
||||||
<enum>QComboBox::AdjustToContents</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="manageDevConfsLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string><a href="irrelevant">Manage device configurations</a></string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
@@ -185,7 +185,7 @@ void MaemoDirectDeviceUploadStep::handleMkdirFinished(int exitStatus)
|
|||||||
raiseError(tr("Failed to upload file '%1'.").arg(nativePath));
|
raiseError(tr("Failed to upload file '%1'.").arg(nativePath));
|
||||||
setFinished();
|
setFinished();
|
||||||
} else if (fi.isDir()) {
|
} else if (fi.isDir()) {
|
||||||
setDeployed(helper().cachedDeviceConfig()->sshParameters().host, d);
|
setDeployed(deviceConfiguration()->sshParameters().host, d);
|
||||||
m_filesToUpload.removeFirst();
|
m_filesToUpload.removeFirst();
|
||||||
uploadNextFile();
|
uploadNextFile();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#include "maemopublisherfremantlefree.h"
|
#include "maemopublisherfremantlefree.h"
|
||||||
|
|
||||||
#include "maemodeployablelistmodel.h"
|
#include "maemodeployablelistmodel.h"
|
||||||
|
#include "maemodeployables.h"
|
||||||
#include "maemoglobal.h"
|
#include "maemoglobal.h"
|
||||||
#include "maemopackagecreationstep.h"
|
#include "maemopackagecreationstep.h"
|
||||||
#include "maemopublishingfileselectiondialog.h"
|
#include "maemopublishingfileselectiondialog.h"
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include "maemoglobal.h"
|
#include "maemoglobal.h"
|
||||||
#include "maemoremotemountsmodel.h"
|
#include "maemoremotemountsmodel.h"
|
||||||
#include "maemorunconfigurationwidget.h"
|
#include "maemorunconfigurationwidget.h"
|
||||||
|
#include "qt4maemodeployconfiguration.h"
|
||||||
|
|
||||||
#include <debugger/debuggerconstants.h>
|
#include <debugger/debuggerconstants.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
@@ -121,9 +122,8 @@ QString MaemoRunConfiguration::commandPrefix() const
|
|||||||
PortList MaemoRunConfiguration::freePorts() const
|
PortList MaemoRunConfiguration::freePorts() const
|
||||||
{
|
{
|
||||||
const Qt4BuildConfiguration * const bc = activeQt4BuildConfiguration();
|
const Qt4BuildConfiguration * const bc = activeQt4BuildConfiguration();
|
||||||
const AbstractLinuxDeviceDeployStep * const step = deployStep();
|
return bc && deployConfig()
|
||||||
return bc && step
|
? MaemoGlobal::freePorts(deployConfig()->deviceConfiguration(), bc->qtVersion())
|
||||||
? MaemoGlobal::freePorts(deployStep()->helper().deviceConfig(), bc->qtVersion())
|
|
||||||
: PortList();
|
: PortList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -154,8 +154,7 @@ void AbstractMaemoUploadAndInstallStep::handleUploadFinished(const QString &erro
|
|||||||
+ QFileInfo(packagingStep()->packageFilePath()).fileName();
|
+ QFileInfo(packagingStep()->packageFilePath()).fileName();
|
||||||
m_extendedState = Installing;
|
m_extendedState = Installing;
|
||||||
writeOutput(tr("Installing package to device..."));
|
writeOutput(tr("Installing package to device..."));
|
||||||
m_installer->installPackage(connection(), helper().cachedDeviceConfig(),
|
m_installer->installPackage(connection(), deviceConfiguration(), remoteFilePath, true);
|
||||||
remoteFilePath, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,11 +32,14 @@
|
|||||||
|
|
||||||
#include "qt4maemodeployconfiguration.h"
|
#include "qt4maemodeployconfiguration.h"
|
||||||
|
|
||||||
|
#include "linuxdeviceconfigurations.h"
|
||||||
|
#include "maemoconstants.h"
|
||||||
#include "maemodeploybymountstep.h"
|
#include "maemodeploybymountstep.h"
|
||||||
#include "maemodeployconfigurationwidget.h"
|
#include "maemodeployconfigurationwidget.h"
|
||||||
#include "maemodeployables.h"
|
#include "maemodeployables.h"
|
||||||
#include "maemoinstalltosysrootstep.h"
|
#include "maemoinstalltosysrootstep.h"
|
||||||
#include "maemopackagecreationstep.h"
|
#include "maemopackagecreationstep.h"
|
||||||
|
#include "maemopertargetdeviceconfigurationlistmodel.h"
|
||||||
#include "maemouploadandinstalldeploystep.h"
|
#include "maemouploadandinstalldeploystep.h"
|
||||||
#include "qt4maemotarget.h"
|
#include "qt4maemotarget.h"
|
||||||
|
|
||||||
@@ -77,12 +80,62 @@ Qt4MaemoDeployConfiguration::Qt4MaemoDeployConfiguration(Target *target,
|
|||||||
m_devConfModel = QSharedPointer<MaemoPerTargetDeviceConfigurationListModel>
|
m_devConfModel = QSharedPointer<MaemoPerTargetDeviceConfigurationListModel>
|
||||||
(new MaemoPerTargetDeviceConfigurationListModel(0, target));
|
(new MaemoPerTargetDeviceConfigurationListModel(0, target));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt4MaemoDeployConfiguration::Qt4MaemoDeployConfiguration(ProjectExplorer::Target *target,
|
Qt4MaemoDeployConfiguration::Qt4MaemoDeployConfiguration(ProjectExplorer::Target *target,
|
||||||
DeployConfiguration *source) : DeployConfiguration(target, source)
|
DeployConfiguration *source) : DeployConfiguration(target, source)
|
||||||
{
|
{
|
||||||
m_deployables = qobject_cast<Qt4MaemoDeployConfiguration *>(source)->deployables();
|
const Qt4MaemoDeployConfiguration * const mdc
|
||||||
|
= qobject_cast<Qt4MaemoDeployConfiguration *>(source);
|
||||||
|
m_deployables = mdc->deployables();
|
||||||
|
m_devConfModel = mdc->deviceConfigModel();
|
||||||
|
initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Qt4MaemoDeployConfiguration::initialize()
|
||||||
|
{
|
||||||
|
m_deviceConfiguration = deviceConfigModel()->defaultDeviceConfig();
|
||||||
|
connect(deviceConfigModel().data(), SIGNAL(updated()),
|
||||||
|
SLOT(handleDeviceConfigurationListUpdated()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Qt4MaemoDeployConfiguration::handleDeviceConfigurationListUpdated()
|
||||||
|
{
|
||||||
|
setDeviceConfig(LinuxDeviceConfigurations::instance()->internalId(m_deviceConfiguration));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Qt4MaemoDeployConfiguration::setDeviceConfig(LinuxDeviceConfiguration::Id internalId)
|
||||||
|
{
|
||||||
|
m_deviceConfiguration = deviceConfigModel()->find(internalId);
|
||||||
|
emit deviceConfigurationListChanged();
|
||||||
|
emit currentDeviceConfigurationChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Qt4MaemoDeployConfiguration::fromMap(const QVariantMap &map)
|
||||||
|
{
|
||||||
|
if (!DeployConfiguration::fromMap(map))
|
||||||
|
return false;
|
||||||
|
setDeviceConfig(map.value(DeviceIdKey, LinuxDeviceConfiguration::InvalidId).toULongLong());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariantMap Qt4MaemoDeployConfiguration::toMap() const
|
||||||
|
{
|
||||||
|
QVariantMap map = DeployConfiguration::toMap();
|
||||||
|
map.insert(DeviceIdKey,
|
||||||
|
LinuxDeviceConfigurations::instance()->internalId(m_deviceConfiguration));
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Qt4MaemoDeployConfiguration::setDeviceConfiguration(int index)
|
||||||
|
{
|
||||||
|
const LinuxDeviceConfiguration::ConstPtr &newDevConf = deviceConfigModel()->deviceAt(index);
|
||||||
|
if (m_deviceConfiguration != newDevConf) {
|
||||||
|
m_deviceConfiguration = newDevConf;
|
||||||
|
emit currentDeviceConfigurationChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt4MaemoDeployConfiguration::~Qt4MaemoDeployConfiguration() {}
|
Qt4MaemoDeployConfiguration::~Qt4MaemoDeployConfiguration() {}
|
||||||
@@ -92,6 +145,21 @@ DeployConfigurationWidget *Qt4MaemoDeployConfiguration::configurationWidget() co
|
|||||||
return new MaemoDeployConfigurationWidget;
|
return new MaemoDeployConfigurationWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSharedPointer<MaemoDeployables> Qt4MaemoDeployConfiguration::deployables() const
|
||||||
|
{
|
||||||
|
return m_deployables;
|
||||||
|
}
|
||||||
|
|
||||||
|
QSharedPointer<MaemoPerTargetDeviceConfigurationListModel> Qt4MaemoDeployConfiguration::deviceConfigModel() const
|
||||||
|
{
|
||||||
|
return m_devConfModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
LinuxDeviceConfiguration::ConstPtr Qt4MaemoDeployConfiguration::deviceConfiguration() const
|
||||||
|
{
|
||||||
|
return m_deviceConfiguration;
|
||||||
|
}
|
||||||
|
|
||||||
const QString Qt4MaemoDeployConfiguration::FremantleWithPackagingId
|
const QString Qt4MaemoDeployConfiguration::FremantleWithPackagingId
|
||||||
= QLatin1String("DeployToFremantleWithPackaging");
|
= QLatin1String("DeployToFremantleWithPackaging");
|
||||||
const QString Qt4MaemoDeployConfiguration::FremantleWithoutPackagingId
|
const QString Qt4MaemoDeployConfiguration::FremantleWithoutPackagingId
|
||||||
|
|||||||
@@ -33,8 +33,7 @@
|
|||||||
#ifndef QT4PROJECTMANAGER_QT4DEPLOYCONFIGURATION_H
|
#ifndef QT4PROJECTMANAGER_QT4DEPLOYCONFIGURATION_H
|
||||||
#define QT4PROJECTMANAGER_QT4DEPLOYCONFIGURATION_H
|
#define QT4PROJECTMANAGER_QT4DEPLOYCONFIGURATION_H
|
||||||
|
|
||||||
#include"maemodeployables.h"
|
#include "linuxdeviceconfiguration.h"
|
||||||
#include "maemopertargetdeviceconfigurationlistmodel.h"
|
|
||||||
|
|
||||||
#include <projectexplorer/deployconfiguration.h>
|
#include <projectexplorer/deployconfiguration.h>
|
||||||
|
|
||||||
@@ -42,6 +41,7 @@
|
|||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
class MaemoDeployables;
|
||||||
class MaemoPerTargetDeviceConfigurationListModel;
|
class MaemoPerTargetDeviceConfigurationListModel;
|
||||||
|
|
||||||
class Qt4MaemoDeployConfiguration : public ProjectExplorer::DeployConfiguration
|
class Qt4MaemoDeployConfiguration : public ProjectExplorer::DeployConfiguration
|
||||||
@@ -53,8 +53,10 @@ public:
|
|||||||
|
|
||||||
virtual ProjectExplorer::DeployConfigurationWidget *configurationWidget() const;
|
virtual ProjectExplorer::DeployConfigurationWidget *configurationWidget() const;
|
||||||
|
|
||||||
QSharedPointer<MaemoDeployables> deployables() const { return m_deployables; }
|
void setDeviceConfiguration(int index);
|
||||||
QSharedPointer<MaemoPerTargetDeviceConfigurationListModel> deviceConfigModel() const { return m_devConfModel; }
|
QSharedPointer<MaemoDeployables> deployables() const;
|
||||||
|
QSharedPointer<MaemoPerTargetDeviceConfigurationListModel> deviceConfigModel() const;
|
||||||
|
QSharedPointer<const LinuxDeviceConfiguration> deviceConfiguration() const;
|
||||||
|
|
||||||
static const QString FremantleWithPackagingId;
|
static const QString FremantleWithPackagingId;
|
||||||
static const QString FremantleWithoutPackagingId;
|
static const QString FremantleWithoutPackagingId;
|
||||||
@@ -62,6 +64,10 @@ public:
|
|||||||
static const QString MeegoId;
|
static const QString MeegoId;
|
||||||
static const QString GenericLinuxId;
|
static const QString GenericLinuxId;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void deviceConfigurationListChanged();
|
||||||
|
void currentDeviceConfigurationChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class Qt4MaemoDeployConfigurationFactory;
|
friend class Qt4MaemoDeployConfigurationFactory;
|
||||||
|
|
||||||
@@ -70,8 +76,16 @@ private:
|
|||||||
Qt4MaemoDeployConfiguration(ProjectExplorer::Target *target,
|
Qt4MaemoDeployConfiguration(ProjectExplorer::Target *target,
|
||||||
ProjectExplorer::DeployConfiguration *source);
|
ProjectExplorer::DeployConfiguration *source);
|
||||||
|
|
||||||
|
bool fromMap(const QVariantMap &map);
|
||||||
|
QVariantMap toMap() const;
|
||||||
|
|
||||||
|
void initialize();
|
||||||
|
void setDeviceConfig(LinuxDeviceConfiguration::Id internalId);
|
||||||
|
Q_SLOT void handleDeviceConfigurationListUpdated();
|
||||||
|
|
||||||
QSharedPointer<MaemoDeployables> m_deployables;
|
QSharedPointer<MaemoDeployables> m_deployables;
|
||||||
QSharedPointer<MaemoPerTargetDeviceConfigurationListModel> m_devConfModel;
|
QSharedPointer<MaemoPerTargetDeviceConfigurationListModel> m_devConfModel;
|
||||||
|
QSharedPointer<const LinuxDeviceConfiguration> m_deviceConfiguration;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -169,7 +169,6 @@ FORMS += \
|
|||||||
maemodeviceconfigurationssettingswidget.ui \
|
maemodeviceconfigurationssettingswidget.ui \
|
||||||
maemosshconfigdialog.ui \
|
maemosshconfigdialog.ui \
|
||||||
maemopackagecreationwidget.ui \
|
maemopackagecreationwidget.ui \
|
||||||
maemodeploystepwidget.ui \
|
|
||||||
maemoprofilesupdatedialog.ui \
|
maemoprofilesupdatedialog.ui \
|
||||||
maemoremoteprocessesdialog.ui \
|
maemoremoteprocessesdialog.ui \
|
||||||
maemopublishingbuildsettingspagefremantlefree.ui \
|
maemopublishingbuildsettingspagefremantlefree.ui \
|
||||||
|
|||||||
@@ -242,8 +242,8 @@ QString RemoteLinuxRunConfiguration::defaultDisplayName()
|
|||||||
|
|
||||||
LinuxDeviceConfiguration::ConstPtr RemoteLinuxRunConfiguration::deviceConfig() const
|
LinuxDeviceConfiguration::ConstPtr RemoteLinuxRunConfiguration::deviceConfig() const
|
||||||
{
|
{
|
||||||
const AbstractLinuxDeviceDeployStep * const step = deployStep();
|
return deployConfig()
|
||||||
return step ? step->helper().deviceConfig() : LinuxDeviceConfiguration::ConstPtr();
|
? deployConfig()->deviceConfiguration() : LinuxDeviceConfiguration::ConstPtr();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString RemoteLinuxRunConfiguration::gdbCmd() const
|
QString RemoteLinuxRunConfiguration::gdbCmd() const
|
||||||
@@ -256,11 +256,6 @@ Qt4MaemoDeployConfiguration *RemoteLinuxRunConfiguration::deployConfig() const
|
|||||||
return qobject_cast<Qt4MaemoDeployConfiguration *>(target()->activeDeployConfiguration());
|
return qobject_cast<Qt4MaemoDeployConfiguration *>(target()->activeDeployConfiguration());
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractLinuxDeviceDeployStep *RemoteLinuxRunConfiguration::deployStep() const
|
|
||||||
{
|
|
||||||
return MaemoGlobal::earlierBuildStep<AbstractLinuxDeviceDeployStep>(deployConfig(), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
QString RemoteLinuxRunConfiguration::arguments() const
|
QString RemoteLinuxRunConfiguration::arguments() const
|
||||||
{
|
{
|
||||||
return m_d->arguments;
|
return m_d->arguments;
|
||||||
@@ -336,24 +331,11 @@ void RemoteLinuxRunConfiguration::handleDeployConfigChanged()
|
|||||||
if (activeDeployConf) {
|
if (activeDeployConf) {
|
||||||
connect(activeDeployConf->deployables().data(), SIGNAL(modelReset()),
|
connect(activeDeployConf->deployables().data(), SIGNAL(modelReset()),
|
||||||
SLOT(handleDeployablesUpdated()), Qt::UniqueConnection);
|
SLOT(handleDeployablesUpdated()), Qt::UniqueConnection);
|
||||||
connect(activeDeployConf->stepList(), SIGNAL(stepInserted(int)),
|
connect(activeDeployConf, SIGNAL(currentDeviceConfigurationChanged()),
|
||||||
SLOT(handleDeployConfigChanged()), Qt::UniqueConnection);
|
SLOT(updateDeviceConfigurations()), Qt::UniqueConnection);
|
||||||
connect(activeDeployConf->stepList(), SIGNAL(stepInserted(int)),
|
|
||||||
SLOT(handleDeployConfigChanged()), Qt::UniqueConnection);
|
|
||||||
connect(activeDeployConf->stepList(), SIGNAL(stepMoved(int,int)),
|
|
||||||
SLOT(handleDeployConfigChanged()), Qt::UniqueConnection);
|
|
||||||
connect(activeDeployConf->stepList(), SIGNAL(stepRemoved(int)),
|
|
||||||
SLOT(handleDeployConfigChanged()), Qt::UniqueConnection);
|
|
||||||
AbstractLinuxDeviceDeployStep * const step
|
|
||||||
= MaemoGlobal::earlierBuildStep<AbstractLinuxDeviceDeployStep>(activeDeployConf, 0);
|
|
||||||
if (step) {
|
|
||||||
connect(&step->helper(), SIGNAL(deviceConfigChanged()),
|
|
||||||
SLOT(updateDeviceConfigurations()), Qt::UniqueConnection);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateDeviceConfigurations();
|
updateDeviceConfigurations();
|
||||||
updateEnabledState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteLinuxRunConfiguration::handleDeployablesUpdated()
|
void RemoteLinuxRunConfiguration::handleDeployablesUpdated()
|
||||||
|
|||||||
@@ -133,7 +133,6 @@ protected:
|
|||||||
QString defaultDisplayName();
|
QString defaultDisplayName();
|
||||||
void setDisabledReason(const QString &reason) const;
|
void setDisabledReason(const QString &reason) const;
|
||||||
QString userEnvironmentChangesAsString() const;
|
QString userEnvironmentChangesAsString() const;
|
||||||
Internal::AbstractLinuxDeviceDeployStep *deployStep() const;
|
|
||||||
Q_SLOT void updateEnabledState() { emit isEnabledChanged(isEnabled()); }
|
Q_SLOT void updateEnabledState() { emit isEnabledChanged(isEnabled()); }
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|||||||
Reference in New Issue
Block a user