summaryrefslogtreecommitdiffstats
path: root/examples/dynamicpage
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2014-04-15 11:22:44 +0200
committerKarsten Heimrich <karsten.heimrich@digia.com>2014-04-24 20:08:26 +0200
commit95f7ae882b192f728d9f6c316a03d0b781d0b5bc (patch)
treea59231463fa0df23486e9c73215ffac21a7fd56b /examples/dynamicpage
parent580c95ecb77e075dfa91f2e9bb390d5795fae27b (diff)
Dynamic page example.
Change-Id: Ia5126d514c3e3f6ebc42d47fc1d2f31e60ca81c5 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'examples/dynamicpage')
-rw-r--r--examples/dynamicpage/README6
-rw-r--r--examples/dynamicpage/config/config.xml9
-rw-r--r--examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node1/data/data.node1.txt2
-rw-r--r--examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node1/meta/installscript.qs51
-rw-r--r--examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node1/meta/package.xml10
-rw-r--r--examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node2/data/data.node2..txt2
-rw-r--r--examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node2/meta/installscript.qs51
-rw-r--r--examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node2/meta/package.xml9
-rw-r--r--examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/installationwidget.ui255
-rw-r--r--examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/installscript.js179
-rw-r--r--examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/licensewidget.ui71
-rw-r--r--examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/package.xml15
-rw-r--r--examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/readytoinstallwidget.ui87
-rw-r--r--examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/targetwidget.ui83
-rw-r--r--examples/dynamicpage/resources/additional.qrc6
-rw-r--r--examples/dynamicpage/resources/icon.pngbin0 -> 2355 bytes
-rw-r--r--examples/dynamicpage/resources/license.txt1
17 files changed, 837 insertions, 0 deletions
diff --git a/examples/dynamicpage/README b/examples/dynamicpage/README
new file mode 100644
index 000000000..cdc773d62
--- /dev/null
+++ b/examples/dynamicpage/README
@@ -0,0 +1,6 @@
+Shows how to build an installer from script side using dynamic pages.
+
+Generate installer with
+
+binarycreator --offline-only -c config/config.xml -r resources/additional.qrc -p packages installer
+
diff --git a/examples/dynamicpage/config/config.xml b/examples/dynamicpage/config/config.xml
new file mode 100644
index 000000000..d65946b9b
--- /dev/null
+++ b/examples/dynamicpage/config/config.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Installer>
+ <Name>Dynamic Page Installer Example</Name>
+ <Version>1.0.0</Version>
+ <Title>Dynamic Page Installer Example</Title>
+ <Publisher>Qt-Project</Publisher>
+ <StartMenuDir>Qt Installer Framework Example</StartMenuDir>
+ <TargetDir>@HomeDir@/IFWDynamicPageInstallerExample</TargetDir>
+</Installer>
diff --git a/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node1/data/data.node1.txt b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node1/data/data.node1.txt
new file mode 100644
index 000000000..f40001983
--- /dev/null
+++ b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node1/data/data.node1.txt
@@ -0,0 +1,2 @@
+This file will be installed into the target directory....
+
diff --git a/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node1/meta/installscript.qs b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node1/meta/installscript.qs
new file mode 100644
index 000000000..dd9cf1d4f
--- /dev/null
+++ b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node1/meta/installscript.qs
@@ -0,0 +1,51 @@
+/**************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Installer Framework.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+**************************************************************************/
+
+function Component()
+{
+ // default constructor
+}
+
+Component.prototype.createOperations = function()
+{
+ // call default implementation to actually install something
+ component.createOperations();
+}
diff --git a/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node1/meta/package.xml b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node1/meta/package.xml
new file mode 100644
index 000000000..4f01cddbe
--- /dev/null
+++ b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node1/meta/package.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<Package>
+ <DisplayName>Example Component 1</DisplayName>
+ <Description>Dummy component with default property set.</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2014-04-07</ReleaseDate>
+ <Default>true</Default>
+ <Script>installscript.qs</Script>
+ <Name>org.qtproject.ifw.example.dynamicpage.node1</Name>
+</Package>
diff --git a/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node2/data/data.node2..txt b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node2/data/data.node2..txt
new file mode 100644
index 000000000..f40001983
--- /dev/null
+++ b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node2/data/data.node2..txt
@@ -0,0 +1,2 @@
+This file will be installed into the target directory....
+
diff --git a/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node2/meta/installscript.qs b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node2/meta/installscript.qs
new file mode 100644
index 000000000..dd9cf1d4f
--- /dev/null
+++ b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node2/meta/installscript.qs
@@ -0,0 +1,51 @@
+/**************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Installer Framework.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+**************************************************************************/
+
+function Component()
+{
+ // default constructor
+}
+
+Component.prototype.createOperations = function()
+{
+ // call default implementation to actually install something
+ component.createOperations();
+}
diff --git a/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node2/meta/package.xml b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node2/meta/package.xml
new file mode 100644
index 000000000..c29dcdeda
--- /dev/null
+++ b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage.node2/meta/package.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<Package>
+ <DisplayName>Example Component 2</DisplayName>
+ <Description>Dummy component without default property set.</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2014-04-07</ReleaseDate>
+ <Script>installscript.qs</Script>
+ <Name>org.qtproject.ifw.example.dynamicpage.node2</Name>
+</Package>
diff --git a/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/installationwidget.ui b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/installationwidget.ui
new file mode 100644
index 000000000..cc54b454f
--- /dev/null
+++ b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/installationwidget.ui
@@ -0,0 +1,255 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>InstallationWidget</class>
+ <widget class="QWidget" name="InstallationWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>491</width>
+ <height>190</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>491</width>
+ <height>190</height>
+ </size>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <property name="horizontalSpacing">
+ <number>0</number>
+ </property>
+ <property name="verticalSpacing">
+ <number>6</number>
+ </property>
+ <item row="3" column="1">
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="4" column="0" rowspan="2">
+ <widget class="QLabel" name="label_6">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="../../../resources/additional.qrc">:/icon.png</pixmap>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" colspan="3">
+ <widget class="QRadioButton" name="completeInstall">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Complete</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" colspan="3">
+ <widget class="QRadioButton" name="defaultInstall">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Typical</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="0" rowspan="2">
+ <widget class="QLabel" name="label_4">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="../../../resources/additional.qrc">:/icon.png</pixmap>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" rowspan="3">
+ <widget class="QLabel" name="label_5">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="../../../resources/additional.qrc">:/icon.png</pixmap>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1" colspan="2">
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>1</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="7" column="1" colspan="3">
+ <widget class="QRadioButton" name="customInstall">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Custom</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" rowspan="2">
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>1</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="2" rowspan="2" colspan="2">
+ <widget class="QLabel" name="label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Common program features will be installed. Recommended for general use.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="2" colspan="2">
+ <widget class="QLabel" name="label_3">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Choose which program features you want to install. Recommended for advanced users.</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="3">
+ <widget class="QLabel" name="label_2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>All program features will be installed. (Requires the most disk space)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1">
+ <spacer name="verticalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="8" column="1">
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>1</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <tabstops>
+ <tabstop>defaultInstall</tabstop>
+ <tabstop>completeInstall</tabstop>
+ <tabstop>customInstall</tabstop>
+ </tabstops>
+ <resources>
+ <include location="../../../resources/additional.qrc"/>
+ </resources>
+ <connections/>
+</ui>
diff --git a/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/installscript.js b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/installscript.js
new file mode 100644
index 000000000..6073d6236
--- /dev/null
+++ b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/installscript.js
@@ -0,0 +1,179 @@
+/**************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Installer Framework.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+**************************************************************************/
+
+var ComponentSelectionPage = null;
+
+var Dir = new function () {
+ this.toNativeSparator = function (path) {
+ if (installer.value("os") == "win")
+ return path.replace(/\//g, '\\');
+ return path;
+ }
+};
+
+function Component() {
+ if (installer.isInstaller()) {
+ component.loaded.connect(this, Component.prototype.installerLoaded);
+ ComponentSelectionPage = gui.pageById(QInstaller.ComponentSelection);
+
+ installer.setDefaultPageVisible(QInstaller.TargetDirectory, false);
+ installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
+ installer.setDefaultPageVisible(QInstaller.LicenseCheck, false);
+ if (installer.value("os") == "win")
+ installer.setDefaultPageVisible(QInstaller.StartMenuSelection, false);
+ installer.setDefaultPageVisible(QInstaller.ReadyForInstallation, false);
+ }
+}
+
+Component.prototype.installerLoaded = function () {
+ if (installer.addWizardPage(component, "TargetWidget", QInstaller.TargetDirectory)) {
+ var widget = gui.pageWidgetByObjectName("DynamicTargetWidget");
+ if (widget != null) {
+ widget.targetChooser.clicked.connect(this, Component.prototype.chooseTarget);
+ widget.targetDirectory.textChanged.connect(this, Component.prototype.targetChanged);
+
+ widget.windowTitle = "Installation Folder";
+ widget.targetDirectory.text = Dir.toNativeSparator(installer.value("TargetDir"));
+ }
+ }
+
+ if (installer.addWizardPage(component, "InstallationWidget", QInstaller.ComponentSelection)) {
+ var widget = gui.pageWidgetByObjectName("DynamicInstallationWidget");
+ if (widget != null) {
+ widget.customInstall.toggled.connect(this, Component.prototype.customInstallToggled);
+ widget.defaultInstall.toggled.connect(this, Component.prototype.defaultInstallToggled);
+ widget.completeInstall.toggled.connect(this, Component.prototype.completeInstallToggled);
+
+ widget.defaultInstall.checked = true;
+ widget.windowTitle = "Please select a installation type";
+ }
+
+ if (installer.addWizardPage(component, "LicenseWidget", QInstaller.LicenseCheck)) {
+ var widget = gui.pageWidgetByObjectName("DynamicLicenseWidget");
+ if (widget != null) {
+ widget.acceptLicense.toggled.connect(this, Component.prototype.checkAccepted);
+
+ widget.complete = false;
+ widget.declineLicense.checked = true;
+ widget.windowTitle = "License Agreement";
+ }
+ }
+
+ if (installer.addWizardPage(component, "ReadyToInstallWidget", QInstaller.ReadyForInstallation)) {
+ var widget = gui.pageWidgetByObjectName("DynamicReadyToInstallWidget");
+ if (widget != null) {
+ widget.showDetails.checked = false;
+ widget.windowTitle = "Ready to Install";
+ }
+ var page = gui.pageByObjectName("DynamicReadyToInstallWidget");
+ if (page != null) {
+ page.entered.connect(this, Component.prototype.readyToInstallWidgetEntered);
+ }
+ }
+ }
+}
+
+Component.prototype.targetChanged = function (text) {
+ var widget = gui.pageWidgetByObjectName("DynamicTargetWidget");
+ if (widget != null) {
+ if (text != "") {
+ if (!installer.fileExists(text + "/components.xml")) {
+ widget.complete = true;
+ installer.setValue("TargetDir", text);
+ return;
+ }
+ }
+ widget.complete = false;
+ }
+}
+
+Component.prototype.chooseTarget = function () {
+ var widget = gui.pageWidgetByObjectName("DynamicTargetWidget");
+ if (widget != null) {
+ var newTarget = QFileDialog.getExistingDirectory("Choose your target directory.", widget
+ .targetDirectory.text);
+ if (newTarget != "")
+ widget.targetDirectory.text = Dir.toNativeSparator(newTarget);
+ }
+}
+
+Component.prototype.customInstallToggled = function (checked) {
+ if (checked) {
+ if (ComponentSelectionPage != null)
+ ComponentSelectionPage.selectDefault();
+ installer.setDefaultPageVisible(QInstaller.ComponentSelection, true);
+ }
+}
+
+Component.prototype.defaultInstallToggled = function (checked) {
+ if (checked) {
+ if (ComponentSelectionPage != null)
+ ComponentSelectionPage.selectDefault();
+ installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
+ }
+}
+
+Component.prototype.completeInstallToggled = function (checked) {
+ if (checked) {
+ if (ComponentSelectionPage != null)
+ ComponentSelectionPage.selectAll();
+ installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
+ }
+}
+
+Component.prototype.checkAccepted = function (checked) {
+ var widget = gui.pageWidgetByObjectName("DynamicLicenseWidget");
+ if (widget != null)
+ widget.complete = checked;
+}
+
+Component.prototype.readyToInstallWidgetEntered = function () {
+ var widget = gui.pageWidgetByObjectName("DynamicReadyToInstallWidget");
+ if (widget != null) {
+ var html = "<b>Components to install:</b><ul>";
+ for (i = 0; i < installer.components.length; ++i) {
+ if (installer.components[i].installationRequested())
+ html = html + "<li>" + installer.components[i].displayName + "</li>"
+ }
+ html = html + "</ul>";
+ widget.showDetailsBrowser.html = html;
+ }
+}
diff --git a/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/licensewidget.ui b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/licensewidget.ui
new file mode 100644
index 000000000..edeae3ba2
--- /dev/null
+++ b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/licensewidget.ui
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>LicenseWidget</class>
+ <widget class="QWidget" name="LicenseWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>491</width>
+ <height>190</height>
+ </rect>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>491</width>
+ <height>190</height>
+ </size>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Please read the following license agreement. You must accept the terms contained in this agreement before continuing with the installation.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextBrowser" name="textBrowser">
+ <property name="source">
+ <url>
+ <string>qrc:/license.txt</string>
+ </url>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="acceptLicense">
+ <property name="text">
+ <string>I accept the license.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="declineLicense">
+ <property name="text">
+ <string>I do not accept the license.</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="../../../resources/additional.qrc"/>
+ </resources>
+ <connections/>
+</ui>
diff --git a/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/package.xml b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/package.xml
new file mode 100644
index 000000000..2b2de5f9f
--- /dev/null
+++ b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/package.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<Package>
+ <DisplayName>Dynamic page installer example</DisplayName>
+ <Description>Can be used as reference on how to build installer independent of predefined installer pages.</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2014-04-07</ReleaseDate>
+ <Script>installscript.js</Script>
+ <UserInterfaces>
+ <UserInterface>targetwidget.ui</UserInterface>
+ <UserInterface>installationwidget.ui</UserInterface>
+ <UserInterface>licensewidget.ui</UserInterface>
+ <UserInterface>readytoinstallwidget.ui</UserInterface>
+ </UserInterfaces>
+ <Name>org.qtproject.ifw.example.dynamicpage</Name>
+</Package>
diff --git a/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/readytoinstallwidget.ui b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/readytoinstallwidget.ui
new file mode 100644
index 000000000..30e1e2c75
--- /dev/null
+++ b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/readytoinstallwidget.ui
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ReadyToInstallWidget</class>
+ <widget class="QWidget" name="ReadyToInstallWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>491</width>
+ <height>190</height>
+ </rect>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>491</width>
+ <height>190</height>
+ </size>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Setup is now ready to begin installing Dynamic Page Installer Example on your computer.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="showDetails">
+ <property name="text">
+ <string>Show details</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextBrowser" name="showDetailsBrowser"/>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ <zorder>label_2</zorder>
+ <zorder>showDetails</zorder>
+ <zorder>showDetailsBrowser</zorder>
+ <zorder>verticalSpacer_2</zorder>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>showDetails</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>showDetailsBrowser</receiver>
+ <slot>setVisible(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>63</x>
+ <y>37</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>85</x>
+ <y>89</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/targetwidget.ui b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/targetwidget.ui
new file mode 100644
index 000000000..f652329e7
--- /dev/null
+++ b/examples/dynamicpage/packages/org.qtproject.ifw.example.dynamicpage/meta/targetwidget.ui
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>TargetWidget</class>
+ <widget class="QWidget" name="TargetWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>491</width>
+ <height>190</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>491</width>
+ <height>190</height>
+ </size>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Please specify the folder where Dynamic Page Installer Example will be installed.</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLineEdit" name="targetDirectory">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="targetChooser">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>122</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/examples/dynamicpage/resources/additional.qrc b/examples/dynamicpage/resources/additional.qrc
new file mode 100644
index 000000000..c1841e778
--- /dev/null
+++ b/examples/dynamicpage/resources/additional.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/">
+ <file>icon.png</file>
+ <file>license.txt</file>
+ </qresource>
+</RCC>
diff --git a/examples/dynamicpage/resources/icon.png b/examples/dynamicpage/resources/icon.png
new file mode 100644
index 000000000..3436a7806
--- /dev/null
+++ b/examples/dynamicpage/resources/icon.png
Binary files differ
diff --git a/examples/dynamicpage/resources/license.txt b/examples/dynamicpage/resources/license.txt
new file mode 100644
index 000000000..61a94dce7
--- /dev/null
+++ b/examples/dynamicpage/resources/license.txt
@@ -0,0 +1 @@
+The fantastic license, have you heard of the Beer Public License Agreement yet?