diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c046d472c07811965114e0daa8b52fe934be76bf --- /dev/null +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp @@ -0,0 +1,40 @@ +#include "maemodeploystep.h" + +#include "maemodeploystepwidget.h" + +using namespace ProjectExplorer; + +namespace Qt4ProjectManager { +namespace Internal { + +const QLatin1String MaemoDeployStep::Id("Qt4ProjectManager.MaemoDeployStep"); + + +MaemoDeployStep::MaemoDeployStep(ProjectExplorer::BuildConfiguration *bc) + : BuildStep(bc, Id) +{ +} + +MaemoDeployStep::MaemoDeployStep(ProjectExplorer::BuildConfiguration *bc, + MaemoDeployStep *other) + : BuildStep(bc, other) +{ +} + +bool MaemoDeployStep::init() +{ + return true; +} + +void MaemoDeployStep::run(QFutureInterface<bool> &fi) +{ + fi.reportResult(true); +} + +BuildStepConfigWidget *MaemoDeployStep::createConfigWidget() +{ + return new MaemoDeployStepWidget; +} + +} // namespace Internal +} // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.h b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.h new file mode 100644 index 0000000000000000000000000000000000000000..24d4e6c12940156db2ca5de19caccf84177f80d4 --- /dev/null +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.h @@ -0,0 +1,30 @@ +#ifndef MAEMODEPLOYSTEP_H +#define MAEMODEPLOYSTEP_H + +#include <projectexplorer/buildstep.h> + +namespace Qt4ProjectManager { +namespace Internal { + +class MaemoDeployStep : public ProjectExplorer::BuildStep +{ + Q_OBJECT + friend class MaemoDeployStepFactory; +public: + MaemoDeployStep(ProjectExplorer::BuildConfiguration *bc); + +private: + MaemoDeployStep(ProjectExplorer::BuildConfiguration *bc, + MaemoDeployStep *other); + virtual bool init(); + virtual void run(QFutureInterface<bool> &fi); + virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget(); + virtual bool immutable() const { return true; } + + static const QLatin1String Id; +}; + +} // namespace Internal +} // namespace Qt4ProjectManager + +#endif // MAEMODEPLOYSTEP_H diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeploystepfactory.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystepfactory.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2d1e712e1a84fb2445a55a773fdb306660a286c9 --- /dev/null +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystepfactory.cpp @@ -0,0 +1,82 @@ +#include "maemodeploystepfactory.h" + +#include "maemodeploystep.h" + +#include <projectexplorer/buildconfiguration.h> +#include <projectexplorer/target.h> +#include <qt4projectmanager/qt4projectmanagerconstants.h> + +using namespace ProjectExplorer; + +namespace Qt4ProjectManager { +namespace Internal { + +MaemoDeployStepFactory::MaemoDeployStepFactory(QObject *parent) + : IBuildStepFactory(parent) +{ +} + +QStringList MaemoDeployStepFactory::availableCreationIds(BuildConfiguration *, + BuildStep::Type) const +{ + return QStringList(); +} + +QString MaemoDeployStepFactory::displayNameForId(const QString &) const +{ + return QString(); +} + +bool MaemoDeployStepFactory::canCreate(BuildConfiguration *, + BuildStep::Type, const QString &) const +{ + return false; +} + +BuildStep *MaemoDeployStepFactory::create(BuildConfiguration *, + BuildStep::Type, const QString &) +{ + Q_ASSERT(false); + return 0; +} + +bool MaemoDeployStepFactory::canRestore(BuildConfiguration *parent, + BuildStep::Type type, const QVariantMap &map) const +{ + return canCreateInternally(parent, type, idFromMap(map)); +} + +BuildStep *MaemoDeployStepFactory::restore(BuildConfiguration *parent, + BuildStep::Type type, const QVariantMap &map) +{ + Q_ASSERT(canRestore(parent, type, map)); + MaemoDeployStep * const step = new MaemoDeployStep(parent); + if (!step->fromMap(map)) { + delete step; + return 0; + } + return step; +} + +bool MaemoDeployStepFactory::canClone(BuildConfiguration *parent, + BuildStep::Type type, BuildStep *product) const +{ + return canCreateInternally(parent, type, product->id()); +} + +BuildStep *MaemoDeployStepFactory::clone(BuildConfiguration *parent, + BuildStep::Type type, BuildStep *product) +{ + Q_ASSERT(canClone(parent, type, product)); + return new MaemoDeployStep(parent, static_cast<MaemoDeployStep*>(product)); +} + +bool MaemoDeployStepFactory::canCreateInternally(BuildConfiguration *parent, + BuildStep::Type type, const QString &id) const +{ + return type == BuildStep::Deploy && id == MaemoDeployStep::Id + && parent->target()->id() == Constants::MAEMO_DEVICE_TARGET_ID; +} + +} // namespace Internal +} // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeploystepfactory.h b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystepfactory.h new file mode 100644 index 0000000000000000000000000000000000000000..0516578673e66a0da19143a9295410b9a29a7928 --- /dev/null +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystepfactory.h @@ -0,0 +1,49 @@ +#ifndef MAEMODEPLOYSTEPFACTORY_H +#define MAEMODEPLOYSTEPFACTORY_H + +#include <projectexplorer/buildstep.h> + +namespace Qt4ProjectManager { +namespace Internal { + +class MaemoDeployStepFactory : public ProjectExplorer::IBuildStepFactory +{ +public: + MaemoDeployStepFactory(QObject *parent); + + virtual QStringList availableCreationIds(ProjectExplorer::BuildConfiguration *parent, + ProjectExplorer::BuildStep::Type type) const; + virtual QString displayNameForId(const QString &id) const; + + virtual bool canCreate(ProjectExplorer::BuildConfiguration *parent, + ProjectExplorer::BuildStep::Type type, + const QString &id) const; + virtual ProjectExplorer::BuildStep * + create(ProjectExplorer::BuildConfiguration *parent, + ProjectExplorer::BuildStep::Type type, const QString &id); + + virtual bool canRestore(ProjectExplorer::BuildConfiguration *parent, + ProjectExplorer::BuildStep::Type type, + const QVariantMap &map) const; + virtual ProjectExplorer::BuildStep * + restore(ProjectExplorer::BuildConfiguration *parent, + ProjectExplorer::BuildStep::Type type, const QVariantMap &map); + + virtual bool canClone(ProjectExplorer::BuildConfiguration *parent, + ProjectExplorer::BuildStep::Type type, + ProjectExplorer::BuildStep *product) const; + virtual ProjectExplorer::BuildStep * + clone(ProjectExplorer::BuildConfiguration *parent, + ProjectExplorer::BuildStep::Type type, + ProjectExplorer::BuildStep *product); + +private: + bool canCreateInternally(ProjectExplorer::BuildConfiguration *parent, + ProjectExplorer::BuildStep::Type type, + const QString &id) const; +}; + +} // namespace Internal +} // namespace Qt4ProjectManager + +#endif // MAEMODEPLOYSTEPFACTORY_H diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeploystepwidget.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystepwidget.cpp new file mode 100644 index 0000000000000000000000000000000000000000..70569eef479591a5f8163483bc17643f1f7dad58 --- /dev/null +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystepwidget.cpp @@ -0,0 +1,34 @@ +#include "maemodeploystepwidget.h" +#include "ui_maemodeploystepwidget.h" + +namespace Qt4ProjectManager { +namespace Internal { + +MaemoDeployStepWidget::MaemoDeployStepWidget() : + ProjectExplorer::BuildStepConfigWidget(), + ui(new Ui::MaemoDeployStepWidget) +{ + ui->setupUi(this); +} + +MaemoDeployStepWidget::~MaemoDeployStepWidget() +{ + delete ui; +} + +void MaemoDeployStepWidget::init() +{ +} + +QString MaemoDeployStepWidget::summaryText() const +{ + return tr("<b>Deploy to device</b> "); +} + +QString MaemoDeployStepWidget::displayName() const +{ + return QString(); +} + +} // namespace Internal +} // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeploystepwidget.h b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystepwidget.h new file mode 100644 index 0000000000000000000000000000000000000000..85342b630b867179e900aed9aad3cf5d2a4308ad --- /dev/null +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystepwidget.h @@ -0,0 +1,34 @@ +#ifndef MAEMODEPLOYSTEPWIDGET_H +#define MAEMODEPLOYSTEPWIDGET_H + +#include <projectexplorer/buildstep.h> + +QT_BEGIN_NAMESPACE +namespace Ui { + class MaemoDeployStepWidget; +} +QT_END_NAMESPACE + +namespace Qt4ProjectManager { +namespace Internal { + +class MaemoDeployStepWidget : public ProjectExplorer::BuildStepConfigWidget +{ + Q_OBJECT + +public: + MaemoDeployStepWidget(); + ~MaemoDeployStepWidget(); + +private: + virtual void init(); + virtual QString summaryText() const; + virtual QString displayName() const; + + Ui::MaemoDeployStepWidget *ui; +}; + +} // namespace Internal +} // namespace Qt4ProjectManager + +#endif // MAEMODEPLOYSTEPWIDGET_H diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeploystepwidget.ui b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystepwidget.ui new file mode 100644 index 0000000000000000000000000000000000000000..3732f48c43b470336948e251cb819dcfce759b35 --- /dev/null +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystepwidget.ui @@ -0,0 +1,21 @@ +<ui version="4.0"> + <author/> + <comment/> + <exportmacro/> + <class>MaemoDeployStepWidget</class> + <widget class="QWidget" name="MaemoDeployStepWidget"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + </widget> + <pixmapfunction/> + <connections/> +</ui> diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemomanager.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemomanager.cpp index 60f6a80fb5f23a698b5c5eac2208c29812c4c268..eb36e1f79f7c40bfaa20a37b41597437ec9d6135 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemomanager.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemomanager.cpp @@ -30,6 +30,7 @@ #include "maemomanager.h" #include "maemoconstants.h" +#include "maemodeploystepfactory.h" #include "maemodeviceconfigurations.h" #include "maemopackagecreationfactory.h" #include "maemorunfactories.h" @@ -57,6 +58,7 @@ MaemoManager::MaemoManager() , m_runControlFactory(new MaemoRunControlFactory(this)) , m_runConfigurationFactory(new MaemoRunConfigurationFactory(this)) , m_packageCreationFactory(new MaemoPackageCreationFactory(this)) + , m_deployStepFactory(new MaemoDeployStepFactory(this)) , m_settingsPage(new MaemoSettingsPage(this)) { Q_ASSERT(!m_instance); @@ -69,6 +71,7 @@ MaemoManager::MaemoManager() pluginManager->addObject(m_runControlFactory); pluginManager->addObject(m_runConfigurationFactory); pluginManager->addObject(m_packageCreationFactory); + pluginManager->addObject(m_deployStepFactory); pluginManager->addObject(m_settingsPage); } @@ -77,6 +80,7 @@ MaemoManager::~MaemoManager() PluginManager *pluginManager = PluginManager::instance(); pluginManager->removeObject(m_runControlFactory); pluginManager->removeObject(m_runConfigurationFactory); + pluginManager->removeObject(m_deployStepFactory); pluginManager->removeObject(m_packageCreationFactory); pluginManager->removeObject(m_settingsPage); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemomanager.h b/src/plugins/qt4projectmanager/qt-maemo/maemomanager.h index 689fbfa27ffa8f7a3882d0cc8739263cff4c596b..865098d0f305edb88719ffa9a7f6a65a830fd414 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemomanager.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemomanager.h @@ -41,6 +41,7 @@ namespace Qt4ProjectManager { class QtVersion; namespace Internal { +class MaemoDeployStepFactory; class MaemoPackageCreationFactory; class MaemoRunControlFactory; class MaemoRunConfigurationFactory; @@ -67,6 +68,7 @@ private: MaemoRunControlFactory *m_runControlFactory; MaemoRunConfigurationFactory *m_runConfigurationFactory; MaemoPackageCreationFactory *m_packageCreationFactory; + MaemoDeployStepFactory *m_deployStepFactory; MaemoSettingsPage *m_settingsPage; QemuRuntimeManager *m_qemuRuntimeManager; }; diff --git a/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri b/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri index 30633dd68ddcdcce6c7f479e0274cf05c672e110..5d3c84c130867b3f8109cdf7fbb11dd5ced4409c 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri +++ b/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri @@ -19,7 +19,10 @@ HEADERS += \ $$PWD/profilewrapper.h \ $$PWD/maemodeployables.h \ $$PWD/maemodeployable.h \ - $$PWD/maemodeployablelistwidget.h + $$PWD/maemodeployablelistwidget.h \ + $$PWD/maemodeploystep.h \ + $$PWD/maemodeploystepwidget.h \ + $$PWD/maemodeploystepfactory.h SOURCES += \ $$PWD/maemoconfigtestdialog.cpp \ @@ -40,13 +43,17 @@ SOURCES += \ $$PWD/qemuruntimemanager.cpp \ $$PWD/profilewrapper.cpp \ $$PWD/maemodeployables.cpp \ - $$PWD/maemodeployablelistwidget.cpp + $$PWD/maemodeployablelistwidget.cpp \ + $$PWD/maemodeploystep.cpp \ + $$PWD/maemodeploystepwidget.cpp \ + $$PWD/maemodeploystepfactory.cpp FORMS += \ $$PWD/maemoconfigtestdialog.ui \ $$PWD/maemosettingswidget.ui \ $$PWD/maemosshconfigdialog.ui \ $$PWD/maemopackagecreationwidget.ui \ - $$PWD/maemodeployablelistwidget.ui + $$PWD/maemodeployablelistwidget.ui \ + qt-maemo/maemodeploystepwidget.ui RESOURCES += $$PWD/qt-maemo.qrc diff --git a/src/plugins/qt4projectmanager/qt4target.cpp b/src/plugins/qt4projectmanager/qt4target.cpp index 198e2e7eff276786aa2d4e955f6df9dccb1a9074..e63228fbc87247643fd5b59b4bcea0aca1e7c3d9 100644 --- a/src/plugins/qt4projectmanager/qt4target.cpp +++ b/src/plugins/qt4projectmanager/qt4target.cpp @@ -35,6 +35,7 @@ #include "qt4project.h" #include "qt4runconfiguration.h" #include "qt4projectmanagerconstants.h" +#include "qt-maemo/maemodeploystep.h" #include "qt-maemo/maemopackagecreationstep.h" #include "qt-maemo/maemorunconfiguration.h" #include "qt-s60/s60devicerunconfiguration.h" @@ -285,7 +286,10 @@ Qt4BuildConfiguration *Qt4Target::addQt4BuildConfiguration(QString displayName, S60CreatePackageStep *packageStep = new S60CreatePackageStep(bc); bc->insertStep(ProjectExplorer::BuildStep::Deploy, 2, packageStep); } else if (id() == Constants::MAEMO_DEVICE_TARGET_ID) { - bc->insertStep(ProjectExplorer::BuildStep::Deploy, 2, new MaemoPackageCreationStep(bc)); + bc->insertStep(ProjectExplorer::BuildStep::Deploy, 2, + new MaemoPackageCreationStep(bc)); +// bc->insertStep(ProjectExplorer::BuildStep::Deploy, 2, +// new MaemoDeployStep(bc)); } MakeStep* cleanStep = new MakeStep(bc);