Commit 7365be7c authored by Kai Koehne's avatar Kai Koehne
Browse files

MobileWizard: Export library symbols to allow wizards in external plugins

Qt components want to provide Qt Quick Application wizards in their own
repos. Allow them to use the MobileAppWizard infrastructure.

Reviewed-by: Alessandro Portale
parent e00d6c1a
......@@ -38,9 +38,9 @@
namespace Qt4ProjectManager {
class Qt4Project;
class TargetSetupPage;
namespace Internal {
class TargetSetupPage;
class ProjectLoadWizard : public QWizard
{
......
......@@ -43,7 +43,6 @@
#endif // CREATORLESSTEST
namespace Qt4ProjectManager {
namespace Internal {
AbstractGeneratedFileInfo::AbstractGeneratedFileInfo()
: fileType(ExtendedFile)
......@@ -474,5 +473,4 @@ void AbstractMobileApp::insertParameter(QString &line, const QString &parameter)
QLatin1Char('(') + parameter + QLatin1Char(')'));
}
} // namespace Internal
} // namespace Qt4ProjectManager
......@@ -34,6 +34,7 @@
#ifndef ABSTRACTMOBILEAPP_H
#define ABSTRACTMOBILEAPP_H
#include "../qt4projectmanager_global.h"
#include <QtCore/QFileInfo>
#include <QtCore/QPair>
......@@ -44,9 +45,9 @@
QT_FORWARD_DECLARE_CLASS(QTextStream)
namespace Qt4ProjectManager {
namespace Internal {
struct AbstractGeneratedFileInfo
/// \internal
struct QT4PROJECTMANAGER_EXPORT AbstractGeneratedFileInfo
{
enum FileType {
MainCppFile,
......@@ -70,7 +71,8 @@ struct AbstractGeneratedFileInfo
typedef QPair<QString, QString> DeploymentFolder; // QPair<.source, .target>
class AbstractMobileApp : public QObject
/// \internal
class QT4PROJECTMANAGER_EXPORT AbstractMobileApp : public QObject
{
Q_OBJECT
......@@ -177,7 +179,6 @@ private:
bool m_networkEnabled;
};
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // ABSTRACTMOBILEAPP_H
......@@ -48,7 +48,6 @@
#include <QtGui/QIcon>
namespace Qt4ProjectManager {
namespace Internal {
AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent)
: ProjectExplorer::BaseProjectWizardDialog(parent)
......@@ -58,13 +57,13 @@ AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent)
m_targetsPage->setMinimumQtVersion(QtVersionNumber(4,7,0));
resize(900, 450);
m_targetsPageId = addPageWithTitle(m_targetsPage, tr("Qt Versions"));
m_genericOptionsPage = new MobileAppWizardGenericOptionsPage;
m_genericOptionsPage = new Internal::MobileAppWizardGenericOptionsPage;
m_genericOptionsPageId = addPageWithTitle(m_genericOptionsPage,
tr("Mobile Options"));
m_symbianOptionsPage = new MobileAppWizardSymbianOptionsPage;
m_symbianOptionsPage = new Internal::MobileAppWizardSymbianOptionsPage;
m_symbianOptionsPageId = addPageWithTitle(m_symbianOptionsPage,
QLatin1String(" ") + tr("Symbian Specific"));
m_maemoOptionsPage = new MobileAppWizardMaemoOptionsPage;
m_maemoOptionsPage = new Internal::MobileAppWizardMaemoOptionsPage;
m_maemoOptionsPageId = addPageWithTitle(m_maemoOptionsPage,
QLatin1String(" ") + tr("Maemo Specific"));
......@@ -78,6 +77,11 @@ AbstractMobileAppWizardDialog::AbstractMobileAppWizardDialog(QWidget *parent)
m_symbianItem->setNextShownItem(0);
}
TargetSetupPage *AbstractMobileAppWizardDialog::targetsPage() const
{
return m_targetsPage;
}
int AbstractMobileAppWizardDialog::addPageWithTitle(QWizardPage *page, const QString &title)
{
const int pageId = addPage(page);
......@@ -250,5 +254,4 @@ void AbstractMobileAppWizard::useProjectPath(const QString &projectName,
projectPathChanged(app()->path(AbstractMobileApp::AppPro));
}
} // namespace Internal
} // namespace Qt4ProjectManager
......@@ -34,28 +34,31 @@
#ifndef ABSTRACTMOBILEAPPWIZARD_H
#define ABSTRACTMOBILEAPPWIZARD_H
#include <qt4projectmanager/qt4projectmanager_global.h>
#include <coreplugin/basefilewizard.h>
#include <projectexplorer/baseprojectwizarddialog.h>
namespace Qt4ProjectManager {
namespace Internal {
class AbstractMobileApp;
class TargetSetupPage;
namespace Internal {
class MobileAppWizardGenericOptionsPage;
class MobileAppWizardSymbianOptionsPage;
class MobileAppWizardMaemoOptionsPage;
}
class AbstractMobileAppWizardDialog : public ProjectExplorer::BaseProjectWizardDialog
/// \internal
class QT4PROJECTMANAGER_EXPORT AbstractMobileAppWizardDialog : public ProjectExplorer::BaseProjectWizardDialog
{
Q_OBJECT
protected:
explicit AbstractMobileAppWizardDialog(QWidget *parent = 0);
public:
MobileAppWizardGenericOptionsPage *m_genericOptionsPage;
MobileAppWizardSymbianOptionsPage *m_symbianOptionsPage;
MobileAppWizardMaemoOptionsPage *m_maemoOptionsPage;
class TargetSetupPage *m_targetsPage;
TargetSetupPage *targetsPage() const;
protected:
int addPageWithTitle(QWizardPage *page, const QString &title);
......@@ -63,11 +66,17 @@ protected:
virtual void cleanupPage(int id);
private:
virtual int nextId() const;
int idOfNextGenericPage() const;
Utils::WizardProgressItem *itemOfNextGenericPage() const;
Internal::MobileAppWizardGenericOptionsPage *m_genericOptionsPage;
Internal::MobileAppWizardSymbianOptionsPage *m_symbianOptionsPage;
Internal::MobileAppWizardMaemoOptionsPage *m_maemoOptionsPage;
TargetSetupPage *m_targetsPage;
int m_genericOptionsPageId;
int m_symbianOptionsPageId;
int m_maemoOptionsPageId;
......@@ -76,9 +85,12 @@ private:
Utils::WizardProgressItem *m_genericItem;
Utils::WizardProgressItem *m_symbianItem;
Utils::WizardProgressItem *m_maemoItem;
friend class AbstractMobileAppWizard;
};
class AbstractMobileAppWizard : public Core::BaseFileWizard
/// \internal
class QT4PROJECTMANAGER_EXPORT AbstractMobileAppWizard : public Core::BaseFileWizard
{
Q_OBJECT
protected:
......@@ -107,7 +119,6 @@ private:
QString *errorMessage) const=0;
};
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // ABSTRACTMOBILEAPPWIZARD_H
......@@ -117,7 +117,7 @@ AbstractMobileAppWizardDialog *Html5AppWizard::createWizardDialogInternal(QWidge
void Html5AppWizard::projectPathChanged(const QString &path) const
{
m_d->wizardDialog->m_targetsPage->setProFilePath(path);
m_d->wizardDialog->targetsPage()->setProFilePath(path);
}
void Html5AppWizard::prepareGenerateFiles(const QWizard *w,
......
......@@ -105,13 +105,13 @@ Core::BaseFileWizardParameters MobileAppWizard::parameters()
AbstractMobileAppWizardDialog *MobileAppWizard::createWizardDialogInternal(QWidget *parent) const
{
m_d->wizardDialog = new MobileAppWizardDialog(parent);
m_d->wizardDialog->m_targetsPage->setPreferMobile(true);
m_d->wizardDialog->targetsPage()->setPreferMobile(true);
return m_d->wizardDialog;
}
void MobileAppWizard::projectPathChanged(const QString &path) const
{
m_d->wizardDialog->m_targetsPage->setProFilePath(path);
m_d->wizardDialog->targetsPage()->setProFilePath(path);
}
void MobileAppWizard::prepareGenerateFiles(const QWizard *w,
......
......@@ -117,7 +117,7 @@ AbstractMobileAppWizardDialog *QtQuickAppWizard::createWizardDialogInternal(QWid
void QtQuickAppWizard::projectPathChanged(const QString &path) const
{
m_d->wizardDialog->m_targetsPage->setProFilePath(path);
m_d->wizardDialog->targetsPage()->setProFilePath(path);
}
void QtQuickAppWizard::prepareGenerateFiles(const QWizard *w,
......
......@@ -45,11 +45,11 @@
namespace Qt4ProjectManager {
class Qt4Project;
class TargetSetupPage;
namespace Internal {
class ModulesPage;
class TargetSetupPage;
/* Base class for wizard creating Qt projects using QtProjectParameters.
* To implement a project wizard, overwrite:
......
......@@ -51,14 +51,13 @@
#include <QtGui/QLayout>
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
TargetSetupPage::TargetSetupPage(QWidget *parent) :
QWizardPage(parent),
m_preferMobile(false),
m_importSearch(false),
m_spacer(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)),
m_ui(new Ui::TargetSetupPage)
m_ui(new Internal::Ui::TargetSetupPage)
{
m_ui->setupUi(this);
QWidget *centralWidget = new QWidget(this);
......
......@@ -34,8 +34,9 @@
#ifndef TARGETSETUPPAGE_H
#define TARGETSETUPPAGE_H
#include "qt4target.h"
#include "qtversionmanager.h"
#include <qt4target.h>
#include <qtversionmanager.h>
#include <qt4projectmanager_global.h>
#include <QtCore/QString>
#include <QtGui/QWizard>
......@@ -55,12 +56,13 @@ namespace Qt4ProjectManager {
class Qt4Project;
namespace Internal {
namespace Ui {
class TargetSetupPage;
}
}
class TargetSetupPage : public QWizardPage
/// \internal
class QT4PROJECTMANAGER_EXPORT TargetSetupPage : public QWizardPage
{
Q_OBJECT
......@@ -105,11 +107,10 @@ private:
QVBoxLayout *m_layout;
QSpacerItem *m_spacer;
Ui::TargetSetupPage *m_ui;
Internal::Ui::TargetSetupPage *m_ui;
QList<BuildConfigurationInfo> m_importInfos;
};
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // TARGETSETUPPAGE_H
......@@ -35,6 +35,7 @@
#include "html5app.h"
#include <QtCore>
using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
static bool writeFile(const QByteArray &data, const QString &targetFile)
......
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