Commit 6fc00ddc authored by ck's avatar ck
Browse files

Maemo: Introduce deploy step infrastructure.

Doesn't do anything yet.
parent f823c481
#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
#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
#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
#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
#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
#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
<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>
......@@ -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);
......
......@@ -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;
};
......
......@@ -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
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment