diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.pro b/src/plugins/qt4projectmanager/qt4projectmanager.pro index caa5bcb1887..3fce8300d61 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.pro +++ b/src/plugins/qt4projectmanager/qt4projectmanager.pro @@ -120,7 +120,6 @@ FORMS += makestep.ui \ gettingstartedwelcomepagewidget.ui \ wizards/testwizardpage.ui \ wizards/targetsetuppage.ui \ - wizards/qmlstandaloneappwizardoptionspage.ui \ wizards/qmlstandaloneappwizardsourcespage.ui \ wizards/mobileappwizardoptionspage.ui \ librarydetailswidget.ui diff --git a/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h b/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h index cbea2f7b359..c687a949dee 100644 --- a/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h +++ b/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h @@ -27,8 +27,8 @@ ** **************************************************************************/ -#ifndef QMLSTANDALONEAPPWIZARDPAGES_H -#define QMLSTANDALONEAPPWIZARDPAGES_H +#ifndef MOBILEAPPWIZARDPAGES_H +#define MOBILEAPPWIZARDPAGES_H #include "mobileapp.h" @@ -68,4 +68,4 @@ private: } // end of namespace Internal } // end of namespace Qt4ProjectManager -#endif // QMLSTANDALONEAPPWIZARDPAGES_H +#endif // MOBILEAPPWIZARDPAGES_H diff --git a/src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.cpp b/src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.cpp index d0aa331a367..425711d36a6 100644 --- a/src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.cpp +++ b/src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.cpp @@ -98,8 +98,7 @@ bool QmlAppGeneratedFileInfo::isOutdated() const return version < AbstractMobileApp::makeStubVersion(QmlStandaloneApp::StubVersion); } -QmlStandaloneApp::QmlStandaloneApp() - : AbstractMobileApp(), m_loadDummyData(false) +QmlStandaloneApp::QmlStandaloneApp() : AbstractMobileApp() { } @@ -118,16 +117,6 @@ QString QmlStandaloneApp::mainQmlFile() const return path(MainQml); } -void QmlStandaloneApp::setLoadDummyData(bool loadIt) -{ - m_loadDummyData = loadIt; -} - -bool QmlStandaloneApp::loadDummyData() const -{ - return m_loadDummyData; -} - bool QmlStandaloneApp::setExternalModules(const QStringList &uris, const QStringList &importPaths) { diff --git a/src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.h b/src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.h index b99dabbe392..5cd48d5e1dc 100644 --- a/src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.h +++ b/src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.h @@ -109,8 +109,6 @@ public: void setMainQmlFile(const QString &qmlFile); QString mainQmlFile() const; - void setLoadDummyData(bool loadIt); - bool loadDummyData() const; bool setExternalModules(const QStringList &uris, const QStringList &importPaths); #ifndef CREATORLESSTEST @@ -143,7 +141,6 @@ private: bool addCppPlugin(const QString &qmldirLine, QmlModule *module); void clearModulesAndPlugins(); - bool m_loadDummyData; QFileInfo m_mainQmlFile; QStringList m_importPaths; QList m_modules; diff --git a/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizard.cpp b/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizard.cpp index d50a0561744..93260362dc1 100644 --- a/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizard.cpp @@ -27,6 +27,7 @@ ** **************************************************************************/ +#include "mobileappwizardpages.h" #include "qmlstandaloneappwizard.h" #include "qmlstandaloneappwizardpages.h" #include "qmlstandaloneapp.h" @@ -61,7 +62,7 @@ public: private: QmlStandaloneAppWizard::WizardType m_type; class QmlStandaloneAppWizardSourcesPage *m_qmlSourcesPage; - class QmlStandaloneAppWizardOptionsPage *m_qmlOptionsPage; + class MobileAppWizardOptionsPage *m_qmlOptionsPage; friend class QmlStandaloneAppWizard; }; @@ -85,7 +86,7 @@ QmlStandaloneAppWizardDialog::QmlStandaloneAppWizardDialog(QmlStandaloneAppWizar wizardProgress()->item(qmlSourcesPagePageId)->setTitle(qmlSourcesTitle); } - m_qmlOptionsPage = new QmlStandaloneAppWizardOptionsPage; + m_qmlOptionsPage = new MobileAppWizardOptionsPage; const int qmlOptionsPagePageId = addPage(m_qmlOptionsPage); wizardProgress()->item(qmlOptionsPagePageId)->setTitle(tr("QML Application options")); if (m_type == QmlStandaloneAppWizard::NewQmlFile) { @@ -152,7 +153,6 @@ QWizard *QmlStandaloneAppWizard::createWizardDialog(QWidget *parent, m_d->wizardDialog->m_qmlOptionsPage->setMaemoPngIcon(m_d->standaloneApp->maemoPngIcon()); m_d->wizardDialog->m_qmlOptionsPage->setOrientation(m_d->standaloneApp->orientation()); m_d->wizardDialog->m_qmlOptionsPage->setNetworkEnabled(m_d->standaloneApp->networkEnabled()); - m_d->wizardDialog->m_qmlOptionsPage->setLoadDummyData(m_d->standaloneApp->loadDummyData()); connect(m_d->wizardDialog, SIGNAL(introPageLeft(QString, QString)), SLOT(useProjectPath(QString, QString))); connect(m_d->wizardDialog->m_qmlSourcesPage, SIGNAL(externalModulesChanged(QStringList, QStringList)), SLOT(handleModulesChange(QStringList, QStringList))); diff --git a/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizardoptionspage.ui b/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizardoptionspage.ui deleted file mode 100644 index 9ebbd7201a2..00000000000 --- a/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizardoptionspage.ui +++ /dev/null @@ -1,240 +0,0 @@ - - - QmlStandaloneAppWizardOptionPage - - - - 0 - 0 - 404 - 548 - - - - WizardPage - - - - - - General - - - - 12 - - - - - - 0 - 0 - - - - Orientation Behavior: - - - orientationBehaviorComboBox - - - - - - - - - - Load dummy data - - - - - - - - - - 0 - - - - Symbian specific - - - - - - - 0 - 0 - - - - Application Icon (.svg): - - - symbianAppIconLoadToolButton - - - - - - - - - - 45 - 45 - - - - - 45 - 45 - - - - QFrame::Panel - - - QFrame::Sunken - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 0 - 0 - - - - Target UID3: - - - symbianTargetUid3LineEdit - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Enable network access - - - - - - - - Maemo specific - - - - - 9 - 9 - 155 - 16 - - - - Application Icon (64x64): - - - - - - 171 - 10 - 71 - 70 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - - - - - 64 - 64 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - diff --git a/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizardpages.cpp b/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizardpages.cpp index f5eeb50f600..34a071b2ec6 100644 --- a/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizardpages.cpp +++ b/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizardpages.cpp @@ -29,7 +29,6 @@ #include "qmlstandaloneappwizardpages.h" #include "ui_qmlstandaloneappwizardsourcespage.h" -#include "ui_qmlstandaloneappwizardoptionspage.h" #include #include @@ -164,142 +163,5 @@ QStringList QmlStandaloneAppWizardSourcesPage::moduleImportPaths() const return ertriesFromListWidget(*m_d->ui.importPathsListWidget); } -class QmlStandaloneAppWizardOptionsPagePrivate -{ - Ui::QmlStandaloneAppWizardOptionPage ui; - QString symbianSvgIcon; - QString maemoPngIcon; - friend class QmlStandaloneAppWizardOptionsPage; -}; - -QmlStandaloneAppWizardOptionsPage::QmlStandaloneAppWizardOptionsPage(QWidget *parent) - : QWizardPage(parent) - , m_d(new QmlStandaloneAppWizardOptionsPagePrivate) -{ - m_d->ui.setupUi(this); - - const QIcon open = QApplication::style()->standardIcon(QStyle::SP_DirOpenIcon); - m_d->ui.symbianAppIconLoadToolButton->setIcon(open); - connect(m_d->ui.symbianAppIconLoadToolButton, SIGNAL(clicked()), SLOT(openSymbianSvgIcon())); - connect(m_d->ui.maemoPngIconButton, SIGNAL(clicked()), this, - SLOT(openMaemoPngIcon())); - - m_d->ui.orientationBehaviorComboBox->addItem(tr("Auto rotate orientation"), - QmlStandaloneApp::Auto); - m_d->ui.orientationBehaviorComboBox->addItem(tr("Lock to landscape orientation"), - QmlStandaloneApp::LockLandscape); - m_d->ui.orientationBehaviorComboBox->addItem(tr("Lock to portrait orientation"), - QmlStandaloneApp::LockPortrait); -} - -QmlStandaloneAppWizardOptionsPage::~QmlStandaloneAppWizardOptionsPage() -{ - delete m_d; -} - -void QmlStandaloneAppWizardOptionsPage::setOrientation(QmlStandaloneApp::Orientation orientation) -{ - QComboBox *const comboBox = m_d->ui.orientationBehaviorComboBox; - for (int i = 0; i < comboBox->count(); ++i) - if (comboBox->itemData(i).toInt() == static_cast(orientation)) { - comboBox->setCurrentIndex(i); - break; - } -} - -QmlStandaloneApp::Orientation QmlStandaloneAppWizardOptionsPage::orientation() const -{ - const int index = m_d->ui.orientationBehaviorComboBox->currentIndex(); - return static_cast(m_d->ui.orientationBehaviorComboBox->itemData(index).toInt()); -} - -QString QmlStandaloneAppWizardOptionsPage::symbianSvgIcon() const -{ - return m_d->symbianSvgIcon; -} - -void QmlStandaloneAppWizardOptionsPage::setSymbianSvgIcon(const QString &icon) -{ - QPixmap iconPixmap(icon); - if (!iconPixmap.isNull()) { - const int symbianIconSize = 44; - if (iconPixmap.height() > symbianIconSize || iconPixmap.width() > symbianIconSize) - iconPixmap = iconPixmap.scaledToHeight(symbianIconSize, Qt::SmoothTransformation); - m_d->ui.symbianAppIconPreview->setPixmap(iconPixmap); - m_d->symbianSvgIcon = icon; - } -} - -QString QmlStandaloneAppWizardOptionsPage::maemoPngIcon() const -{ - return m_d->maemoPngIcon; -} - -void QmlStandaloneAppWizardOptionsPage::setMaemoPngIcon(const QString &icon) -{ - QString error; - QPixmap iconPixmap(icon); - if (iconPixmap.isNull()) - error = tr("The file is not a valid image."); - else if (iconPixmap.size() != QSize(64, 64)) - error = tr("The icon has an invalid size."); - if (!error.isEmpty()) { - QMessageBox::warning(this, tr("Icon unusable"), error); - } else { - m_d->ui.maemoPngIconButton->setIcon(iconPixmap); - m_d->maemoPngIcon = icon; - } -} - -QString QmlStandaloneAppWizardOptionsPage::symbianUid() const -{ - return m_d->ui.symbianTargetUid3LineEdit->text(); -} - -void QmlStandaloneAppWizardOptionsPage::setSymbianUid(const QString &uid) -{ - m_d->ui.symbianTargetUid3LineEdit->setText(uid); -} - -void QmlStandaloneAppWizardOptionsPage::setLoadDummyData(bool loadIt) -{ - m_d->ui.loadDummyDataCheckBox->setChecked(loadIt); -} - -bool QmlStandaloneAppWizardOptionsPage::loadDummyData() const -{ - return m_d->ui.loadDummyDataCheckBox->isChecked(); -} - -void QmlStandaloneAppWizardOptionsPage::setNetworkEnabled(bool enableIt) -{ - m_d->ui.symbianEnableNetworkChackBox->setChecked(enableIt); -} - -bool QmlStandaloneAppWizardOptionsPage::networkEnabled() const -{ - return m_d->ui.symbianEnableNetworkChackBox->isChecked(); -} - -void QmlStandaloneAppWizardOptionsPage::openSymbianSvgIcon() -{ - const QString svgIcon = QFileDialog::getOpenFileName( - this, - m_d->ui.symbianAppIconLabel->text(), - QDesktopServices::storageLocation(QDesktopServices::PicturesLocation), - QLatin1String("*.svg")); - if (!svgIcon.isEmpty()) - setSymbianSvgIcon(svgIcon); -} - -void QmlStandaloneAppWizardOptionsPage::openMaemoPngIcon() -{ - const QString iconPath = QFileDialog::getOpenFileName(this, - m_d->ui.maemoAppIconLabel->text(), m_d->maemoPngIcon, - QLatin1String("*.png")); - if (!iconPath.isEmpty()) - setMaemoPngIcon(iconPath); -} - } // namespace Internal } // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizardpages.h b/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizardpages.h index f75c8b0d13c..5ce91e3a92f 100644 --- a/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizardpages.h +++ b/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizardpages.h @@ -66,36 +66,6 @@ private: class QmlStandaloneAppWizardSourcesPagePrivate *m_d; }; -class QmlStandaloneAppWizardOptionsPage : public QWizardPage -{ - Q_OBJECT - Q_DISABLE_COPY(QmlStandaloneAppWizardOptionsPage) - -public: - explicit QmlStandaloneAppWizardOptionsPage(QWidget *parent = 0); - virtual ~QmlStandaloneAppWizardOptionsPage(); - - void setOrientation(QmlStandaloneApp::Orientation orientation); - QmlStandaloneApp::Orientation orientation() const; - QString symbianSvgIcon() const; - void setSymbianSvgIcon(const QString &icon); - QString maemoPngIcon() const; - void setMaemoPngIcon(const QString &icon); - QString symbianUid() const; - void setLoadDummyData(bool loadIt); - bool loadDummyData() const; - void setNetworkEnabled(bool enableIt); - bool networkEnabled() const; - void setSymbianUid(const QString &uid); - -private slots: - void openSymbianSvgIcon(); // Via file open dialog - void openMaemoPngIcon(); - -private: - class QmlStandaloneAppWizardOptionsPagePrivate *m_d; -}; - } // end of namespace Internal } // end of namespace Qt4ProjectManager