forked from qt-creator/qt-creator
QtQuickApp wizard: Merge Components and Sources page
Change-Id: I48e5009f2f71562a700eabddf38e54c1d4a127c1 Reviewed-on: http://codereview.qt.nokia.com/913 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
This commit is contained in:
committed by
Alessandro Portale
parent
17c8833c05
commit
30ff312929
@@ -132,7 +132,6 @@ FORMS += makestep.ui \
|
||||
librarydetailswidget.ui \
|
||||
wizards/testwizardpage.ui \
|
||||
wizards/targetsetuppage.ui \
|
||||
wizards/qtquickappwizardsourcespage.ui \
|
||||
wizards/html5appwizardsourcespage.ui \
|
||||
wizards/mobilelibrarywizardoptionpage.ui \
|
||||
wizards/mobileappwizardgenericoptionspage.ui \
|
||||
|
@@ -57,7 +57,6 @@ protected:
|
||||
bool validateCurrentPage();
|
||||
|
||||
private:
|
||||
class QtQuickAppWizardSourcesPage *m_qmlSourcesPage;
|
||||
class QtQuickComponentSetOptionsPage *m_componentOptionsPage;
|
||||
int m_componentOptionsPageId;
|
||||
|
||||
@@ -68,22 +67,18 @@ private:
|
||||
|
||||
QtQuickAppWizardDialog::QtQuickAppWizardDialog(QWidget *parent)
|
||||
: AbstractMobileAppWizardDialog(parent, QtSupport::QtVersionNumber(4, 7, 1))
|
||||
, m_qmlSourcesPage(0)
|
||||
{
|
||||
setWindowTitle(tr("New Qt Quick Application"));
|
||||
setIntroDescription(tr("This wizard generates a Qt Quick application project."));
|
||||
|
||||
m_componentOptionsPage = new Internal::QtQuickComponentSetOptionsPage;
|
||||
m_componentOptionsPageId = addPageWithTitle(m_componentOptionsPage, tr("Component Set"));
|
||||
m_componentOptionsPageId = addPageWithTitle(m_componentOptionsPage, tr("Application Type"));
|
||||
m_componentItem = wizardProgress()->item(m_componentOptionsPageId);
|
||||
|
||||
AbstractMobileAppWizardDialog::addMobilePages();
|
||||
|
||||
m_componentItem->setNextItems(QList<Utils::WizardProgressItem *>()
|
||||
<< targetsPageItem());
|
||||
|
||||
m_qmlSourcesPage = new QtQuickAppWizardSourcesPage;
|
||||
addPageWithTitle(m_qmlSourcesPage, tr("QML Sources"));
|
||||
}
|
||||
|
||||
bool QtQuickAppWizardDialog::validateCurrentPage()
|
||||
@@ -163,10 +158,10 @@ void QtQuickAppWizard::prepareGenerateFiles(const QWizard *w,
|
||||
{
|
||||
Q_UNUSED(errorMessage)
|
||||
const QtQuickAppWizardDialog *wizard = qobject_cast<const QtQuickAppWizardDialog*>(w);
|
||||
if (wizard->m_qmlSourcesPage->mainQmlMode() == QtQuickApp::ModeGenerate) {
|
||||
if (wizard->m_componentOptionsPage->mainQmlMode() == QtQuickApp::ModeGenerate) {
|
||||
m_d->app->setMainQml(QtQuickApp::ModeGenerate);
|
||||
} else {
|
||||
const QString mainQmlFile = wizard->m_qmlSourcesPage->mainQmlFile();
|
||||
const QString mainQmlFile = wizard->m_componentOptionsPage->mainQmlFile();
|
||||
m_d->app->setMainQml(QtQuickApp::ModeImport, mainQmlFile);
|
||||
}
|
||||
m_d->app->setComponentSet(wizard->m_componentOptionsPage->componentSet());
|
||||
|
@@ -32,7 +32,6 @@
|
||||
|
||||
#include "qtquickappwizardpages.h"
|
||||
#include "ui_qtquickcomponentsetoptionspage.h"
|
||||
#include "ui_qtquickappwizardsourcespage.h"
|
||||
#include <coreplugin/coreconstants.h>
|
||||
|
||||
#include <QtGui/QDesktopServices>
|
||||
@@ -43,28 +42,32 @@
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
|
||||
class QtQuickComponentSetOptionsPagePrivate
|
||||
{
|
||||
Ui::QtQuickComponentSetOptionsPage ui;
|
||||
friend class QtQuickComponentSetOptionsPage;
|
||||
};
|
||||
|
||||
class QtQuickAppWizardSourcesPagePrivate
|
||||
{
|
||||
Ui::QtQuickAppWizardSourcesPage ui;
|
||||
friend class QtQuickAppWizardSourcesPage;
|
||||
};
|
||||
|
||||
|
||||
QtQuickComponentSetOptionsPage::QtQuickComponentSetOptionsPage(QWidget *parent)
|
||||
: QWizardPage(parent)
|
||||
, m_d(new QtQuickComponentSetOptionsPagePrivate)
|
||||
{
|
||||
m_d->ui.setupUi(this);
|
||||
|
||||
m_d->ui.importLineEdit->setExpectedKind(Utils::PathChooser::File);
|
||||
m_d->ui.importLineEdit->setPromptDialogFilter(QLatin1String("*.qml"));
|
||||
m_d->ui.importLineEdit->setPromptDialogTitle(tr("Select QML File"));
|
||||
connect(m_d->ui.importLineEdit, SIGNAL(changed(QString)), SIGNAL(completeChanged()));
|
||||
connect(m_d->ui.importRadioButton,
|
||||
SIGNAL(toggled(bool)), SIGNAL(completeChanged()));
|
||||
|
||||
connect(m_d->ui.importRadioButton, SIGNAL(toggled(bool)),
|
||||
m_d->ui.importLineEdit, SLOT(setEnabled(bool)));
|
||||
|
||||
m_d->ui.buttonGroup->setId(m_d->ui.qtquick10RadioButton, 0);
|
||||
m_d->ui.buttonGroup->setId(m_d->ui.symbian10RadioButton, 1);
|
||||
m_d->ui.buttonGroup->setId(m_d->ui.meego10RadioButton, 2);
|
||||
m_d->ui.buttonGroup->setId(m_d->ui.importRadioButton, 3);
|
||||
connect(m_d->ui.buttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(radioButtonChecked(int)));
|
||||
}
|
||||
|
||||
@@ -98,40 +101,19 @@ void QtQuickComponentSetOptionsPage::radioButtonChecked(int index)
|
||||
m_d->ui.descriptionStackedWidget->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
QtQuickAppWizardSourcesPage::QtQuickAppWizardSourcesPage(QWidget *parent)
|
||||
: QWizardPage(parent)
|
||||
, m_d(new QtQuickAppWizardSourcesPagePrivate)
|
||||
QtQuickApp::Mode QtQuickComponentSetOptionsPage::mainQmlMode() const
|
||||
{
|
||||
m_d->ui.setupUi(this);
|
||||
m_d->ui.importLineEdit->setExpectedKind(Utils::PathChooser::File);
|
||||
m_d->ui.importLineEdit->setPromptDialogFilter(QLatin1String("*.qml"));
|
||||
m_d->ui.importLineEdit->setPromptDialogTitle(tr("Select QML File"));
|
||||
connect(m_d->ui.importLineEdit, SIGNAL(changed(QString)), SIGNAL(completeChanged()));
|
||||
connect(m_d->ui.importRadioButton,
|
||||
SIGNAL(toggled(bool)), SIGNAL(completeChanged()));
|
||||
connect(m_d->ui.generateRadioButton, SIGNAL(toggled(bool)),
|
||||
m_d->ui.importLineEdit, SLOT(setDisabled(bool)));
|
||||
m_d->ui.generateRadioButton->setChecked(true);
|
||||
return m_d->ui.importRadioButton->isChecked() ? QtQuickApp::ModeImport
|
||||
: QtQuickApp::ModeGenerate;
|
||||
}
|
||||
|
||||
QtQuickAppWizardSourcesPage::~QtQuickAppWizardSourcesPage()
|
||||
{
|
||||
delete m_d;
|
||||
}
|
||||
|
||||
QtQuickApp::Mode QtQuickAppWizardSourcesPage::mainQmlMode() const
|
||||
{
|
||||
return m_d->ui.generateRadioButton->isChecked() ? QtQuickApp::ModeGenerate
|
||||
: QtQuickApp::ModeImport;
|
||||
}
|
||||
|
||||
QString QtQuickAppWizardSourcesPage::mainQmlFile() const
|
||||
QString QtQuickComponentSetOptionsPage::mainQmlFile() const
|
||||
{
|
||||
return mainQmlMode() == QtQuickApp::ModeImport ?
|
||||
m_d->ui.importLineEdit->path() : QString();
|
||||
}
|
||||
|
||||
bool QtQuickAppWizardSourcesPage::isComplete() const
|
||||
bool QtQuickComponentSetOptionsPage::isComplete() const
|
||||
{
|
||||
return mainQmlMode() != QtQuickApp::ModeImport
|
||||
|| m_d->ui.importLineEdit->isValid();
|
||||
|
@@ -48,6 +48,10 @@ public:
|
||||
explicit QtQuickComponentSetOptionsPage(QWidget *parent = 0);
|
||||
virtual ~QtQuickComponentSetOptionsPage();
|
||||
|
||||
QtQuickApp::Mode mainQmlMode() const;
|
||||
QString mainQmlFile() const;
|
||||
virtual bool isComplete() const;
|
||||
|
||||
QtQuickApp::ComponentSet componentSet() const;
|
||||
void setComponentSet(QtQuickApp::ComponentSet componentSet);
|
||||
|
||||
@@ -58,23 +62,6 @@ private:
|
||||
class QtQuickComponentSetOptionsPagePrivate *m_d;
|
||||
};
|
||||
|
||||
class QtQuickAppWizardSourcesPage : public QWizardPage
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(QtQuickAppWizardSourcesPage)
|
||||
|
||||
public:
|
||||
explicit QtQuickAppWizardSourcesPage(QWidget *parent = 0);
|
||||
virtual ~QtQuickAppWizardSourcesPage();
|
||||
|
||||
QtQuickApp::Mode mainQmlMode() const;
|
||||
QString mainQmlFile() const;
|
||||
virtual bool isComplete() const;
|
||||
|
||||
private:
|
||||
class QtQuickAppWizardSourcesPagePrivate *m_d;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Qt4ProjectManager
|
||||
|
||||
|
@@ -1,94 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QtQuickAppWizardSourcesPage</class>
|
||||
<widget class="QWizardPage" name="QtQuickAppWizardSourcesPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>605</width>
|
||||
<height>386</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>WizardPage</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="mainQmlFileGroupBox">
|
||||
<property name="title">
|
||||
<string>Main QML File</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="generateRadioButton">
|
||||
<property name="text">
|
||||
<string>Generate a main.qml file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="importRadioButton">
|
||||
<property name="text">
|
||||
<string>Import an existing .qml file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="Utils::PathChooser" name="importLineEdit"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Maximum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>12</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>1</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Note: All files and directories that reside in the same directory as the main QML file are deployed. You can modify the contents of the directory any time before deploying.</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Utils::PathChooser</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header location="global">utils/pathchooser.h</header>
|
||||
<container>1</container>
|
||||
<slots>
|
||||
<signal>editingFinished()</signal>
|
||||
<signal>browsingFinished()</signal>
|
||||
</slots>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@@ -20,7 +20,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Qt Quick Component Set</string>
|
||||
<string>Qt Quick Application Type</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
@@ -38,7 +38,7 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string>buttonGroup</string>
|
||||
<string notr="true">buttonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -48,7 +48,7 @@
|
||||
<string>Qt Quick Components for Symbian</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string>buttonGroup</string>
|
||||
<string notr="true">buttonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -58,10 +58,43 @@
|
||||
<string>Qt Quick Components for Meego/Harmattan</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string>buttonGroup</string>
|
||||
<string notr="true">buttonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="importRadioButton">
|
||||
<property name="text">
|
||||
<string>Use an existing .qml file</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Maximum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>12</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Utils::PathChooser" name="importLineEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
@@ -81,7 +114,7 @@
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="descriptionStackedWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="qtquick10DescriptionWidget">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
@@ -140,6 +173,23 @@ Requires Qt 4.7.4 or newer, and the component set installed for your Qt version.
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="importDescriptionWidget">
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="importDescriptionLabel">
|
||||
<property name="text">
|
||||
<string>All files and directories that reside in the same directory as the main QML file are deployed. You can modify the contents of the directory any time before deploying.</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -147,6 +197,18 @@ Requires Qt 4.7.4 or newer, and the component set installed for your Qt version.
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Utils::PathChooser</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header location="global">utils/pathchooser.h</header>
|
||||
<container>1</container>
|
||||
<slots>
|
||||
<signal>editingFinished()</signal>
|
||||
<signal>browsingFinished()</signal>
|
||||
</slots>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
<buttongroups>
|
||||
|
Reference in New Issue
Block a user