summaryrefslogtreecommitdiff
path: root/src/plugins/qt4projectmanager/wizards
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/qt4projectmanager/wizards')
-rw-r--r--src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h6
-rw-r--r--src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.cpp13
-rw-r--r--src/plugins/qt4projectmanager/wizards/qmlstandaloneapp.h3
-rw-r--r--src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizard.cpp6
-rw-r--r--src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizardoptionspage.ui240
-rw-r--r--src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizardpages.cpp138
-rw-r--r--src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizardpages.h30
7 files changed, 7 insertions, 429 deletions
diff --git a/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h b/src/plugins/qt4projectmanager/wizards/mobileappwizardpages.h
index cbea2f7b35..c687a949de 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 d0aa331a36..425711d36a 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 b99dabbe39..5cd48d5e1d 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 <QmlModule*> m_modules;
diff --git a/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizard.cpp b/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizard.cpp
index d50a056174..93260362dc 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 9ebbd7201a..0000000000
--- a/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizardoptionspage.ui
+++ /dev/null
@@ -1,240 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>QmlStandaloneAppWizardOptionPage</class>
- <widget class="QWizardPage" name="QmlStandaloneAppWizardOptionPage">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>404</width>
- <height>548</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>WizardPage</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QGroupBox" name="groupBox_2">
- <property name="title">
- <string>General</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <property name="verticalSpacing">
- <number>12</number>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="orientationBehaviorLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Orientation Behavior:</string>
- </property>
- <property name="buddy">
- <cstring>orientationBehaviorComboBox</cstring>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QComboBox" name="orientationBehaviorComboBox"/>
- </item>
- <item row="1" column="1">
- <widget class="QCheckBox" name="loadDummyDataCheckBox">
- <property name="text">
- <string>Load dummy data</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QTabWidget" name="platformsTabWidget">
- <property name="currentIndex">
- <number>0</number>
- </property>
- <widget class="QWidget" name="tab">
- <attribute name="title">
- <string>Symbian specific</string>
- </attribute>
- <layout class="QFormLayout" name="formLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="symbianAppIconLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Application Icon (.svg):</string>
- </property>
- <property name="buddy">
- <cstring>symbianAppIconLoadToolButton</cstring>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QLabel" name="symbianAppIconPreview">
- <property name="minimumSize">
- <size>
- <width>45</width>
- <height>45</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>45</width>
- <height>45</height>
- </size>
- </property>
- <property name="frameShape">
- <enum>QFrame::Panel</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Sunken</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="symbianAppIconLoadToolButton">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="symbianTargetUid3Label">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Target UID3:</string>
- </property>
- <property name="buddy">
- <cstring>symbianTargetUid3LineEdit</cstring>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="QLineEdit" name="symbianTargetUid3LineEdit"/>
- </item>
- <item>
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item row="2" column="0" colspan="2">
- <widget class="QCheckBox" name="symbianEnableNetworkChackBox">
- <property name="text">
- <string>Enable network access</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="tab_2">
- <attribute name="title">
- <string>Maemo specific</string>
- </attribute>
- <widget class="QLabel" name="maemoAppIconLabel">
- <property name="geometry">
- <rect>
- <x>9</x>
- <y>9</y>
- <width>155</width>
- <height>16</height>
- </rect>
- </property>
- <property name="text">
- <string>Application Icon (64x64):</string>
- </property>
- </widget>
- <widget class="QToolButton" name="maemoPngIconButton">
- <property name="geometry">
- <rect>
- <x>171</x>
- <y>10</y>
- <width>71</width>
- <height>70</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="iconSize">
- <size>
- <width>64</width>
- <height>64</height>
- </size>
- </property>
- </widget>
- </widget>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
diff --git a/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizardpages.cpp b/src/plugins/qt4projectmanager/wizards/qmlstandaloneappwizardpages.cpp
index f5eeb50f60..34a071b2ec 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 <coreplugin/coreconstants.h>
#include <QtGui/QDesktopServices>
@@ -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<int>(orientation)) {
- comboBox->setCurrentIndex(i);
- break;
- }
-}
-
-QmlStandaloneApp::Orientation QmlStandaloneAppWizardOptionsPage::orientation() const
-{
- const int index = m_d->ui.orientationBehaviorComboBox->currentIndex();
- return static_cast<QmlStandaloneApp::Orientation>(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 f75c8b0d13..5ce91e3a92 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