forked from qt-creator/qt-creator
Maemo: Don't create desktop files, ask before updating project files.
Also don't waste performance by repeatedly reacting to the same project file change. This is relevant for bigger projects to which a Maemo target might have been added by mistake. Task-number: QTCREATORBUG-2647 Reviewed-by: kh1
This commit is contained in:
@@ -41,12 +41,14 @@ namespace Qt4ProjectManager {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
MaemoDeployableListModel::MaemoDeployableListModel(const Qt4ProFileNode *proFileNode,
|
MaemoDeployableListModel::MaemoDeployableListModel(const Qt4ProFileNode *proFileNode,
|
||||||
const QSharedPointer<ProFileOption> &proFileOption, QObject *parent)
|
const QSharedPointer<ProFileOption> &proFileOption,
|
||||||
|
ProFileUpdateSetting updateSetting, QObject *parent)
|
||||||
: QAbstractTableModel(parent),
|
: QAbstractTableModel(parent),
|
||||||
m_proFileNode(proFileNode),
|
m_proFileNode(proFileNode),
|
||||||
m_modified(false),
|
m_modified(false),
|
||||||
m_proFileWrapper(new MaemoProFileWrapper(m_proFileNode->path(),
|
m_proFileWrapper(new MaemoProFileWrapper(m_proFileNode->path(),
|
||||||
m_proFileNode->buildDir(), proFileOption))
|
m_proFileNode->buildDir(), proFileOption)),
|
||||||
|
m_proFileUpdateSetting(updateSetting), m_hasTargetPath(false)
|
||||||
{
|
{
|
||||||
buildModel();
|
buildModel();
|
||||||
}
|
}
|
||||||
@@ -58,7 +60,8 @@ bool MaemoDeployableListModel::buildModel()
|
|||||||
m_deployables.clear();
|
m_deployables.clear();
|
||||||
|
|
||||||
const MaemoProFileWrapper::InstallsList &installs = m_proFileWrapper->installs();
|
const MaemoProFileWrapper::InstallsList &installs = m_proFileWrapper->installs();
|
||||||
if (installs.targetPath.isEmpty()) {
|
m_hasTargetPath = !installs.targetPath.isEmpty();
|
||||||
|
if (!m_hasTargetPath && m_proFileUpdateSetting == UpdateProFile) {
|
||||||
const QString remoteDirSuffix
|
const QString remoteDirSuffix
|
||||||
= QLatin1String(m_proFileNode->projectType() == LibraryTemplate
|
= QLatin1String(m_proFileNode->projectType() == LibraryTemplate
|
||||||
? "/lib" : "/bin");
|
? "/lib" : "/bin");
|
||||||
@@ -223,8 +226,10 @@ QString MaemoDeployableListModel::localExecutableFilePath() const
|
|||||||
|
|
||||||
QString MaemoDeployableListModel::remoteExecutableFilePath() const
|
QString MaemoDeployableListModel::remoteExecutableFilePath() const
|
||||||
{
|
{
|
||||||
return deployableAt(0).remoteDir + '/'
|
return m_hasTargetPath
|
||||||
+ QFileInfo(localExecutableFilePath()).fileName();
|
? deployableAt(0).remoteDir + '/'
|
||||||
|
+ QFileInfo(localExecutableFilePath()).fileName()
|
||||||
|
: QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoDeployableListModel::projectName() const
|
QString MaemoDeployableListModel::projectName() const
|
||||||
@@ -237,5 +242,12 @@ QString MaemoDeployableListModel::projectDir() const
|
|||||||
return QFileInfo(m_proFileNode->path()).dir().path();
|
return QFileInfo(m_proFileNode->path()).dir().path();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MaemoDeployableListModel::setProFileUpdateSetting(ProFileUpdateSetting updateSetting)
|
||||||
|
{
|
||||||
|
m_proFileUpdateSetting = updateSetting;
|
||||||
|
if (updateSetting == UpdateProFile)
|
||||||
|
buildModel();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -52,8 +52,13 @@ class MaemoDeployableListModel : public QAbstractTableModel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
enum ProFileUpdateSetting {
|
||||||
|
UpdateProFile, DontUpdateProFile, AskToUpdateProFile
|
||||||
|
};
|
||||||
|
|
||||||
MaemoDeployableListModel(const Qt4ProFileNode *proFileNode,
|
MaemoDeployableListModel(const Qt4ProFileNode *proFileNode,
|
||||||
const QSharedPointer<ProFileOption> &proFileOption, QObject *parent);
|
const QSharedPointer<ProFileOption> &proFileOption,
|
||||||
|
ProFileUpdateSetting updateSetting, QObject *parent);
|
||||||
~MaemoDeployableListModel();
|
~MaemoDeployableListModel();
|
||||||
|
|
||||||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
@@ -68,6 +73,11 @@ public:
|
|||||||
QString projectName() const;
|
QString projectName() const;
|
||||||
QString projectDir() const;
|
QString projectDir() const;
|
||||||
const Qt4ProFileNode *proFileNode() const { return m_proFileNode; }
|
const Qt4ProFileNode *proFileNode() const { return m_proFileNode; }
|
||||||
|
bool hasTargetPath() const { return m_hasTargetPath; }
|
||||||
|
ProFileUpdateSetting proFileUpdateSetting() const {
|
||||||
|
return m_proFileUpdateSetting;
|
||||||
|
}
|
||||||
|
void setProFileUpdateSetting(ProFileUpdateSetting updateSetting);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
@@ -85,6 +95,8 @@ private:
|
|||||||
QList<MaemoDeployable> m_deployables;
|
QList<MaemoDeployable> m_deployables;
|
||||||
mutable bool m_modified;
|
mutable bool m_modified;
|
||||||
const QScopedPointer<MaemoProFileWrapper> m_proFileWrapper;
|
const QScopedPointer<MaemoProFileWrapper> m_proFileWrapper;
|
||||||
|
ProFileUpdateSetting m_proFileUpdateSetting;
|
||||||
|
bool m_hasTargetPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ MaemoDeployableListWidget::MaemoDeployableListWidget(QWidget *parent,
|
|||||||
SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this,
|
SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this,
|
||||||
SLOT(enableOrDisableRemoveButton()));
|
SLOT(enableOrDisableRemoveButton()));
|
||||||
m_ui->deployablesView->resizeColumnsToContents();
|
m_ui->deployablesView->resizeColumnsToContents();
|
||||||
|
m_ui->deployablesView->resizeRowsToContents();
|
||||||
m_ui->deployablesView->horizontalHeader()->setStretchLastSection(true);
|
m_ui->deployablesView->horizontalHeader()->setStretchLastSection(true);
|
||||||
enableOrDisableRemoveButton();
|
enableOrDisableRemoveButton();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ class MaemoDeployableListWidget : public QWidget
|
|||||||
public:
|
public:
|
||||||
MaemoDeployableListWidget(QWidget *parent, MaemoDeployableListModel *model);
|
MaemoDeployableListWidget(QWidget *parent, MaemoDeployableListModel *model);
|
||||||
~MaemoDeployableListWidget();
|
~MaemoDeployableListWidget();
|
||||||
|
MaemoDeployableListModel *model() const { return m_model; }
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void addFile();
|
void addFile();
|
||||||
|
|||||||
@@ -41,10 +41,11 @@
|
|||||||
|
|
||||||
#include "maemodeployables.h"
|
#include "maemodeployables.h"
|
||||||
|
|
||||||
#include "maemodeployablelistmodel.h"
|
#include "maemoprofilesupdatedialog.h"
|
||||||
|
|
||||||
#include <profileevaluator.h>
|
#include <profileevaluator.h>
|
||||||
#include <projectexplorer/buildstep.h>
|
#include <projectexplorer/buildstep.h>
|
||||||
|
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||||
#include <qt4projectmanager/qt4project.h>
|
#include <qt4projectmanager/qt4project.h>
|
||||||
#include <qt4projectmanager/qt4target.h>
|
#include <qt4projectmanager/qt4target.h>
|
||||||
@@ -55,46 +56,91 @@ namespace Qt4ProjectManager {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
MaemoDeployables::MaemoDeployables(const ProjectExplorer::BuildStep *buildStep)
|
MaemoDeployables::MaemoDeployables(const ProjectExplorer::BuildStep *buildStep)
|
||||||
: m_buildStep(buildStep)
|
: m_buildStep(buildStep), m_updateTimer(new QTimer(this))
|
||||||
{
|
{
|
||||||
QTimer::singleShot(0, this, SLOT(init()));
|
QTimer::singleShot(0, this, SLOT(init()));
|
||||||
|
m_updateTimer->setInterval(1500);
|
||||||
|
connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(createModels()));
|
||||||
}
|
}
|
||||||
|
|
||||||
MaemoDeployables::~MaemoDeployables() {}
|
MaemoDeployables::~MaemoDeployables() {}
|
||||||
|
|
||||||
void MaemoDeployables::init()
|
void MaemoDeployables::init()
|
||||||
{
|
{
|
||||||
createModels();
|
|
||||||
connect(qt4BuildConfiguration()->qt4Target()->qt4Project(),
|
connect(qt4BuildConfiguration()->qt4Target()->qt4Project(),
|
||||||
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||||
this, SLOT(createModels()));
|
m_updateTimer, SLOT(start()));
|
||||||
|
createModels();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoDeployables::createModels()
|
void MaemoDeployables::createModels()
|
||||||
{
|
{
|
||||||
qDeleteAll(m_listModels);
|
if (!qt4BuildConfiguration() || !qt4BuildConfiguration()->qt4Target()
|
||||||
m_listModels.clear();
|
|| qt4BuildConfiguration()->qt4Target()->project()->activeTarget()->id()
|
||||||
|
!= QLatin1String(Qt4ProjectManager::Constants::MAEMO_DEVICE_TARGET_ID))
|
||||||
|
return;
|
||||||
|
disconnect(qt4BuildConfiguration()->qt4Target()->qt4Project(),
|
||||||
|
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||||
|
m_updateTimer, SLOT(start()));
|
||||||
|
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;
|
||||||
createModels(qt4BuildConfiguration()->qt4Target()->qt4Project()
|
const Qt4ProFileNode *const rootNode
|
||||||
->rootProjectNode());
|
= qt4BuildConfiguration()->qt4Target()->qt4Project()->rootProjectNode();
|
||||||
|
if (!rootNode) // Happens on project creation by wizard.
|
||||||
|
return;
|
||||||
|
qDeleteAll(m_listModels);
|
||||||
|
m_listModels.clear();
|
||||||
|
createModels(rootNode);
|
||||||
|
QList<MaemoDeployableListModel *> modelsWithoutTargetPath;
|
||||||
|
foreach (MaemoDeployableListModel *const model, m_listModels) {
|
||||||
|
if (!model->hasTargetPath()) {
|
||||||
|
if (model->proFileUpdateSetting() == MaemoDeployableListModel::AskToUpdateProFile)
|
||||||
|
modelsWithoutTargetPath << model;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!modelsWithoutTargetPath.isEmpty()) {
|
||||||
|
MaemoProFilesUpdateDialog dialog(modelsWithoutTargetPath);
|
||||||
|
dialog.exec();
|
||||||
|
const QList<MaemoProFilesUpdateDialog::UpdateSetting> &settings
|
||||||
|
= dialog.getUpdateSettings();
|
||||||
|
foreach (const MaemoProFilesUpdateDialog::UpdateSetting &setting, settings) {
|
||||||
|
const MaemoDeployableListModel::ProFileUpdateSetting updateSetting
|
||||||
|
= setting.second
|
||||||
|
? MaemoDeployableListModel::UpdateProFile
|
||||||
|
: MaemoDeployableListModel::DontUpdateProFile;
|
||||||
|
m_updateSettings.insert(setting.first->proFileNode()->path(),
|
||||||
|
updateSetting);
|
||||||
|
setting.first->setProFileUpdateSetting(updateSetting);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
emit modelsCreated();
|
emit modelsCreated();
|
||||||
|
connect(qt4BuildConfiguration()->qt4Target()->qt4Project(),
|
||||||
|
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||||
|
m_updateTimer, SLOT(start()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoDeployables::createModels(const Qt4ProFileNode *proFileNode)
|
void MaemoDeployables::createModels(const Qt4ProFileNode *proFileNode)
|
||||||
{
|
{
|
||||||
if (!proFileNode) // Happens on project creation by wizard.
|
switch (proFileNode->projectType()) {
|
||||||
return;
|
|
||||||
const Qt4ProjectType type = proFileNode->projectType() ;
|
|
||||||
switch (type) {
|
|
||||||
case ApplicationTemplate:
|
case ApplicationTemplate:
|
||||||
case LibraryTemplate:
|
case LibraryTemplate:
|
||||||
case ScriptTemplate:
|
case ScriptTemplate: {
|
||||||
m_listModels
|
UpdateSettingsMap::ConstIterator it
|
||||||
<< new MaemoDeployableListModel(proFileNode, m_proFileOption, this);
|
= m_updateSettings.find(proFileNode->path());
|
||||||
|
const MaemoDeployableListModel::ProFileUpdateSetting updateSetting
|
||||||
|
= it != m_updateSettings.end()
|
||||||
|
? it.value() : MaemoDeployableListModel::AskToUpdateProFile;
|
||||||
|
MaemoDeployableListModel *const newModel
|
||||||
|
= new MaemoDeployableListModel(proFileNode, m_proFileOption,
|
||||||
|
updateSetting, this);
|
||||||
|
m_listModels << newModel;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case SubDirsTemplate: {
|
case SubDirsTemplate: {
|
||||||
const QList<ProjectExplorer::ProjectNode *> &subProjects
|
const QList<ProjectExplorer::ProjectNode *> &subProjects
|
||||||
= proFileNode->subProjectNodes();
|
= proFileNode->subProjectNodes();
|
||||||
@@ -160,7 +206,6 @@ const Qt4BuildConfiguration *MaemoDeployables::qt4BuildConfiguration() const
|
|||||||
{
|
{
|
||||||
const Qt4BuildConfiguration * const bc
|
const Qt4BuildConfiguration * const bc
|
||||||
= qobject_cast<Qt4BuildConfiguration *>(m_buildStep->target()->activeBuildConfiguration());
|
= qobject_cast<Qt4BuildConfiguration *>(m_buildStep->target()->activeBuildConfiguration());
|
||||||
Q_ASSERT(bc);
|
|
||||||
return bc;
|
return bc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,21 +43,21 @@
|
|||||||
#define MAEMODEPLOYABLES_H
|
#define MAEMODEPLOYABLES_H
|
||||||
|
|
||||||
#include "maemodeployable.h"
|
#include "maemodeployable.h"
|
||||||
|
#include "maemodeployablelistmodel.h"
|
||||||
|
|
||||||
|
#include <QtCore/QHash>
|
||||||
#include <QtCore/QList>
|
#include <QtCore/QList>
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtCore/QSharedPointer>
|
#include <QtCore/QSharedPointer>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_FORWARD_DECLARE_CLASS(QTimer);
|
||||||
struct ProFileOption;
|
QT_FORWARD_DECLARE_STRUCT(ProFileOption)
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace ProjectExplorer { class BuildStep; }
|
namespace ProjectExplorer { class BuildStep; }
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class MaemoDeployableListModel;
|
|
||||||
class Qt4BuildConfiguration;
|
class Qt4BuildConfiguration;
|
||||||
class Qt4ProFileNode;
|
class Qt4ProFileNode;
|
||||||
|
|
||||||
@@ -80,6 +80,8 @@ signals:
|
|||||||
void modelsCreated();
|
void modelsCreated();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
typedef QHash<QString, MaemoDeployableListModel::ProFileUpdateSetting> UpdateSettingsMap;
|
||||||
|
|
||||||
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);
|
||||||
@@ -87,7 +89,9 @@ private:
|
|||||||
|
|
||||||
QList<MaemoDeployableListModel *> m_listModels;
|
QList<MaemoDeployableListModel *> m_listModels;
|
||||||
QSharedPointer<ProFileOption> m_proFileOption;
|
QSharedPointer<ProFileOption> m_proFileOption;
|
||||||
|
UpdateSettingsMap m_updateSettings;
|
||||||
const ProjectExplorer::BuildStep * const m_buildStep;
|
const ProjectExplorer::BuildStep * const m_buildStep;
|
||||||
|
QTimer *const m_updateTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -0,0 +1,99 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** Commercial Usage
|
||||||
|
**
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** 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.
|
||||||
|
**
|
||||||
|
** If you are unsure which license is appropriate for your use, please
|
||||||
|
** contact the sales department at http://qt.nokia.com/contact.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
#include "maemoprofilesupdatedialog.h"
|
||||||
|
#include "ui_maemoprofilesupdatedialog.h"
|
||||||
|
|
||||||
|
#include "maemodeployablelistmodel.h"
|
||||||
|
|
||||||
|
#include <qt4projectmanager/qt4nodes.h>
|
||||||
|
|
||||||
|
#include <QtGui/QTableWidgetItem>
|
||||||
|
|
||||||
|
namespace Qt4ProjectManager {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
MaemoProFilesUpdateDialog::MaemoProFilesUpdateDialog(const QList<MaemoDeployableListModel *> &models,
|
||||||
|
QWidget *parent)
|
||||||
|
: QDialog(parent),
|
||||||
|
m_models(models),
|
||||||
|
ui(new Ui::MaemoProFilesUpdateDialog)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
ui->tableWidget->setRowCount(models.count());
|
||||||
|
ui->tableWidget->setHorizontalHeaderItem(0,
|
||||||
|
new QTableWidgetItem(tr("Updateable Project Files")));
|
||||||
|
for (int row = 0; row < models.count(); ++row) {
|
||||||
|
QTableWidgetItem *const item
|
||||||
|
= new QTableWidgetItem(models.at(row)->proFileNode()->path());
|
||||||
|
item->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
|
||||||
|
item->setCheckState(Qt::Unchecked);
|
||||||
|
ui->tableWidget->setItem(row, 0, item);
|
||||||
|
}
|
||||||
|
ui->tableWidget->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
|
||||||
|
ui->tableWidget->resizeRowsToContents();
|
||||||
|
connect(ui->checkAllButton, SIGNAL(clicked()), this, SLOT(checkAll()));
|
||||||
|
connect(ui->uncheckAllButton, SIGNAL(clicked()), this, SLOT(uncheckAll()));
|
||||||
|
}
|
||||||
|
|
||||||
|
MaemoProFilesUpdateDialog::~MaemoProFilesUpdateDialog()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaemoProFilesUpdateDialog::checkAll()
|
||||||
|
{
|
||||||
|
setCheckStateForAll(Qt::Checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaemoProFilesUpdateDialog::uncheckAll()
|
||||||
|
{
|
||||||
|
setCheckStateForAll(Qt::Unchecked);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaemoProFilesUpdateDialog::setCheckStateForAll(Qt::CheckState checkState)
|
||||||
|
{
|
||||||
|
for (int row = 0; row < ui->tableWidget->rowCount(); ++row) {
|
||||||
|
ui->tableWidget->item(row, 0)->setCheckState(checkState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<MaemoProFilesUpdateDialog::UpdateSetting>
|
||||||
|
MaemoProFilesUpdateDialog::getUpdateSettings() const
|
||||||
|
{
|
||||||
|
QList<UpdateSetting> settings;
|
||||||
|
for (int row = 0; row < m_models.count(); ++row) {
|
||||||
|
const bool doUpdate = result() != Rejected
|
||||||
|
&& ui->tableWidget->item(row, 0)->checkState() == Qt::Checked;
|
||||||
|
settings << UpdateSetting(m_models.at(row), doUpdate);
|
||||||
|
}
|
||||||
|
return settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Qt4ProjectManager
|
||||||
|
} // namespace Internal
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
/**************************************************************************
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
**
|
||||||
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||||
|
**
|
||||||
|
** Commercial Usage
|
||||||
|
**
|
||||||
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||||
|
** accordance with the Qt Commercial License Agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
** 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.
|
||||||
|
**
|
||||||
|
** If you are unsure which license is appropriate for your use, please
|
||||||
|
** contact the sales department at http://qt.nokia.com/contact.
|
||||||
|
**
|
||||||
|
**************************************************************************/
|
||||||
|
#ifndef MAEMOPROFILESUPDATEDIALOG_H
|
||||||
|
#define MAEMOPROFILESUPDATEDIALOG_H
|
||||||
|
|
||||||
|
#include <QtCore/QList>
|
||||||
|
#include <QtCore/QPair>
|
||||||
|
#include <QtCore/QString>
|
||||||
|
#include <QtGui/QDialog>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
namespace Ui {
|
||||||
|
class MaemoProFilesUpdateDialog;
|
||||||
|
}
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
namespace Qt4ProjectManager {
|
||||||
|
namespace Internal {
|
||||||
|
class MaemoDeployableListModel;
|
||||||
|
|
||||||
|
class MaemoProFilesUpdateDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
typedef QPair<MaemoDeployableListModel *, bool> UpdateSetting;
|
||||||
|
|
||||||
|
explicit MaemoProFilesUpdateDialog(const QList<MaemoDeployableListModel *> &models,
|
||||||
|
QWidget *parent = 0);
|
||||||
|
~MaemoProFilesUpdateDialog();
|
||||||
|
QList<UpdateSetting> getUpdateSettings() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Q_SLOT void checkAll();
|
||||||
|
Q_SLOT void uncheckAll();
|
||||||
|
void setCheckStateForAll(Qt::CheckState checkState);
|
||||||
|
|
||||||
|
const QList<MaemoDeployableListModel *> m_models;
|
||||||
|
Ui::MaemoProFilesUpdateDialog *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Qt4ProjectManager
|
||||||
|
} // namespace Internal
|
||||||
|
|
||||||
|
#endif // MAEMOPROFILESUPDATEDIALOG_H
|
||||||
@@ -0,0 +1,139 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>MaemoProFilesUpdateDialog</class>
|
||||||
|
<widget class="QDialog" name="MaemoProFilesUpdateDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>659</width>
|
||||||
|
<height>494</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Maemo Deployment Issue</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="infoLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>The project files listed below do not contain Maemo deployment information, which means the respective targets cannot be deployed to and/or run on a device. Qt Creator can add the missing information to these files. </string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="checkAllButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Check all</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="uncheckAllButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Uncheck All</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>
|
||||||
|
<widget class="Line" name="line_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QTableWidget" name="tableWidget">
|
||||||
|
<property name="showGrid">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="columnCount">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<attribute name="horizontalHeaderDefaultSectionSize">
|
||||||
|
<number>200</number>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="horizontalHeaderStretchLastSection">
|
||||||
|
<bool>true</bool>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="verticalHeaderVisible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
<column/>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="Line" name="line">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>MaemoProFilesUpdateDialog</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>248</x>
|
||||||
|
<y>254</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>157</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>rejected()</signal>
|
||||||
|
<receiver>MaemoProFilesUpdateDialog</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>316</x>
|
||||||
|
<y>260</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>286</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
||||||
@@ -222,6 +222,8 @@ QString MaemoProFileWrapper::absFilePath(const QString &relFilePath) const
|
|||||||
|
|
||||||
void MaemoProFileWrapper::parseProFile(ParseType type) const
|
void MaemoProFileWrapper::parseProFile(ParseType type) const
|
||||||
{
|
{
|
||||||
|
if (m_proFileReader)
|
||||||
|
m_proFile->deref();
|
||||||
m_proFileReader.reset(new ProFileReader(m_proFileOption.data()));
|
m_proFileReader.reset(new ProFileReader(m_proFileOption.data()));
|
||||||
m_proFileReader->setOutputDir(m_buildDir);
|
m_proFileReader->setOutputDir(m_buildDir);
|
||||||
m_proFileReader->setCumulative(false);
|
m_proFileReader->setCumulative(false);
|
||||||
@@ -241,7 +243,6 @@ void MaemoProFileWrapper::parseProFile(ParseType type) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_proFileReader->accept(m_proFile);
|
m_proFileReader->accept(m_proFile);
|
||||||
m_proFile->deref();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MaemoProFileWrapper::writeProFileContents()
|
bool MaemoProFileWrapper::writeProFileContents()
|
||||||
|
|||||||
@@ -402,9 +402,9 @@ void MaemoTemplatesManager::handleProFileUpdated()
|
|||||||
= qobject_cast<MaemoDeployables *>(sender());
|
= qobject_cast<MaemoDeployables *>(sender());
|
||||||
if (!deployables)
|
if (!deployables)
|
||||||
return;
|
return;
|
||||||
const Target * const target = deployables->buildStep()->target();
|
// const Target * const target = deployables->buildStep()->target();
|
||||||
if (m_maemoProjects.contains(target->project()))
|
// if (m_maemoProjects.contains(target->project()))
|
||||||
updateDesktopFiles(qobject_cast<const Qt4Target *>(target));
|
// updateDesktopFiles(qobject_cast<const Qt4Target *>(target));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoTemplatesManager::version(const Project *project,
|
QString MaemoTemplatesManager::version(const Project *project,
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ HEADERS += \
|
|||||||
$$PWD/maemodeviceenvreader.h \
|
$$PWD/maemodeviceenvreader.h \
|
||||||
$$PWD/maemotemplatesmanager.h \
|
$$PWD/maemotemplatesmanager.h \
|
||||||
$$PWD/maemomountspecification.h \
|
$$PWD/maemomountspecification.h \
|
||||||
$$PWD/maemoremotemounter.h
|
$$PWD/maemoremotemounter.h \
|
||||||
|
$$PWD/maemoprofilesupdatedialog.h
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$PWD/maemoconfigtestdialog.cpp \
|
$$PWD/maemoconfigtestdialog.cpp \
|
||||||
@@ -64,7 +65,8 @@ SOURCES += \
|
|||||||
$$PWD/maemodeviceenvreader.cpp \
|
$$PWD/maemodeviceenvreader.cpp \
|
||||||
$$PWD/maemotemplatesmanager.cpp \
|
$$PWD/maemotemplatesmanager.cpp \
|
||||||
$$PWD/maemomountspecification.cpp \
|
$$PWD/maemomountspecification.cpp \
|
||||||
$$PWD/maemoremotemounter.cpp
|
$$PWD/maemoremotemounter.cpp \
|
||||||
|
$$PWD/maemoprofilesupdatedialog.cpp
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
$$PWD/maemoconfigtestdialog.ui \
|
$$PWD/maemoconfigtestdialog.ui \
|
||||||
@@ -72,6 +74,7 @@ FORMS += \
|
|||||||
$$PWD/maemosshconfigdialog.ui \
|
$$PWD/maemosshconfigdialog.ui \
|
||||||
$$PWD/maemopackagecreationwidget.ui \
|
$$PWD/maemopackagecreationwidget.ui \
|
||||||
$$PWD/maemodeployablelistwidget.ui \
|
$$PWD/maemodeployablelistwidget.ui \
|
||||||
$$PWD/maemodeploystepwidget.ui
|
$$PWD/maemodeploystepwidget.ui \
|
||||||
|
$$PWD/maemoprofilesupdatedialog.ui
|
||||||
|
|
||||||
RESOURCES += $$PWD/qt-maemo.qrc
|
RESOURCES += $$PWD/qt-maemo.qrc
|
||||||
|
|||||||
Reference in New Issue
Block a user