summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLeena Miettinen <riitta-leena.miettinen@theqtcompany.com>2014-12-22 16:08:16 +0100
committerLeena Miettinen <riitta-leena.miettinen@theqtcompany.com>2015-01-09 13:32:51 +0100
commit9a5127a9d99ba2650e8a1f4c16c82876b7b915f9 (patch)
tree5e8d580c925492a30329a35bf8374ac7a55c2b40 /examples
parent51eae5a7319a8a2b27f7b65e2c740f3d37cabe59 (diff)
Doc: update docs for the Quit Installer example
Change-Id: I0b456962e9a07e16a3e44882d936f604fcd4f71f Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/doc/images/qtifw-examples-quit_installer.pngbin0 -> 19682 bytes
-rw-r--r--examples/doc/quit_installer.qdoc38
-rw-r--r--examples/quit_installer/config/config.xml4
-rw-r--r--examples/quit_installer/packages/org.qtproject.ifw.example.quitinstaller/meta/installscript.js6
4 files changed, 43 insertions, 5 deletions
diff --git a/examples/doc/images/qtifw-examples-quit_installer.png b/examples/doc/images/qtifw-examples-quit_installer.png
new file mode 100644
index 000000000..12e94f0a1
--- /dev/null
+++ b/examples/doc/images/qtifw-examples-quit_installer.png
Binary files differ
diff --git a/examples/doc/quit_installer.qdoc b/examples/doc/quit_installer.qdoc
index bb1655ad2..55b9f3ba3 100644
--- a/examples/doc/quit_installer.qdoc
+++ b/examples/doc/quit_installer.qdoc
@@ -30,11 +30,49 @@
\ingroup qtifwexamples
\title Quit Installer Example
+ \image qtifw-examples-quit_installer.png
+
\brief Quitting an installer by using a script.
+ \e{Quit Installer} illustrates how to use the \c Component() function to
+ display a message box to end users for quitting the installation if some
+ requirements for the installation are not met.
+
\include installerfw-examples-configuring.qdocinc
\quotefile quit_installer/config/config.xml
+ \include installerfw-examples-packaging.qdocinc
+
+ \list
+ \li The \c <Default> section is set to \c true to preselect the
+ component in the installer.
+ \li The \c <Script> section specifies the file name of the JavaScript
+ file that is loaded to perform operations.
+ \endlist
+
+ \quotefile quit_installer/packages/org.qtproject.ifw.example.quitinstaller/meta/package.xml
+
+ \section1 Quitting the Installation
+
+ In installscript.js, we use the \c Component() function to display a
+ message box for quitting the installer to end users:
+
+ \quotefromfile quit_installer/packages/org.qtproject.ifw.example.quitinstaller/meta/installscript.js
+ \skipto Component()
+ \printuntil QMessageBox.Ok
+
+ If end users select \uicontrol OK, we use the \c installer::setValue()
+ function to display a message and the \c installer.setDefaultPageVisible()
+ function to hide the subsequent installer pages:
+
+ \printuntil NextButton
+
+ If end users select \uicontrol Cancel, we display the default installer
+ pages and use the \c installer::setValue() function to display another
+ message on the last installer page:
+
+ \printuntil /^\}/
+
\include installerfw-examples-generating.qdocinc
*/
diff --git a/examples/quit_installer/config/config.xml b/examples/quit_installer/config/config.xml
index 36717025c..896c9f91b 100644
--- a/examples/quit_installer/config/config.xml
+++ b/examples/quit_installer/config/config.xml
@@ -4,6 +4,6 @@
<Version>1.0.0</Version>
<Title>Quit Installer Example</Title>
<Publisher>Qt-Project</Publisher>
- <StartMenuDir>Qt Installer Framework Example</StartMenuDir>
- <TargetDir>@HomeDir@/IFWQuitInstallerExample</TargetDir>
+ <StartMenuDir>Qt IFW Examples</StartMenuDir>
+ <TargetDir>@HomeDir@/IfwExample</TargetDir>
</Installer>
diff --git a/examples/quit_installer/packages/org.qtproject.ifw.example.quitinstaller/meta/installscript.js b/examples/quit_installer/packages/org.qtproject.ifw.example.quitinstaller/meta/installscript.js
index 6075a00f1..713f86765 100644
--- a/examples/quit_installer/packages/org.qtproject.ifw.example.quitinstaller/meta/installscript.js
+++ b/examples/quit_installer/packages/org.qtproject.ifw.example.quitinstaller/meta/installscript.js
@@ -35,9 +35,9 @@
function Component()
{
var result = QMessageBox["question"]("test.quit", "Installer", "Do you want to quit the installer?<br>" +
- "This message box was created through javascript.", QMessageBox.Ok | QMessageBox.Cancel);
+ "This message box was created using JavaScript.", QMessageBox.Ok | QMessageBox.Cancel);
if (result == QMessageBox.Ok) {
- installer.setValue("FinishedText", "<font color='red' size=10>This installer was quit.</font>");
+ installer.setValue("FinishedText", "<font color='red' size=3>The installer was quit.</font>");
installer.setDefaultPageVisible(QInstaller.TargetDirectory, false);
installer.setDefaultPageVisible(QInstaller.ReadyForInstallation, false);
installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
@@ -47,6 +47,6 @@ function Component()
gui.clickButton(buttons.NextButton);
} else {
installer.setValue("FinishedText",
- "<font color='green' size=10>The installer was not quit from javascript.</font>");
+ "<font color='green' size=3>The installer was not quit by JavaScript.</font>");
}
}