OSDN Git Service

MobileWizard: Export library symbols to allow wizards in external plugins
authorKai Koehne <kai.koehne@nokia.com>
Tue, 15 Mar 2011 12:34:44 +0000 (13:34 +0100)
committerKai Koehne <kai.koehne@nokia.com>
Wed, 16 Mar 2011 14:29:05 +0000 (15:29 +0100)
Qt components want to provide Qt Quick Application wizards in their own
repos. Allow them to use the MobileAppWizard infrastructure.

Reviewed-by: Alessandro Portale
12 files changed:
src/plugins/qt4projectmanager/projectloadwizard.h
src/plugins/qt4projectmanager/wizards/abstractmobileapp.cpp
src/plugins/qt4projectmanager/wizards/abstractmobileapp.h
src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.cpp
src/plugins/qt4projectmanager/wizards/abstractmobileappwizard.h
src/plugins/qt4projectmanager/wizards/html5appwizard.cpp
src/plugins/qt4projectmanager/wizards/mobileappwizard.cpp
src/plugins/qt4projectmanager/wizards/qtquickappwizard.cpp
src/plugins/qt4projectmanager/wizards/qtwizard.h
src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp
src/plugins/qt4projectmanager/wizards/targetsetuppage.h
tests/manual/appwizards/helpers.cpp

index d4bcb43..518f6b0 100644 (file)
@@ -38,9 +38,9 @@
 
 namespace Qt4ProjectManager {
 class Qt4Project;
+class TargetSetupPage;
 
 namespace Internal {
-class TargetSetupPage;
 
 class ProjectLoadWizard : public QWizard
 {
index ee80ca9..a7bc867 100644 (file)
@@ -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
index 1d32eba..b0fcf16 100644 (file)
@@ -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
index 4cb1a3c..d7b9a22 100644 (file)
@@ -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
index b0fd8b4..ebf8993 100644 (file)
 #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
index 4952030..df30d22 100644 (file)
@@ -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,
index 5c3dcb5..7a3ff71 100644 (file)
@@ -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,
index 04204fc..5501ff1 100644 (file)
@@ -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,
index 0177b02..7231edd 100644 (file)
 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:
index 8e65aca..b5fcb31 100644 (file)
 #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);
index d36b8e3..bfec236 100644 (file)
@@ -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
index bb47098..1319531 100644 (file)
@@ -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)