forked from qt-creator/qt-creator
Maemo: Run configuration gets device from deploy step.
This commit is contained in:
@@ -278,14 +278,6 @@ MaemoDeviceConfig MaemoDeployStep::deviceConfig() const
|
|||||||
return deviceConfigModel()->current();
|
return deviceConfigModel()->current();
|
||||||
}
|
}
|
||||||
|
|
||||||
MaemoDeviceConfigListModel *MaemoDeployStep::deviceConfigModel() const
|
|
||||||
{
|
|
||||||
const MaemoRunConfiguration * const rc =
|
|
||||||
qobject_cast<const MaemoRunConfiguration *>(buildConfiguration()
|
|
||||||
->target()->activeRunConfiguration());
|
|
||||||
return rc ? rc->deviceConfigModel() : m_deviceConfigModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoDeployStep::start()
|
void MaemoDeployStep::start()
|
||||||
{
|
{
|
||||||
#ifdef DEPLOY_VIA_MOUNT
|
#ifdef DEPLOY_VIA_MOUNT
|
||||||
|
@@ -78,7 +78,7 @@ public:
|
|||||||
|
|
||||||
virtual ~MaemoDeployStep();
|
virtual ~MaemoDeployStep();
|
||||||
MaemoDeviceConfig deviceConfig() const;
|
MaemoDeviceConfig deviceConfig() const;
|
||||||
MaemoDeviceConfigListModel *deviceConfigModel() const;
|
MaemoDeviceConfigListModel *deviceConfigModel() const { return m_deviceConfigModel; }
|
||||||
bool currentlyNeedsDeployment(const QString &host,
|
bool currentlyNeedsDeployment(const QString &host,
|
||||||
const MaemoDeployable &deployable) const;
|
const MaemoDeployable &deployable) const;
|
||||||
void setDeployed(const QString &host, const MaemoDeployable &deployable);
|
void setDeployed(const QString &host, const MaemoDeployable &deployable);
|
||||||
|
@@ -87,15 +87,13 @@ MaemoRunConfiguration::MaemoRunConfiguration(Qt4Target *parent,
|
|||||||
|
|
||||||
void MaemoRunConfiguration::init()
|
void MaemoRunConfiguration::init()
|
||||||
{
|
{
|
||||||
m_devConfigModel = new MaemoDeviceConfigListModel(this);
|
|
||||||
m_remoteMounts = new MaemoRemoteMountsModel(this);
|
m_remoteMounts = new MaemoRemoteMountsModel(this);
|
||||||
setDisplayName(QFileInfo(m_proFilePath).completeBaseName());
|
setDisplayName(QFileInfo(m_proFilePath).completeBaseName());
|
||||||
|
|
||||||
updateDeviceConfigurations();
|
connect(target(),
|
||||||
connect(m_devConfigModel, SIGNAL(currentChanged()), this,
|
SIGNAL(activeDeployConfigurationChanged(ProjectExplorer::DeployConfiguration*)),
|
||||||
SLOT(updateDeviceConfigurations()));
|
this, SLOT(handleDeployConfigChanged()));
|
||||||
connect(m_devConfigModel, SIGNAL(modelReset()), this,
|
handleDeployConfigChanged();
|
||||||
SLOT(updateDeviceConfigurations()));
|
|
||||||
|
|
||||||
connect(qt4Target()->qt4Project(),
|
connect(qt4Target()->qt4Project(),
|
||||||
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||||
@@ -150,7 +148,6 @@ QVariantMap MaemoRunConfiguration::toMap() const
|
|||||||
map.insert(BaseEnvironmentBaseKey, m_baseEnvironmentBase);
|
map.insert(BaseEnvironmentBaseKey, m_baseEnvironmentBase);
|
||||||
map.insert(UserEnvironmentChangesKey,
|
map.insert(UserEnvironmentChangesKey,
|
||||||
ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges));
|
ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges));
|
||||||
map.unite(m_devConfigModel->toMap());
|
|
||||||
map.unite(m_remoteMounts->toMap());
|
map.unite(m_remoteMounts->toMap());
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
@@ -169,7 +166,6 @@ bool MaemoRunConfiguration::fromMap(const QVariantMap &map)
|
|||||||
.toStringList());
|
.toStringList());
|
||||||
m_baseEnvironmentBase = static_cast<BaseEnvironmentBase> (map.value(BaseEnvironmentBaseKey,
|
m_baseEnvironmentBase = static_cast<BaseEnvironmentBase> (map.value(BaseEnvironmentBaseKey,
|
||||||
SystemEnvironmentBase).toInt());
|
SystemEnvironmentBase).toInt());
|
||||||
m_devConfigModel->fromMap(map);
|
|
||||||
m_remoteMounts->fromMap(map);
|
m_remoteMounts->fromMap(map);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -177,12 +173,7 @@ bool MaemoRunConfiguration::fromMap(const QVariantMap &map)
|
|||||||
|
|
||||||
MaemoDeviceConfig MaemoRunConfiguration::deviceConfig() const
|
MaemoDeviceConfig MaemoRunConfiguration::deviceConfig() const
|
||||||
{
|
{
|
||||||
return m_devConfigModel->current();
|
return deployStep()->deviceConfigModel()->current();
|
||||||
}
|
|
||||||
|
|
||||||
MaemoDeviceConfigListModel *MaemoRunConfiguration::deviceConfigModel() const
|
|
||||||
{
|
|
||||||
return m_devConfigModel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const MaemoToolChain *MaemoRunConfiguration::toolchain() const
|
const MaemoToolChain *MaemoRunConfiguration::toolchain() const
|
||||||
@@ -301,6 +292,30 @@ void MaemoRunConfiguration::updateDeviceConfigurations()
|
|||||||
emit deviceConfigurationChanged(target());
|
emit deviceConfigurationChanged(target());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MaemoRunConfiguration::handleDeployConfigChanged()
|
||||||
|
{
|
||||||
|
const QList<DeployConfiguration *> &deployConfigs
|
||||||
|
= target()->deployConfigurations();
|
||||||
|
DeployConfiguration * const activeDeployConf
|
||||||
|
= target()->activeDeployConfiguration();
|
||||||
|
for (int i = 0; i < deployConfigs.count(); ++i) {
|
||||||
|
MaemoDeployStep * const step
|
||||||
|
= MaemoGlobal::buildStep<MaemoDeployStep>(deployConfigs.at(i));
|
||||||
|
MaemoDeviceConfigListModel * const devConfigModel
|
||||||
|
= step->deviceConfigModel();
|
||||||
|
if (deployConfigs.at(i) == activeDeployConf) {
|
||||||
|
connect(devConfigModel, SIGNAL(currentChanged()), this,
|
||||||
|
SLOT(updateDeviceConfigurations()));
|
||||||
|
connect(devConfigModel, SIGNAL(modelReset()), this,
|
||||||
|
SLOT(updateDeviceConfigurations()));
|
||||||
|
} else {
|
||||||
|
disconnect(devConfigModel, 0, this,
|
||||||
|
SLOT(updateDeviceConfigurations()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
updateDeviceConfigurations();
|
||||||
|
}
|
||||||
|
|
||||||
QString MaemoRunConfiguration::baseEnvironmentText() const
|
QString MaemoRunConfiguration::baseEnvironmentText() const
|
||||||
{
|
{
|
||||||
if (m_baseEnvironmentBase == CleanEnvironmentBase)
|
if (m_baseEnvironmentBase == CleanEnvironmentBase)
|
||||||
|
@@ -92,7 +92,6 @@ public:
|
|||||||
const QStringList arguments() const;
|
const QStringList arguments() const;
|
||||||
void setArguments(const QStringList &args);
|
void setArguments(const QStringList &args);
|
||||||
MaemoDeviceConfig deviceConfig() const;
|
MaemoDeviceConfig deviceConfig() const;
|
||||||
MaemoDeviceConfigListModel *deviceConfigModel() const;
|
|
||||||
MaemoPortList freePorts() const;
|
MaemoPortList freePorts() const;
|
||||||
bool useRemoteGdb() const { return m_useRemoteGdb; }
|
bool useRemoteGdb() const { return m_useRemoteGdb; }
|
||||||
void setUseRemoteGdb(bool useRemoteGdb) { m_useRemoteGdb = useRemoteGdb; }
|
void setUseRemoteGdb(bool useRemoteGdb) { m_useRemoteGdb = useRemoteGdb; }
|
||||||
@@ -132,6 +131,7 @@ protected:
|
|||||||
private slots:
|
private slots:
|
||||||
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
||||||
void updateDeviceConfigurations();
|
void updateDeviceConfigurations();
|
||||||
|
void handleDeployConfigChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init();
|
void init();
|
||||||
@@ -139,7 +139,6 @@ private:
|
|||||||
private:
|
private:
|
||||||
QString m_proFilePath;
|
QString m_proFilePath;
|
||||||
mutable QString m_gdbPath;
|
mutable QString m_gdbPath;
|
||||||
MaemoDeviceConfigListModel *m_devConfigModel;
|
|
||||||
MaemoRemoteMountsModel *m_remoteMounts;
|
MaemoRemoteMountsModel *m_remoteMounts;
|
||||||
QStringList m_arguments;
|
QStringList m_arguments;
|
||||||
bool m_useRemoteGdb;
|
bool m_useRemoteGdb;
|
||||||
|
@@ -78,7 +78,8 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
|
|||||||
addDebuggingWidgets(mainLayout);
|
addDebuggingWidgets(mainLayout);
|
||||||
addMountWidgets(mainLayout);
|
addMountWidgets(mainLayout);
|
||||||
addEnvironmentWidgets(mainLayout);
|
addEnvironmentWidgets(mainLayout);
|
||||||
connect(m_runConfiguration->deviceConfigModel(), SIGNAL(currentChanged()),
|
connect(m_runConfiguration,
|
||||||
|
SIGNAL(deviceConfigurationChanged(ProjectExplorer::Target*)),
|
||||||
this, SLOT(handleCurrentDeviceConfigChanged()));
|
this, SLOT(handleCurrentDeviceConfigChanged()));
|
||||||
handleCurrentDeviceConfigChanged();
|
handleCurrentDeviceConfigChanged();
|
||||||
}
|
}
|
||||||
@@ -93,11 +94,9 @@ void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
|
|||||||
|
|
||||||
QWidget *devConfWidget = new QWidget;
|
QWidget *devConfWidget = new QWidget;
|
||||||
QHBoxLayout *devConfLayout = new QHBoxLayout(devConfWidget);
|
QHBoxLayout *devConfLayout = new QHBoxLayout(devConfWidget);
|
||||||
m_devConfBox = new QComboBox;
|
m_devConfLabel = new QLabel;
|
||||||
m_devConfBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
|
||||||
m_devConfBox->setModel(m_runConfiguration->deviceConfigModel());
|
|
||||||
devConfLayout->setMargin(0);
|
devConfLayout->setMargin(0);
|
||||||
devConfLayout->addWidget(m_devConfBox);
|
devConfLayout->addWidget(m_devConfLabel);
|
||||||
QLabel *addDevConfLabel= new QLabel(tr("<a href=\"%1\">Manage device configurations</a>")
|
QLabel *addDevConfLabel= new QLabel(tr("<a href=\"%1\">Manage device configurations</a>")
|
||||||
.arg(QLatin1String("deviceconfig")));
|
.arg(QLatin1String("deviceconfig")));
|
||||||
addDevConfLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
|
addDevConfLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
|
||||||
@@ -125,8 +124,6 @@ void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
|
|||||||
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(int)), this,
|
|
||||||
SLOT(setCurrentDeviceConfig(int)));
|
|
||||||
connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this,
|
connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this,
|
||||||
SLOT(updateTargetInformation()));
|
SLOT(updateTargetInformation()));
|
||||||
connect(m_runConfiguration->deployStep()->deployables(),
|
connect(m_runConfiguration->deployStep()->deployables(),
|
||||||
@@ -278,16 +275,10 @@ void MaemoRunConfigurationWidget::showSettingsDialog(const QString &link)
|
|||||||
|
|
||||||
void MaemoRunConfigurationWidget::handleCurrentDeviceConfigChanged()
|
void MaemoRunConfigurationWidget::handleCurrentDeviceConfigChanged()
|
||||||
{
|
{
|
||||||
m_devConfBox->setCurrentIndex(m_runConfiguration->deviceConfigModel()
|
m_devConfLabel->setText(m_runConfiguration->deviceConfig().name);
|
||||||
->currentIndex());
|
|
||||||
updateMountWarning();
|
updateMountWarning();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfigurationWidget::setCurrentDeviceConfig(int index)
|
|
||||||
{
|
|
||||||
m_runConfiguration->deviceConfigModel()->setCurrentIndex(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoRunConfigurationWidget::enableOrDisableRemoveMountSpecButton()
|
void MaemoRunConfigurationWidget::enableOrDisableRemoveMountSpecButton()
|
||||||
{
|
{
|
||||||
const QModelIndexList selectedRows
|
const QModelIndexList selectedRows
|
||||||
|
@@ -74,7 +74,6 @@ private slots:
|
|||||||
void showSettingsDialog(const QString &link);
|
void showSettingsDialog(const QString &link);
|
||||||
void updateTargetInformation();
|
void updateTargetInformation();
|
||||||
void handleCurrentDeviceConfigChanged();
|
void handleCurrentDeviceConfigChanged();
|
||||||
void setCurrentDeviceConfig(int index);
|
|
||||||
void addMount();
|
void addMount();
|
||||||
void removeMount();
|
void removeMount();
|
||||||
void changeLocalMountDir(const QModelIndex &index);
|
void changeLocalMountDir(const QModelIndex &index);
|
||||||
@@ -101,7 +100,7 @@ private:
|
|||||||
QLineEdit *m_argsLineEdit;
|
QLineEdit *m_argsLineEdit;
|
||||||
QLabel *m_localExecutableLabel;
|
QLabel *m_localExecutableLabel;
|
||||||
QLabel *m_remoteExecutableLabel;
|
QLabel *m_remoteExecutableLabel;
|
||||||
QComboBox *m_devConfBox;
|
QLabel *m_devConfLabel;
|
||||||
QLabel *m_mountWarningLabel;
|
QLabel *m_mountWarningLabel;
|
||||||
QTableView *m_mountView;
|
QTableView *m_mountView;
|
||||||
QToolButton *m_removeMountButton;
|
QToolButton *m_removeMountButton;
|
||||||
|
Reference in New Issue
Block a user