forked from qt-creator/qt-creator
Maemo: Don't create a deployment widget per sub project.
This makes use of a Maemo target perform acceptably for big projects. Task-number: QTCREATORBUG-2703 Reviewed-by: kh1
This commit is contained in:
@@ -1,131 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
** All rights reserved.
|
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
|
||||||
** No Commercial Usage
|
|
||||||
** This file contains pre-release code and may not be distributed.
|
|
||||||
** You may use this file in accordance with the terms and conditions
|
|
||||||
** contained in the Technology Preview License Agreement accompanying
|
|
||||||
** this package.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. Please review the following information to
|
|
||||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
||||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** In addition, as a special exception, Nokia gives you certain additional
|
|
||||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
** If you have questions regarding the use of this file, please contact
|
|
||||||
** Nokia at qt-info@nokia.com.
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "maemodeployablelistwidget.h"
|
|
||||||
#include "ui_maemodeployablelistwidget.h"
|
|
||||||
|
|
||||||
#include "maemodeployablelistmodel.h"
|
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
|
||||||
|
|
||||||
#include <QtCore/QDir>
|
|
||||||
#include <QtCore/QFile>
|
|
||||||
#include <QtCore/QFileInfo>
|
|
||||||
#include <QtGui/QFileDialog>
|
|
||||||
#include <QtGui/QMessageBox>
|
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
MaemoDeployableListWidget::MaemoDeployableListWidget(QWidget *parent,
|
|
||||||
MaemoDeployableListModel *model)
|
|
||||||
: QWidget(parent), m_ui(new Ui::MaemoDeployableListWidget), m_model(model)
|
|
||||||
{
|
|
||||||
m_ui->setupUi(this);
|
|
||||||
m_ui->addFileButton->hide();
|
|
||||||
m_ui->removeFileButton->hide();
|
|
||||||
m_ui->deployablesView->setWordWrap(false);
|
|
||||||
m_ui->deployablesView->setModel(m_model);
|
|
||||||
connect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
|
|
||||||
m_ui->deployablesView, SLOT(resizeColumnsToContents()));
|
|
||||||
connect(m_model, SIGNAL(rowsInserted(QModelIndex, int, int)),
|
|
||||||
m_ui->deployablesView, SLOT(resizeColumnsToContents()));
|
|
||||||
connect(m_ui->deployablesView->selectionModel(),
|
|
||||||
SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this,
|
|
||||||
SLOT(enableOrDisableRemoveButton()));
|
|
||||||
m_ui->deployablesView->resizeColumnsToContents();
|
|
||||||
m_ui->deployablesView->resizeRowsToContents();
|
|
||||||
m_ui->deployablesView->horizontalHeader()->setStretchLastSection(true);
|
|
||||||
enableOrDisableRemoveButton();
|
|
||||||
}
|
|
||||||
|
|
||||||
MaemoDeployableListWidget::~MaemoDeployableListWidget()
|
|
||||||
{
|
|
||||||
delete m_ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoDeployableListWidget::addFile()
|
|
||||||
{
|
|
||||||
const QString title = tr("Choose a local file");
|
|
||||||
const QString localFile = QFileDialog::getOpenFileName(this, title, m_model->projectDir()); // TODO: Support directories.
|
|
||||||
if (localFile.isEmpty())
|
|
||||||
return;
|
|
||||||
const MaemoDeployable
|
|
||||||
deployable(QDir::toNativeSeparators(QFileInfo(localFile).absoluteFilePath()),
|
|
||||||
"/");
|
|
||||||
QString errorString;
|
|
||||||
if (!m_model->addDeployable(deployable, &errorString)) {
|
|
||||||
QMessageBox::information(this, tr("Error adding file"), errorString);
|
|
||||||
} else {
|
|
||||||
const QModelIndex newIndex
|
|
||||||
= m_model->index(m_model->rowCount() - 1, 1);
|
|
||||||
m_ui->deployablesView->selectionModel()->clear();
|
|
||||||
m_ui->deployablesView->scrollTo(newIndex);
|
|
||||||
m_ui->deployablesView->edit(newIndex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoDeployableListWidget::removeFile()
|
|
||||||
{
|
|
||||||
const QModelIndexList selectedRows
|
|
||||||
= m_ui->deployablesView->selectionModel()->selectedRows();
|
|
||||||
if (selectedRows.isEmpty())
|
|
||||||
return;
|
|
||||||
const int row = selectedRows.first().row();
|
|
||||||
if (row != 0) {
|
|
||||||
QString errorString;
|
|
||||||
if (!m_model->removeDeployableAt(row, &errorString)) {
|
|
||||||
QMessageBox::information(this, tr("Error removing file"),
|
|
||||||
errorString);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoDeployableListWidget::enableOrDisableRemoveButton()
|
|
||||||
{
|
|
||||||
const QModelIndexList selectedRows
|
|
||||||
= m_ui->deployablesView->selectionModel()->selectedRows();
|
|
||||||
m_ui->removeFileButton->setEnabled(!selectedRows.isEmpty()
|
|
||||||
&& selectedRows.first().row() != 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Qt4ProjectManager
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
** All rights reserved.
|
|
||||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
|
||||||
** No Commercial Usage
|
|
||||||
** This file contains pre-release code and may not be distributed.
|
|
||||||
** You may use this file in accordance with the terms and conditions
|
|
||||||
** contained in the Technology Preview License Agreement accompanying
|
|
||||||
** this package.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
||||||
** packaging of this file. Please review the following information to
|
|
||||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
||||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** In addition, as a special exception, Nokia gives you certain additional
|
|
||||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
** If you have questions regarding the use of this file, please contact
|
|
||||||
** Nokia at qt-info@nokia.com.
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef MAEMODEPLOYABLELISTWIDGET_H
|
|
||||||
#define MAEMODEPLOYABLELISTWIDGET_H
|
|
||||||
|
|
||||||
#include <QtGui/QWidget>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
namespace Ui {
|
|
||||||
class MaemoDeployableListWidget;
|
|
||||||
}
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
|
||||||
namespace Internal {
|
|
||||||
class MaemoDeployableListModel;
|
|
||||||
|
|
||||||
class MaemoDeployableListWidget : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
MaemoDeployableListWidget(QWidget *parent, MaemoDeployableListModel *model);
|
|
||||||
~MaemoDeployableListWidget();
|
|
||||||
MaemoDeployableListModel *model() const { return m_model; }
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void addFile();
|
|
||||||
void removeFile();
|
|
||||||
void enableOrDisableRemoveButton();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Ui::MaemoDeployableListWidget *m_ui;
|
|
||||||
MaemoDeployableListModel * const m_model;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Qt4ProjectManager
|
|
||||||
|
|
||||||
#endif // MAEMODEPLOYABLELISTWIDGET_H
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>MaemoDeployableListWidget</class>
|
|
||||||
<widget class="QWidget" name="MaemoDeployableListWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>491</width>
|
|
||||||
<height>289</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Form</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QTableView" name="deployablesView">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
|
||||||
<horstretch>1</horstretch>
|
|
||||||
<verstretch>1</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>400</width>
|
|
||||||
<height>200</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="selectionMode">
|
|
||||||
<enum>QAbstractItemView::SingleSelection</enum>
|
|
||||||
</property>
|
|
||||||
<property name="selectionBehavior">
|
|
||||||
<enum>QAbstractItemView::SelectRows</enum>
|
|
||||||
</property>
|
|
||||||
<property name="showGrid">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<attribute name="horizontalHeaderVisible">
|
|
||||||
<bool>true</bool>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="horizontalHeaderCascadingSectionResizes">
|
|
||||||
<bool>false</bool>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="verticalHeaderVisible">
|
|
||||||
<bool>false</bool>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="addFileButton">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Add File to Package</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../../coreplugin/core.qrc">
|
|
||||||
<normaloff>:/core/images/plus.png</normaloff>:/core/images/plus.png</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="removeFileButton">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Remove File from Package</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../../coreplugin/core.qrc">
|
|
||||||
<normaloff>:/core/images/minus.png</normaloff>:/core/images/minus.png</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</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>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources>
|
|
||||||
<include location="../../coreplugin/core.qrc"/>
|
|
||||||
</resources>
|
|
||||||
<connections>
|
|
||||||
<connection>
|
|
||||||
<sender>addFileButton</sender>
|
|
||||||
<signal>clicked()</signal>
|
|
||||||
<receiver>MaemoDeployableListWidget</receiver>
|
|
||||||
<slot>addFile()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>475</x>
|
|
||||||
<y>32</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>488</x>
|
|
||||||
<y>242</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>removeFileButton</sender>
|
|
||||||
<signal>clicked()</signal>
|
|
||||||
<receiver>MaemoDeployableListWidget</receiver>
|
|
||||||
<slot>removeFile()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>456</x>
|
|
||||||
<y>66</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>490</x>
|
|
||||||
<y>182</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
<slots>
|
|
||||||
<slot>addFile()</slot>
|
|
||||||
<slot>removeFile()</slot>
|
|
||||||
</slots>
|
|
||||||
</ui>
|
|
||||||
@@ -79,18 +79,19 @@ void MaemoDeployables::createModels()
|
|||||||
|| qt4BuildConfiguration()->qt4Target()->project()->activeTarget()->id()
|
|| qt4BuildConfiguration()->qt4Target()->project()->activeTarget()->id()
|
||||||
!= QLatin1String(Qt4ProjectManager::Constants::MAEMO_DEVICE_TARGET_ID))
|
!= QLatin1String(Qt4ProjectManager::Constants::MAEMO_DEVICE_TARGET_ID))
|
||||||
return;
|
return;
|
||||||
disconnect(qt4BuildConfiguration()->qt4Target()->qt4Project(),
|
const Qt4ProFileNode *const rootNode
|
||||||
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
= qt4BuildConfiguration()->qt4Target()->qt4Project()->rootProjectNode();
|
||||||
m_updateTimer, SLOT(start()));
|
if (!rootNode) // Happens on project creation by wizard.
|
||||||
|
return;
|
||||||
m_updateTimer->stop();
|
m_updateTimer->stop();
|
||||||
m_proFileOption = QSharedPointer<ProFileOption>(new ProFileOption);
|
m_proFileOption = QSharedPointer<ProFileOption>(new ProFileOption);
|
||||||
m_proFileOption->properties
|
m_proFileOption->properties
|
||||||
= qt4BuildConfiguration()->qtVersion()->versionInfo();
|
= qt4BuildConfiguration()->qtVersion()->versionInfo();
|
||||||
m_proFileOption->target_mode = ProFileOption::TARG_UNIX_MODE;
|
m_proFileOption->target_mode = ProFileOption::TARG_UNIX_MODE;
|
||||||
const Qt4ProFileNode *const rootNode
|
disconnect(qt4BuildConfiguration()->qt4Target()->qt4Project(),
|
||||||
= qt4BuildConfiguration()->qt4Target()->qt4Project()->rootProjectNode();
|
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||||
if (!rootNode) // Happens on project creation by wizard.
|
m_updateTimer, SLOT(start()));
|
||||||
return;
|
beginResetModel();
|
||||||
qDeleteAll(m_listModels);
|
qDeleteAll(m_listModels);
|
||||||
m_listModels.clear();
|
m_listModels.clear();
|
||||||
createModels(rootNode);
|
createModels(rootNode);
|
||||||
@@ -118,7 +119,7 @@ void MaemoDeployables::createModels()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emit modelsCreated();
|
endResetModel();
|
||||||
connect(qt4BuildConfiguration()->qt4Target()->qt4Project(),
|
connect(qt4BuildConfiguration()->qt4Target()->qt4Project(),
|
||||||
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||||
m_updateTimer, SLOT(start()));
|
m_updateTimer, SLOT(start()));
|
||||||
@@ -209,5 +210,26 @@ const Qt4BuildConfiguration *MaemoDeployables::qt4BuildConfiguration() const
|
|||||||
return bc;
|
return bc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int MaemoDeployables::rowCount(const QModelIndex &parent) const
|
||||||
|
{
|
||||||
|
return parent.isValid() ? 0 : modelCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant MaemoDeployables::data(const QModelIndex &index, int role) const
|
||||||
|
{
|
||||||
|
if (!index.isValid() || index.row() < 0 || index.row() >= modelCount()
|
||||||
|
|| index.column() != 0)
|
||||||
|
return QVariant();
|
||||||
|
const MaemoDeployableListModel *const model = m_listModels.at(index.row());
|
||||||
|
if (role == Qt::ForegroundRole && !model->hasTargetPath()) {
|
||||||
|
QBrush brush;
|
||||||
|
brush.setColor(Qt::red);
|
||||||
|
return brush;
|
||||||
|
}
|
||||||
|
if (role == Qt::DisplayRole)
|
||||||
|
return QFileInfo(model->proFilePath()).fileName();
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -45,9 +45,9 @@
|
|||||||
#include "maemodeployable.h"
|
#include "maemodeployable.h"
|
||||||
#include "maemodeployablelistmodel.h"
|
#include "maemodeployablelistmodel.h"
|
||||||
|
|
||||||
|
#include <QtCore/QAbstractListModel>
|
||||||
#include <QtCore/QHash>
|
#include <QtCore/QHash>
|
||||||
#include <QtCore/QList>
|
#include <QtCore/QList>
|
||||||
#include <QtCore/QObject>
|
|
||||||
#include <QtCore/QSharedPointer>
|
#include <QtCore/QSharedPointer>
|
||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QTimer);
|
QT_FORWARD_DECLARE_CLASS(QTimer);
|
||||||
@@ -61,7 +61,7 @@ namespace Internal {
|
|||||||
class Qt4BuildConfiguration;
|
class Qt4BuildConfiguration;
|
||||||
class Qt4ProFileNode;
|
class Qt4ProFileNode;
|
||||||
|
|
||||||
class MaemoDeployables : public QObject
|
class MaemoDeployables : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
@@ -76,12 +76,12 @@ public:
|
|||||||
MaemoDeployableListModel *modelAt(int i) const { return m_listModels.at(i); }
|
MaemoDeployableListModel *modelAt(int i) const { return m_listModels.at(i); }
|
||||||
const ProjectExplorer::BuildStep *buildStep() const { return m_buildStep; }
|
const ProjectExplorer::BuildStep *buildStep() const { return m_buildStep; }
|
||||||
|
|
||||||
signals:
|
|
||||||
void modelsCreated();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef QHash<QString, MaemoDeployableListModel::ProFileUpdateSetting> UpdateSettingsMap;
|
typedef QHash<QString, MaemoDeployableListModel::ProFileUpdateSetting> UpdateSettingsMap;
|
||||||
|
|
||||||
|
virtual int rowCount(const QModelIndex &parent) const;
|
||||||
|
virtual QVariant data(const QModelIndex &index, int role) const;
|
||||||
|
|
||||||
Q_SLOT void createModels();
|
Q_SLOT void createModels();
|
||||||
Q_SLOT void init();
|
Q_SLOT void init();
|
||||||
void createModels(const Qt4ProFileNode *proFileNode);
|
void createModels(const Qt4ProFileNode *proFileNode);
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
|
|
||||||
#include "maemodeploystep.h"
|
#include "maemodeploystep.h"
|
||||||
#include "maemodeployablelistmodel.h"
|
#include "maemodeployablelistmodel.h"
|
||||||
#include "maemodeployablelistwidget.h"
|
|
||||||
#include "maemodeployables.h"
|
#include "maemodeployables.h"
|
||||||
#include "maemodeviceconfiglistmodel.h"
|
#include "maemodeviceconfiglistmodel.h"
|
||||||
#include "maemorunconfiguration.h"
|
#include "maemorunconfiguration.h"
|
||||||
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -20,10 +20,19 @@ MaemoDeployStepWidget::MaemoDeployStepWidget(MaemoDeployStep *step) :
|
|||||||
m_step(step)
|
m_step(step)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
ui->tableView->setTextElideMode(Qt::ElideMiddle);
|
||||||
|
ui->modelComboBox->setModel(m_step->deployables());
|
||||||
|
connect(m_step->deployables(), SIGNAL(modelAboutToBeReset()),
|
||||||
|
SLOT(handleModelListToBeReset()));
|
||||||
|
|
||||||
connect(m_step->deployables(), SIGNAL(modelsCreated()), this,
|
// Queued connection because of race condition with combo box's reaction
|
||||||
SLOT(handleModelsCreated()));
|
// to modelReset().
|
||||||
handleModelsCreated();
|
connect(m_step->deployables(), SIGNAL(modelReset()),
|
||||||
|
SLOT(handleModelListReset()), Qt::QueuedConnection);
|
||||||
|
|
||||||
|
connect(ui->modelComboBox, SIGNAL(currentIndexChanged(int)),
|
||||||
|
SLOT(setModel(int)));
|
||||||
|
handleModelListReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
MaemoDeployStepWidget::~MaemoDeployStepWidget()
|
MaemoDeployStepWidget::~MaemoDeployStepWidget()
|
||||||
@@ -77,18 +86,6 @@ QString MaemoDeployStepWidget::displayName() const
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MaemoDeployStepWidget::handleModelsCreated()
|
|
||||||
{
|
|
||||||
ui->tabWidget->clear();
|
|
||||||
for (int i = 0; i < m_step->deployables()->modelCount(); ++i) {
|
|
||||||
MaemoDeployableListModel * const model
|
|
||||||
= m_step->deployables()->modelAt(i);
|
|
||||||
ui->tabWidget->addTab(new MaemoDeployableListWidget(this, model),
|
|
||||||
model->projectName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoDeployStepWidget::setCurrentDeviceConfig(int index)
|
void MaemoDeployStepWidget::setCurrentDeviceConfig(int index)
|
||||||
{
|
{
|
||||||
m_step->deviceConfigModel()->setCurrentIndex(index);
|
m_step->deviceConfigModel()->setCurrentIndex(index);
|
||||||
@@ -99,5 +96,29 @@ void MaemoDeployStepWidget::setDeployToSysroot(bool doDeploy)
|
|||||||
m_step->setDeployToSysrootEnabled(doDeploy);
|
m_step->setDeployToSysrootEnabled(doDeploy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MaemoDeployStepWidget::handleModelListToBeReset()
|
||||||
|
{
|
||||||
|
ui->tableView->setModel(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaemoDeployStepWidget::handleModelListReset()
|
||||||
|
{
|
||||||
|
QTC_ASSERT(m_step->deployables()->modelCount() == ui->modelComboBox->count(), return);
|
||||||
|
if (m_step->deployables()->modelCount() > 0) {
|
||||||
|
if (ui->modelComboBox->currentIndex() == -1)
|
||||||
|
ui->modelComboBox->setCurrentIndex(0);
|
||||||
|
else
|
||||||
|
setModel(ui->modelComboBox->currentIndex());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaemoDeployStepWidget::setModel(int row)
|
||||||
|
{
|
||||||
|
if (row != -1) {
|
||||||
|
ui->tableView->setModel(m_step->deployables()->modelAt(row));
|
||||||
|
ui->tableView->resizeRowsToContents();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -23,10 +23,12 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Q_SLOT void handleDeviceUpdate();
|
Q_SLOT void handleDeviceUpdate();
|
||||||
Q_SLOT void handleModelsCreated();
|
|
||||||
Q_SLOT void handleDeviceConfigModelChanged();
|
Q_SLOT void handleDeviceConfigModelChanged();
|
||||||
Q_SLOT void setCurrentDeviceConfig(int index);
|
Q_SLOT void setCurrentDeviceConfig(int index);
|
||||||
Q_SLOT void setDeployToSysroot(bool doDeloy);
|
Q_SLOT void setDeployToSysroot(bool doDeloy);
|
||||||
|
Q_SLOT void setModel(int row);
|
||||||
|
Q_SLOT void handleModelListToBeReset();
|
||||||
|
Q_SLOT void handleModelListReset();
|
||||||
|
|
||||||
virtual void init();
|
virtual void init();
|
||||||
virtual QString summaryText() const;
|
virtual QString summaryText() const;
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>460</width>
|
<width>662</width>
|
||||||
<height>277</height>
|
<height>418</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -15,58 +15,118 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QFormLayout" name="formLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item row="0" column="0">
|
<item>
|
||||||
<widget class="QLabel" name="deviceConfigLabel">
|
<widget class="QLabel" name="deviceConfigLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Device configuration:</string>
|
<string>Device configuration:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<widget class="QComboBox" name="deviceConfigComboBox"/>
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="deviceConfigComboBox"/>
|
|
||||||
</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>
|
||||||
<item row="1" column="1">
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2"/>
|
<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>
|
</item>
|
||||||
<item row="1" column="0">
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
<widget class="QCheckBox" name="deployToSysrootCheckBox">
|
<widget class="QCheckBox" name="deployToSysrootCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Also deploy to sysroot</string>
|
<string>Also deploy to sysroot</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<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>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="installLabel">
|
<widget class="Line" name="line">
|
||||||
<property name="toolTip">
|
<property name="orientation">
|
||||||
<string>These show the INSTALLS settings from the project file(s).</string>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string><b>Files to install:</b></string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget"/>
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="installLabel">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>These show the INSTALLS settings from the project file(s).</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><b>Files to install for subproject:</b></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="modelComboBox">
|
||||||
|
<property name="sizeAdjustPolicy">
|
||||||
|
<enum>QComboBox::AdjustToContents</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<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>
|
||||||
|
<widget class="QTableView" name="tableView">
|
||||||
|
<property name="showGrid">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<attribute name="horizontalHeaderDefaultSectionSize">
|
||||||
|
<number>400</number>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="horizontalHeaderMinimumSectionSize">
|
||||||
|
<number>100</number>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="horizontalHeaderStretchLastSection">
|
||||||
|
<bool>true</bool>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="verticalHeaderVisible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
|
|||||||
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(),
|
||||||
SIGNAL(modelsCreated()), this, SLOT(handleDeploySpecsChanged()));
|
SIGNAL(modelReset()), this, SLOT(handleDeploySpecsChanged()));
|
||||||
handleDeploySpecsChanged();
|
handleDeploySpecsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ MaemoTemplatesManager::MaemoTemplatesManager(QObject *parent) : QObject(parent)
|
|||||||
SLOT(handleActiveProjectChanged(ProjectExplorer::Project*)));
|
SLOT(handleActiveProjectChanged(ProjectExplorer::Project*)));
|
||||||
connect(session, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project*)),
|
connect(session, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project*)),
|
||||||
this, SLOT(handleProjectToBeRemoved(ProjectExplorer::Project*)));
|
this, SLOT(handleProjectToBeRemoved(ProjectExplorer::Project*)));
|
||||||
handleActiveProjectChanged(session->startupProject());
|
handleActiveProjectChanged(session->startupProject());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoTemplatesManager::handleActiveProjectChanged(ProjectExplorer::Project *project)
|
void MaemoTemplatesManager::handleActiveProjectChanged(ProjectExplorer::Project *project)
|
||||||
@@ -113,7 +113,7 @@ bool MaemoTemplatesManager::handleTarget(ProjectExplorer::Target *target)
|
|||||||
const Qt4Target * const qt4Target = qobject_cast<Qt4Target *>(target);
|
const Qt4Target * const qt4Target = qobject_cast<Qt4Target *>(target);
|
||||||
const MaemoDeployStep * const deployStep
|
const MaemoDeployStep * const deployStep
|
||||||
= MaemoGlobal::buildStep<MaemoDeployStep>(qt4Target->activeDeployConfiguration());
|
= MaemoGlobal::buildStep<MaemoDeployStep>(qt4Target->activeDeployConfiguration());
|
||||||
connect(deployStep->deployables(), SIGNAL(modelsCreated()), this,
|
connect(deployStep->deployables(), SIGNAL(modelReset()), this,
|
||||||
SLOT(handleProFileUpdated()), Qt::QueuedConnection);
|
SLOT(handleProFileUpdated()), Qt::QueuedConnection);
|
||||||
|
|
||||||
Project * const project = target->project();
|
Project * const project = target->project();
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ HEADERS += \
|
|||||||
$$PWD/maemoprofilewrapper.h \
|
$$PWD/maemoprofilewrapper.h \
|
||||||
$$PWD/maemodeployables.h \
|
$$PWD/maemodeployables.h \
|
||||||
$$PWD/maemodeployable.h \
|
$$PWD/maemodeployable.h \
|
||||||
$$PWD/maemodeployablelistwidget.h \
|
|
||||||
$$PWD/maemodeploystep.h \
|
$$PWD/maemodeploystep.h \
|
||||||
$$PWD/maemodeploystepwidget.h \
|
$$PWD/maemodeploystepwidget.h \
|
||||||
$$PWD/maemodeploystepfactory.h \
|
$$PWD/maemodeploystepfactory.h \
|
||||||
@@ -53,7 +52,6 @@ SOURCES += \
|
|||||||
$$PWD/maemoqemumanager.cpp \
|
$$PWD/maemoqemumanager.cpp \
|
||||||
$$PWD/maemoprofilewrapper.cpp \
|
$$PWD/maemoprofilewrapper.cpp \
|
||||||
$$PWD/maemodeployables.cpp \
|
$$PWD/maemodeployables.cpp \
|
||||||
$$PWD/maemodeployablelistwidget.cpp \
|
|
||||||
$$PWD/maemodeploystep.cpp \
|
$$PWD/maemodeploystep.cpp \
|
||||||
$$PWD/maemodeploystepwidget.cpp \
|
$$PWD/maemodeploystepwidget.cpp \
|
||||||
$$PWD/maemodeploystepfactory.cpp \
|
$$PWD/maemodeploystepfactory.cpp \
|
||||||
@@ -73,7 +71,6 @@ FORMS += \
|
|||||||
$$PWD/maemosettingswidget.ui \
|
$$PWD/maemosettingswidget.ui \
|
||||||
$$PWD/maemosshconfigdialog.ui \
|
$$PWD/maemosshconfigdialog.ui \
|
||||||
$$PWD/maemopackagecreationwidget.ui \
|
$$PWD/maemopackagecreationwidget.ui \
|
||||||
$$PWD/maemodeployablelistwidget.ui \
|
|
||||||
$$PWD/maemodeploystepwidget.ui \
|
$$PWD/maemodeploystepwidget.ui \
|
||||||
$$PWD/maemoprofilesupdatedialog.ui
|
$$PWD/maemoprofilesupdatedialog.ui
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user