aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Nätterlund <tobias.naetterlund.qnx@kdab.com>2012-06-29 07:23:13 +0200
committerDaniel Teske <daniel.teske@nokia.com>2012-07-13 15:37:34 +0200
commita7ac2bb559fb717b616548ef3cc6332f1bdd46eb (patch)
tree063c170c5ae35cd769e51aa07a5c2fad8ec78fcc
parentcbce4389a540370169a874301450081eb6dbf675 (diff)
New QNX plugin.
This plugin adds support for cross-compiling, deploying, running and debugging on a PlayBook or QNX Neutrino device. Change-Id: I0da7ccee40bd7ce4c0d6bdc6884d48ef23167dac Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
-rwxr-xr-xdoc/images/qtcreator-qnx-deployment.pngbin0 -> 10407 bytes
-rw-r--r--doc/images/qtcreator-qnx-device-configurations-wizard-1.pngbin0 -> 7843 bytes
-rw-r--r--doc/images/qtcreator-qnx-device-configurations-wizard-2.pngbin0 -> 6411 bytes
-rw-r--r--doc/images/qtcreator-qnx-device-configurations.pngbin0 -> 12384 bytes
-rw-r--r--doc/images/qtcreator-qnx-playbook-development-mode.pngbin0 -> 29284 bytes
-rw-r--r--doc/images/qtcreator-qnx-playbook-storage-sharing.pngbin0 -> 45194 bytes
-rw-r--r--doc/images/qtcreator-qnx-run-settings.pngbin0 -> 16640 bytes
-rw-r--r--doc/images/qtcreator-qt4-qtversions-win-qnx.pngbin0 -> 16368 bytes
-rw-r--r--doc/src/linux-mobile/creator-deployment-madde.qdoc2
-rw-r--r--doc/src/overview/creator-deployment-overview.qdoc5
-rw-r--r--doc/src/overview/creator-mobile-targets.qdoc9
-rw-r--r--doc/src/overview/creator-target-platforms.qdocinc10
-rw-r--r--doc/src/projects/creator-projects-builds-customizing.qdoc2
-rw-r--r--doc/src/projects/creator-projects-qt-versions.qdoc1
-rw-r--r--doc/src/projects/creator-projects-running.qdoc1
-rw-r--r--doc/src/projects/creator-projects-settings-run.qdoc1
-rw-r--r--doc/src/qnx/creator-deployment-qnx.qdoc61
-rw-r--r--doc/src/qnx/creator-developing-qnx.qdoc118
-rw-r--r--doc/src/qnx/creator-projects-qt-version-qnx.qdocinc21
-rw-r--r--doc/src/qnx/creator-projects-running-qnx.qdocinc37
-rw-r--r--doc/src/qnx/creator-projects-settings-run-qnx.qdocinc13
-rw-r--r--doc/src/qtcreator.qdoc2
-rw-r--r--doc/src/symbian/symbiandev.qdoc2
-rw-r--r--share/qtcreator/templates/wizards/bb-bardescriptor/bar-descriptor.xml33
-rw-r--r--share/qtcreator/templates/wizards/bb-bardescriptor/wizard.xml44
-rw-r--r--share/qtcreator/templates/wizards/bb-guiapp/bar-descriptor.xml28
-rw-r--r--share/qtcreator/templates/wizards/bb-guiapp/icon.pngbin0 -> 1364 bytes
-rw-r--r--share/qtcreator/templates/wizards/bb-guiapp/main.cpp12
-rw-r--r--share/qtcreator/templates/wizards/bb-guiapp/mainwidget.cpp14
-rw-r--r--share/qtcreator/templates/wizards/bb-guiapp/mainwidget.h22
-rw-r--r--share/qtcreator/templates/wizards/bb-guiapp/mainwidget.ui31
-rw-r--r--share/qtcreator/templates/wizards/bb-guiapp/project.pro7
-rw-r--r--share/qtcreator/templates/wizards/bb-guiapp/wizard.xml51
-rw-r--r--share/qtcreator/templates/wizards/bb-qt5-bardescriptor/bar-descriptor.xml32
-rw-r--r--share/qtcreator/templates/wizards/bb-qt5-bardescriptor/wizard.xml44
-rw-r--r--share/qtcreator/templates/wizards/bb-qt5-guiapp/bar-descriptor.xml28
-rw-r--r--share/qtcreator/templates/wizards/bb-qt5-guiapp/icon.pngbin0 -> 1364 bytes
-rw-r--r--share/qtcreator/templates/wizards/bb-qt5-guiapp/main.cpp13
-rw-r--r--share/qtcreator/templates/wizards/bb-qt5-guiapp/mainwidget.cpp14
-rw-r--r--share/qtcreator/templates/wizards/bb-qt5-guiapp/mainwidget.h22
-rw-r--r--share/qtcreator/templates/wizards/bb-qt5-guiapp/mainwidget.ui31
-rw-r--r--share/qtcreator/templates/wizards/bb-qt5-guiapp/project.pro11
-rw-r--r--share/qtcreator/templates/wizards/bb-qt5-guiapp/wizard.xml51
-rw-r--r--share/qtcreator/templates/wizards/bb-qt5-quick2app/bar-descriptor.xml30
-rw-r--r--share/qtcreator/templates/wizards/bb-qt5-quick2app/icon.pngbin0 -> 1364 bytes
-rw-r--r--share/qtcreator/templates/wizards/bb-qt5-quick2app/main.cpp26
-rw-r--r--share/qtcreator/templates/wizards/bb-qt5-quick2app/project.pro12
-rw-r--r--share/qtcreator/templates/wizards/bb-qt5-quick2app/qml/main.qml17
-rw-r--r--share/qtcreator/templates/wizards/bb-qt5-quick2app/wizard.xml49
-rw-r--r--share/qtcreator/templates/wizards/bb-quickapp/bar-descriptor.xml30
-rw-r--r--share/qtcreator/templates/wizards/bb-quickapp/icon.pngbin0 -> 1364 bytes
-rw-r--r--share/qtcreator/templates/wizards/bb-quickapp/main.cpp20
-rw-r--r--share/qtcreator/templates/wizards/bb-quickapp/project.pro12
-rw-r--r--share/qtcreator/templates/wizards/bb-quickapp/qml/main.qml17
-rw-r--r--share/qtcreator/templates/wizards/bb-quickapp/wizard.xml49
-rw-r--r--src/plugins/debugger/debuggerstartparameters.h3
-rw-r--r--src/plugins/debugger/gdb/remotegdbserveradapter.cpp49
-rw-r--r--src/plugins/debugger/gdb/remotegdbserveradapter.h1
-rw-r--r--src/plugins/plugins.pro9
-rw-r--r--src/plugins/projectexplorer/toolchain.h2
-rw-r--r--src/plugins/qnx/Qnx.pluginspec.in21
-rw-r--r--src/plugins/qnx/bardescriptorfileimagewizardpage.cpp197
-rw-r--r--src/plugins/qnx/bardescriptorfileimagewizardpage.h87
-rw-r--r--src/plugins/qnx/bardescriptorfileimagewizardpage.ui95
-rw-r--r--src/plugins/qnx/blackberryabstractdeploystep.cpp236
-rw-r--r--src/plugins/qnx/blackberryabstractdeploystep.h106
-rw-r--r--src/plugins/qnx/blackberryapplicationrunner.cpp356
-rw-r--r--src/plugins/qnx/blackberryapplicationrunner.h121
-rw-r--r--src/plugins/qnx/blackberryconnect.cpp183
-rw-r--r--src/plugins/qnx/blackberryconnect.h87
-rw-r--r--src/plugins/qnx/blackberrycreatepackagestep.cpp218
-rw-r--r--src/plugins/qnx/blackberrycreatepackagestep.h74
-rw-r--r--src/plugins/qnx/blackberrycreatepackagestepconfigwidget.cpp57
-rw-r--r--src/plugins/qnx/blackberrycreatepackagestepconfigwidget.h57
-rw-r--r--src/plugins/qnx/blackberrycreatepackagestepfactory.cpp120
-rw-r--r--src/plugins/qnx/blackberrycreatepackagestepfactory.h67
-rw-r--r--src/plugins/qnx/blackberrydebugsupport.cpp111
-rw-r--r--src/plugins/qnx/blackberrydebugsupport.h89
-rw-r--r--src/plugins/qnx/blackberrydeployconfiguration.cpp111
-rw-r--r--src/plugins/qnx/blackberrydeployconfiguration.h77
-rw-r--r--src/plugins/qnx/blackberrydeployconfigurationfactory.cpp135
-rw-r--r--src/plugins/qnx/blackberrydeployconfigurationfactory.h73
-rw-r--r--src/plugins/qnx/blackberrydeployconfigurationwidget.cpp79
-rw-r--r--src/plugins/qnx/blackberrydeployconfigurationwidget.h66
-rw-r--r--src/plugins/qnx/blackberrydeployconfigurationwidget.ui41
-rw-r--r--src/plugins/qnx/blackberrydeployinformation.cpp197
-rw-r--r--src/plugins/qnx/blackberrydeployinformation.h99
-rw-r--r--src/plugins/qnx/blackberrydeploystep.cpp193
-rw-r--r--src/plugins/qnx/blackberrydeploystep.h73
-rw-r--r--src/plugins/qnx/blackberrydeploystepconfigwidget.cpp57
-rw-r--r--src/plugins/qnx/blackberrydeploystepconfigwidget.h57
-rw-r--r--src/plugins/qnx/blackberrydeploystepfactory.cpp113
-rw-r--r--src/plugins/qnx/blackberrydeploystepfactory.h68
-rw-r--r--src/plugins/qnx/blackberrydeviceconfiguration.cpp134
-rw-r--r--src/plugins/qnx/blackberrydeviceconfiguration.h86
-rw-r--r--src/plugins/qnx/blackberrydeviceconfigurationfactory.cpp93
-rw-r--r--src/plugins/qnx/blackberrydeviceconfigurationfactory.h63
-rw-r--r--src/plugins/qnx/blackberrydeviceconfigurationwidget.cpp124
-rw-r--r--src/plugins/qnx/blackberrydeviceconfigurationwidget.h76
-rw-r--r--src/plugins/qnx/blackberrydeviceconfigurationwidget.ui107
-rw-r--r--src/plugins/qnx/blackberrydeviceconfigurationwizard.cpp141
-rw-r--r--src/plugins/qnx/blackberrydeviceconfigurationwizard.h75
-rw-r--r--src/plugins/qnx/blackberrydeviceconfigurationwizardpages.cpp228
-rw-r--r--src/plugins/qnx/blackberrydeviceconfigurationwizardpages.h111
-rw-r--r--src/plugins/qnx/blackberrydeviceconfigurationwizardsetuppage.ui153
-rw-r--r--src/plugins/qnx/blackberrydeviceconfigurationwizardsshkeypage.ui64
-rw-r--r--src/plugins/qnx/blackberryqtversion.cpp176
-rw-r--r--src/plugins/qnx/blackberryqtversion.h70
-rw-r--r--src/plugins/qnx/blackberryqtversionfactory.cpp89
-rw-r--r--src/plugins/qnx/blackberryqtversionfactory.h62
-rw-r--r--src/plugins/qnx/blackberryrunconfiguration.cpp153
-rw-r--r--src/plugins/qnx/blackberryrunconfiguration.h94
-rw-r--r--src/plugins/qnx/blackberryrunconfigurationfactory.cpp170
-rw-r--r--src/plugins/qnx/blackberryrunconfigurationfactory.h68
-rw-r--r--src/plugins/qnx/blackberryrunconfigurationwidget.cpp62
-rw-r--r--src/plugins/qnx/blackberryrunconfigurationwidget.h68
-rw-r--r--src/plugins/qnx/blackberryrunconfigurationwidget.ui38
-rw-r--r--src/plugins/qnx/blackberryruncontrol.cpp99
-rw-r--r--src/plugins/qnx/blackberryruncontrol.h74
-rw-r--r--src/plugins/qnx/blackberryruncontrolfactory.cpp172
-rw-r--r--src/plugins/qnx/blackberryruncontrolfactory.h76
-rw-r--r--src/plugins/qnx/blackberrywizardextension.cpp139
-rw-r--r--src/plugins/qnx/blackberrywizardextension.h67
-rw-r--r--src/plugins/qnx/images/target-small.pngbin0 -> 655 bytes
-rw-r--r--src/plugins/qnx/images/target.pngbin0 -> 1364 bytes
-rw-r--r--src/plugins/qnx/pathchooserdelegate.cpp99
-rw-r--r--src/plugins/qnx/pathchooserdelegate.h73
-rw-r--r--src/plugins/qnx/qnx.pro120
-rw-r--r--src/plugins/qnx/qnx.qrc6
-rw-r--r--src/plugins/qnx/qnx_dependencies.pri3
-rw-r--r--src/plugins/qnx/qnxabstractqtversion.cpp173
-rw-r--r--src/plugins/qnx/qnxabstractqtversion.h92
-rw-r--r--src/plugins/qnx/qnxapplicationrunner.cpp87
-rw-r--r--src/plugins/qnx/qnxapplicationrunner.h69
-rw-r--r--src/plugins/qnx/qnxbaseqtconfigwidget.cpp72
-rw-r--r--src/plugins/qnx/qnxbaseqtconfigwidget.h66
-rw-r--r--src/plugins/qnx/qnxbaseqtconfigwidget.ui36
-rw-r--r--src/plugins/qnx/qnxconstants.h101
-rw-r--r--src/plugins/qnx/qnxdebugsupport.cpp147
-rw-r--r--src/plugins/qnx/qnxdebugsupport.h90
-rw-r--r--src/plugins/qnx/qnxdeployconfiguration.cpp47
-rw-r--r--src/plugins/qnx/qnxdeployconfiguration.h59
-rw-r--r--src/plugins/qnx/qnxdeployconfigurationfactory.cpp128
-rw-r--r--src/plugins/qnx/qnxdeployconfigurationfactory.h70
-rw-r--r--src/plugins/qnx/qnxdeploystepfactory.cpp109
-rw-r--r--src/plugins/qnx/qnxdeploystepfactory.h68
-rw-r--r--src/plugins/qnx/qnxdeviceconfiguration.cpp74
-rw-r--r--src/plugins/qnx/qnxdeviceconfiguration.h66
-rw-r--r--src/plugins/qnx/qnxdeviceconfigurationfactory.cpp94
-rw-r--r--src/plugins/qnx/qnxdeviceconfigurationfactory.h63
-rw-r--r--src/plugins/qnx/qnxdeviceconfigurationwizard.cpp90
-rw-r--r--src/plugins/qnx/qnxdeviceconfigurationwizard.h70
-rw-r--r--src/plugins/qnx/qnxdeviceconfigurationwizardpages.cpp50
-rw-r--r--src/plugins/qnx/qnxdeviceconfigurationwizardpages.h54
-rw-r--r--src/plugins/qnx/qnxplugin.cpp99
-rw-r--r--src/plugins/qnx/qnxplugin.h58
-rw-r--r--src/plugins/qnx/qnxqtversion.cpp123
-rw-r--r--src/plugins/qnx/qnxqtversion.h70
-rw-r--r--src/plugins/qnx/qnxqtversionfactory.cpp89
-rw-r--r--src/plugins/qnx/qnxqtversionfactory.h62
-rw-r--r--src/plugins/qnx/qnxrunconfiguration.cpp112
-rw-r--r--src/plugins/qnx/qnxrunconfiguration.h72
-rw-r--r--src/plugins/qnx/qnxrunconfigurationfactory.cpp157
-rw-r--r--src/plugins/qnx/qnxrunconfigurationfactory.h68
-rw-r--r--src/plugins/qnx/qnxruncontrol.cpp52
-rw-r--r--src/plugins/qnx/qnxruncontrol.h59
-rw-r--r--src/plugins/qnx/qnxruncontrolfactory.cpp153
-rw-r--r--src/plugins/qnx/qnxruncontrolfactory.h67
-rw-r--r--src/plugins/qnx/qnxutils.cpp77
-rw-r--r--src/plugins/qnx/qnxutils.h57
-rw-r--r--src/plugins/remotelinux/linuxdevicetester.cpp5
-rw-r--r--src/plugins/remotelinux/linuxdevicetester.h3
-rw-r--r--src/plugins/remotelinux/remotelinuxapplicationrunner.cpp2
-rw-r--r--src/plugins/remotelinux/remotelinuxapplicationrunner.h2
-rw-r--r--src/plugins/remotelinux/remotelinuxusedportsgatherer.cpp31
-rw-r--r--src/plugins/remotelinux/remotelinuxusedportsgatherer.h2
176 files changed, 11619 insertions, 29 deletions
diff --git a/doc/images/qtcreator-qnx-deployment.png b/doc/images/qtcreator-qnx-deployment.png
new file mode 100755
index 0000000000..7b3313c5ae
--- /dev/null
+++ b/doc/images/qtcreator-qnx-deployment.png
Binary files differ
diff --git a/doc/images/qtcreator-qnx-device-configurations-wizard-1.png b/doc/images/qtcreator-qnx-device-configurations-wizard-1.png
new file mode 100644
index 0000000000..90821bbbe3
--- /dev/null
+++ b/doc/images/qtcreator-qnx-device-configurations-wizard-1.png
Binary files differ
diff --git a/doc/images/qtcreator-qnx-device-configurations-wizard-2.png b/doc/images/qtcreator-qnx-device-configurations-wizard-2.png
new file mode 100644
index 0000000000..79e9564aae
--- /dev/null
+++ b/doc/images/qtcreator-qnx-device-configurations-wizard-2.png
Binary files differ
diff --git a/doc/images/qtcreator-qnx-device-configurations.png b/doc/images/qtcreator-qnx-device-configurations.png
new file mode 100644
index 0000000000..b3c982a5f0
--- /dev/null
+++ b/doc/images/qtcreator-qnx-device-configurations.png
Binary files differ
diff --git a/doc/images/qtcreator-qnx-playbook-development-mode.png b/doc/images/qtcreator-qnx-playbook-development-mode.png
new file mode 100644
index 0000000000..c1e381fc7f
--- /dev/null
+++ b/doc/images/qtcreator-qnx-playbook-development-mode.png
Binary files differ
diff --git a/doc/images/qtcreator-qnx-playbook-storage-sharing.png b/doc/images/qtcreator-qnx-playbook-storage-sharing.png
new file mode 100644
index 0000000000..7e7de5b99e
--- /dev/null
+++ b/doc/images/qtcreator-qnx-playbook-storage-sharing.png
Binary files differ
diff --git a/doc/images/qtcreator-qnx-run-settings.png b/doc/images/qtcreator-qnx-run-settings.png
new file mode 100644
index 0000000000..f1f27ed973
--- /dev/null
+++ b/doc/images/qtcreator-qnx-run-settings.png
Binary files differ
diff --git a/doc/images/qtcreator-qt4-qtversions-win-qnx.png b/doc/images/qtcreator-qt4-qtversions-win-qnx.png
new file mode 100644
index 0000000000..ed5a14b9ac
--- /dev/null
+++ b/doc/images/qtcreator-qt4-qtversions-win-qnx.png
Binary files differ
diff --git a/doc/src/linux-mobile/creator-deployment-madde.qdoc b/doc/src/linux-mobile/creator-deployment-madde.qdoc
index 81318b5b7b..303eed3d72 100644
--- a/doc/src/linux-mobile/creator-deployment-madde.qdoc
+++ b/doc/src/linux-mobile/creator-deployment-madde.qdoc
@@ -29,7 +29,7 @@
\contentspage index.html
\previouspage creator-deployment-symbian.html
\page creator-deployment-maemo.html
- \nextpage creator-connecting-mobile.html
+ \nextpage creator-deployment-qnx.html
\title Deploying Applications to Linux-Based Devices
diff --git a/doc/src/overview/creator-deployment-overview.qdoc b/doc/src/overview/creator-deployment-overview.qdoc
index 35e57834c2..d59ed7dc10 100644
--- a/doc/src/overview/creator-deployment-overview.qdoc
+++ b/doc/src/overview/creator-deployment-overview.qdoc
@@ -55,6 +55,11 @@
can test and debug the application on the device.
You can create Debian installation packages for MeeGo Harmattan and
Maemo 5 devices.
+ \o \l{Deploying Applications to QNX Devices}
+
+ When you deploy the application on the \gui{QNX} target, \QC generates
+ a BAR package in the build directory and deploys it to the connected
+ device. You can test and debug the application on the device.
\endlist
\section1 Related Topics
diff --git a/doc/src/overview/creator-mobile-targets.qdoc b/doc/src/overview/creator-mobile-targets.qdoc
index 498e4964bc..ea343b7568 100644
--- a/doc/src/overview/creator-mobile-targets.qdoc
+++ b/doc/src/overview/creator-mobile-targets.qdoc
@@ -27,7 +27,7 @@
/*!
\contentspage index.html
- \previouspage creator-deployment-maemo.html
+ \previouspage creator-deployment-qnx.html
\page creator-connecting-mobile.html
\nextpage creator-developing-meego.html
@@ -76,6 +76,13 @@
Install and launch the CODA on-device debugging agent on the
devices and connect the devices to the development PC.
+ \o \l{Connecting QNX Devices}
+
+ You can connect QNX devices to the development PC to deploy, run and
+ debug applications on them from within \QC. This is currently only
+ supported for BlackBerry Playbook, and requires the BlackBerry NDK
+ to be installed on the development PC.
+
\endlist
*/
diff --git a/doc/src/overview/creator-target-platforms.qdocinc b/doc/src/overview/creator-target-platforms.qdocinc
index 7a0a7533a5..30d6d83da1 100644
--- a/doc/src/overview/creator-target-platforms.qdocinc
+++ b/doc/src/overview/creator-target-platforms.qdocinc
@@ -16,6 +16,8 @@
\o Symbian
+ \o QNX
+
\endlist
The following table summarizes operating system support for developing
@@ -23,8 +25,8 @@
\table
\header
- \o {1,6} Operating system
- \o {6,1} Platform
+ \o {1,7} Operating system
+ \o {7,1} Platform
\header
\o Desktop
\o \QS
@@ -32,6 +34,7 @@
\o MeeGo Harmattan
\o Generic Remote Linux
\o Symbian
+ \o QNX
\row
\o Windows
@@ -41,6 +44,7 @@
\o Yes
\o Yes
\o Yes
+ \o Yes (see \l{Running on QNX Devices} for limitations)
\row
\o Linux
\o Yes
@@ -49,6 +53,7 @@
\o Yes
\o Yes
\o Yes (by using Remote Compiler for building)
+ \o Yes
\row
\o Mac OS X
\o Yes
@@ -57,4 +62,5 @@
\o Yes
\o Yes
\o Yes (by using Remote Compiler for building)
+ \o Yes
\endtable
diff --git a/doc/src/projects/creator-projects-builds-customizing.qdoc b/doc/src/projects/creator-projects-builds-customizing.qdoc
index 8fb387f272..c630d23e11 100644
--- a/doc/src/projects/creator-projects-builds-customizing.qdoc
+++ b/doc/src/projects/creator-projects-builds-customizing.qdoc
@@ -27,7 +27,7 @@
/*!
\contentspage index.html
- \previouspage creator-developing-symbian.html
+ \previouspage creator-developing-qnx.html
\page creator-build-process-customizing.html
\nextpage creator-maemo-emulator.html
diff --git a/doc/src/projects/creator-projects-qt-versions.qdoc b/doc/src/projects/creator-projects-qt-versions.qdoc
index 159c815121..a509ed11e9 100644
--- a/doc/src/projects/creator-projects-qt-versions.qdoc
+++ b/doc/src/projects/creator-projects-qt-versions.qdoc
@@ -83,6 +83,7 @@
\if defined(qcmanual)
\input symbian/creator-projects-qt-versions-symbian.qdocinc
+ \input qnx/creator-projects-qt-version-qnx.qdocinc
\endif
*/
diff --git a/doc/src/projects/creator-projects-running.qdoc b/doc/src/projects/creator-projects-running.qdoc
index d22212cd29..f8d7159ebd 100644
--- a/doc/src/projects/creator-projects-running.qdoc
+++ b/doc/src/projects/creator-projects-running.qdoc
@@ -55,6 +55,7 @@
\input linux-mobile/creator-projects-running-madde.qdocinc
\input linux-mobile/creator-projects-running-generic-linux.qdocinc
\input symbian/creator-projects-running-symbian.qdocinc
+ \input qnx/creator-projects-running-qnx.qdocinc
\endif
*/
diff --git a/doc/src/projects/creator-projects-settings-run.qdoc b/doc/src/projects/creator-projects-settings-run.qdoc
index 38bb559ea1..5d2742754c 100644
--- a/doc/src/projects/creator-projects-settings-run.qdoc
+++ b/doc/src/projects/creator-projects-settings-run.qdoc
@@ -54,6 +54,7 @@
\input projects/creator-projects-settings-run-debug.qdocinc
\input symbian/creator-projects-settings-run-symbian.qdocinc
\input linux-mobile/creator-projects-settings-run-linux.qdocinc
+ \input qnx/creator-projects-settings-run-qnx.qdocinc
\endif
\section1 Specifying a Custom Executable to Run
diff --git a/doc/src/qnx/creator-deployment-qnx.qdoc b/doc/src/qnx/creator-deployment-qnx.qdoc
new file mode 100644
index 0000000000..936f9f9901
--- /dev/null
+++ b/doc/src/qnx/creator-deployment-qnx.qdoc
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Free Documentation License
+**
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of this
+** file.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+****************************************************************************/
+
+// **********************************************************************
+// NOTE: the sections are not ordered by their logical order to avoid
+// reshuffling the file each time the index order changes (i.e., often).
+// Run the fixnavi.pl script to adjust the links to the index order.
+// **********************************************************************
+
+/*!
+ \contentspage index.html
+ \previouspage creator-deployment-maemo.html
+ \page creator-deployment-qnx.html
+ \nextpage creator-connecting-mobile.html
+
+ \title Deploying Applications to QNX Devices
+
+ When you deploy the application on the \gui{QNX} target, \QC generates
+ a BAR package in the build directory and installs it on the connected
+ device. The contents of the BAR package are specified in the \gui{Application
+ Descriptor File}.
+
+ \image qtcreator-qnx-deployment.png "Deploy to device"
+
+ The name of the generated BAR package is shown in the \gui{Bar package}
+ setting. If the package already exists, it will be overwritten without
+ prior notification.
+
+ \section1 Application Descriptor File
+
+ The application descriptor file needs to be created manually,
+ or you can use the \gui{Application Descriptor} wizard to have a generic
+ template generated. The wizard is available in \gui {File > New File or
+ Project > BlackBerry > Application descriptor}. This wizard will also
+ include a splashscreen.png and an icon.png file which are included in the
+ application descriptor file.
+
+ To tailor your BAR packages, you will have to manually edit the application
+ descriptor file. For a full reference, see
+ \l{https://bdsc.webapps.blackberry.com/native/documentation/com.qnx.doc.native_sdk.devguide/com.qnx.doc.native_sdk.devguide/topic/r_blackberry_tablet_dtd_intro.html}
+ {Document Type Definition (DTD) for the application descriptor file}.
+*/
diff --git a/doc/src/qnx/creator-developing-qnx.qdoc b/doc/src/qnx/creator-developing-qnx.qdoc
new file mode 100644
index 0000000000..7cca506a12
--- /dev/null
+++ b/doc/src/qnx/creator-developing-qnx.qdoc
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Free Documentation License
+**
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of this
+** file.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+****************************************************************************/
+
+/*!
+ \contentspage index.html
+ \previouspage creator-developing-symbian.html
+ \page creator-developing-qnx.html
+ \nextpage creator-build-process-customizing.html
+
+ \title Connecting QNX Devices
+
+ You can connect QNX devices to the development PC to deploy, run and debug
+ applications on them from within \QC.
+
+ \section1 Setting Up Connectivity on Playbook
+
+ In order to deploy applications to the Playbook, you will need to enable
+ Development Mode on the device and upload a debug token to it.
+
+ Enabling Development Mode is done by sliding top-down on the Playbook,
+ thereby opening the \gui{Preferences}. Now go to \gui{Security >
+ Development Mode} and set \gui{Use Development Mode} to \gui{ON}. Enter the
+ device password when asked to do so.
+
+ \image qtcreator-qnx-playbook-development-mode.png
+
+ \section2 USB Access
+
+ The \gui{Development Address} shown in the \gui{Development Mode} settings
+ is the IP address to use when you are connecting the device with a USB
+ cable to the development PC. If you are deploying over a Wi-Fi network, you
+ should use the IP address shown in \gui{Preferences > About > Network}.
+
+ To enable access over USB, change \gui{Preferences > Storage & Sharing >
+ USB Connections} to \gui{Connect to Windows} if you are deploying from
+ Windows, or \gui{Connect to Mac} if you are deploying from Linux or Mac OS.
+
+ \image qtcreator-qnx-playbook-storage-sharing.png
+
+ \section2 Debug Token
+
+ If you are using a physical device, you will have to upload a debug token to
+ the device. The simulator does not require any debug token.
+
+ \section3 Create a Debug Token
+
+ You can create the debug token either in QNX Momentics or from the command
+ line. There is currently no support for creating the debug token from
+ within \QC.
+
+ From the command line:
+ \c{blackberry-debugtokenrequest -storepass <pass> -devicepin <your PB pin> debugtoken.bar}
+
+ \section3 Install Debug Token on Playbook
+
+ You can install the debug token on the Playbook either in QNX Momentics or
+ from the command line. There is currently no support for installing the
+ debug token from within \QC.
+
+ From the command line:
+ \c{blackberry-nativepackage -installDebugToken ~/.rim/debugtoken.bar -device <device_ip> [-password <device_pass>]}
+
+ \section1 Adding a QNX Device in \QC
+
+ Adding a QNX device is done using a wizard in the \gui{Device
+ Configurations} options. To launch it, go to \gui{Tools > Options >
+ Linux Devices > Device Configurations > Add... > QNX device > Start
+ Wizard}.
+
+ \image qtcreator-qnx-device-configurations-wizard-1.png "Connection details"
+
+ \list
+ \o In the \gui{The name to identify this configuration} field, enter a
+ name for the device.
+ \o In the \gui{The device's host name or IP address} field, enter the
+ host name or IP address of the device.
+ \o In the \gui{Device password} field, enter the password for the device.
+ \o In the \gui{Device type} field, select whether it is a \gui{Physical
+ device} or a \gui{Simulator} you are connecting to.
+ \o In the \gui{Debug token} field, enter the path to the debug token
+ that is also installed on the device. This is only necessary if you are
+ connecting to a \gui{Physical device}.
+ \o Click \gui{Next} to continue.
+ \endlist
+
+ \image qtcreator-qnx-device-configurations-wizard-2.png "SSH Key Setup"
+
+ For the \gui{SSH Key Setup}, you can either select an existing \bold{4096}-bit
+ key, or click \gui{Generate} to create a new key. The generated key will be
+ stored next to the \QC settings, in a \bold{qnx} sub-directory.
+
+ Click \gui{Next} and then \gui{Finish} to complete setting up the device
+ connection.
+
+ Once the device is added, you can edit the settings directly in the
+ \gui{Device Configurations} options page.
+
+ \image qtcreator-qnx-device-configurations.png "Device Configurations"
+*/
diff --git a/doc/src/qnx/creator-projects-qt-version-qnx.qdocinc b/doc/src/qnx/creator-projects-qt-version-qnx.qdocinc
new file mode 100644
index 0000000000..33c47cdb8a
--- /dev/null
+++ b/doc/src/qnx/creator-projects-qt-version-qnx.qdocinc
@@ -0,0 +1,21 @@
+ \section2 Setting Up Qt for QNX Versions
+
+ If you install Qt for QNX as a part of Qt Playbook SDK, it is automatically
+ detected by \QC. The \gui {BlackBerry Native SDK} field displays the path to the directory where
+ the Blackberry NDK is located.
+
+ To view Qt for QNX version settings, select \gui {Tools > Options >
+ Build & Run > Qt Versions}.
+
+ \image qtcreator-qt4-qtversions-win-qnx.png
+
+ If you have built your own version of Qt for QNX you need to add this manually to Qt Creator
+ using the above dialog:
+
+ \list
+ \o Select \gui {Tools > Options > Build & Run > Qt Versions > Add}.
+ \o Navigate to and select the qmake application that is part of your Qt for QNX build and select
+ \gui {Open}.
+ \o In the \gui {Blackberry Native SDK} field enter the path to your installed Blackberry NDK.
+ \o Select \gui {OK}.
+ \endlist
diff --git a/doc/src/qnx/creator-projects-running-qnx.qdocinc b/doc/src/qnx/creator-projects-running-qnx.qdocinc
new file mode 100644
index 0000000000..eab2b06e79
--- /dev/null
+++ b/doc/src/qnx/creator-projects-running-qnx.qdocinc
@@ -0,0 +1,37 @@
+ \section1 Running on QNX Devices
+
+ \list 1
+
+ \o Connect the device to the development PC or to the Wi-Fi network.
+
+ \o Configure the device and specify a connection to it. For more
+ information, see \l{Connecting QNX Devices}.
+
+ \o Create an Application Descriptor File if it does not already exist.
+ For more information, see \l{Deploying Applications to QNX
+ Devices}.
+
+ \o Click the \gui Run button.
+
+ \endlist
+
+ \QC uses the compiler specified in the QNX tool chain to build the
+ application.
+
+ \QC generates a BAR package, installs it on the device, and
+ executes the selected application. The application views are displayed on
+ the device. Command-line output is visible in the \QC
+ \gui {Application Output} view.
+
+ \note Debugging is currently only fully supported on Linux and Mac OS.
+ It is not possible to insert breakpoints during runtime on Windows.
+
+ \section2 Troubleshooting Errors
+
+ For the command-line output to show up in the \gui{Application Output}
+ view, \QC needs to be able to establish an SSH connection to the device.
+ This is only possible if QNX Momentics is not running, and the SSH key
+ configured for the device is a 4096-bit key.
+
+ If these conditions are not met, you will get an error message saying debug
+ output cannot be shown. \ No newline at end of file
diff --git a/doc/src/qnx/creator-projects-settings-run-qnx.qdocinc b/doc/src/qnx/creator-projects-settings-run-qnx.qdocinc
new file mode 100644
index 0000000000..244e119fa1
--- /dev/null
+++ b/doc/src/qnx/creator-projects-settings-run-qnx.qdocinc
@@ -0,0 +1,13 @@
+ \section2 Specifying Run Settings for QNX Devices
+
+ To run and debug an application on a QNX device, you must create connections
+ from the development PC to the device. Click \gui {Manage device configurations}
+ to create a connection. For more information, see \l{Connecting QNX
+ Devices}.
+
+ \image qtcreator-qnx-run-settings.png "Run settings for QNX devices"
+
+ When you run the application on the QNX device, \QC first creates a BAR package
+ using the settings in the Application Descriptor File. The default is to create the
+ BAR package in the build directory. The BAR package is then deployed onto the
+ selected device. For more information, see \l{Deploying Applications to QNX Devices}.
diff --git a/doc/src/qtcreator.qdoc b/doc/src/qtcreator.qdoc
index 82fd31ea06..e766d78abe 100644
--- a/doc/src/qtcreator.qdoc
+++ b/doc/src/qtcreator.qdoc
@@ -240,6 +240,7 @@
\list
\o \l{Deploying Applications to Symbian Devices}
\o \l{Deploying Applications to Linux-Based Devices}
+ \o \l{Deploying Applications to QNX Devices}
\endlist
\o \l{Connecting Mobile Targets}
\list
@@ -247,6 +248,7 @@
\o \l{Connecting Embedded Linux Devices}
\o \l{Connecting Maemo Devices}
\o \l{Connecting Symbian Devices}
+ \o \l{Connecting QNX Devices}
\endlist
\o \l{Customizing the Build Process}
\o \l{Using Maemo or MeeGo Harmattan Emulator}
diff --git a/doc/src/symbian/symbiandev.qdoc b/doc/src/symbian/symbiandev.qdoc
index bd70ad1b77..3dddaf2a25 100644
--- a/doc/src/symbian/symbiandev.qdoc
+++ b/doc/src/symbian/symbiandev.qdoc
@@ -28,7 +28,7 @@
\endif
\page creator-developing-symbian.html
\if defined(qcmanual)
- \nextpage creator-build-process-customizing.html
+ \nextpage creator-developing-qnx.html
\else
\nextpage creator-developing-meego.html
\endif
diff --git a/share/qtcreator/templates/wizards/bb-bardescriptor/bar-descriptor.xml b/share/qtcreator/templates/wizards/bb-bardescriptor/bar-descriptor.xml
new file mode 100644
index 0000000000..b8fe696b5e
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-bardescriptor/bar-descriptor.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
+ <id>ID</id>
+ <name>PROJECTNAME</name>
+ <versionNumber>1.0.0</versionNumber>
+ <description>DESCRIPTION</description>
+
+ <initialWindow>
+ <systemChrome>none</systemChrome>
+ <transparent>false</transparent>
+ <autoOrients>true</autoOrients>
+ <aspectRatio>landscape</aspectRatio>
+ </initialWindow>
+ <publisher>PUBLISHER</publisher>
+ <copyright>COPYRIGHT</copyright>
+ <env var="QML_IMPORT_PATH" value="app/native/imports"/>
+ <env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
+ <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
+ <arg>-platform</arg>
+ <arg>blackberry</arg>
+ <arg>-style</arg>
+ <arg>qnxlight</arg>
+
+ <action system="true">run_native</action>
+
+ <!-- PROJECTPATH should point to the project binary, path can be relative -->
+ <asset entry="true" path="PROJECTPATH" type="Qnx/Elf">PROJECTNAME</asset>
+
+ <!-- These values will be replaced when deploying in Qt Creator -->
+ <asset path="%QT_INSTALL_LIBS%">lib</asset>
+ <asset path="%QT_INSTALL_PLUGINS%">plugins</asset>
+ <asset path="%QT_INSTALL_IMPORTS%">imports</asset>
+</qnx>
diff --git a/share/qtcreator/templates/wizards/bb-bardescriptor/wizard.xml b/share/qtcreator/templates/wizards/bb-bardescriptor/wizard.xml
new file mode 100644
index 0000000000..3d81578a7b
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-bardescriptor/wizard.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**************************************************************************/
+-->
+
+<wizard version="1" kind="file" id="Q.QnxBlackBerryBarDescriptor" category="Q.BlackBerry"
+ featuresRequired="QtSupport.Wizards.FeatureBlackBerry">
+ <description>Creates an application descriptor file.</description>
+ <displayname>Application descriptor</displayname>;
+ <displaycategory>BlackBerry</displaycategory>
+ <files>
+ <file source="bar-descriptor.xml" openeditor="true"/>
+ </files>
+</wizard>
diff --git a/share/qtcreator/templates/wizards/bb-guiapp/bar-descriptor.xml b/share/qtcreator/templates/wizards/bb-guiapp/bar-descriptor.xml
new file mode 100644
index 0000000000..09fe868ef0
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-guiapp/bar-descriptor.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
+ <id>ID</id>
+ <name>%ProjectName%</name>
+ <versionNumber>1.0.0</versionNumber>
+ <description>DESCRIPTION</description>
+
+ <initialWindow>
+ <systemChrome>none</systemChrome>
+ <transparent>false</transparent>
+ <autoOrients>true</autoOrients>
+ <aspectRatio>landscape</aspectRatio>
+ </initialWindow>
+
+ <env var="QML_IMPORT_PATH" value="app/native/imports"/>
+ <env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
+ <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
+ <arg>-platform</arg>
+ <arg>blackberry</arg>
+
+ <action system="true">run_native</action>
+ <asset entry="true" path="%ProjectName%" type="Qnx/Elf">%ProjectName%</asset>
+
+ <!-- These values will be replaced when deploying in Qt Creator -->
+ <asset path="%QT_INSTALL_LIBS%">lib</asset>
+ <asset path="%QT_INSTALL_PLUGINS%">plugins</asset>
+ <asset path="%QT_INSTALL_IMPORTS%">imports</asset>
+</qnx>
diff --git a/share/qtcreator/templates/wizards/bb-guiapp/icon.png b/share/qtcreator/templates/wizards/bb-guiapp/icon.png
new file mode 100644
index 0000000000..6bbf3761ef
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-guiapp/icon.png
Binary files differ
diff --git a/share/qtcreator/templates/wizards/bb-guiapp/main.cpp b/share/qtcreator/templates/wizards/bb-guiapp/main.cpp
new file mode 100644
index 0000000000..198a87db96
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-guiapp/main.cpp
@@ -0,0 +1,12 @@
+#include <QApplication>
+#include "mainwidget.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+
+ MainWidget w;
+ w.showMaximized();
+
+ return a.exec();
+}
diff --git a/share/qtcreator/templates/wizards/bb-guiapp/mainwidget.cpp b/share/qtcreator/templates/wizards/bb-guiapp/mainwidget.cpp
new file mode 100644
index 0000000000..4c353088e4
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-guiapp/mainwidget.cpp
@@ -0,0 +1,14 @@
+#include "mainwidget.h"
+#include "ui_mainwidget.h"
+
+MainWidget::MainWidget(QWidget *parent) :
+ QWidget(parent),
+ ui(new Ui::MainWidget)
+{
+ ui->setupUi(this);
+}
+
+MainWidget::~MainWidget()
+{
+ delete ui;
+}
diff --git a/share/qtcreator/templates/wizards/bb-guiapp/mainwidget.h b/share/qtcreator/templates/wizards/bb-guiapp/mainwidget.h
new file mode 100644
index 0000000000..bc6b7faf77
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-guiapp/mainwidget.h
@@ -0,0 +1,22 @@
+#ifndef MAINWIDGET_H
+#define MAINWIDGET_H
+
+#include <QWidget>
+
+namespace Ui {
+class MainWidget;
+}
+
+class MainWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit MainWidget(QWidget *parent = 0);
+ ~MainWidget();
+
+private:
+ Ui::MainWidget *ui;
+};
+
+#endif // MAINWIDGET_H
diff --git a/share/qtcreator/templates/wizards/bb-guiapp/mainwidget.ui b/share/qtcreator/templates/wizards/bb-guiapp/mainwidget.ui
new file mode 100644
index 0000000000..a3c38c7a8a
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-guiapp/mainwidget.ui
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWidget</class>
+ <widget class="QWidget" name="MainWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Hello World</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/share/qtcreator/templates/wizards/bb-guiapp/project.pro b/share/qtcreator/templates/wizards/bb-guiapp/project.pro
new file mode 100644
index 0000000000..d4b4aedb63
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-guiapp/project.pro
@@ -0,0 +1,7 @@
+TEMPLATE = app
+
+SOURCES += main.cpp mainwidget.cpp
+HEADERS += mainwidget.h
+FORMS += mainwidget.ui
+
+OTHER_FILES += bar-descriptor.xml
diff --git a/share/qtcreator/templates/wizards/bb-guiapp/wizard.xml b/share/qtcreator/templates/wizards/bb-guiapp/wizard.xml
new file mode 100644
index 0000000000..b9b6e1d41c
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-guiapp/wizard.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+-->
+<wizard version="1" kind="project"
+ class="qt4project" firstpage="10"
+ id="Q.QnxBlackBerryGuiApp" category="F.QtApplications"
+ featuresRequired="QtSupport.Wizards.FeatureBlackBerry">
+ <icon>icon.png</icon>
+ <displayname>BlackBerry Qt Gui Application</displayname>;
+ <description>Creates a Qt Gui application for BlackBerry.</description>
+ <files>
+ <file source="main.cpp" openeditor="true"/>
+ <file source="mainwidget.cpp" openeditor="true"/>
+ <file source="mainwidget.h" openeditor="true"/>
+ <file source="mainwidget.ui" openeditor="true"/>
+ <file source="bar-descriptor.xml" openeditor="true"/>
+ <file source="project.pro" target="%ProjectName%.pro" openproject="true"/>
+ </files>
+</wizard>
diff --git a/share/qtcreator/templates/wizards/bb-qt5-bardescriptor/bar-descriptor.xml b/share/qtcreator/templates/wizards/bb-qt5-bardescriptor/bar-descriptor.xml
new file mode 100644
index 0000000000..1dc09ef123
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-qt5-bardescriptor/bar-descriptor.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
+ <id>ID</id>
+ <name>PROJECTNAME</name>
+ <versionNumber>1.0.0</versionNumber>
+ <description>DESCRIPTION</description>
+
+ <initialWindow>
+ <systemChrome>none</systemChrome>
+ <transparent>false</transparent>
+ <autoOrients>true</autoOrients>
+ <aspectRatio>landscape</aspectRatio>
+ </initialWindow>
+ <publisher>PUBLISHER</publisher>
+ <copyright>COPYRIGHT</copyright>
+
+ <env var="QML_IMPORT_PATH" value="app/native/imports"/>
+ <env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
+ <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
+ <arg>-style</arg>
+ <arg>qnxlight</arg>
+
+ <action system="true">run_native</action>
+
+ <!-- PROJECTPATH should point to the project binary, path can be relative -->
+ <asset entry="true" path="PROJECTPATH" type="Qnx/Elf">PROJECTNAME</asset>
+
+ <!-- These values will be replaced when deploying in Qt Creator -->
+ <asset path="%QT_INSTALL_LIBS%">lib</asset>
+ <asset path="%QT_INSTALL_PLUGINS%">plugins</asset>
+ <asset path="%QT_INSTALL_IMPORTS%">imports</asset>
+</qnx>
diff --git a/share/qtcreator/templates/wizards/bb-qt5-bardescriptor/wizard.xml b/share/qtcreator/templates/wizards/bb-qt5-bardescriptor/wizard.xml
new file mode 100644
index 0000000000..fda61da506
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-qt5-bardescriptor/wizard.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**************************************************************************/
+-->
+
+<wizard version="1" kind="file" id="Q.QnxBlackBerryBarDescriptor" category="Q.BlackBerry"
+ featuresRequired="QtSupport.Wizards.FeatureBlackBerry">
+ <description>Creates an Qt5 application descriptor file.</description>
+ <displayname>Qt5 Application descriptor</displayname>;
+ <displaycategory>BlackBerry</displaycategory>
+ <files>
+ <file source="bar-descriptor.xml" openeditor="true"/>
+ </files>
+</wizard>
diff --git a/share/qtcreator/templates/wizards/bb-qt5-guiapp/bar-descriptor.xml b/share/qtcreator/templates/wizards/bb-qt5-guiapp/bar-descriptor.xml
new file mode 100644
index 0000000000..d1de845019
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-qt5-guiapp/bar-descriptor.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
+ <id>ID</id>
+ <name>%ProjectName%</name>
+ <versionNumber>1.0.0</versionNumber>
+ <description>DESCRIPTION</description>
+
+ <initialWindow>
+ <systemChrome>none</systemChrome>
+ <transparent>false</transparent>
+ <autoOrients>true</autoOrients>
+ <aspectRatio>landscape</aspectRatio>
+ </initialWindow>
+
+ <env var="QML_IMPORT_PATH" value="app/native/imports"/>
+ <env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
+ <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
+ <publisher>PUBLISHER</publisher>
+ <copyright>COPYRIGHT</copyright>
+
+ <action system="true">run_native</action>
+ <asset entry="true" path="%ProjectName%" type="Qnx/Elf">%ProjectName%</asset>
+
+ <!-- These values will be replaced when deploying in Qt Creator -->
+ <asset path="%QT_INSTALL_LIBS%">lib</asset>
+ <asset path="%QT_INSTALL_PLUGINS%">plugins</asset>
+ <asset path="%QT_INSTALL_IMPORTS%">imports</asset>
+</qnx>
diff --git a/share/qtcreator/templates/wizards/bb-qt5-guiapp/icon.png b/share/qtcreator/templates/wizards/bb-qt5-guiapp/icon.png
new file mode 100644
index 0000000000..6bbf3761ef
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-qt5-guiapp/icon.png
Binary files differ
diff --git a/share/qtcreator/templates/wizards/bb-qt5-guiapp/main.cpp b/share/qtcreator/templates/wizards/bb-qt5-guiapp/main.cpp
new file mode 100644
index 0000000000..f49892189e
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-qt5-guiapp/main.cpp
@@ -0,0 +1,13 @@
+#include <QtGui/QGuiApplication>
+#include "mainwidget.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+
+ MainWidget w;
+ w.showFullScreen();
+
+
+ return a.exec();
+}
diff --git a/share/qtcreator/templates/wizards/bb-qt5-guiapp/mainwidget.cpp b/share/qtcreator/templates/wizards/bb-qt5-guiapp/mainwidget.cpp
new file mode 100644
index 0000000000..4c353088e4
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-qt5-guiapp/mainwidget.cpp
@@ -0,0 +1,14 @@
+#include "mainwidget.h"
+#include "ui_mainwidget.h"
+
+MainWidget::MainWidget(QWidget *parent) :
+ QWidget(parent),
+ ui(new Ui::MainWidget)
+{
+ ui->setupUi(this);
+}
+
+MainWidget::~MainWidget()
+{
+ delete ui;
+}
diff --git a/share/qtcreator/templates/wizards/bb-qt5-guiapp/mainwidget.h b/share/qtcreator/templates/wizards/bb-qt5-guiapp/mainwidget.h
new file mode 100644
index 0000000000..9c17cff5fc
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-qt5-guiapp/mainwidget.h
@@ -0,0 +1,22 @@
+#ifndef MAINWIDGET_H
+#define MAINWIDGET_H
+
+#include <QtWidgets>
+
+namespace Ui {
+class MainWidget;
+}
+
+class MainWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit MainWidget(QWidget *parent = 0);
+ ~MainWidget();
+
+private:
+ Ui::MainWidget *ui;
+};
+
+#endif // MAINWIDGET_H
diff --git a/share/qtcreator/templates/wizards/bb-qt5-guiapp/mainwidget.ui b/share/qtcreator/templates/wizards/bb-qt5-guiapp/mainwidget.ui
new file mode 100644
index 0000000000..a3c38c7a8a
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-qt5-guiapp/mainwidget.ui
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWidget</class>
+ <widget class="QWidget" name="MainWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Hello World</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/share/qtcreator/templates/wizards/bb-qt5-guiapp/project.pro b/share/qtcreator/templates/wizards/bb-qt5-guiapp/project.pro
new file mode 100644
index 0000000000..88835eca2c
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-qt5-guiapp/project.pro
@@ -0,0 +1,11 @@
+TEMPLATE = app
+
+QT += widgets
+
+SOURCES += main.cpp mainwidget.cpp
+HEADERS += mainwidget.h
+FORMS += mainwidget.ui
+
+OTHER_FILES += bar-descriptor.xml
+
+
diff --git a/share/qtcreator/templates/wizards/bb-qt5-guiapp/wizard.xml b/share/qtcreator/templates/wizards/bb-qt5-guiapp/wizard.xml
new file mode 100644
index 0000000000..325e630217
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-qt5-guiapp/wizard.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+-->
+<wizard version="1" kind="project"
+ class="qt4project" firstpage="10"
+ id="Q.QnxBlackBerryGuiApp" category="F.QtApplications"
+ featuresRequired="QtSupport.Wizards.FeatureBlackBerry">
+ <icon>icon.png</icon>
+ <displayname>BlackBerry Qt5 Gui Application</displayname>;
+ <description>Creates a Qt5 Gui application for BlackBerry.</description>
+ <files>
+ <file source="main.cpp" openeditor="true"/>
+ <file source="mainwidget.cpp" openeditor="true"/>
+ <file source="mainwidget.h" openeditor="true"/>
+ <file source="mainwidget.ui" openeditor="true"/>
+ <file source="bar-descriptor.xml" openeditor="true"/>
+ <file source="project.pro" target="%ProjectName%.pro" openproject="true"/>
+ </files>
+</wizard>
diff --git a/share/qtcreator/templates/wizards/bb-qt5-quick2app/bar-descriptor.xml b/share/qtcreator/templates/wizards/bb-qt5-quick2app/bar-descriptor.xml
new file mode 100644
index 0000000000..0acc8145a0
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-qt5-quick2app/bar-descriptor.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
+ <id>ID</id>
+ <name>%ProjectName%</name>
+ <versionNumber>1.0.0</versionNumber>
+ <description>DESCRIPTION</description>
+
+ <initialWindow>
+ <systemChrome>none</systemChrome>
+ <transparent>false</transparent>
+ <autoOrients>true</autoOrients>
+ <aspectRatio>landscape</aspectRatio>
+ </initialWindow>
+ <publisher>PUBLISHER</publisher>
+ <copyright>COPYRIGHT</copyright>
+
+ <env var="QML_IMPORT_PATH" value="app/native/imports"/>
+ <env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
+ <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
+
+ <action system="true">run_native</action>
+ <asset entry="true" path="%ProjectName%" type="Qnx/Elf">%ProjectName%</asset>
+
+ <asset path="%SRC_DIR%/qml">qml</asset>
+
+ <!-- These values will be replaced when deploying in Qt Creator -->
+ <asset path="%QT_INSTALL_LIBS%">lib</asset>
+ <asset path="%QT_INSTALL_PLUGINS%">plugins</asset>
+ <asset path="%QT_INSTALL_IMPORTS%">imports</asset>
+</qnx>
diff --git a/share/qtcreator/templates/wizards/bb-qt5-quick2app/icon.png b/share/qtcreator/templates/wizards/bb-qt5-quick2app/icon.png
new file mode 100644
index 0000000000..6bbf3761ef
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-qt5-quick2app/icon.png
Binary files differ
diff --git a/share/qtcreator/templates/wizards/bb-qt5-quick2app/main.cpp b/share/qtcreator/templates/wizards/bb-qt5-quick2app/main.cpp
new file mode 100644
index 0000000000..c90d2f8a6c
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-qt5-quick2app/main.cpp
@@ -0,0 +1,26 @@
+#include <QWindow>
+#include <QtDeclarative>
+#include <QQuickView>
+
+int main( int argc, char** argv )
+{
+ QGuiApplication app( argc, argv );
+
+ QWindow *window = 0;
+ int exitCode = 0;
+
+ QQuickView* view = new QQuickView();
+ view->setResizeMode( QQuickView::SizeRootObjectToView );
+ view->setSource( QUrl( "app/native/qml/main.qml" ) );
+
+ QDeclarativeEngine* engine = view->engine();
+ QObject::connect( engine, SIGNAL( quit() ),
+ QCoreApplication::instance(), SLOT( quit() ) );
+ window = view;
+ window->showMaximized();
+
+ exitCode = app.exec();
+
+ delete window;
+ return exitCode;
+}
diff --git a/share/qtcreator/templates/wizards/bb-qt5-quick2app/project.pro b/share/qtcreator/templates/wizards/bb-qt5-quick2app/project.pro
new file mode 100644
index 0000000000..b55dddd24f
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-qt5-quick2app/project.pro
@@ -0,0 +1,12 @@
+TEMPLATE = app
+
+QT += qml quick
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+OTHER_FILES += bar-descriptor.xml \
+ qml/main.qml
diff --git a/share/qtcreator/templates/wizards/bb-qt5-quick2app/qml/main.qml b/share/qtcreator/templates/wizards/bb-qt5-quick2app/qml/main.qml
new file mode 100644
index 0000000000..5968d86973
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-qt5-quick2app/qml/main.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 1024
+ height: 600
+ Text {
+ text: qsTr("Hello from QtQuick2")
+ anchors.centerIn: parent
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ Qt.quit();
+ }
+ }
+}
+
diff --git a/share/qtcreator/templates/wizards/bb-qt5-quick2app/wizard.xml b/share/qtcreator/templates/wizards/bb-qt5-quick2app/wizard.xml
new file mode 100644
index 0000000000..09c363184c
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-qt5-quick2app/wizard.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+-->
+<wizard version="1" kind="project"
+ class="qt4project" firstpage="10"
+ id="Q.QnxBlackBerryQQ2App" category="F.QtApplications"
+ featuresRequired="QtSupport.Wizards.FeatureBlackBerry">
+ <icon>icon.png</icon>
+ <displayname>BlackBerry Qt Quick 2 Application</displayname>;
+ <description>Creates a Qt Quick 2 application for BlackBerry.</description>
+ <files>
+ <file source="main.cpp" openeditor="true"/>
+ <file source="qml/main.qml" openeditor="true"/>
+ <file source="bar-descriptor.xml" openeditor="true"/>
+ <file source="project.pro" target="%ProjectName%.pro" openproject="true"/>
+ </files>
+</wizard>
diff --git a/share/qtcreator/templates/wizards/bb-quickapp/bar-descriptor.xml b/share/qtcreator/templates/wizards/bb-quickapp/bar-descriptor.xml
new file mode 100644
index 0000000000..f1059b31d5
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-quickapp/bar-descriptor.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
+ <id>ID</id>
+ <name>%ProjectName%</name>
+ <versionNumber>1.0.0</versionNumber>
+ <description>DESCRIPTION</description>
+
+ <initialWindow>
+ <systemChrome>none</systemChrome>
+ <transparent>false</transparent>
+ <autoOrients>true</autoOrients>
+ <aspectRatio>landscape</aspectRatio>
+ </initialWindow>
+
+ <env var="QML_IMPORT_PATH" value="app/native/imports"/>
+ <env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
+ <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
+ <arg>-platform</arg>
+ <arg>blackberry</arg>
+
+ <action system="true">run_native</action>
+ <asset entry="true" path="%ProjectName%" type="Qnx/Elf">%ProjectName%</asset>
+
+ <asset path="%SRC_DIR%/qml">qml</asset>
+
+ <!-- These values will be replaced when deploying in Qt Creator -->
+ <asset path="%QT_INSTALL_LIBS%">lib</asset>
+ <asset path="%QT_INSTALL_PLUGINS%">plugins</asset>
+ <asset path="%QT_INSTALL_IMPORTS%">imports</asset>
+</qnx>
diff --git a/share/qtcreator/templates/wizards/bb-quickapp/icon.png b/share/qtcreator/templates/wizards/bb-quickapp/icon.png
new file mode 100644
index 0000000000..6bbf3761ef
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-quickapp/icon.png
Binary files differ
diff --git a/share/qtcreator/templates/wizards/bb-quickapp/main.cpp b/share/qtcreator/templates/wizards/bb-quickapp/main.cpp
new file mode 100644
index 0000000000..0567683b62
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-quickapp/main.cpp
@@ -0,0 +1,20 @@
+#include <QApplication>
+#include <QDeclarativeView>
+#include <QObject>
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+
+ QDeclarativeView view;
+#ifdef Q_OS_QNX
+ view.setSource(QUrl("app/native/qml/main.qml"));
+#else
+ view.setSource(QUrl("qml/main.qml"));
+#endif
+ view.setAttribute(Qt::WA_AutoOrientation, true);
+ view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ view.showMaximized();
+
+ return a.exec();
+}
diff --git a/share/qtcreator/templates/wizards/bb-quickapp/project.pro b/share/qtcreator/templates/wizards/bb-quickapp/project.pro
new file mode 100644
index 0000000000..637b8046f4
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-quickapp/project.pro
@@ -0,0 +1,12 @@
+TEMPLATE = app
+
+QT += declarative
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp
+
+OTHER_FILES += bar-descriptor.xml \
+ qml/main.qml
diff --git a/share/qtcreator/templates/wizards/bb-quickapp/qml/main.qml b/share/qtcreator/templates/wizards/bb-quickapp/qml/main.qml
new file mode 100644
index 0000000000..8cac67b0b3
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-quickapp/qml/main.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.1
+
+Rectangle {
+ width: 360
+ height: 360
+ Text {
+ text: qsTr("Hello World")
+ anchors.centerIn: parent
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ Qt.quit();
+ }
+ }
+}
+
diff --git a/share/qtcreator/templates/wizards/bb-quickapp/wizard.xml b/share/qtcreator/templates/wizards/bb-quickapp/wizard.xml
new file mode 100644
index 0000000000..dd6a3a04c3
--- /dev/null
+++ b/share/qtcreator/templates/wizards/bb-quickapp/wizard.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+-->
+<wizard version="1" kind="project"
+ class="qt4project" firstpage="10"
+ id="Q.QnxBlackBerryQQApp" category="F.QtApplications"
+ featuresRequired="QtSupport.Wizards.FeatureBlackBerry">
+ <icon>icon.png</icon>
+ <displayname>BlackBerry Qt Quick Application</displayname>;
+ <description>Creates a Qt Quick application for BlackBerry.</description>
+ <files>
+ <file source="main.cpp" openeditor="true"/>
+ <file source="qml/main.qml" openeditor="true"/>
+ <file source="bar-descriptor.xml" openeditor="true"/>
+ <file source="project.pro" target="%ProjectName%.pro" openproject="true"/>
+ </files>
+</wizard>
diff --git a/src/plugins/debugger/debuggerstartparameters.h b/src/plugins/debugger/debuggerstartparameters.h
index 51a5bd51b4..5201c9a9fb 100644
--- a/src/plugins/debugger/debuggerstartparameters.h
+++ b/src/plugins/debugger/debuggerstartparameters.h
@@ -144,6 +144,9 @@ public:
QString serverAddress;
quint16 serverPort;
+ // For QNX debugging
+ QString remoteExecutable;
+
// For Debugger testing.
QObject *testReceiver;
const char *testCallback;
diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp
index 0f1d3e09ed..fc26e49af6 100644
--- a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp
+++ b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp
@@ -170,11 +170,17 @@ void GdbRemoteServerEngine::setupInferior()
#else
#define PATHSEP ":"
#endif
- QString fileName;
+ QString executableFileName;
if (!sp.executable.isEmpty()) {
QFileInfo fi(sp.executable);
- fileName = fi.absoluteFilePath();
+ executableFileName = fi.absoluteFilePath();
}
+ QString symbolFileName;
+ if (!sp.symbolFileName.isEmpty()) {
+ QFileInfo fi(sp.symbolFileName);
+ symbolFileName = fi.absoluteFilePath();
+ }
+
//const QByteArray sysroot = sp.sysroot.toLocal8Bit();
//const QByteArray remoteArch = sp.remoteArchitecture.toLatin1();
//const QByteArray gnuTarget = sp.gnuTarget.toLatin1();
@@ -213,14 +219,21 @@ void GdbRemoteServerEngine::setupInferior()
if (debuggerCore()->boolSetting(TargetAsync))
postCommand("set target-async on", CB(handleSetTargetAsync));
- if (fileName.isEmpty()) {
+ if (executableFileName.isEmpty() && symbolFileName.isEmpty()) {
showMessage(tr("No symbol file given."), StatusBar);
callTargetRemote();
return;
}
- postCommand("-file-exec-and-symbols \"" + fileName.toLocal8Bit() + '"',
- CB(handleFileExecAndSymbols));
+ if (!symbolFileName.isEmpty()) {
+ postCommand("-file-symbol-file \""
+ + symbolFileName.toLocal8Bit() + '"',
+ CB(handleFileExecAndSymbols));
+ }
+ if (!executableFileName.isEmpty()) {
+ postCommand("-file-exec-and-symbols \"" + executableFileName.toLocal8Bit() + '"',
+ CB(handleFileExecAndSymbols));
+ }
}
void GdbRemoteServerEngine::handleSetTargetAsync(const GdbResponse &response)
@@ -302,7 +315,7 @@ void GdbRemoteServerEngine::handleTargetQnx(const GdbResponse &response)
showMessage(_("INFERIOR STARTED"));
showMessage(msgAttachedToStoppedInferior(), StatusBar);
- const qint64 pid = startParameters().attachPID;
+ const qint64 pid = isMasterEngine() ? startParameters().attachPID : masterEngine()->startParameters().attachPID;
if (pid > -1) {
postCommand("attach " + QByteArray::number(pid), CB(handleAttach));
} else {
@@ -342,8 +355,28 @@ void GdbRemoteServerEngine::handleAttach(const GdbResponse &response)
void GdbRemoteServerEngine::runEngine()
{
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
- notifyEngineRunAndInferiorStopOk();
- continueInferiorInternal();
+
+ const QString remoteExecutable = startParameters().remoteExecutable;
+ if (!remoteExecutable.isEmpty()) {
+ postCommand("-exec-run " + remoteExecutable.toLocal8Bit(), GdbEngine::RunRequest, CB(handleExecRun));
+ } else {
+ notifyEngineRunAndInferiorStopOk();
+ continueInferiorInternal();
+ }
+}
+
+void GdbRemoteServerEngine::handleExecRun(const GdbResponse &response)
+{
+ QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
+ if (response.resultClass == GdbResultRunning) {
+ notifyEngineRunAndInferiorRunOk();
+ showMessage(_("INFERIOR STARTED"));
+ showMessage(msgInferiorSetupOk(), StatusBar);
+ } else {
+ QString msg = QString::fromLocal8Bit(response.data.findChild("msg").data());
+ showMessage(msg);
+ notifyEngineRunFailed();
+ }
}
void GdbRemoteServerEngine::interruptInferior2()
diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.h b/src/plugins/debugger/gdb/remotegdbserveradapter.h
index 0905defa24..ee88ae2d7a 100644
--- a/src/plugins/debugger/gdb/remotegdbserveradapter.h
+++ b/src/plugins/debugger/gdb/remotegdbserveradapter.h
@@ -91,6 +91,7 @@ private:
void handleTargetQnx(const GdbResponse &response);
void handleAttach(const GdbResponse &response);
void handleInterruptInferior(const GdbResponse &response);
+ void handleExecRun(const GdbResponse &response);
QProcess m_uploadProc;
LocalGdbProcess m_gdbProc;
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index 509a315bc7..2d345fb5b8 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -45,7 +45,8 @@ SUBDIRS = plugin_coreplugin \
plugin_android \
plugin_madde \
plugin_valgrind \
- plugin_todo
+ plugin_todo \
+ plugin_qnx
isEmpty(IDE_PACKAGE_MODE) {
SUBDIRS += plugin_helloworld \
@@ -322,3 +323,9 @@ plugin_todo.depends = plugin_coreplugin
plugin_todo.depends += plugin_projectexplorer
plugin_todo.depends += plugin_texteditor
plugin_todo.depends += plugin_cpptools
+
+plugin_qnx.subdir = qnx
+plugin_qnx.depends = plugin_remotelinux
+plugin_qnx.depends += plugin_qt4projectmanager
+plugin_qnx.depends += plugin_coreplugin
+
diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h
index 37696e54a6..933cce842b 100644
--- a/src/plugins/projectexplorer/toolchain.h
+++ b/src/plugins/projectexplorer/toolchain.h
@@ -75,7 +75,7 @@ public:
QString id() const;
virtual QList<Utils::FileName> suggestedMkspecList() const { return QList<Utils::FileName>(); }
- Utils::FileName suggestedDebugger();
+ virtual Utils::FileName suggestedDebugger();
virtual QString type() const = 0;
virtual QString typeDisplayName() const = 0;
diff --git a/src/plugins/qnx/Qnx.pluginspec.in b/src/plugins/qnx/Qnx.pluginspec.in
new file mode 100644
index 0000000000..98f5caa2b4
--- /dev/null
+++ b/src/plugins/qnx/Qnx.pluginspec.in
@@ -0,0 +1,21 @@
+<plugin name=\"Qnx\" version=\"$$QTCREATOR_VERSION\" compatVersion=\"$$QTCREATOR_VERSION\">
+ <vendor>Research In Motion</vendor>
+ <copyright>(C) Research In Motion</copyright>
+ <license>
+Commercial Usage
+
+Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
+
+GNU Lesser General Public License Usage
+
+Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. 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.
+ </license>
+ <description>Adds support for QNX to Qt Creator</description>
+ <url>http://www.rim.com</url>
+ <category>Device Support</category>
+ <dependencyList>
+ <dependency name=\"Core\" version=\"$$QTCREATOR_VERSION\"/>
+ <dependency name=\"Qt4ProjectManager\" version=\"$$QTCREATOR_VERSION\"/>
+ <dependency name=\"RemoteLinux\" version=\"$$QTCREATOR_VERSION\"/>
+ </dependencyList>
+</plugin>
diff --git a/src/plugins/qnx/bardescriptorfileimagewizardpage.cpp b/src/plugins/qnx/bardescriptorfileimagewizardpage.cpp
new file mode 100644
index 0000000000..a915372b15
--- /dev/null
+++ b/src/plugins/qnx/bardescriptorfileimagewizardpage.cpp
@@ -0,0 +1,197 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "bardescriptorfileimagewizardpage.h"
+#include "ui_bardescriptorfileimagewizardpage.h"
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BarDescriptorFileImageWizardPage::BarDescriptorFileImageWizardPage(QWidget *parent)
+ : QWizardPage(parent)
+ , m_ui(new Ui::BarDescriptorFileImageWizardPage)
+ , m_iconValidationResult(Valid)
+ , m_landscapeSplashScreenValidationResult(Valid)
+ , m_portraitSplashScreenValidationResult(Valid)
+{
+ m_ui->setupUi(this);
+
+ setTitle(tr("Images"));
+
+ const QString dialogFilter = tr("Images (*.jpg *.png)");
+
+ m_ui->icon->setExpectedKind(Utils::PathChooser::File);
+ m_ui->icon->setPromptDialogFilter(dialogFilter);
+ connect(m_ui->icon, SIGNAL(changed(QString)), this, SLOT(validateIcon(QString)));
+
+ m_ui->landscapeSplashScreen->setExpectedKind(Utils::PathChooser::File);
+ m_ui->landscapeSplashScreen->setPromptDialogFilter(dialogFilter);
+ connect(m_ui->landscapeSplashScreen, SIGNAL(changed(QString)), this, SLOT(validateLandscapeSplashScreen(QString)));
+
+ m_ui->portraitSplashScreen->setExpectedKind(Utils::PathChooser::File);
+ m_ui->portraitSplashScreen->setPromptDialogFilter(dialogFilter);
+ connect(m_ui->portraitSplashScreen, SIGNAL(changed(QString)), this, SLOT(validatePortraitSplashScreen(QString)));
+}
+
+BarDescriptorFileImageWizardPage::~BarDescriptorFileImageWizardPage()
+{
+ delete m_ui;
+}
+
+bool BarDescriptorFileImageWizardPage::isComplete() const
+{
+ return m_iconValidationResult == Valid
+ && m_landscapeSplashScreenValidationResult == Valid
+ && m_portraitSplashScreenValidationResult == Valid;
+}
+
+QString BarDescriptorFileImageWizardPage::icon() const
+{
+ return m_ui->icon->path();
+}
+
+QString BarDescriptorFileImageWizardPage::landscapeSplashScreen() const
+{
+ return m_ui->landscapeSplashScreen->path();
+}
+
+QString BarDescriptorFileImageWizardPage::portraitSplashScreen() const
+{
+ return m_ui->portraitSplashScreen->path();
+}
+
+void BarDescriptorFileImageWizardPage::validateIcon(const QString &path)
+{
+ m_iconValidationResult = validateImage(path, QSize(1, 1), QSize(90, 90));
+
+ switch (m_iconValidationResult) {
+ case Valid:
+ m_ui->iconValidationLabel->clear();
+ break;
+ case CouldNotLoad:
+ m_ui->iconValidationLabel->setText(tr("<font color=\"red\">Could not open '%1' for reading.</font>").arg(path));
+ break;
+ case IncorrectSize: {
+ const QSize size = imageSize(path);
+ m_ui->iconValidationLabel->setText(tr("<font color=\"red\">Incorrect icon size (%1x%2). The recommended size is "
+ "86x86 pixels with a maximum size of 90x90 pixels.</font>").arg(size.width()).arg(size.height()));
+ break;
+ }
+ default:
+ break;
+ }
+
+ emit completeChanged();
+}
+
+void BarDescriptorFileImageWizardPage::validateLandscapeSplashScreen(const QString &path)
+{
+ m_landscapeSplashScreenValidationResult = validateImage(path, QSize(1024, 600), QSize(1024, 600));
+ updateSplashScreenValidationLabel();
+ emit completeChanged();
+}
+
+void BarDescriptorFileImageWizardPage::validatePortraitSplashScreen(const QString &path)
+{
+ m_portraitSplashScreenValidationResult = validateImage(path, QSize(600, 1024), QSize(600, 1024));
+ updateSplashScreenValidationLabel();
+ emit completeChanged();
+}
+
+void BarDescriptorFileImageWizardPage::updateSplashScreenValidationLabel()
+{
+ if (m_landscapeSplashScreenValidationResult == Valid
+ && m_portraitSplashScreenValidationResult == Valid) {
+ m_ui->splashScreenValidationLabel->clear();
+ return;
+ }
+
+ switch (m_landscapeSplashScreenValidationResult) {
+ case CouldNotLoad:
+ m_ui->splashScreenValidationLabel->setText(tr("<font color=\"red\">Could not open '%1' for reading.</font>")
+ .arg(m_ui->landscapeSplashScreen->fileName().toString()));
+ break;
+ case IncorrectSize: {
+ const QSize size = imageSize(m_ui->landscapeSplashScreen->fileName().toString());
+ m_ui->splashScreenValidationLabel->setText(tr("<font color=\"red\">Incorrect landscape splash screen size (%1x%2). The required "
+ "size is 1024x600 pixels.</font>").arg(size.width()).arg(size.height()));
+ break;
+ }
+ case Valid:
+ default:
+ break;
+ }
+
+ switch (m_portraitSplashScreenValidationResult) {
+ case CouldNotLoad:
+ m_ui->splashScreenValidationLabel->setText(tr("<font color=\"red\">Could not open '%1' for reading.</font>")
+ .arg(m_ui->portraitSplashScreen->fileName().toString()));
+ break;
+ case IncorrectSize: {
+ const QSize size = imageSize(m_ui->portraitSplashScreen->fileName().toString());
+ m_ui->splashScreenValidationLabel->setText(tr("<font color=\"red\">Incorrect portrait splash screen size (%1x%2). The required "
+ "size is 600x1024 pixels.</font>").arg(size.width()).arg(size.height()));
+ break;
+ }
+ case Valid:
+ default:
+ break;
+ }
+}
+
+BarDescriptorFileImageWizardPage::ImageValidationResult BarDescriptorFileImageWizardPage::validateImage(const QString &path, const QSize &minimumSize, const QSize &maximumSize)
+{
+ if (path.isEmpty())
+ return Valid; // Empty is ok, since <icon> and <splashscreen> entries are optional
+
+ QImage img(path);
+ if (img.isNull())
+ return CouldNotLoad;
+
+ const QSize imgSize = img.size();
+ if (imgSize.width() < minimumSize.width() || imgSize.height() < minimumSize.height()
+ || imgSize.width() > maximumSize.width() || imgSize.height() > maximumSize.height())
+ return IncorrectSize;
+
+ return Valid;
+}
+
+QSize BarDescriptorFileImageWizardPage::imageSize(const QString &path)
+{
+ QImage img(path);
+ if (img.isNull())
+ return QSize();
+
+ return img.size();
+}
+
diff --git a/src/plugins/qnx/bardescriptorfileimagewizardpage.h b/src/plugins/qnx/bardescriptorfileimagewizardpage.h
new file mode 100644
index 0000000000..dcbad0f59a
--- /dev/null
+++ b/src/plugins/qnx/bardescriptorfileimagewizardpage.h
@@ -0,0 +1,87 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BARDESCRIPTORFILEIMAGEWIZARDPAGE_H
+#define QNX_INTERNAL_BARDESCRIPTORFILEIMAGEWIZARDPAGE_H
+
+#include <QWizardPage>
+
+namespace Qnx {
+namespace Internal {
+
+namespace Ui {
+class BarDescriptorFileImageWizardPage;
+}
+
+class BarDescriptorFileImageWizardPage : public QWizardPage
+{
+ Q_OBJECT
+
+public:
+ explicit BarDescriptorFileImageWizardPage(QWidget *parent = 0);
+ ~BarDescriptorFileImageWizardPage();
+
+ bool isComplete() const;
+
+ QString icon() const;
+ QString landscapeSplashScreen() const;
+ QString portraitSplashScreen() const;
+
+private slots:
+ void validateIcon(const QString &path);
+ void validateLandscapeSplashScreen(const QString &path);
+ void validatePortraitSplashScreen(const QString &path);
+
+private:
+ enum ImageValidationResult {
+ Valid,
+ CouldNotLoad,
+ IncorrectSize
+ };
+
+ void updateSplashScreenValidationLabel();
+
+ ImageValidationResult validateImage(const QString &path, const QSize &minimumSize, const QSize &maximumSize);
+ QSize imageSize(const QString &path);
+
+ Ui::BarDescriptorFileImageWizardPage *m_ui;
+
+ ImageValidationResult m_iconValidationResult;
+ ImageValidationResult m_landscapeSplashScreenValidationResult;
+ ImageValidationResult m_portraitSplashScreenValidationResult;
+};
+
+
+} // namespace Internal
+} // namespace Qnx
+#endif // QNX_INTERNAL_BARDESCRIPTORFILEIMAGEWIZARDPAGE_H
diff --git a/src/plugins/qnx/bardescriptorfileimagewizardpage.ui b/src/plugins/qnx/bardescriptorfileimagewizardpage.ui
new file mode 100644
index 0000000000..13b944187f
--- /dev/null
+++ b/src/plugins/qnx/bardescriptorfileimagewizardpage.ui
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Qnx::Internal::BarDescriptorFileImageWizardPage</class>
+ <widget class="QWizardPage" name="Qnx::Internal::BarDescriptorFileImageWizardPage">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>116</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>WizardPage</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::ExpandingFieldsGrow</enum>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Icon:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="Utils::PathChooser" name="icon" native="true"/>
+ </item>
+ <item row="1" column="0" colspan="2">
+ <widget class="QLabel" name="iconValidationLabel">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="2">
+ <widget class="QLabel" name="label_2">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Splash screens</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Landscape:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="Utils::PathChooser" name="landscapeSplashScreen" native="true"/>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Portrait:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="Utils::PathChooser" name="portraitSplashScreen" native="true"/>
+ </item>
+ <item row="5" column="0" colspan="2">
+ <widget class="QLabel" name="splashScreenValidationLabel">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>Utils::PathChooser</class>
+ <extends>QWidget</extends>
+ <header location="global">utils/pathchooser.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/plugins/qnx/blackberryabstractdeploystep.cpp b/src/plugins/qnx/blackberryabstractdeploystep.cpp
new file mode 100644
index 0000000000..f178c8ceaf
--- /dev/null
+++ b/src/plugins/qnx/blackberryabstractdeploystep.cpp
@@ -0,0 +1,236 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberryabstractdeploystep.h"
+
+#include <projectexplorer/buildconfiguration.h>
+#include <projectexplorer/target.h>
+#include <utils/qtcassert.h>
+#include <utils/qtcprocess.h>
+
+#include <QDir>
+#include <QTimer>
+#include <QEventLoop>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryAbstractDeployStep::BlackBerryAbstractDeployStep(ProjectExplorer::BuildStepList *bsl, Core::Id id)
+ : ProjectExplorer::BuildStep(bsl, id)
+ , m_processCounter(-1)
+ , m_process(0)
+ , m_timer(0)
+ , m_futureInterface(0)
+ , m_eventLoop(0)
+{
+}
+
+BlackBerryAbstractDeployStep::BlackBerryAbstractDeployStep(ProjectExplorer::BuildStepList *bsl, BlackBerryAbstractDeployStep *bs)
+ : ProjectExplorer::BuildStep(bsl, bs)
+ , m_processCounter(-1)
+ , m_process(0)
+ , m_timer(0)
+ , m_futureInterface(0)
+ , m_eventLoop(0)
+{
+}
+
+BlackBerryAbstractDeployStep::~BlackBerryAbstractDeployStep()
+{
+ delete m_process;
+ m_process = 0;
+}
+
+bool BlackBerryAbstractDeployStep::init()
+{
+ m_params.clear();
+ m_processCounter = -1;
+
+ m_environment = target()->activeBuildConfiguration()->environment();
+ m_buildDirectory = target()->activeBuildConfiguration()->buildDirectory();
+
+ return true;
+}
+
+void BlackBerryAbstractDeployStep::run(QFutureInterface<bool> &fi)
+{
+ m_timer = new QTimer();
+ connect(m_timer, SIGNAL(timeout()), this, SLOT(checkForCancel()), Qt::DirectConnection);
+ m_timer->start(500);
+ m_eventLoop = new QEventLoop;
+
+ fi.setProgressRange(0, 100 * m_params.size());
+
+ Q_ASSERT(!m_futureInterface);
+ m_futureInterface = &fi;
+
+ runCommands();
+
+ bool returnValue = m_eventLoop->exec();
+
+ // Finished
+ m_params.clear();
+ cleanup();
+ m_processCounter = -1;
+
+ m_timer->stop();
+ delete m_timer;
+ m_timer = 0;
+
+ delete m_process;
+ m_process = 0;
+ delete m_eventLoop;
+ m_eventLoop = 0;
+
+ m_futureInterface = 0;
+
+ fi.reportResult(returnValue);
+}
+
+void BlackBerryAbstractDeployStep::addCommand(const QString &command, const QStringList &arguments)
+{
+ ProjectExplorer::ProcessParameters param;
+ param.setCommand(command);
+ param.setArguments(arguments.join(QLatin1String(" ")));
+ m_params << param;
+}
+
+void BlackBerryAbstractDeployStep::reportProgress(int progress)
+{
+ QTC_ASSERT(progress >= 0 && progress <= 100, return);
+
+ m_futureInterface->setProgressValue(100 * m_processCounter + progress);
+}
+
+void BlackBerryAbstractDeployStep::runCommands()
+{
+ if (!m_process) {
+ m_process = new Utils::QtcProcess();
+ connect(m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(processReadyReadStdOutput()), Qt::DirectConnection);
+ connect(m_process, SIGNAL(readyReadStandardError()), this, SLOT(processReadyReadStdError()), Qt::DirectConnection);
+ }
+
+ m_process->setEnvironment(m_environment);
+ m_process->setWorkingDirectory(m_buildDirectory);
+
+ connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(handleProcessFinished(int, QProcess::ExitStatus)), Qt::DirectConnection);
+
+ runNextCommand();
+}
+
+void BlackBerryAbstractDeployStep::runNextCommand()
+{
+ ++m_processCounter;
+ m_futureInterface->setProgressValue(100 * m_processCounter);
+
+ ProjectExplorer::ProcessParameters param = m_params.takeFirst();
+
+ QTC_ASSERT(m_process->state() == QProcess::NotRunning, return);
+
+ m_process->setCommand(param.effectiveCommand(), param.effectiveArguments());
+ m_process->start();
+ if (!m_process->waitForStarted()) {
+ m_eventLoop->exit(false);
+ return;
+ }
+ processStarted(param);
+}
+
+void BlackBerryAbstractDeployStep::processStarted(const ProjectExplorer::ProcessParameters &params)
+{
+ emitOutputInfo(params, params.prettyArguments());
+}
+
+void BlackBerryAbstractDeployStep::emitOutputInfo(const ProjectExplorer::ProcessParameters &params, const QString &arguments)
+{
+ emit addOutput(tr("Starting: \"%1\" %2")
+ .arg(QDir::toNativeSeparators(params.effectiveCommand()),
+ arguments),
+ BuildStep::MessageOutput);
+}
+
+void BlackBerryAbstractDeployStep::processReadyReadStdOutput()
+{
+ m_process->setReadChannel(QProcess::StandardOutput);
+ while (m_process && m_process->canReadLine()) {
+ const QString line = QString::fromLocal8Bit(m_process->readLine());
+ stdOutput(line);
+ }
+}
+
+void BlackBerryAbstractDeployStep::stdOutput(const QString &line)
+{
+ emit addOutput(line, BuildStep::NormalOutput, BuildStep::DontAppendNewline);
+}
+
+void BlackBerryAbstractDeployStep::processReadyReadStdError()
+{
+ m_process->setReadChannel(QProcess::StandardError);
+ while (m_process && m_process->canReadLine()) {
+ const QString line = QString::fromLocal8Bit(m_process->readLine());
+ stdError(line);
+ }
+}
+
+void BlackBerryAbstractDeployStep::checkForCancel()
+{
+ if (m_futureInterface->isCanceled()
+ && m_timer && m_timer->isActive()) {
+ m_timer->stop();
+ if (m_process) {
+ m_process->terminate();
+ m_process->waitForFinished(5000); //while waiting, the process can be killed
+ if (m_process)
+ m_process->kill();
+ }
+ if (m_eventLoop)
+ m_eventLoop->exit(false);
+ }
+}
+
+void BlackBerryAbstractDeployStep::handleProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
+{
+ if (exitCode == 0 && exitStatus == QProcess::NormalExit) {
+ if (!m_params.isEmpty())
+ runNextCommand();
+ else
+ m_eventLoop->exit(true);
+ } else {
+ m_eventLoop->exit(false);
+ }
+}
+
+void BlackBerryAbstractDeployStep::stdError(const QString &line)
+{
+ emit addOutput(line, BuildStep::ErrorOutput, BuildStep::DontAppendNewline);
+}
diff --git a/src/plugins/qnx/blackberryabstractdeploystep.h b/src/plugins/qnx/blackberryabstractdeploystep.h
new file mode 100644
index 0000000000..377ebbb3e8
--- /dev/null
+++ b/src/plugins/qnx/blackberryabstractdeploystep.h
@@ -0,0 +1,106 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYABSTRACTDEPLOYSTEP_H
+#define QNX_INTERNAL_BLACKBERRYABSTRACTDEPLOYSTEP_H
+
+#include <projectexplorer/buildstep.h>
+#include <projectexplorer/processparameters.h>
+
+#include <QProcess>
+
+QT_BEGIN_NAMESPACE
+class QEventLoop;
+QT_END_NAMESPACE
+
+namespace Utils {
+class QtcProcess;
+}
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryAbstractDeployStep : public ProjectExplorer::BuildStep
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryAbstractDeployStep(ProjectExplorer::BuildStepList *bsl, Core::Id id);
+ ~BlackBerryAbstractDeployStep();
+
+ bool init();
+ void run(QFutureInterface<bool> &fi);
+ virtual void cleanup() = 0;
+
+protected:
+ BlackBerryAbstractDeployStep(ProjectExplorer::BuildStepList *bsl, BlackBerryAbstractDeployStep *bs);
+
+ void addCommand(const QString &command, const QStringList &arguments);
+ void reportProgress(int progress);
+
+ virtual void stdOutput(const QString &line);
+ virtual void stdError(const QString &line);
+
+ virtual void processStarted(const ProjectExplorer::ProcessParameters &param);
+
+ void emitOutputInfo(const ProjectExplorer::ProcessParameters &params, const QString& arguments);
+
+private slots:
+ void processReadyReadStdOutput();
+ void processReadyReadStdError();
+
+ void checkForCancel();
+
+ void handleProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
+
+private:
+ void ctor();
+
+ void runCommands();
+ void runNextCommand();
+
+ QList<ProjectExplorer::ProcessParameters> m_params;
+ int m_processCounter;
+ Utils::QtcProcess *m_process;
+
+ Utils::Environment m_environment;
+ QString m_buildDirectory;
+
+ QTimer *m_timer;
+ QFutureInterface<bool> *m_futureInterface;
+ QEventLoop *m_eventLoop;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYABSTRACTDEPLOYSTEP_H
diff --git a/src/plugins/qnx/blackberryapplicationrunner.cpp b/src/plugins/qnx/blackberryapplicationrunner.cpp
new file mode 100644
index 0000000000..4302be519b
--- /dev/null
+++ b/src/plugins/qnx/blackberryapplicationrunner.cpp
@@ -0,0 +1,356 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberryapplicationrunner.h"
+
+#include "blackberrydeployconfiguration.h"
+#include "blackberryrunconfiguration.h"
+
+#include <projectexplorer/target.h>
+#include <qt4projectmanager/qt4buildconfiguration.h>
+#include <ssh/sshremoteprocessrunner.h>
+#include <utils/qtcassert.h>
+
+#include <QTimer>
+#include <QDir>
+
+namespace {
+const char DEPLOY_CMD[] = "blackberry-deploy";
+
+qint64 parsePid(const QString &line)
+{
+ QTC_ASSERT(line.startsWith(QLatin1String("result::")), return -1);
+
+ int pidIndex = -1;
+ if (line.contains(QLatin1String("running"))) // "result::running,<pid>"
+ pidIndex = 16;
+ else // "result::<pid>"
+ pidIndex = 8;
+
+ bool ok;
+ const qint64 pid = line.mid(pidIndex).toInt(&ok);
+ if (!ok)
+ return -1;
+ return pid;
+}
+
+QString parseAppId(const QString &line)
+{
+ QTC_ASSERT(line.startsWith(QLatin1String("Info: Launching")), return QString());
+
+ const int endOfId = line.indexOf(QLatin1String("..."));
+ return line.mid(16, endOfId - 16);
+}
+
+bool parseRunningState(const QString &line)
+{
+ QTC_ASSERT(line.startsWith(QLatin1String("result::")), return false);
+ return line.trimmed().mid(8) == QLatin1String("true");
+}
+}
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryApplicationRunner::BlackBerryApplicationRunner(bool debugMode, BlackBerryRunConfiguration *runConfiguration, QObject *parent)
+ : QObject(parent)
+ , m_debugMode(debugMode)
+ , m_pid(-1)
+ , m_appId(QString())
+ , m_running(false)
+ , m_stopping(false)
+ , m_launchProcess(0)
+ , m_stopProcess(0)
+ , m_tailProcess(0)
+ , m_runningStateTimer(new QTimer(this))
+ , m_runningStateProcess(0)
+{
+ QTC_ASSERT(runConfiguration, return);
+
+ Qt4ProjectManager::Qt4BuildConfiguration *qt4BuildConfig = runConfiguration->activeQt4BuildConfiguration();
+ m_environment = qt4BuildConfig->environment();
+ m_deployCmd = m_environment.searchInPath(QLatin1String(DEPLOY_CMD));
+
+ m_deviceHost = runConfiguration->deployConfiguration()->deviceHost();
+ m_password = runConfiguration->deployConfiguration()->password();
+
+ BlackBerryRunConfiguration *blackberryRunConfiguration = qobject_cast<BlackBerryRunConfiguration *>(runConfiguration);
+ if (blackberryRunConfiguration)
+ m_barPackage = blackberryRunConfiguration->barPackage();
+
+ BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(runConfiguration->target()->profile());
+ m_sshParams = device->sshParameters();
+ // The BlackBerry device always uses key authentication
+ m_sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationByKey;
+
+ m_runningStateTimer->setInterval(3000);
+ m_runningStateTimer->setSingleShot(true);
+ connect(m_runningStateTimer, SIGNAL(timeout()), this, SLOT(determineRunningState()));
+}
+
+void BlackBerryApplicationRunner::start()
+{
+ QStringList args;
+ args << QLatin1String("-launchApp");
+ if (m_debugMode)
+ args << QLatin1String("-debugNative");
+ args << "-device" << m_deviceHost;
+ if (!m_password.isEmpty())
+ args << QLatin1String("-password") << m_password;
+ args << QDir::toNativeSeparators(m_barPackage);
+
+ if (!m_launchProcess) {
+ m_launchProcess = new QProcess(this);
+ connect(m_launchProcess, SIGNAL(readyReadStandardError()), this, SLOT(readStandardError()));
+ connect(m_launchProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandardOutput()));
+ connect(m_launchProcess, SIGNAL(finished(int,QProcess::ExitStatus)),
+ this, SLOT(startFinished(int,QProcess::ExitStatus)));
+
+ m_launchProcess->setEnvironment(m_environment.toStringList());
+ }
+
+ m_launchProcess->start(m_deployCmd, args);
+ m_runningStateTimer->start();
+ m_running = true;
+}
+
+void BlackBerryApplicationRunner::startFinished(int exitCode, QProcess::ExitStatus exitStatus)
+{
+ if (exitCode == 0 && exitStatus == QProcess::NormalExit && m_pid > -1) {
+ emit started();
+ } else {
+ m_running = false;
+ m_runningStateTimer->stop();
+
+ QTC_ASSERT(m_launchProcess, return);
+ const QString errorString = (m_launchProcess->error() != QProcess::UnknownError)
+ ? m_launchProcess->errorString() : tr("Launching application failed");
+ emit startFailed(errorString);
+ }
+}
+
+ProjectExplorer::RunControl::StopResult BlackBerryApplicationRunner::stop()
+{
+ m_stopping = true;
+
+ QStringList args;
+ args << QLatin1String("-terminateApp");
+ args << QLatin1String("-device") << m_deviceHost;
+ if (!m_password.isEmpty())
+ args << QLatin1String("-password") << m_password;
+ args << m_barPackage;
+
+ if (!m_stopProcess) {
+ m_stopProcess = new QProcess(this);
+ connect(m_stopProcess, SIGNAL(readyReadStandardError()), this, SLOT(readStandardError()));
+ connect(m_stopProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandardOutput()));
+ connect(m_stopProcess, SIGNAL(finished(int,QProcess::ExitStatus)),
+ this, SLOT(stopFinished(int,QProcess::ExitStatus)));
+
+ m_stopProcess->setEnvironment(m_environment.toStringList());
+ }
+
+
+ m_stopProcess->start(m_deployCmd, args);
+ return ProjectExplorer::RunControl::AsynchronousStop;
+}
+
+bool BlackBerryApplicationRunner::isRunning() const
+{
+ return m_running && !m_stopping;
+}
+
+qint64 BlackBerryApplicationRunner::pid() const
+{
+ return m_pid;
+}
+
+void BlackBerryApplicationRunner::stopFinished(int exitCode, QProcess::ExitStatus exitStatus)
+{
+ Q_UNUSED(exitCode);
+ Q_UNUSED(exitStatus);
+
+ reset();
+}
+
+void BlackBerryApplicationRunner::readStandardOutput()
+{
+ QProcess *process = qobject_cast<QProcess *>(sender());
+ process->setReadChannel(QProcess::StandardOutput);
+ while (process->canReadLine()) {
+ QString line = QString::fromLocal8Bit(process->readLine());
+ emit output(line, Utils::StdOutFormat);
+
+ if (line.startsWith(QLatin1String("result::"))) {
+ m_pid = parsePid(line);
+ } else if (line.startsWith(QLatin1String("Info: Launching"))) {
+ m_appId = parseAppId(line);
+ }
+ }
+}
+
+void BlackBerryApplicationRunner::readStandardError()
+{
+ QProcess *process = qobject_cast<QProcess *>(sender());
+ process->setReadChannel(QProcess::StandardError);
+ while (process->canReadLine()) {
+ const QString line = QString::fromLocal8Bit(process->readLine());
+ emit output(line, Utils::StdErrFormat);
+ }
+}
+
+void BlackBerryApplicationRunner::killTailProcess()
+{
+ QSsh::SshRemoteProcessRunner *slayProcess = new QSsh::SshRemoteProcessRunner(this);
+ connect(slayProcess, SIGNAL(processClosed(int)), this, SIGNAL(finished()));
+
+ slayProcess->run("slay tail", m_sshParams);
+
+ // Not supported by OpenSSH server
+ //m_tailProcess->sendSignalToProcess(Utils::SshRemoteProcess::KillSignal);
+ m_tailProcess->cancel();
+
+ delete m_tailProcess;
+ m_tailProcess = 0;
+}
+
+void BlackBerryApplicationRunner::tailApplicationLog()
+{
+ // TODO: Reading the log using qconn instead?
+
+ if (m_tailProcess && m_tailProcess->isProcessRunning())
+ return;
+
+ QTC_CHECK(!m_appId.isEmpty());
+
+ if (!m_tailProcess) {
+ m_tailProcess = new QSsh::SshRemoteProcessRunner(this);
+
+ connect(m_tailProcess, SIGNAL(readyReadStandardOutput()),
+ this, SLOT(handleTailOutput()));
+ connect(m_tailProcess, SIGNAL(readyReadStandardError()),
+ this, SLOT(handleTailError()));
+ connect(m_tailProcess, SIGNAL(connectionError()),
+ this, SLOT(handleTailConnectionError()));
+ }
+
+ const QString command = QLatin1String("tail -c +1 -f /accounts/1000/appdata/") + m_appId
+ + QLatin1String("/logs/log");
+
+ m_tailProcess->run(command.toLatin1(), m_sshParams);
+}
+
+void BlackBerryApplicationRunner::handleTailOutput()
+{
+ QSsh::SshRemoteProcessRunner *process = qobject_cast<QSsh::SshRemoteProcessRunner *>(sender());
+ QTC_ASSERT(process, return);
+
+ const QString message = QString::fromLatin1(process->readAllStandardOutput());
+ emit output(message, Utils::StdOutFormat);
+}
+
+void BlackBerryApplicationRunner::handleTailError()
+{
+ QSsh::SshRemoteProcessRunner *process = qobject_cast<QSsh::SshRemoteProcessRunner *>(sender());
+ QTC_ASSERT(process, return);
+
+ const QString message = QString::fromLatin1(process->readAllStandardError());
+ emit output(message, Utils::StdErrFormat);
+}
+
+void BlackBerryApplicationRunner::handleTailConnectionError()
+{
+ emit output(tr("Cannot show debug output. Error: %1").arg(m_tailProcess->lastConnectionErrorString()),
+ Utils::StdErrFormat);
+}
+
+void BlackBerryApplicationRunner::startRunningStateTimer()
+{
+ if (m_running)
+ m_runningStateTimer->start();
+}
+
+void BlackBerryApplicationRunner::determineRunningState()
+{
+ QStringList args;
+ args << QLatin1String("-isAppRunning");
+ args << "-device" << m_deviceHost;
+ if (!m_password.isEmpty())
+ args << QLatin1String("-password") << m_password;
+ args << m_barPackage;
+
+ if (!m_runningStateProcess) {
+ m_runningStateProcess = new QProcess(this);
+
+ connect(m_runningStateProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readRunningStateStandardOutput()));
+ connect(m_runningStateProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(startRunningStateTimer()));
+ }
+
+ m_runningStateProcess->setEnvironment(m_environment.toStringList());
+
+ m_runningStateProcess->start(m_deployCmd, args);
+}
+
+void BlackBerryApplicationRunner::readRunningStateStandardOutput()
+{
+ QProcess *process = qobject_cast<QProcess *>(sender());
+ process->setReadChannel(QProcess::StandardOutput);
+ while (process->canReadLine()) {
+ const QString line = QString::fromLocal8Bit(process->readLine());
+ if (line.startsWith(QLatin1String("result"))) {
+ m_running = parseRunningState(line);
+ break;
+ }
+ }
+
+ if (!m_running)
+ reset();
+}
+
+void BlackBerryApplicationRunner::reset()
+{
+ m_pid = -1;
+ m_appId = "";
+ m_running = false;
+ m_stopping = false;
+
+ m_runningStateTimer->stop();
+ m_runningStateProcess->terminate();
+ if (!m_runningStateProcess->waitForFinished(1000))
+ m_runningStateProcess->kill();
+
+ if (m_tailProcess && m_tailProcess->isProcessRunning())
+ killTailProcess();
+ else
+ emit finished();
+}
diff --git a/src/plugins/qnx/blackberryapplicationrunner.h b/src/plugins/qnx/blackberryapplicationrunner.h
new file mode 100644
index 0000000000..73eb6b1e9f
--- /dev/null
+++ b/src/plugins/qnx/blackberryapplicationrunner.h
@@ -0,0 +1,121 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYAPPLICATIONRUNNER_H
+#define QNX_INTERNAL_BLACKBERRYAPPLICATIONRUNNER_H
+
+#include <projectexplorer/runconfiguration.h>
+
+#include <ssh/sshconnection.h>
+#include <utils/environment.h>
+
+#include <QObject>
+#include <QProcess>
+
+namespace QSsh {
+class SshRemoteProcessRunner;
+}
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryRunConfiguration;
+
+class BlackBerryApplicationRunner : public QObject
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryApplicationRunner(bool debugMode, BlackBerryRunConfiguration *runConfiguration, QObject *parent = 0);
+
+ bool isRunning() const;
+ qint64 pid() const;
+
+ ProjectExplorer::RunControl::StopResult stop();
+
+public slots:
+ void start();
+ void tailApplicationLog();
+
+signals:
+ void output(const QString &msg, Utils::OutputFormat format);
+ void started();
+ void finished();
+
+ void startFailed(const QString &msg);
+
+private slots:
+ void startFinished(int exitCode, QProcess::ExitStatus exitStatus);
+ void stopFinished(int exitCode, QProcess::ExitStatus exitStatus);
+
+ void readStandardOutput();
+ void readStandardError();
+
+ void handleTailOutput();
+ void handleTailError();
+ void handleTailConnectionError();
+
+ void startRunningStateTimer();
+ void determineRunningState();
+ void readRunningStateStandardOutput();
+
+private:
+ void reset();
+ void killTailProcess();
+
+ bool m_debugMode;
+
+ qint64 m_pid;
+ QString m_appId;
+
+ bool m_running;
+ bool m_stopping;
+
+ Utils::Environment m_environment;
+ QString m_deployCmd;
+ QString m_deviceHost;
+ QString m_password;
+ QString m_barPackage;
+ QSsh::SshConnectionParameters m_sshParams;
+
+ QProcess *m_launchProcess;
+ QProcess *m_stopProcess;
+ QSsh::SshRemoteProcessRunner *m_tailProcess;
+
+ QTimer *m_runningStateTimer;
+ QProcess *m_runningStateProcess;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYAPPLICATIONRUNNER_H
diff --git a/src/plugins/qnx/blackberryconnect.cpp b/src/plugins/qnx/blackberryconnect.cpp
new file mode 100644
index 0000000000..8e424836ae
--- /dev/null
+++ b/src/plugins/qnx/blackberryconnect.cpp
@@ -0,0 +1,183 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberryconnect.h"
+#include "blackberryrunconfiguration.h"
+#include "blackberrydeployconfiguration.h"
+
+#include <qt4projectmanager/qt4buildconfiguration.h>
+#include <projectexplorer/target.h>
+#include <ssh/sshconnection.h>
+#include <utils/qtcassert.h>
+
+#include <QProcess>
+#include <QApplication>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+namespace {
+const char CONNECT_CMD[] = "java";
+const char CONNECT_SUCCESS_MSG[] = "Successfully connected";
+}
+
+QMap<QString, BlackBerryConnect *> BlackBerryConnect::m_instances = QMap<QString, BlackBerryConnect *>();
+QMap<QString, int> BlackBerryConnect::m_usageCount = QMap<QString, int>();
+
+BlackBerryConnect *BlackBerryConnect::instance(BlackBerryRunConfiguration *runConfig)
+{
+ BlackBerryDeployConfiguration *deployConfig = runConfig->deployConfiguration();
+ QString deviceHost = deployConfig->deviceHost();
+ if (!m_instances.contains(deviceHost)) {
+ m_instances[deviceHost] = new BlackBerryConnect(runConfig);
+ m_usageCount[deviceHost] = 1;
+ } else {
+ ++m_usageCount[deviceHost];
+ }
+
+ return m_instances[deviceHost];
+}
+
+void BlackBerryConnect::cleanup(BlackBerryConnect *instance)
+{
+ const QString deviceHost = instance->m_deviceHost;
+ QTC_ASSERT(m_usageCount.contains(deviceHost), return);
+
+ --m_usageCount[deviceHost];
+ QTC_ASSERT(m_usageCount[deviceHost] >= 0, return);
+
+ if (m_usageCount[deviceHost] == 0) {
+ m_instances.remove(deviceHost);
+ m_usageCount.remove(deviceHost);
+ instance->deleteLater();
+ }
+}
+
+BlackBerryConnect::BlackBerryConnect(BlackBerryRunConfiguration *runConfig)
+ : QObject()
+ , m_connected(false)
+{
+ m_process = new QProcess(this);
+
+ Utils::Environment env;
+ if (runConfig->activeQt4BuildConfiguration())
+ env = runConfig->activeQt4BuildConfiguration()->environment();
+
+ m_process->setEnvironment(env.toStringList());
+ m_connectCmd = env.searchInPath(QLatin1String(CONNECT_CMD));
+ m_qnxHost = env.value(QLatin1String("QNX_HOST"));
+
+ BlackBerryDeployConfiguration *deployConfig = runConfig->deployConfiguration();
+ m_deviceHost = deployConfig->deviceHost();
+ m_password = deployConfig->password();
+
+ BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(runConfig->target()->profile());
+ m_publicKeyFile = device->sshParameters().privateKeyFile + QLatin1String(".pub");
+
+ connect(m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandardOutput()));
+ connect(m_process, SIGNAL(readyReadStandardError()), this, SLOT(readStandardError()));
+ connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)),
+ this, SLOT(handleProcessFinished(int,QProcess::ExitStatus)));
+}
+
+void BlackBerryConnect::connectToDevice()
+{
+ if (m_connected) {
+ emit connected();
+ return;
+ }
+
+ QTC_ASSERT(!m_connectCmd.isEmpty() && !m_qnxHost.isEmpty(), return);
+
+ // Since killing the blackberry-connect script won't kill the java process it launches, let's just call
+ // the java process directly instead.
+ QStringList connectArgs;
+ connectArgs << QLatin1String("-Xmx512M");
+ connectArgs << QLatin1String("-jar") << m_qnxHost + QLatin1String("/usr/lib/Connect.jar");
+
+ connectArgs << QLatin1String("-targetHost") << m_deviceHost;
+ if (!m_password.isEmpty())
+ connectArgs << QLatin1String("-password") << m_password;
+ connectArgs << QLatin1String("-sshPublicKey") << m_publicKeyFile;
+
+ m_process->start(m_connectCmd, connectArgs);
+}
+
+void BlackBerryConnect::disconnectFromDevice()
+{
+ if (m_process->state() != QProcess::Running)
+ return;
+
+ if (m_usageCount[m_deviceHost] == 1) {
+ m_process->terminate();
+ if (!m_process->waitForFinished(5000))
+ m_process->kill();
+ }
+}
+
+void BlackBerryConnect::handleProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
+{
+ m_connected = false;
+ if (exitCode != 0 || exitStatus != QProcess::NormalExit)
+ emit error(m_process->errorString());
+}
+
+void BlackBerryConnect::readStandardOutput()
+{
+ m_process->setReadChannel(QProcess::StandardOutput);
+ while (m_process->canReadLine()) {
+ const QString line = QString::fromLocal8Bit(m_process->readLine());
+ emit output(line, Utils::StdOutFormat);
+ if (line.contains(QLatin1String(CONNECT_SUCCESS_MSG))) {
+ m_connected = true;
+ emit connected();
+ }
+ }
+}
+
+void BlackBerryConnect::readStandardError()
+{
+ m_process->setReadChannel(QProcess::StandardError);
+ QStringList errorLines;
+
+ while (m_process->canReadLine()) {
+ const QString line = QString::fromLocal8Bit(m_process->readLine());
+ emit output(line, Utils::StdErrFormat);
+ if (line.contains(QLatin1String("Error:")))
+ errorLines << line.mid(7);
+ }
+
+ // TODO: Handle error messages better
+ if (!errorLines.isEmpty())
+ emit error(errorLines.join(QLatin1String("\n")));
+}
diff --git a/src/plugins/qnx/blackberryconnect.h b/src/plugins/qnx/blackberryconnect.h
new file mode 100644
index 0000000000..7d0230cdcd
--- /dev/null
+++ b/src/plugins/qnx/blackberryconnect.h
@@ -0,0 +1,87 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYCONNECT_H
+#define QNX_INTERNAL_BLACKBERRYCONNECT_H
+
+#include <utils/outputformat.h>
+
+#include <QObject>
+#include <QProcess>
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryRunConfiguration;
+
+class BlackBerryConnect : public QObject
+{
+ Q_OBJECT
+public:
+ static BlackBerryConnect *instance(BlackBerryRunConfiguration *runConfig);
+ static void cleanup(BlackBerryConnect *instance);
+
+signals:
+ void connected();
+ void error(const QString &msg);
+ void output(const QString &msg, Utils::OutputFormat format);
+
+public slots:
+ void connectToDevice();
+ void disconnectFromDevice();
+
+private slots:
+ void handleProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
+ void readStandardOutput();
+ void readStandardError();
+
+private:
+ explicit BlackBerryConnect(BlackBerryRunConfiguration *runConfig);
+
+ static QMap<QString, BlackBerryConnect *> m_instances;
+ static QMap<QString, int> m_usageCount;
+
+ QProcess *m_process;
+ QString m_connectCmd;
+ QString m_deviceHost;
+ QString m_password;
+ QString m_publicKeyFile;
+ QString m_qnxHost;
+
+ bool m_connected;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYCONNECT_H
diff --git a/src/plugins/qnx/blackberrycreatepackagestep.cpp b/src/plugins/qnx/blackberrycreatepackagestep.cpp
new file mode 100644
index 0000000000..8b9f8da77a
--- /dev/null
+++ b/src/plugins/qnx/blackberrycreatepackagestep.cpp
@@ -0,0 +1,218 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberrycreatepackagestep.h"
+
+#include "qnxconstants.h"
+#include "blackberrycreatepackagestepconfigwidget.h"
+#include "blackberrydeployconfiguration.h"
+#include "qnxutils.h"
+#include "blackberryqtversion.h"
+#include "blackberrydeviceconfiguration.h"
+#include "blackberrydeployinformation.h"
+
+#include <projectexplorer/projectexplorerconstants.h>
+#include <projectexplorer/target.h>
+#include <projectexplorer/runconfiguration.h>
+#include <qt4projectmanager/qt4buildconfiguration.h>
+#include <qt4projectmanager/qt4nodes.h>
+#include <qt4projectmanager/qt4project.h>
+#include <qtsupport/qtprofileinformation.h>
+#include <utils/qtcassert.h>
+
+#include <QTemporaryFile>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+namespace {
+const char PACKAGER_CMD[] = "blackberry-nativepackager";
+
+const char QT_INSTALL_LIBS[] = "QT_INSTALL_LIBS";
+const char QT_INSTALL_LIBS_VAR[] = "%QT_INSTALL_LIBS%";
+const char QT_INSTALL_PLUGINS[] = "QT_INSTALL_PLUGINS";
+const char QT_INSTALL_PLUGINS_VAR[] = "%QT_INSTALL_PLUGINS%";
+const char QT_INSTALL_IMPORTS[] = "QT_INSTALL_IMPORTS";
+const char QT_INSTALL_IMPORTS_VAR[] = "%QT_INSTALL_IMPORTS%";
+const char SRC_DIR_VAR[] = "%SRC_DIR%";
+}
+
+BlackBerryCreatePackageStep::BlackBerryCreatePackageStep(ProjectExplorer::BuildStepList *bsl)
+ : BlackBerryAbstractDeployStep(bsl, Core::Id(Constants::QNX_CREATE_PACKAGE_BS_ID))
+{
+ setDisplayName(tr("Create BAR packages"));
+}
+
+BlackBerryCreatePackageStep::BlackBerryCreatePackageStep(ProjectExplorer::BuildStepList *bsl,
+ BlackBerryCreatePackageStep *bs)
+ : BlackBerryAbstractDeployStep(bsl, bs)
+{
+ setDisplayName(tr("Create BAR packages"));
+}
+
+bool BlackBerryCreatePackageStep::init()
+{
+ if (!BlackBerryAbstractDeployStep::init())
+ return false;
+
+ const QString packageCmd = target()->activeBuildConfiguration()->environment().searchInPath(QLatin1String(PACKAGER_CMD));
+ if (packageCmd.isEmpty()) {
+ raiseError(tr("Could not find packager command '%s' in the build environment")
+ .arg(QLatin1String(PACKAGER_CMD)));
+ return false;
+ }
+
+ BlackBerryDeployConfiguration *deployConfig = qobject_cast<BlackBerryDeployConfiguration *>(deployConfiguration());
+ QTC_ASSERT(deployConfig, return false);
+
+ QList<BarPackageDeployInformation> packagesToDeploy = deployConfig->deploymentInfo()->enabledPackages();
+ if (packagesToDeploy.isEmpty()) {
+ raiseError(tr("No packages enabled for deployment"));
+ return false;
+ }
+
+ foreach (const BarPackageDeployInformation &info, packagesToDeploy) {
+ if (info.appDescriptorPath.isEmpty()) {
+ raiseError(tr("Application descriptor file not specified, please check deployment settings"));
+ return false;
+ }
+
+ if (info.packagePath.isEmpty()) {
+ raiseError(tr("No package specified, please check deployment settings"));
+ return false;
+ }
+
+ const QString buildDir = target()->activeBuildConfiguration()->buildDirectory();
+ QDir dir(buildDir);
+ if (!dir.exists()) {
+ if (!dir.mkpath(buildDir)) {
+ raiseError(tr("Could not create build directory '%1'").arg(buildDir));
+ return false;
+ }
+ }
+
+ QTemporaryFile *preparedAppDescriptorFile = new QTemporaryFile(buildDir + QLatin1String("/bar-descriptor_XXXXXX.xml"));
+ if (!prepareAppDescriptorFile(info.appDescriptorPath, preparedAppDescriptorFile)) { // If there is an error, prepareAppDescriptorFile() will raise it
+ delete preparedAppDescriptorFile;
+ return false;
+ }
+
+ m_preparedAppDescriptorFiles << preparedAppDescriptorFile;
+
+ QStringList args;
+ args << QLatin1String("-devMode");
+ if (!debugToken().isEmpty())
+ args << QLatin1String("-debugToken") << QnxUtils::addQuotes(QDir::toNativeSeparators(debugToken()));
+ args << QLatin1String("-package") << QnxUtils::addQuotes(QDir::toNativeSeparators(info.packagePath));
+ args << QnxUtils::addQuotes(QDir::toNativeSeparators(preparedAppDescriptorFile->fileName()));
+ addCommand(packageCmd, args);
+ }
+
+ return true;
+}
+
+void BlackBerryCreatePackageStep::cleanup()
+{
+ while (!m_preparedAppDescriptorFiles.isEmpty()) {
+ QTemporaryFile *file = m_preparedAppDescriptorFiles.takeFirst();
+ delete file;
+ }
+}
+
+ProjectExplorer::BuildStepConfigWidget *BlackBerryCreatePackageStep::createConfigWidget()
+{
+ return new BlackBerryCreatePackageStepConfigWidget();
+}
+
+QString BlackBerryCreatePackageStep::debugToken() const
+{
+ BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(target()->profile());
+ return device->debugToken();
+}
+
+void BlackBerryCreatePackageStep::raiseError(const QString &errorMessage)
+{
+ emit addOutput(errorMessage, BuildStep::ErrorMessageOutput);
+ emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, errorMessage, Utils::FileName(), -1,
+ Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
+ cleanup();
+}
+
+bool BlackBerryCreatePackageStep::prepareAppDescriptorFile(const QString &appDescriptorPath, QTemporaryFile *preparedFile)
+{
+ BlackBerryQtVersion *qtVersion = dynamic_cast<BlackBerryQtVersion *>(QtSupport::QtProfileInformation::qtVersion(target()->profile()));
+ if (!qtVersion) {
+ raiseError(tr("Error preparing application descriptor file"));
+ return false;
+ }
+
+ QFile file(appDescriptorPath);
+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ raiseError(tr("Could not open '%1' for reading").arg(appDescriptorPath));
+ return false;
+ }
+
+ QByteArray fileContent = file.readAll();
+
+ // Replace Qt path placeholders
+ if (fileContent.contains(QT_INSTALL_LIBS_VAR))
+ fileContent.replace(QT_INSTALL_LIBS_VAR, qtVersion->versionInfo().value(QLatin1String(QT_INSTALL_LIBS)).toLatin1());
+ if (fileContent.contains(QT_INSTALL_PLUGINS_VAR))
+ fileContent.replace(QT_INSTALL_PLUGINS_VAR, qtVersion->versionInfo().value(QLatin1String(QT_INSTALL_PLUGINS)).toLatin1());
+ if (fileContent.contains(QT_INSTALL_IMPORTS_VAR))
+ fileContent.replace(QT_INSTALL_IMPORTS_VAR, qtVersion->versionInfo().value(QLatin1String(QT_INSTALL_IMPORTS)).toLatin1());
+
+ //Replace Source path placeholder
+ if (fileContent.contains(SRC_DIR_VAR))
+ fileContent.replace(SRC_DIR_VAR, QDir::toNativeSeparators(target()->project()->projectDirectory()).toLatin1());
+
+ // Add parameter for QML debugging (if enabled)
+ if (target()->activeRunConfiguration()->debuggerAspect()->useQmlDebugger()) {
+ if (!fileContent.contains("-qmljsdebugger")) {
+ const QString argString = QString::fromLatin1("<arg>-qmljsdebugger=port:%1</arg>\n</qnx>")
+ .arg(target()->activeRunConfiguration()->debuggerAspect()->qmlDebugServerPort());
+ fileContent.replace("</qnx>", argString.toLatin1());
+ }
+ }
+
+ const QString buildDir = target()->activeBuildConfiguration()->buildDirectory();
+ if (!preparedFile->open()) {
+ raiseError(tr("Could not create prepared application descriptor file in '%1'").arg(buildDir));
+ return false;
+ }
+
+ preparedFile->write(fileContent);
+ preparedFile->close();
+
+ return true;
+}
diff --git a/src/plugins/qnx/blackberrycreatepackagestep.h b/src/plugins/qnx/blackberrycreatepackagestep.h
new file mode 100644
index 0000000000..76ae8fd0a3
--- /dev/null
+++ b/src/plugins/qnx/blackberrycreatepackagestep.h
@@ -0,0 +1,74 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEP_H
+#define QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEP_H
+
+#include "blackberryabstractdeploystep.h"
+
+QT_BEGIN_NAMESPACE
+class QTemporaryFile;
+QT_END_NAMESPACE
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryCreatePackageStep : public BlackBerryAbstractDeployStep
+{
+ Q_OBJECT
+ friend class BlackBerryCreatePackageStepFactory;
+
+public:
+ explicit BlackBerryCreatePackageStep(ProjectExplorer::BuildStepList *bsl);
+
+ bool init();
+ void cleanup();
+ ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
+
+ QString debugToken() const;
+
+protected:
+ BlackBerryCreatePackageStep(ProjectExplorer::BuildStepList *bsl, BlackBerryCreatePackageStep *bs);
+
+ void raiseError(const QString &errorMessage);
+
+private:
+ bool prepareAppDescriptorFile(const QString &appDescriptorPath, QTemporaryFile *preparedFile);
+
+ QList<QTemporaryFile *> m_preparedAppDescriptorFiles;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEP_H
diff --git a/src/plugins/qnx/blackberrycreatepackagestepconfigwidget.cpp b/src/plugins/qnx/blackberrycreatepackagestepconfigwidget.cpp
new file mode 100644
index 0000000000..14e0f19486
--- /dev/null
+++ b/src/plugins/qnx/blackberrycreatepackagestepconfigwidget.cpp
@@ -0,0 +1,57 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberrycreatepackagestepconfigwidget.h"
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryCreatePackageStepConfigWidget::BlackBerryCreatePackageStepConfigWidget()
+ : ProjectExplorer::BuildStepConfigWidget()
+{
+}
+
+QString BlackBerryCreatePackageStepConfigWidget::displayName() const
+{
+ return tr("<b>Create packages</b>");
+}
+
+QString BlackBerryCreatePackageStepConfigWidget::summaryText() const
+{
+ return displayName();
+}
+
+bool BlackBerryCreatePackageStepConfigWidget::showWidget() const
+{
+ return false;
+}
diff --git a/src/plugins/qnx/blackberrycreatepackagestepconfigwidget.h b/src/plugins/qnx/blackberrycreatepackagestepconfigwidget.h
new file mode 100644
index 0000000000..6ba961e150
--- /dev/null
+++ b/src/plugins/qnx/blackberrycreatepackagestepconfigwidget.h
@@ -0,0 +1,57 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEPCONFIGWIDGET_H
+#define QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEPCONFIGWIDGET_H
+
+#include <projectexplorer/buildstep.h>
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryCreatePackageStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryCreatePackageStepConfigWidget();
+
+ QString displayName() const;
+ QString summaryText() const;
+
+ bool showWidget() const;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEPCONFIGWIDGET_H
diff --git a/src/plugins/qnx/blackberrycreatepackagestepfactory.cpp b/src/plugins/qnx/blackberrycreatepackagestepfactory.cpp
new file mode 100644
index 0000000000..bf7c5d7028
--- /dev/null
+++ b/src/plugins/qnx/blackberrycreatepackagestepfactory.cpp
@@ -0,0 +1,120 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberrycreatepackagestepfactory.h"
+
+#include "qnxconstants.h"
+#include "blackberrycreatepackagestep.h"
+#include "blackberrydeviceconfigurationfactory.h"
+
+#include <projectexplorer/buildsteplist.h>
+#include <projectexplorer/profileinformation.h>
+#include <projectexplorer/projectexplorerconstants.h>
+#include <projectexplorer/target.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryCreatePackageStepFactory::BlackBerryCreatePackageStepFactory(QObject *parent) :
+ ProjectExplorer::IBuildStepFactory(parent)
+{
+}
+
+BlackBerryCreatePackageStepFactory::~BlackBerryCreatePackageStepFactory()
+{
+}
+
+QList<Core::Id> BlackBerryCreatePackageStepFactory::availableCreationIds(
+ ProjectExplorer::BuildStepList *parent) const
+{
+ if (parent->id() != Core::Id(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY))
+ return QList<Core::Id>();
+
+ Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(parent->target()->profile());
+ if (deviceType != BlackBerryDeviceConfigurationFactory::deviceType())
+ return QList<Core::Id>();
+
+ return QList<Core::Id>() << Core::Id(Constants::QNX_CREATE_PACKAGE_BS_ID);
+}
+
+QString BlackBerryCreatePackageStepFactory::displayNameForId(const Core::Id id) const
+{
+ if (id == Core::Id(Constants::QNX_CREATE_PACKAGE_BS_ID))
+ return tr("Create BAR Packages");
+ return QString();
+}
+
+bool BlackBerryCreatePackageStepFactory::canCreate(ProjectExplorer::BuildStepList *parent,
+ const Core::Id id) const
+{
+ return availableCreationIds(parent).contains(id);
+}
+
+ProjectExplorer::BuildStep *BlackBerryCreatePackageStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id)
+{
+ if (!canCreate(parent, id))
+ return 0;
+ return new BlackBerryCreatePackageStep(parent);
+}
+
+bool BlackBerryCreatePackageStepFactory::canRestore(ProjectExplorer::BuildStepList *parent,
+ const QVariantMap &map) const
+{
+ return canCreate(parent, ProjectExplorer::idFromMap(map));
+}
+
+ProjectExplorer::BuildStep *BlackBerryCreatePackageStepFactory::restore(
+ ProjectExplorer::BuildStepList *parent, const QVariantMap &map)
+{
+ if (!canRestore(parent, map))
+ return 0;
+ BlackBerryCreatePackageStep *bs = new BlackBerryCreatePackageStep(parent);
+ if (bs->fromMap(map))
+ return bs;
+ delete bs;
+ return 0;
+}
+
+bool BlackBerryCreatePackageStepFactory::canClone(ProjectExplorer::BuildStepList *parent,
+ ProjectExplorer::BuildStep *source) const
+{
+ return canCreate(parent, source->id());
+}
+
+ProjectExplorer::BuildStep *BlackBerryCreatePackageStepFactory::clone(ProjectExplorer::BuildStepList *parent,
+ ProjectExplorer::BuildStep *source)
+{
+ if (!canClone(parent, source))
+ return 0;
+ return new BlackBerryCreatePackageStep(parent, static_cast<BlackBerryCreatePackageStep *>(source));
+}
diff --git a/src/plugins/qnx/blackberrycreatepackagestepfactory.h b/src/plugins/qnx/blackberrycreatepackagestepfactory.h
new file mode 100644
index 0000000000..c5030ac9ca
--- /dev/null
+++ b/src/plugins/qnx/blackberrycreatepackagestepfactory.h
@@ -0,0 +1,67 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEPFACTORY_H
+#define QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEPFACTORY_H
+
+#include <projectexplorer/buildstep.h>
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryCreatePackageStepFactory : public ProjectExplorer::IBuildStepFactory
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryCreatePackageStepFactory(QObject *parent = 0);
+ ~BlackBerryCreatePackageStepFactory();
+
+ QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
+ QString displayNameForId(const Core::Id id) const;
+
+ bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
+ ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
+
+ bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
+ ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent,
+ const QVariantMap &map);
+
+ bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const;
+ ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent,
+ ProjectExplorer::BuildStep *product);
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYCREATEPACKAGESTEPFACTORY_H
diff --git a/src/plugins/qnx/blackberrydebugsupport.cpp b/src/plugins/qnx/blackberrydebugsupport.cpp
new file mode 100644
index 0000000000..4cc843a39b
--- /dev/null
+++ b/src/plugins/qnx/blackberrydebugsupport.cpp
@@ -0,0 +1,111 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberrydebugsupport.h"
+#include "blackberryapplicationrunner.h"
+#include "blackberryconnect.h"
+
+#include <debugger/debuggerrunner.h>
+#include <debugger/debuggerengine.h>
+#include <debugger/debuggerstartparameters.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryDebugSupport::BlackBerryDebugSupport(BlackBerryRunConfiguration *runConfig,
+ Debugger::DebuggerRunControl *runControl)
+ : QObject(runControl->engine())
+ , m_engine(runControl->engine())
+{
+ m_runner = new BlackBerryApplicationRunner(true, runConfig, this);
+ m_connector = BlackBerryConnect::instance(runConfig);
+
+ connect(m_engine, SIGNAL(requestRemoteSetup()), this, SLOT(launchRemoteApplication()));
+ connect(m_engine, SIGNAL(stateChanged(Debugger::DebuggerState)),
+ this, SLOT(handleDebuggerStateChanged(Debugger::DebuggerState)));
+
+ connect(m_connector, SIGNAL(error(QString)), this, SLOT(handleConnectorError(QString)));
+ connect(m_connector, SIGNAL(connected()), m_runner, SLOT(start()));
+ connect(m_connector, SIGNAL(output(QString,Utils::OutputFormat)),
+ runControl, SLOT(appendMessage(QString,Utils::OutputFormat)));
+
+ connect(m_runner, SIGNAL(started()), this, SLOT(handleStarted()));
+ connect(m_runner, SIGNAL(started()), m_runner, SLOT(tailApplicationLog()));
+ connect(m_runner, SIGNAL(startFailed(QString)), this, SLOT(handleStartFailed(QString)));
+ connect(m_runner, SIGNAL(output(QString,Utils::OutputFormat)),
+ this, SLOT(handleApplicationOutput(QString,Utils::OutputFormat)));
+ connect(m_runner, SIGNAL(finished()), m_connector, SLOT(disconnectFromDevice()));
+
+ connect(this, SIGNAL(output(QString,Utils::OutputFormat)),
+ runControl, SLOT(appendMessage(QString,Utils::OutputFormat)));
+}
+
+BlackBerryDebugSupport::~BlackBerryDebugSupport()
+{
+ BlackBerryConnect::cleanup(m_connector);
+}
+
+void BlackBerryDebugSupport::launchRemoteApplication()
+{
+ m_connector->connectToDevice();
+}
+
+void BlackBerryDebugSupport::handleStarted()
+{
+ m_engine->startParameters().attachPID = m_runner->pid();
+ m_engine->notifyEngineRemoteSetupDone(-1, -1);
+}
+
+void BlackBerryDebugSupport::handleStartFailed(const QString &message)
+{
+ m_engine->notifyEngineRemoteSetupFailed(message);
+}
+
+void BlackBerryDebugSupport::handleDebuggerStateChanged(Debugger::DebuggerState state)
+{
+ if (state == Debugger::EngineShutdownOk || state == Debugger::DebuggerFinished) {
+ if (m_runner->isRunning())
+ m_runner->stop();
+ }
+}
+
+void BlackBerryDebugSupport::handleConnectorError(const QString &message)
+{
+ m_engine->notifyEngineRemoteSetupFailed(message);
+}
+
+void BlackBerryDebugSupport::handleApplicationOutput(const QString &msg, Utils::OutputFormat format)
+{
+ Q_UNUSED(format)
+ m_engine->showMessage(msg, Debugger::AppOutput);
+}
diff --git a/src/plugins/qnx/blackberrydebugsupport.h b/src/plugins/qnx/blackberrydebugsupport.h
new file mode 100644
index 0000000000..88111c2f4c
--- /dev/null
+++ b/src/plugins/qnx/blackberrydebugsupport.h
@@ -0,0 +1,89 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYDEBUGSUPPORT_H
+#define QNX_INTERNAL_BLACKBERRYDEBUGSUPPORT_H
+
+#include <debugger/debuggerconstants.h>
+
+#include <utils/outputformat.h>
+
+#include <QObject>
+#include <QProcess>
+
+namespace Debugger {
+class DebuggerEngine;
+class DebuggerRunControl;
+}
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryConnect;
+class BlackBerryRunConfiguration;
+class BlackBerryApplicationRunner;
+
+class BlackBerryDebugSupport : public QObject
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryDebugSupport(BlackBerryRunConfiguration *runConfig,
+ Debugger::DebuggerRunControl *runControl);
+ ~BlackBerryDebugSupport();
+
+signals:
+ void output(const QString &msg, Utils::OutputFormat format);
+
+private slots:
+ void launchRemoteApplication();
+
+ void handleStarted();
+ void handleStartFailed(const QString &message);
+
+ void handleDebuggerStateChanged(Debugger::DebuggerState state);
+
+ void handleConnectorError(const QString &message);
+
+ void handleApplicationOutput(const QString &msg, Utils::OutputFormat format);
+
+private:
+ Debugger::DebuggerEngine *m_engine;
+
+ BlackBerryApplicationRunner *m_runner;
+ BlackBerryConnect *m_connector;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYDEBUGSUPPORT_H
diff --git a/src/plugins/qnx/blackberrydeployconfiguration.cpp b/src/plugins/qnx/blackberrydeployconfiguration.cpp
new file mode 100644
index 0000000000..1a43cd5c8c
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeployconfiguration.cpp
@@ -0,0 +1,111 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberrydeployconfiguration.h"
+
+#include "qnxconstants.h"
+#include "blackberrydeployconfigurationwidget.h"
+#include "blackberrydeployinformation.h"
+
+#include <projectexplorer/profileinformation.h>
+#include <projectexplorer/target.h>
+#include <qt4projectmanager/qt4nodes.h>
+#include <qt4projectmanager/qt4project.h>
+#include <ssh/sshconnection.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+namespace {
+const char DEPLOYMENT_INFO_SETTING[] = "QNX.BlackBerry.DeploymentInfo";
+}
+
+BlackBerryDeployConfiguration::BlackBerryDeployConfiguration(ProjectExplorer::Target *parent)
+ : ProjectExplorer::DeployConfiguration(parent, Core::Id(Constants::QNX_BB_DEPLOYCONFIGURATION_ID))
+{
+ ctor();
+}
+
+BlackBerryDeployConfiguration::BlackBerryDeployConfiguration(ProjectExplorer::Target *parent,
+ BlackBerryDeployConfiguration *source)
+ : ProjectExplorer::DeployConfiguration(parent, source)
+{
+ ctor();
+}
+
+void BlackBerryDeployConfiguration::ctor()
+{
+ BlackBerryDeployInformation *info
+ = qobject_cast<BlackBerryDeployInformation *>(target()->project()->namedSettings(QLatin1String(DEPLOYMENT_INFO_SETTING)).value<QObject *>());
+ if (!info) {
+ info = new BlackBerryDeployInformation(static_cast<Qt4ProjectManager::Qt4Project *>(target()->project()));
+ QVariant data = QVariant::fromValue(static_cast<QObject *>(info));
+ target()->project()->setNamedSettings(QLatin1String(DEPLOYMENT_INFO_SETTING), data);
+ }
+
+ setDefaultDisplayName(tr("Deploy to BlackBerry Device"));
+}
+
+BlackBerryDeployConfiguration::~BlackBerryDeployConfiguration()
+{
+}
+
+BlackBerryDeployInformation *BlackBerryDeployConfiguration::deploymentInfo() const
+{
+ BlackBerryDeployInformation *info
+ = qobject_cast<BlackBerryDeployInformation *>(target()->project()->namedSettings(QLatin1String(DEPLOYMENT_INFO_SETTING)).value<QObject *>());
+ return info;
+}
+
+QString BlackBerryDeployConfiguration::deviceHost() const
+{
+ BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(target()->profile());
+ return device->sshParameters().host;
+}
+
+QString BlackBerryDeployConfiguration::password() const
+{
+ BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(target()->profile());
+ return device->sshParameters().password;
+}
+
+QString BlackBerryDeployConfiguration::deviceName() const
+{
+ BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(target()->profile());
+ return device->displayName();
+}
+
+ProjectExplorer::DeployConfigurationWidget *BlackBerryDeployConfiguration::configurationWidget() const
+{
+ return new BlackBerryDeployConfigurationWidget;
+}
diff --git a/src/plugins/qnx/blackberrydeployconfiguration.h b/src/plugins/qnx/blackberrydeployconfiguration.h
new file mode 100644
index 0000000000..65d74e752c
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeployconfiguration.h
@@ -0,0 +1,77 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATION_H
+#define QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATION_H
+
+#include <projectexplorer/deployconfiguration.h>
+
+#include "blackberrydeviceconfiguration.h"
+
+namespace ProjectExplorer {
+class Target;
+}
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryDeployInformation;
+
+class BlackBerryDeployConfiguration : public ProjectExplorer::DeployConfiguration
+{
+ Q_OBJECT
+ friend class BlackBerryDeployConfigurationFactory;
+
+public:
+ explicit BlackBerryDeployConfiguration(ProjectExplorer::Target *parent);
+ virtual ~BlackBerryDeployConfiguration();
+
+ ProjectExplorer::DeployConfigurationWidget *configurationWidget() const;
+
+ BlackBerryDeployInformation *deploymentInfo() const;
+
+ QString deviceHost() const;
+ QString password() const;
+ QString deviceName() const;
+
+protected:
+ BlackBerryDeployConfiguration(ProjectExplorer::Target *parent, BlackBerryDeployConfiguration *source);
+
+private:
+ void ctor();
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATION_H
diff --git a/src/plugins/qnx/blackberrydeployconfigurationfactory.cpp b/src/plugins/qnx/blackberrydeployconfigurationfactory.cpp
new file mode 100644
index 0000000000..0523016c1e
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeployconfigurationfactory.cpp
@@ -0,0 +1,135 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberrydeployconfigurationfactory.h"
+
+#include "qnxconstants.h"
+#include "blackberrydeployconfiguration.h"
+#include "blackberrycreatepackagestep.h"
+#include "blackberrydeploystep.h"
+#include "blackberrydeviceconfigurationfactory.h"
+
+#include <projectexplorer/buildsteplist.h>
+#include <projectexplorer/profileinformation.h>
+#include <projectexplorer/target.h>
+#include <qt4projectmanager/qt4project.h>
+#include <remotelinux/genericdirectuploadstep.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryDeployConfigurationFactory::BlackBerryDeployConfigurationFactory(QObject *parent) :
+ ProjectExplorer::DeployConfigurationFactory(parent)
+{
+}
+
+BlackBerryDeployConfigurationFactory::~BlackBerryDeployConfigurationFactory()
+{
+}
+
+QList<Core::Id> BlackBerryDeployConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const
+{
+ QList<Core::Id> result;
+
+ Qt4ProjectManager::Qt4Project *project = qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project());
+ if (!project)
+ return result;
+
+ Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(parent->profile());
+ if (deviceType != BlackBerryDeviceConfigurationFactory::deviceType())
+ return result;
+
+ result << Core::Id(Constants::QNX_BB_DEPLOYCONFIGURATION_ID);
+ return result;
+}
+
+QString BlackBerryDeployConfigurationFactory::displayNameForId(const Core::Id id) const
+{
+ if (id == Core::Id(Constants::QNX_BB_DEPLOYCONFIGURATION_ID))
+ return tr("Deploy to BlackBerry Device");
+
+ return QString();
+}
+
+bool BlackBerryDeployConfigurationFactory::canCreate(ProjectExplorer::Target *parent,
+ const Core::Id id) const
+{
+ return availableCreationIds(parent).contains(id);
+}
+
+ProjectExplorer::DeployConfiguration *BlackBerryDeployConfigurationFactory::create(
+ ProjectExplorer::Target *parent, const Core::Id id)
+{
+ if (!canCreate(parent, id))
+ return 0;
+
+ BlackBerryDeployConfiguration *dc = new BlackBerryDeployConfiguration(parent);
+ dc->stepList()->insertStep(0, new BlackBerryCreatePackageStep(dc->stepList()));
+ dc->stepList()->insertStep(1, new BlackBerryDeployStep(dc->stepList()));
+ return dc;
+}
+
+bool BlackBerryDeployConfigurationFactory::canRestore(ProjectExplorer::Target *parent,
+ const QVariantMap &map) const
+{
+ return canCreate(parent, ProjectExplorer::idFromMap(map));
+}
+
+ProjectExplorer::DeployConfiguration *BlackBerryDeployConfigurationFactory::restore(
+ ProjectExplorer::Target *parent, const QVariantMap &map)
+{
+ if (!canRestore(parent, map))
+ return 0;
+
+ BlackBerryDeployConfiguration *dc = new BlackBerryDeployConfiguration(parent);
+ if (dc->fromMap(map))
+ return dc;
+
+ delete dc;
+ return 0;
+}
+
+bool BlackBerryDeployConfigurationFactory::canClone(ProjectExplorer::Target *parent,
+ ProjectExplorer::DeployConfiguration *source) const
+{
+ return canCreate(parent, source->id());
+}
+
+ProjectExplorer::DeployConfiguration *BlackBerryDeployConfigurationFactory::clone(
+ ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source)
+{
+ if (!canClone(parent, source))
+ return 0;
+ BlackBerryDeployConfiguration *old = static_cast<BlackBerryDeployConfiguration *>(source);
+ return new BlackBerryDeployConfiguration(parent, old);
+}
diff --git a/src/plugins/qnx/blackberrydeployconfigurationfactory.h b/src/plugins/qnx/blackberrydeployconfigurationfactory.h
new file mode 100644
index 0000000000..9860a0cbae
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeployconfigurationfactory.h
@@ -0,0 +1,73 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATIONFACTORY_H
+#define QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATIONFACTORY_H
+
+#include <projectexplorer/deployconfiguration.h>
+
+namespace ProjectExplorer {
+class Target;
+}
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryDeployConfigurationFactory : public ProjectExplorer::DeployConfigurationFactory
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryDeployConfigurationFactory(QObject *parent = 0);
+ ~BlackBerryDeployConfigurationFactory();
+
+ QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const;
+ QString displayNameForId(const Core::Id id) const;
+
+ bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
+ ProjectExplorer::DeployConfiguration *create(ProjectExplorer::Target *parent,
+ const Core::Id id);
+
+ bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
+ ProjectExplorer::DeployConfiguration *restore(ProjectExplorer::Target *parent,
+ const QVariantMap &map);
+
+ bool canClone(ProjectExplorer::Target *parent,
+ ProjectExplorer::DeployConfiguration *source) const;
+ ProjectExplorer::DeployConfiguration *clone(ProjectExplorer::Target *parent,
+ ProjectExplorer::DeployConfiguration *source);
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATIONFACTORY_H
diff --git a/src/plugins/qnx/blackberrydeployconfigurationwidget.cpp b/src/plugins/qnx/blackberrydeployconfigurationwidget.cpp
new file mode 100644
index 0000000000..6f5fbc7d26
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeployconfigurationwidget.cpp
@@ -0,0 +1,79 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberrydeployconfigurationwidget.h"
+#include "ui_blackberrydeployconfigurationwidget.h"
+#include "blackberrydeployconfiguration.h"
+#include "blackberrydeployinformation.h"
+#include "pathchooserdelegate.h"
+
+#include <coreplugin/icore.h>
+#include <projectexplorer/devicesupport/devicemanager.h>
+#include <projectexplorer/projectexplorerconstants.h>
+#include <utils/pathchooser.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryDeployConfigurationWidget::BlackBerryDeployConfigurationWidget(QWidget *parent)
+ : ProjectExplorer::DeployConfigurationWidget(parent)
+ , m_ui(new Ui::BlackBerryDeployConfigurationWidget)
+ , m_deployConfiguration(0)
+{
+ m_ui->setupUi(this);
+}
+
+BlackBerryDeployConfigurationWidget::~BlackBerryDeployConfigurationWidget()
+{
+ delete m_ui;
+}
+
+void BlackBerryDeployConfigurationWidget::init(ProjectExplorer::DeployConfiguration *dc)
+{
+ m_deployConfiguration = qobject_cast<BlackBerryDeployConfiguration *>(dc);
+
+ m_ui->deployPackagesView->setModel(m_deployConfiguration->deploymentInfo());
+
+ PathChooserDelegate *appDescriptorPathDelegate = new PathChooserDelegate(this);
+ appDescriptorPathDelegate->setExpectedKind(Utils::PathChooser::File);
+ appDescriptorPathDelegate->setPromptDialogFilter(QLatin1String("*.xml"));
+
+ PathChooserDelegate *barPathDelegate = new PathChooserDelegate(this);
+ barPathDelegate->setExpectedKind(Utils::PathChooser::File);
+ barPathDelegate->setPromptDialogFilter(QLatin1String("*.bar"));
+
+ m_ui->deployPackagesView->setItemDelegateForColumn(1, appDescriptorPathDelegate);
+ m_ui->deployPackagesView->setItemDelegateForColumn(2, barPathDelegate);
+
+ m_ui->deployPackagesView->header()->resizeSections(QHeaderView::ResizeToContents);
+}
diff --git a/src/plugins/qnx/blackberrydeployconfigurationwidget.h b/src/plugins/qnx/blackberrydeployconfigurationwidget.h
new file mode 100644
index 0000000000..779a97bf8c
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeployconfigurationwidget.h
@@ -0,0 +1,66 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATIONWIDGET_H
+#define QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATIONWIDGET_H
+
+#include <projectexplorer/deployconfiguration.h>
+
+namespace Qnx {
+namespace Internal {
+
+namespace Ui {
+class BlackBerryDeployConfigurationWidget;
+}
+
+class BlackBerryDeployConfiguration;
+
+class BlackBerryDeployConfigurationWidget : public ProjectExplorer::DeployConfigurationWidget
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryDeployConfigurationWidget(QWidget *parent = 0);
+ ~BlackBerryDeployConfigurationWidget();
+
+ void init(ProjectExplorer::DeployConfiguration *dc);
+
+private:
+ Ui::BlackBerryDeployConfigurationWidget *m_ui;
+
+ BlackBerryDeployConfiguration *m_deployConfiguration;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYDEPLOYCONFIGURATIONWIDGET_H
diff --git a/src/plugins/qnx/blackberrydeployconfigurationwidget.ui b/src/plugins/qnx/blackberrydeployconfigurationwidget.ui
new file mode 100644
index 0000000000..393ed5c2f6
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeployconfigurationwidget.ui
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Qnx::Internal::BlackBerryDeployConfigurationWidget</class>
+ <widget class="QWidget" name="Qnx::Internal::BlackBerryDeployConfigurationWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>599</width>
+ <height>213</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Packages to deploy:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTreeView" name="deployPackagesView">
+ <property name="alternatingRowColors">
+ <bool>true</bool>
+ </property>
+ <property name="textElideMode">
+ <enum>Qt::ElideLeft</enum>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>false</bool>
+ </property>
+ <property name="itemsExpandable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/plugins/qnx/blackberrydeployinformation.cpp b/src/plugins/qnx/blackberrydeployinformation.cpp
new file mode 100644
index 0000000000..284afad35e
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeployinformation.cpp
@@ -0,0 +1,197 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberrydeployinformation.h"
+
+#include "blackberrydeployconfiguration.h"
+
+#include <projectexplorer/target.h>
+#include <qt4projectmanager/qt4project.h>
+#include <qt4projectmanager/qt4nodes.h>
+#include <qtsupport/baseqtversion.h>
+#include <qtsupport/qtprofileinformation.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryDeployInformation::BlackBerryDeployInformation(Qt4ProjectManager::Qt4Project *project)
+ : QAbstractTableModel(project)
+ , m_project(project)
+{
+ connect(m_project, SIGNAL(buildSystemEvaluated()), this, SLOT(initModel()));
+}
+
+int BlackBerryDeployInformation::rowCount(const QModelIndex &parent) const
+{
+ if (parent.isValid())
+ return 0;
+
+ return m_deployInformation.count();
+}
+
+int BlackBerryDeployInformation::columnCount(const QModelIndex &parent) const
+{
+ if (parent.isValid())
+ return 0;
+
+ return ColumnCount;
+}
+
+QVariant BlackBerryDeployInformation::data(const QModelIndex &index, int role) const
+{
+ if (!index.isValid())
+ return QVariant();
+
+ if (index.row() >= m_deployInformation.count() || index.column() >= ColumnCount)
+ return QVariant();
+
+ BarPackageDeployInformation di = m_deployInformation[index.row()];
+ if (role == Qt::CheckStateRole) {
+ if (index.column() == EnabledColumn)
+ return di.enabled ? Qt::Checked : Qt::Unchecked;
+ } else if (role == Qt::DisplayRole || role == Qt::EditRole) {
+ if (index.column() == AppDescriptorColumn)
+ return di.appDescriptorPath;
+ else if (index.column() == PackageColumn)
+ return di.packagePath;
+ }
+
+ return QVariant();
+}
+
+QVariant BlackBerryDeployInformation::headerData(int section, Qt::Orientation orientation, int role) const
+{
+ if (orientation == Qt::Vertical || role != Qt::DisplayRole)
+ return QVariant();
+
+ switch (section) {
+ case EnabledColumn:
+ return tr("Enabled");
+ case AppDescriptorColumn:
+ return tr("Application descriptor file");
+ case PackageColumn:
+ return tr("Package");
+ default:
+ return QVariant();
+ }
+}
+
+bool BlackBerryDeployInformation::setData(const QModelIndex &index, const QVariant &value, int role)
+{
+ if (!index.isValid())
+ return false;
+ if (index.row() >= m_deployInformation.count() || index.column() >= ColumnCount)
+ return false;
+
+ BarPackageDeployInformation &di = m_deployInformation[index.row()];
+ if (role == Qt::CheckStateRole && index.column() == EnabledColumn) {
+ di.enabled = static_cast<Qt::CheckState>(value.toInt()) == Qt::Checked;
+ } else if (role == Qt::EditRole) {
+ if (index.column() == AppDescriptorColumn)
+ di.appDescriptorPath = value.toString();
+ else if (index.column() == PackageColumn)
+ di.packagePath = value.toString();
+ }
+
+ emit dataChanged(index, index);
+ return true;
+}
+
+Qt::ItemFlags BlackBerryDeployInformation::flags(const QModelIndex &index) const
+{
+ Qt::ItemFlags flags = QAbstractTableModel::flags(index);
+ switch (index.column()) {
+ case EnabledColumn:
+ flags |= Qt::ItemIsEditable | Qt::ItemIsUserCheckable;
+ break;
+ case AppDescriptorColumn:
+ case PackageColumn:
+ flags |= Qt::ItemIsEditable;
+ break;
+ }
+
+ return flags;
+}
+
+QList<BarPackageDeployInformation> BlackBerryDeployInformation::enabledPackages() const
+{
+ QList<BarPackageDeployInformation> result;
+
+ foreach (const BarPackageDeployInformation& info, m_deployInformation) {
+ if (info.enabled)
+ result << info;
+ }
+
+ return result;
+}
+
+void BlackBerryDeployInformation::initModel()
+{
+ ProjectExplorer::Target *target = m_project->activeTarget();
+ if (!target
+ || !target->activeDeployConfiguration()
+ || !qobject_cast<BlackBerryDeployConfiguration *>(target->activeDeployConfiguration()))
+ return;
+
+ QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target->profile());
+ if (!version || !version->isValid()) {
+ beginResetModel();
+ m_deployInformation.clear();
+ endResetModel();
+ return;
+ }
+
+ const Qt4ProjectManager::Qt4ProFileNode *const rootNode = m_project->rootQt4ProjectNode();
+ if (!rootNode || rootNode->parseInProgress()) // Can be null right after project creation by wizard.
+ return;
+
+ disconnect(m_project, SIGNAL(buildSystemEvaluated()), this, SLOT(initModel()));
+ beginResetModel();
+ m_deployInformation.clear();
+
+ QList<Qt4ProjectManager::Qt4ProFileNode *> appNodes = m_project->applicationProFiles();
+ foreach (Qt4ProjectManager::Qt4ProFileNode *node, appNodes) {
+ Qt4ProjectManager::TargetInformation ti = node->targetInformation();
+
+ QFileInfo fi(node->path());
+ const QString appDescriptorPath = QDir::toNativeSeparators(fi.absolutePath() + QLatin1String("/bar-descriptor.xml"));
+ QString barPackagePath;
+ if (!ti.buildDir.isEmpty())
+ barPackagePath = QDir::toNativeSeparators(ti.buildDir + QLatin1Char('/') + ti.target + QLatin1String(".bar"));
+
+ m_deployInformation << BarPackageDeployInformation(true, appDescriptorPath, barPackagePath, node->path());
+ }
+
+ endResetModel();
+ connect(m_project, SIGNAL(buildSystemEvaluated()), SLOT(initModel()));
+}
diff --git a/src/plugins/qnx/blackberrydeployinformation.h b/src/plugins/qnx/blackberrydeployinformation.h
new file mode 100644
index 0000000000..e82c208df6
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeployinformation.h
@@ -0,0 +1,99 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYDEPLOYINFORMATION_H
+#define QNX_INTERNAL_BLACKBERRYDEPLOYINFORMATION_H
+
+#include <QAbstractTableModel>
+
+namespace Qt4ProjectManager {
+class Qt4Project;
+}
+
+namespace Qnx {
+namespace Internal {
+
+class BarPackageDeployInformation {
+public:
+ BarPackageDeployInformation(bool enabled, QString appDescriptorPath, QString packagePath, QString proFilePath)
+ : enabled(enabled)
+ , appDescriptorPath(appDescriptorPath)
+ , packagePath(packagePath)
+ , proFilePath(proFilePath)
+ {
+ }
+
+ bool enabled;
+ QString appDescriptorPath;
+ QString packagePath;
+ QString proFilePath;
+};
+
+class BlackBerryDeployInformation : public QAbstractTableModel
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryDeployInformation(Qt4ProjectManager::Qt4Project *project);
+
+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const;
+
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+ QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
+
+ bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
+
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+
+ QList<BarPackageDeployInformation> enabledPackages() const;
+
+private slots:
+ void initModel();
+
+private:
+ enum Columns {
+ EnabledColumn = 0,
+ AppDescriptorColumn,
+ PackageColumn,
+ ColumnCount // Always have last
+ };
+
+ Qt4ProjectManager::Qt4Project *m_project;
+
+ QList<BarPackageDeployInformation> m_deployInformation;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYDEPLOYINFORMATION_H
diff --git a/src/plugins/qnx/blackberrydeploystep.cpp b/src/plugins/qnx/blackberrydeploystep.cpp
new file mode 100644
index 0000000000..046ddcdf56
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeploystep.cpp
@@ -0,0 +1,193 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberrydeploystep.h"
+
+#include "qnxconstants.h"
+#include "blackberrydeployconfiguration.h"
+#include "blackberrydeploystepconfigwidget.h"
+#include "qnxutils.h"
+#include "blackberrydeployinformation.h"
+
+#include <projectexplorer/projectexplorerconstants.h>
+#include <projectexplorer/target.h>
+#include <qt4projectmanager/qt4buildconfiguration.h>
+#include <utils/qtcassert.h>
+
+#include <QDir>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+namespace {
+const char DEPLOY_CMD[] = "blackberry-deploy";
+
+int parseProgress(const QString &line)
+{
+ const QString startOfLine = QLatin1String("Info: Progress ");
+ if (!line.startsWith(startOfLine))
+ return -1;
+
+ const int percentPos = line.indexOf(QLatin1Char('%'));
+ const QString progressStr = line.mid(startOfLine.length(), percentPos - startOfLine.length());
+
+ bool ok;
+ const int progress = progressStr.toInt(&ok);
+ if (!ok)
+ return -1;
+
+ return progress;
+}
+}
+
+BlackBerryDeployStep::BlackBerryDeployStep(ProjectExplorer::BuildStepList *bsl)
+ : BlackBerryAbstractDeployStep(bsl, Core::Id(Constants::QNX_DEPLOY_PACKAGE_BS_ID))
+{
+ setDisplayName(tr("Deploy packages"));
+}
+
+BlackBerryDeployStep::BlackBerryDeployStep(ProjectExplorer::BuildStepList *bsl, BlackBerryDeployStep *bs)
+ : BlackBerryAbstractDeployStep(bsl, bs)
+{
+ setDisplayName(tr("Deploy packages"));
+}
+
+BlackBerryDeployStep::~BlackBerryDeployStep()
+{
+}
+
+bool BlackBerryDeployStep::init()
+{
+ if (!BlackBerryAbstractDeployStep::init())
+ return false;
+
+ QString deployCmd = target()->activeBuildConfiguration()->environment().searchInPath(QLatin1String(DEPLOY_CMD));
+ if (deployCmd.isEmpty()) {
+ raiseError(tr("Could not find deploy command '%1' in the build environment")
+ .arg(QLatin1String(DEPLOY_CMD)));
+ return false;
+ }
+
+ if (deviceHost().isEmpty()) {
+ raiseError(tr("No hostname specified for device"));
+ return false;
+ }
+
+ BlackBerryDeployConfiguration *deployConfig = qobject_cast<BlackBerryDeployConfiguration *>(deployConfiguration());
+ QTC_ASSERT(deployConfig, return false);
+
+ QList<BarPackageDeployInformation> packagesToDeploy = deployConfig->deploymentInfo()->enabledPackages();
+ if (packagesToDeploy.isEmpty()) {
+ raiseError(tr("No packages enabled for deployment"));
+ return false;
+ }
+
+ foreach (const BarPackageDeployInformation &info, packagesToDeploy) {
+ QStringList args;
+ args << QLatin1String("-installApp");
+ args << QLatin1String("-device") << deviceHost();
+ if (!password().isEmpty())
+ args << QLatin1String("-password") << password();
+ args << QnxUtils::addQuotes(QDir::toNativeSeparators(info.packagePath));
+
+ addCommand(deployCmd, args);
+ }
+
+ return true;
+}
+
+void BlackBerryDeployStep::run(QFutureInterface<bool> &fi)
+{
+ BlackBerryDeployConfiguration *deployConfig = qobject_cast<BlackBerryDeployConfiguration *>(deployConfiguration());
+ QTC_ASSERT(deployConfig, return);
+
+ QList<BarPackageDeployInformation> packagesToDeploy = deployConfig->deploymentInfo()->enabledPackages();
+ foreach (const BarPackageDeployInformation &info, packagesToDeploy) {
+ if (!QFileInfo(info.packagePath).exists()) {
+ raiseError(tr("Package '%1' does not exist. Create the package first.").arg(info.packagePath));
+ fi.reportResult(false);
+ return;
+ }
+ }
+
+ BlackBerryAbstractDeployStep::run(fi);
+}
+
+void BlackBerryDeployStep::cleanup()
+{
+}
+
+void BlackBerryDeployStep::stdOutput(const QString &line)
+{
+ const int progress = parseProgress(line);
+ if (progress > -1)
+ reportProgress(progress);
+
+ BlackBerryAbstractDeployStep::stdOutput(line);
+}
+
+void BlackBerryDeployStep::processStarted(const ProjectExplorer::ProcessParameters &params)
+{
+ QString arguments = params.prettyArguments();
+ if (!password().isEmpty()) {
+ const QString passwordLine = QLatin1String(" -password ") + password();
+ const QString hiddenPasswordLine = QLatin1String(" -password <hidden>");
+ arguments.replace(passwordLine, hiddenPasswordLine);
+ }
+
+ emitOutputInfo(params, arguments);
+}
+
+ProjectExplorer::BuildStepConfigWidget *BlackBerryDeployStep::createConfigWidget()
+{
+ return new BlackBerryDeployStepConfigWidget();
+}
+
+QString BlackBerryDeployStep::deviceHost() const
+{
+ BlackBerryDeployConfiguration *dc = static_cast<BlackBerryDeployConfiguration *>(deployConfiguration());
+ return dc->deviceHost();
+}
+
+QString BlackBerryDeployStep::password() const
+{
+ BlackBerryDeployConfiguration *dc = static_cast<BlackBerryDeployConfiguration *>(deployConfiguration());
+ return dc->password();
+}
+
+void BlackBerryDeployStep::raiseError(const QString &errorMessage)
+{
+ emit addOutput(errorMessage, BuildStep::ErrorMessageOutput);
+ emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, errorMessage, Utils::FileName(), -1,
+ Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
+}
diff --git a/src/plugins/qnx/blackberrydeploystep.h b/src/plugins/qnx/blackberrydeploystep.h
new file mode 100644
index 0000000000..291cdbbc7f
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeploystep.h
@@ -0,0 +1,73 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYDEPLOYSTEP_H
+#define QNX_INTERNAL_BLACKBERRYDEPLOYSTEP_H
+
+#include "blackberryabstractdeploystep.h"
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryDeployStep : public BlackBerryAbstractDeployStep
+{
+ Q_OBJECT
+ friend class BlackBerryDeployStepFactory;
+
+public:
+ explicit BlackBerryDeployStep(ProjectExplorer::BuildStepList *bsl);
+ ~BlackBerryDeployStep();
+
+ bool init();
+ void run(QFutureInterface<bool> &fi);
+ void cleanup();
+
+ ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
+
+protected:
+ BlackBerryDeployStep(ProjectExplorer::BuildStepList *bsl, BlackBerryDeployStep *bs);
+
+ void stdOutput(const QString &line);
+ void processStarted(const ProjectExplorer::ProcessParameters &params);
+
+ void raiseError(const QString &errorMessage);
+
+private:
+ QString deviceHost() const;
+ QString password() const;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYDEPLOYSTEP_H
diff --git a/src/plugins/qnx/blackberrydeploystepconfigwidget.cpp b/src/plugins/qnx/blackberrydeploystepconfigwidget.cpp
new file mode 100644
index 0000000000..5cd6e39d91
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeploystepconfigwidget.cpp
@@ -0,0 +1,57 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberrydeploystepconfigwidget.h"
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryDeployStepConfigWidget::BlackBerryDeployStepConfigWidget()
+ : ProjectExplorer::BuildStepConfigWidget()
+{
+}
+
+QString BlackBerryDeployStepConfigWidget::summaryText() const
+{
+ return displayName();
+}
+
+QString BlackBerryDeployStepConfigWidget::displayName() const
+{
+ return tr("<b>Deploy packages</b>");
+}
+
+bool BlackBerryDeployStepConfigWidget::showWidget() const
+{
+ return false;
+}
diff --git a/src/plugins/qnx/blackberrydeploystepconfigwidget.h b/src/plugins/qnx/blackberrydeploystepconfigwidget.h
new file mode 100644
index 0000000000..045368d5b7
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeploystepconfigwidget.h
@@ -0,0 +1,57 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYDEPLOYSTEPCONFIGWIDGET_H
+#define QNX_INTERNAL_BLACKBERRYDEPLOYSTEPCONFIGWIDGET_H
+
+#include <projectexplorer/buildstep.h>
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryDeployStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryDeployStepConfigWidget();
+
+ QString summaryText() const;
+ QString displayName() const;
+
+ bool showWidget() const;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYDEPLOYSTEPCONFIGWIDGET_H
diff --git a/src/plugins/qnx/blackberrydeploystepfactory.cpp b/src/plugins/qnx/blackberrydeploystepfactory.cpp
new file mode 100644
index 0000000000..abeec42a83
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeploystepfactory.cpp
@@ -0,0 +1,113 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberrydeploystepfactory.h"
+#include "qnxconstants.h"
+#include "blackberrydeploystep.h"
+#include "blackberrydeviceconfigurationfactory.h"
+
+#include <projectexplorer/buildsteplist.h>
+#include <projectexplorer/profileinformation.h>
+#include <projectexplorer/projectexplorerconstants.h>
+#include <projectexplorer/target.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryDeployStepFactory::BlackBerryDeployStepFactory()
+{
+}
+
+QList<Core::Id> BlackBerryDeployStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const
+{
+ if (parent->id() != Core::Id(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY))
+ return QList<Core::Id>();
+
+ Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(parent->target()->profile());
+ if (deviceType != BlackBerryDeviceConfigurationFactory::deviceType())
+ return QList<Core::Id>();
+
+ return QList<Core::Id>() << Core::Id(Constants::QNX_DEPLOY_PACKAGE_BS_ID);
+}
+
+QString BlackBerryDeployStepFactory::displayNameForId(const Core::Id id) const
+{
+ if (id == Core::Id(Constants::QNX_DEPLOY_PACKAGE_BS_ID))
+ return tr("Deploy Package");
+ return QString();
+}
+
+bool BlackBerryDeployStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
+{
+ return availableCreationIds(parent).contains(id);
+}
+
+ProjectExplorer::BuildStep *BlackBerryDeployStepFactory::create(ProjectExplorer::BuildStepList *parent,
+ const Core::Id id)
+{
+ if (!canCreate(parent, id))
+ return 0;
+ return new BlackBerryDeployStep(parent);
+}
+
+bool BlackBerryDeployStepFactory::canRestore(ProjectExplorer::BuildStepList *parent,
+ const QVariantMap &map) const
+{
+ return canCreate(parent, ProjectExplorer::idFromMap(map));
+}
+
+ProjectExplorer::BuildStep *BlackBerryDeployStepFactory::restore(ProjectExplorer::BuildStepList *parent,
+ const QVariantMap &map)
+{
+ if (!canRestore(parent, map))
+ return 0;
+ BlackBerryDeployStep *bs = new BlackBerryDeployStep(parent);
+ if (bs->fromMap(map))
+ return bs;
+ delete bs;
+ return 0;
+}
+
+bool BlackBerryDeployStepFactory::canClone(ProjectExplorer::BuildStepList *parent,
+ ProjectExplorer::BuildStep *product) const
+{
+ return canCreate(parent, product->id());
+}
+
+ProjectExplorer::BuildStep *BlackBerryDeployStepFactory::clone(ProjectExplorer::BuildStepList *parent,
+ ProjectExplorer::BuildStep *product)
+{
+ if (!canClone(parent, product))
+ return 0;
+ return new BlackBerryDeployStep(parent, static_cast<BlackBerryDeployStep *>(product));
+}
diff --git a/src/plugins/qnx/blackberrydeploystepfactory.h b/src/plugins/qnx/blackberrydeploystepfactory.h
new file mode 100644
index 0000000000..8141c7bae0
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeploystepfactory.h
@@ -0,0 +1,68 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYDEPLOYSTEPFACTORY_H
+#define QNX_INTERNAL_BLACKBERRYDEPLOYSTEPFACTORY_H
+
+#include <projectexplorer/buildstep.h>
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryDeployStepFactory : public ProjectExplorer::IBuildStepFactory
+{
+ Q_OBJECT
+public:
+ BlackBerryDeployStepFactory();
+
+ QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
+ QString displayNameForId(const Core::Id id) const;
+
+ bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
+ ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent,
+ const Core::Id id);
+
+ bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
+ ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent,
+ const QVariantMap &map);
+
+ bool canClone(ProjectExplorer::BuildStepList *parent,
+ ProjectExplorer::BuildStep *product) const;
+ ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent,
+ ProjectExplorer::BuildStep *product);
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYDEPLOYSTEPFACTORY_H
diff --git a/src/plugins/qnx/blackberrydeviceconfiguration.cpp b/src/plugins/qnx/blackberrydeviceconfiguration.cpp
new file mode 100644
index 0000000000..d1c85e934f
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeviceconfiguration.cpp
@@ -0,0 +1,134 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberrydeviceconfiguration.h"
+
+#include "qnxconstants.h"
+#include "blackberrydeviceconfigurationwidget.h"
+
+#include <projectexplorer/profileinformation.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryDeviceConfiguration::BlackBerryDeviceConfiguration()
+ : RemoteLinux::LinuxDeviceConfiguration()
+{
+}
+
+BlackBerryDeviceConfiguration::BlackBerryDeviceConfiguration(const QString &name, Core::Id type,
+ RemoteLinux::LinuxDeviceConfiguration::MachineType machineType,
+ ProjectExplorer::IDevice::Origin origin, Core::Id id)
+ : RemoteLinux::LinuxDeviceConfiguration(name, type, machineType, origin, id)
+{
+}
+
+BlackBerryDeviceConfiguration::BlackBerryDeviceConfiguration(const BlackBerryDeviceConfiguration &other)
+ : RemoteLinux::LinuxDeviceConfiguration(other)
+ , m_debugToken(other.m_debugToken)
+{
+}
+
+BlackBerryDeviceConfiguration::Ptr BlackBerryDeviceConfiguration::create()
+{
+ return Ptr(new BlackBerryDeviceConfiguration);
+}
+
+BlackBerryDeviceConfiguration::Ptr BlackBerryDeviceConfiguration::create(const QString &name, Core::Id type,
+ RemoteLinux::LinuxDeviceConfiguration::MachineType machineType,
+ ProjectExplorer::IDevice::Origin origin, Core::Id id)
+{
+ return Ptr(new BlackBerryDeviceConfiguration(name, type, machineType, origin, id));
+}
+
+QString BlackBerryDeviceConfiguration::debugToken() const
+{
+ return m_debugToken;
+}
+
+void BlackBerryDeviceConfiguration::setDebugToken(const QString &debugToken)
+{
+ m_debugToken = debugToken;
+}
+
+void BlackBerryDeviceConfiguration::fromMap(const QVariantMap &map)
+{
+ RemoteLinux::LinuxDeviceConfiguration::fromMap(map);
+ m_debugToken = map.value(QLatin1String(Constants::QNX_DEBUG_TOKEN_KEY)).toString();
+}
+
+ProjectExplorer::IDevice::Ptr BlackBerryDeviceConfiguration::clone() const
+{
+ return Ptr(new BlackBerryDeviceConfiguration(*this));
+}
+
+BlackBerryDeviceConfiguration::ConstPtr BlackBerryDeviceConfiguration::device(const ProjectExplorer::Profile *p)
+{
+ ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceProfileInformation::device(p);
+ return dev.dynamicCast<const BlackBerryDeviceConfiguration>();
+}
+
+QString BlackBerryDeviceConfiguration::displayType() const
+{
+ return tr("BlackBerry");
+}
+
+ProjectExplorer::IDeviceWidget *BlackBerryDeviceConfiguration::createWidget()
+{
+ return new BlackBerryDeviceConfigurationWidget(sharedFromThis()
+ .staticCast<BlackBerryDeviceConfiguration>());
+}
+
+QList<Core::Id> BlackBerryDeviceConfiguration::actionIds() const
+{
+ return QList<Core::Id>();
+}
+
+QString BlackBerryDeviceConfiguration::displayNameForActionId(Core::Id actionId) const
+{
+ Q_UNUSED(actionId);
+ return QString();
+}
+
+void BlackBerryDeviceConfiguration::executeAction(Core::Id actionId, QWidget *parent) const
+{
+ Q_UNUSED(actionId);
+ Q_UNUSED(parent);
+}
+
+QVariantMap BlackBerryDeviceConfiguration::toMap() const
+{
+ QVariantMap map = RemoteLinux::LinuxDeviceConfiguration::toMap();
+ map.insert(QLatin1String(Constants::QNX_DEBUG_TOKEN_KEY), m_debugToken);
+ return map;
+}
diff --git a/src/plugins/qnx/blackberrydeviceconfiguration.h b/src/plugins/qnx/blackberrydeviceconfiguration.h
new file mode 100644
index 0000000000..61d6c93549
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeviceconfiguration.h
@@ -0,0 +1,86 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATION_H
+#define QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATION_H
+
+#include <remotelinux/linuxdeviceconfiguration.h>
+
+namespace ProjectExplorer {
+class Profile;
+}
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryDeviceConfiguration : public RemoteLinux::LinuxDeviceConfiguration
+{
+public:
+ typedef QSharedPointer<BlackBerryDeviceConfiguration> Ptr;
+ typedef QSharedPointer<const BlackBerryDeviceConfiguration> ConstPtr;
+
+
+ static Ptr create();
+ static Ptr create(const QString &name, Core::Id type, MachineType machineType,
+ Origin origin = ManuallyAdded, Core::Id id = Core::Id());
+
+ QString debugToken() const;
+ void setDebugToken(const QString &debugToken);
+
+ void fromMap(const QVariantMap &map);
+
+ QString displayType() const;
+ ProjectExplorer::IDeviceWidget *createWidget();
+ QList<Core::Id> actionIds() const;
+ QString displayNameForActionId(Core::Id actionId) const;
+ void executeAction(Core::Id actionId, QWidget *parent) const;
+ ProjectExplorer::IDevice::Ptr clone() const;
+
+ static ConstPtr device(const ProjectExplorer::Profile *p);
+
+protected:
+ BlackBerryDeviceConfiguration();
+ BlackBerryDeviceConfiguration(const QString &name, Core::Id type, MachineType machineType,
+ Origin origin, Core::Id id);
+ BlackBerryDeviceConfiguration(const BlackBerryDeviceConfiguration &other);
+
+ QVariantMap toMap() const;
+
+private:
+ QString m_debugToken;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATION_H
diff --git a/src/plugins/qnx/blackberrydeviceconfigurationfactory.cpp b/src/plugins/qnx/blackberrydeviceconfigurationfactory.cpp
new file mode 100644
index 0000000000..db7968cbc5
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeviceconfigurationfactory.cpp
@@ -0,0 +1,93 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberrydeviceconfigurationfactory.h"
+
+#include "qnxconstants.h"
+#include "blackberrydeviceconfigurationwizard.h"
+#include "blackberrydeviceconfiguration.h"
+
+#include <utils/qtcassert.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryDeviceConfigurationFactory::BlackBerryDeviceConfigurationFactory(QObject *parent) :
+ ProjectExplorer::IDeviceFactory(parent)
+{
+}
+
+QString BlackBerryDeviceConfigurationFactory::displayNameForId(Core::Id type) const
+{
+ Q_UNUSED(type);
+ return tr("BlackBerry Device");
+}
+
+QList<Core::Id> BlackBerryDeviceConfigurationFactory::availableCreationIds() const
+{
+ QList<Core::Id> result;
+ result << Core::Id(Constants::QNX_BB_OS_TYPE);
+ return result;
+}
+
+bool BlackBerryDeviceConfigurationFactory::canCreate() const
+{
+ return true;
+}
+
+ProjectExplorer::IDevice::Ptr BlackBerryDeviceConfigurationFactory::create(Core::Id id) const
+{
+ Q_UNUSED(id);
+ BlackBerryDeviceConfigurationWizard wizard;
+ if (wizard.exec() != QDialog::Accepted)
+ return ProjectExplorer::IDevice::Ptr();
+ return wizard.device();
+}
+
+bool BlackBerryDeviceConfigurationFactory::canRestore(const QVariantMap &map) const
+{
+ return ProjectExplorer::IDevice::typeFromMap(map) == Core::Id(Constants::QNX_BB_OS_TYPE);
+}
+
+ProjectExplorer::IDevice::Ptr BlackBerryDeviceConfigurationFactory::restore(const QVariantMap &map) const
+{
+ QTC_ASSERT(canRestore(map), return BlackBerryDeviceConfiguration::Ptr());
+ const BlackBerryDeviceConfiguration::Ptr device = BlackBerryDeviceConfiguration::create();
+ device->fromMap(map);
+ return device;
+}
+
+Core::Id BlackBerryDeviceConfigurationFactory::deviceType()
+{
+ return Core::Id(Constants::QNX_BB_OS_TYPE);
+}
diff --git a/src/plugins/qnx/blackberrydeviceconfigurationfactory.h b/src/plugins/qnx/blackberrydeviceconfigurationfactory.h
new file mode 100644
index 0000000000..335869eeba
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeviceconfigurationfactory.h
@@ -0,0 +1,63 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONFACTORY_H
+#define QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONFACTORY_H
+
+#include <projectexplorer/devicesupport/idevicefactory.h>
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryDeviceConfigurationFactory : public ProjectExplorer::IDeviceFactory
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryDeviceConfigurationFactory(QObject *parent = 0);
+
+ QString displayNameForId(Core::Id type) const;
+ QList<Core::Id> availableCreationIds() const;
+
+ bool canCreate() const;
+ ProjectExplorer::IDevice::Ptr create(Core::Id id) const;
+
+ bool canRestore(const QVariantMap &map) const;
+ ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const;
+
+ static Core::Id deviceType();
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONFACTORY_H
diff --git a/src/plugins/qnx/blackberrydeviceconfigurationwidget.cpp b/src/plugins/qnx/blackberrydeviceconfigurationwidget.cpp
new file mode 100644
index 0000000000..fbe6cfb5cc
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeviceconfigurationwidget.cpp
@@ -0,0 +1,124 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberrydeviceconfigurationwidget.h"
+#include "ui_blackberrydeviceconfigurationwidget.h"
+#include "qnxconstants.h"
+
+#include <remotelinux/linuxdeviceconfiguration.h>
+
+#include <ssh/sshconnection.h>
+#include <utils/pathchooser.h>
+
+using namespace Qnx::Internal;
+
+BlackBerryDeviceConfigurationWidget::BlackBerryDeviceConfigurationWidget(const ProjectExplorer::IDevice::Ptr &device, QWidget *parent) :
+ ProjectExplorer::IDeviceWidget(device, parent),
+ ui(new Ui::BlackBerryDeviceConfigurationWidget)
+{
+ ui->setupUi(this);
+ connect(ui->hostLineEdit, SIGNAL(editingFinished()), this, SLOT(hostNameEditingFinished()));
+ connect(ui->pwdLineEdit, SIGNAL(editingFinished()), this, SLOT(passwordEditingFinished()));
+ connect(ui->keyFileLineEdit, SIGNAL(editingFinished()), this, SLOT(keyFileEditingFinished()));
+ connect(ui->keyFileLineEdit, SIGNAL(browsingFinished()), this, SLOT(keyFileEditingFinished()));
+ connect(ui->showPasswordCheckBox, SIGNAL(toggled(bool)), this, SLOT(showPassword(bool)));
+ connect(ui->debugToken, SIGNAL(editingFinished()), this, SLOT(debugTokenEditingFinished()));
+
+ initGui();
+}
+
+BlackBerryDeviceConfigurationWidget::~BlackBerryDeviceConfigurationWidget()
+{
+ delete ui;
+}
+
+void BlackBerryDeviceConfigurationWidget::hostNameEditingFinished()
+{
+ QSsh::SshConnectionParameters sshParams = deviceConfiguration()->sshParameters();
+ sshParams.host = ui->hostLineEdit->text();
+ deviceConfiguration()->setSshParameters(sshParams);
+}
+
+void BlackBerryDeviceConfigurationWidget::passwordEditingFinished()
+{
+ QSsh::SshConnectionParameters sshParams = deviceConfiguration()->sshParameters();
+ sshParams.password = ui->pwdLineEdit->text();
+ deviceConfiguration()->setSshParameters(sshParams);
+}
+
+void BlackBerryDeviceConfigurationWidget::keyFileEditingFinished()
+{
+ QSsh::SshConnectionParameters sshParams = deviceConfiguration()->sshParameters();
+ sshParams.privateKeyFile = ui->keyFileLineEdit->path();
+ deviceConfiguration()->setSshParameters(sshParams);
+}
+
+void BlackBerryDeviceConfigurationWidget::showPassword(bool showClearText)
+{
+ ui->pwdLineEdit->setEchoMode(showClearText
+ ? QLineEdit::Normal : QLineEdit::Password);
+}
+
+void BlackBerryDeviceConfigurationWidget::debugTokenEditingFinished()
+{
+ deviceConfiguration()->setDebugToken(ui->debugToken->path());
+}
+
+void BlackBerryDeviceConfigurationWidget::initGui()
+{
+ ui->debugToken->setExpectedKind(Utils::PathChooser::File);
+ ui->debugToken->setPromptDialogFilter(QLatin1String("*.bar"));
+
+ ui->keyFileLineEdit->setExpectedKind(Utils::PathChooser::File);
+ ui->keyFileLineEdit->lineEdit()->setMinimumWidth(0);
+
+ const QSsh::SshConnectionParameters &sshParams = deviceConfiguration()->sshParameters();
+
+ ui->hostLineEdit->setEnabled(!deviceConfiguration()->isAutoDetected());
+
+ ui->hostLineEdit->setText(sshParams.host);
+ ui->pwdLineEdit->setText(sshParams.password);
+ ui->keyFileLineEdit->setPath(sshParams.privateKeyFile);
+ ui->showPasswordCheckBox->setChecked(false);
+ ui->debugToken->setPath(deviceConfiguration()->debugToken());
+
+ if (deviceConfiguration()->machineType() == RemoteLinux::LinuxDeviceConfiguration::Emulator) {
+ ui->debugToken->setEnabled(false);
+ ui->debugTokenLabel->setEnabled(false);
+ }
+}
+
+BlackBerryDeviceConfiguration::Ptr BlackBerryDeviceConfigurationWidget::deviceConfiguration() const
+{
+ return device().dynamicCast<BlackBerryDeviceConfiguration>();
+}
diff --git a/src/plugins/qnx/blackberrydeviceconfigurationwidget.h b/src/plugins/qnx/blackberrydeviceconfigurationwidget.h
new file mode 100644
index 0000000000..299ec4cc9c
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeviceconfigurationwidget.h
@@ -0,0 +1,76 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIDGET_H
+#define QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIDGET_H
+
+#include <projectexplorer/devicesupport/idevicewidget.h>
+
+#include "blackberrydeviceconfiguration.h"
+
+namespace Qnx {
+namespace Internal {
+
+namespace Ui {
+class BlackBerryDeviceConfigurationWidget;
+}
+
+class BlackBerryDeviceConfigurationWidget : public ProjectExplorer::IDeviceWidget
+{
+ Q_OBJECT
+
+public:
+ explicit BlackBerryDeviceConfigurationWidget(const ProjectExplorer::IDevice::Ptr &device,
+ QWidget *parent = 0);
+ ~BlackBerryDeviceConfigurationWidget();
+
+private slots:
+ void hostNameEditingFinished();
+ void passwordEditingFinished();
+ void keyFileEditingFinished();
+ void showPassword(bool showClearText);
+ void debugTokenEditingFinished();
+
+private:
+ void initGui();
+
+ BlackBerryDeviceConfiguration::Ptr deviceConfiguration() const;
+
+ Ui::BlackBerryDeviceConfigurationWidget *ui;
+};
+
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIDGET_H
diff --git a/src/plugins/qnx/blackberrydeviceconfigurationwidget.ui b/src/plugins/qnx/blackberrydeviceconfigurationwidget.ui
new file mode 100644
index 0000000000..1972ba0eeb
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeviceconfigurationwidget.ui
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Qnx::Internal::BlackBerryDeviceConfigurationWidget</class>
+ <widget class="QWidget" name="Qnx::Internal::BlackBerryDeviceConfigurationWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>334</width>
+ <height>109</height>
+ </rect>
+ </property>
+ <layout class="QFormLayout" name="formLayout">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::FieldsStayAtSizeHint</enum>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="hostNameLabel">
+ <property name="text">
+ <string>&amp;Device name:</string>
+ </property>
+ <property name="buddy">
+ <cstring>hostLineEdit</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="hostLineEdit">
+ <property name="placeholderText">
+ <string>IP or host name of the device</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="passwordLabel">
+ <property name="text">
+ <string>Device &amp;password</string>
+ </property>
+ <property name="buddy">
+ <cstring>pwdLineEdit</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_6">
+ <item>
+ <widget class="QLineEdit" name="pwdLineEdit">
+ <property name="echoMode">
+ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="showPasswordCheckBox">
+ <property name="text">
+ <string>Show password</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="debugTokenLabel">
+ <property name="text">
+ <string>Debug token:</string>
+ </property>
+ <property name="buddy">
+ <cstring>debugToken</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="Utils::PathChooser" name="debugToken" native="true"/>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="keyLabel">
+ <property name="text">
+ <string>Private key file:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="Utils::PathChooser" name="keyFileLineEdit" native="true"/>
+ </item>
+ </layout>
+ <zorder>hostNameLabel</zorder>
+ <zorder>hostLineEdit</zorder>
+ <zorder>passwordLabel</zorder>
+ <zorder>keyLabel</zorder>
+ <zorder>debugTokenLabel</zorder>
+ <zorder>debugToken</zorder>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>Utils::PathChooser</class>
+ <extends>QWidget</extends>
+ <header location="global">utils/pathchooser.h</header>
+ <container>1</container>
+ <slots>
+ <signal>editingFinished()</signal>
+ <signal>browsingFinished()</signal>
+ </slots>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/plugins/qnx/blackberrydeviceconfigurationwizard.cpp b/src/plugins/qnx/blackberrydeviceconfigurationwizard.cpp
new file mode 100644
index 0000000000..a83ef2a907
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeviceconfigurationwizard.cpp
@@ -0,0 +1,141 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberrydeviceconfigurationwizard.h"
+#include "blackberrydeviceconfigurationwizardpages.h"
+#include "qnxconstants.h"
+#include "blackberrydeviceconfiguration.h"
+
+#include <ssh/sshconnection.h>
+#include <ssh/sshkeygenerator.h>
+#include <utils/portlist.h>
+#include <utils/fileutils.h>
+#include <utils/qtcassert.h>
+
+#include <QDir>
+#include <QFileInfo>
+#include <QMessageBox>
+#include <QHostInfo>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryDeviceConfigurationWizard::BlackBerryDeviceConfigurationWizard(QWidget *parent) :
+ QWizard(parent)
+{
+ setWindowTitle(tr("New BlackBerry Device Configuration Setup"));
+
+ m_setupPage = new BlackBerryDeviceConfigurationWizardSetupPage(this);
+ m_sshKeyPage = new BlackBerryDeviceConfigurationWizardSshKeyPage(this);
+ m_finalPage = new BlackBerryDeviceConfigurationWizardFinalPage(this);
+
+ setPage(SetupPageId, m_setupPage);
+ setPage(SshKeyPageId, m_sshKeyPage);
+ setPage(FinalPageId, m_finalPage);
+ m_finalPage->setCommitPage(true);
+}
+
+ProjectExplorer::IDevice::Ptr BlackBerryDeviceConfigurationWizard::device()
+{
+ QSsh::SshConnectionParameters sshParams;
+ sshParams.proxyType = QSsh::SshConnectionParameters::NoProxy;
+ sshParams.host = m_setupPage->hostName();
+ sshParams.password = m_setupPage->password();
+ sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationByKey;
+ sshParams.privateKeyFile = m_sshKeyPage->privateKey();
+ sshParams.userName = QLatin1String("devuser");
+ sshParams.timeout = 10;
+ sshParams.port = 22;
+
+ BlackBerryDeviceConfiguration::Ptr configuration = BlackBerryDeviceConfiguration::create(m_setupPage->deviceName(),
+ Core::Id(Constants::QNX_BB_OS_TYPE),
+ m_setupPage->machineType());
+ configuration->setSshParameters(sshParams);
+ configuration->setDebugToken(m_setupPage->debugToken());
+ return configuration;
+}
+
+void BlackBerryDeviceConfigurationWizard::accept()
+{
+ if (m_sshKeyPage->isGenerated()) {
+ if (saveKeys()) {
+ QWizard::accept();
+ }
+ } else {
+ QWizard::accept();
+ }
+}
+
+bool BlackBerryDeviceConfigurationWizard::saveKeys()
+{
+ const QString privKeyPath = m_sshKeyPage->privateKey();
+ const QString pubKeyPath = m_sshKeyPage->publicKey();
+
+ const QString storeLocation = QFileInfo(privKeyPath).absolutePath();
+ if (!QDir::root().mkpath(storeLocation)) {
+ QMessageBox::critical(this, tr("Failure to Save Key File"),
+ tr("Failed to create directory: '%1'.").arg(storeLocation));
+ return false;
+ }
+
+ if (QFileInfo(privKeyPath).exists()) {
+ QMessageBox::critical(this, tr("Failure to Save Key File"),
+ tr("Private key file already exists: '%1'").arg(privKeyPath));
+ return false;
+ }
+ if (QFileInfo(pubKeyPath).exists()) {
+ QMessageBox::critical(this, tr("Failure to Save Key File"),
+ tr("Public key file already exists: '%1'").arg(pubKeyPath));
+ return false;
+ }
+
+ Utils::FileSaver privSaver(privKeyPath);
+ privSaver.write(m_sshKeyPage->keyGenerator()->privateKey());
+ if (!privSaver.finalize(this))
+ return false; // finalize shows an error message if necessary
+ QFile::setPermissions(privKeyPath, QFile::ReadOwner | QFile::WriteOwner);
+
+ Utils::FileSaver pubSaver(pubKeyPath);
+
+ // blackberry-connect requires an @ character to be included in the RSA comment
+ const QString atHost = QLatin1String("@") + QHostInfo::localHostName();
+ QByteArray pubKeyContent = m_sshKeyPage->keyGenerator()->publicKey();
+ pubKeyContent.append(atHost.toLocal8Bit());
+
+ pubSaver.write(pubKeyContent);
+ if (!pubSaver.finalize(this)) {
+ return false;
+ }
+
+ return true;
+}
diff --git a/src/plugins/qnx/blackberrydeviceconfigurationwizard.h b/src/plugins/qnx/blackberrydeviceconfigurationwizard.h
new file mode 100644
index 0000000000..84423a44c6
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeviceconfigurationwizard.h
@@ -0,0 +1,75 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIZARD_H
+#define QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIZARD_H
+
+#include <QWizard>
+
+#include <projectexplorer/devicesupport/idevice.h>
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryDeviceConfigurationWizardSetupPage;
+class BlackBerryDeviceConfigurationWizardSshKeyPage;
+class BlackBerryDeviceConfigurationWizardFinalPage;
+
+class BlackBerryDeviceConfigurationWizard : public QWizard
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryDeviceConfigurationWizard(QWidget *parent = 0);
+
+ ProjectExplorer::IDevice::Ptr device();
+
+ void accept();
+
+private:
+ enum PageId {
+ SetupPageId,
+ SshKeyPageId,
+ FinalPageId
+ };
+
+ bool saveKeys();
+
+ BlackBerryDeviceConfigurationWizardSetupPage *m_setupPage;
+ BlackBerryDeviceConfigurationWizardSshKeyPage *m_sshKeyPage;
+ BlackBerryDeviceConfigurationWizardFinalPage *m_finalPage;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIZARD_H
diff --git a/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.cpp b/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.cpp
new file mode 100644
index 0000000000..b6face4d42
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.cpp
@@ -0,0 +1,228 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberrydeviceconfigurationwizardpages.h"
+#include "ui_blackberrydeviceconfigurationwizardsetuppage.h"
+#include "ui_blackberrydeviceconfigurationwizardsshkeypage.h"
+
+#include <coreplugin/icore.h>
+#include <ssh/sshkeygenerator.h>
+
+#include <QFormLayout>
+#include <QMessageBox>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+namespace {
+const char DEVICENAME_FIELD_ID[] = "DeviceName";
+}
+
+BlackBerryDeviceConfigurationWizardSetupPage::BlackBerryDeviceConfigurationWizardSetupPage(QWidget *parent)
+ : QWizardPage(parent)
+ , m_ui(new Ui::BlackBerryDeviceConfigurationWizardSetupPage)
+{
+ m_ui->setupUi(this);
+ setTitle(tr("Connection Details"));
+
+ m_ui->debugToken->setExpectedKind(Utils::PathChooser::File);
+ m_ui->debugToken->setPromptDialogFilter(QLatin1String("*.bar"));
+
+ connect(m_ui->deviceName, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged()));
+ connect(m_ui->deviceHostIp, SIGNAL(textChanged(QString)), this, SIGNAL(completeChanged()));
+ connect(m_ui->physicalDevice, SIGNAL(toggled(bool)), this, SIGNAL(completeChanged()));
+ connect(m_ui->debugToken, SIGNAL(changed(QString)), this, SIGNAL(completeChanged()));
+
+ registerField(QLatin1String(DEVICENAME_FIELD_ID), m_ui->deviceName);
+}
+
+BlackBerryDeviceConfigurationWizardSetupPage::~BlackBerryDeviceConfigurationWizardSetupPage()
+{
+ delete m_ui;
+ m_ui = 0;
+}
+
+void BlackBerryDeviceConfigurationWizardSetupPage::initializePage()
+{
+ m_ui->deviceName->setText(tr("BlackBerry Device"));
+ m_ui->deviceHostIp->setText(QString());
+ m_ui->password->setText(QString());
+ m_ui->physicalDevice->setChecked(true);
+}
+
+bool BlackBerryDeviceConfigurationWizardSetupPage::isComplete() const
+{
+ bool debugTokenComplete = m_ui->simulator->isChecked()
+ || (m_ui->physicalDevice->isChecked() && !m_ui->debugToken->fileName().isEmpty()
+ && QFileInfo(m_ui->debugToken->fileName().toString()).exists());
+
+ return !m_ui->deviceHostIp->text().isEmpty() && !m_ui->deviceHostIp->text().isEmpty()
+ && debugTokenComplete;
+}
+
+QString BlackBerryDeviceConfigurationWizardSetupPage::deviceName() const
+{
+ return m_ui->deviceName->text();
+}
+
+QString BlackBerryDeviceConfigurationWizardSetupPage::hostName() const
+{
+ return m_ui->deviceHostIp->text();
+}
+
+QString BlackBerryDeviceConfigurationWizardSetupPage::password() const
+{
+ return m_ui->password->text();
+}
+
+QString BlackBerryDeviceConfigurationWizardSetupPage::debugToken() const
+{
+ return m_ui->debugToken->fileName().toString();
+}
+
+RemoteLinux::LinuxDeviceConfiguration::MachineType BlackBerryDeviceConfigurationWizardSetupPage::machineType() const
+{
+ if (m_ui->physicalDevice->isChecked())
+ return RemoteLinux::LinuxDeviceConfiguration::Hardware;
+ else
+ return RemoteLinux::LinuxDeviceConfiguration::Emulator;
+}
+
+
+// ----------------------------------------------------------------------------
+
+
+BlackBerryDeviceConfigurationWizardSshKeyPage::BlackBerryDeviceConfigurationWizardSshKeyPage(QWidget *parent)
+ : QWizardPage(parent)
+ , m_ui(new Ui::BlackBerryDeviceConfigurationWizardSshKeyPage)
+ , m_keyGen(0)
+ , m_isGenerated(false)
+{
+ m_ui->setupUi(this);
+
+ m_ui->privateKey->setExpectedKind(Utils::PathChooser::File);
+
+ setTitle(tr("SSH Key Setup"));
+ setSubTitle(tr("Please select an existing <b>4096</b>-bit key or click <b>Generate</b> to create a new one."));
+
+ connect(m_ui->privateKey, SIGNAL(changed(QString)), this, SLOT(findMatchingPublicKey(QString)));
+ connect(m_ui->privateKey, SIGNAL(changed(QString)), this, SIGNAL(completeChanged()));
+ connect(m_ui->generate, SIGNAL(clicked()), this, SLOT(generateSshKey()));
+}
+
+BlackBerryDeviceConfigurationWizardSshKeyPage::~BlackBerryDeviceConfigurationWizardSshKeyPage()
+{
+ delete m_ui;
+ m_ui = 0;
+
+ delete m_keyGen;
+ m_keyGen = 0;
+}
+
+void BlackBerryDeviceConfigurationWizardSshKeyPage::initializePage()
+{
+}
+
+bool BlackBerryDeviceConfigurationWizardSshKeyPage::isComplete() const
+{
+ QFileInfo privateKeyFi(m_ui->privateKey->fileName().toString());
+ QFileInfo publicKeyFi(m_ui->publicKey->text());
+
+ return (privateKeyFi.exists() && publicKeyFi.exists()) || m_isGenerated;
+}
+
+QString BlackBerryDeviceConfigurationWizardSshKeyPage::privateKey() const
+{
+ return m_ui->privateKey->fileName().toString();
+}
+
+QString BlackBerryDeviceConfigurationWizardSshKeyPage::publicKey() const
+{
+ return m_ui->publicKey->text();
+}
+
+bool BlackBerryDeviceConfigurationWizardSshKeyPage::isGenerated() const
+{
+ return m_isGenerated;
+}
+
+QSsh::SshKeyGenerator *BlackBerryDeviceConfigurationWizardSshKeyPage::keyGenerator() const
+{
+ return m_keyGen;
+}
+
+void BlackBerryDeviceConfigurationWizardSshKeyPage::findMatchingPublicKey(const QString &privateKeyPath)
+{
+ const QString candidate = privateKeyPath + QLatin1String(".pub");
+ if (QFileInfo(candidate).exists())
+ m_ui->publicKey->setText(candidate);
+}
+
+void BlackBerryDeviceConfigurationWizardSshKeyPage::generateSshKey()
+{
+ if (!m_keyGen)
+ m_keyGen = new QSsh::SshKeyGenerator;
+
+ const bool success = m_keyGen->generateKeys(QSsh::SshKeyGenerator::Rsa,
+ QSsh::SshKeyGenerator::Mixed, 4096,
+ QSsh::SshKeyGenerator::DoNotOfferEncryption);
+
+ if (!success) {
+ QMessageBox::critical(this, tr("Key Generation Failed"), m_keyGen->error());
+ m_isGenerated = false;
+ return;
+ }
+ m_isGenerated = true;
+
+ const QString storeLocation = Core::ICore::userResourcePath() + QLatin1String("/qnx/")
+ + field(QLatin1String(DEVICENAME_FIELD_ID)).toString();
+ const QString privKeyPath = storeLocation + QLatin1String("/id_rsa");
+ const QString pubKeyPath = storeLocation + QLatin1String("/id_rsa.pub");
+
+ m_ui->privateKey->setFileName(Utils::FileName::fromString(privKeyPath));
+ m_ui->publicKey->setText(pubKeyPath);
+ m_ui->privateKey->setEnabled(false);
+}
+
+// ----------------------------------------------------------------------------
+
+
+BlackBerryDeviceConfigurationWizardFinalPage::BlackBerryDeviceConfigurationWizardFinalPage(QWidget *parent)
+ : QWizardPage(parent)
+{
+ setTitle(tr("Setup Finished"));
+
+ QVBoxLayout *layout = new QVBoxLayout(this);
+ QLabel *label = new QLabel(tr("The new device configuration will now be created."), this);
+ layout->addWidget(label);
+}
diff --git a/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.h b/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.h
new file mode 100644
index 0000000000..e159761eff
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeviceconfigurationwizardpages.h
@@ -0,0 +1,111 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIZARDPAGES_H
+#define QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIZARDPAGES_H
+
+#include <remotelinux/linuxdeviceconfiguration.h>
+
+#include <QWizardPage>
+
+namespace QSsh {
+class SshKeyGenerator;
+}
+
+namespace Qnx {
+namespace Internal {
+namespace Ui {
+class BlackBerryDeviceConfigurationWizardSetupPage;
+class BlackBerryDeviceConfigurationWizardSshKeyPage;
+}
+
+class BlackBerryDeviceConfigurationWizardSetupPage : public QWizardPage
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryDeviceConfigurationWizardSetupPage(QWidget *parent = 0);
+ ~BlackBerryDeviceConfigurationWizardSetupPage();
+
+ void initializePage();
+ bool isComplete() const;
+
+ QString deviceName() const;
+ QString hostName() const;
+ QString password() const;
+ QString debugToken() const;
+ RemoteLinux::LinuxDeviceConfiguration::MachineType machineType() const;
+
+private:
+ Ui::BlackBerryDeviceConfigurationWizardSetupPage *m_ui;
+};
+
+class BlackBerryDeviceConfigurationWizardSshKeyPage : public QWizardPage
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryDeviceConfigurationWizardSshKeyPage(QWidget *parent = 0);
+ ~BlackBerryDeviceConfigurationWizardSshKeyPage();
+
+ void initializePage();
+ bool isComplete() const;
+
+ QString privateKey() const;
+ QString publicKey() const;
+ bool isGenerated() const;
+
+ QSsh::SshKeyGenerator *keyGenerator() const;
+
+private slots:
+ void findMatchingPublicKey(const QString &privateKeyPath);
+ void generateSshKey();
+
+private:
+ void saveKeys();
+
+ Ui::BlackBerryDeviceConfigurationWizardSshKeyPage *m_ui;
+
+ QSsh::SshKeyGenerator *m_keyGen;
+ bool m_isGenerated;
+};
+
+class BlackBerryDeviceConfigurationWizardFinalPage : public QWizardPage
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryDeviceConfigurationWizardFinalPage(QWidget *parent = 0);
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYDEVICECONFIGURATIONWIZARDPAGES_H
diff --git a/src/plugins/qnx/blackberrydeviceconfigurationwizardsetuppage.ui b/src/plugins/qnx/blackberrydeviceconfigurationwizardsetuppage.ui
new file mode 100644
index 0000000000..c08f32dd37
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeviceconfigurationwizardsetuppage.ui
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Qnx::Internal::BlackBerryDeviceConfigurationWizardSetupPage</class>
+ <widget class="QWizardPage" name="Qnx::Internal::BlackBerryDeviceConfigurationWizardSetupPage">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>546</width>
+ <height>148</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>WizardPage</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>The name to identify this configuration:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="deviceName"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>The device's host name or IP address:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLineEdit" name="deviceHostIp"/>
+ </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="2" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Device password:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLineEdit" name="password">
+ <property name="echoMode">
+ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
+ </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="3" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Device type:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QRadioButton" name="physicalDevice">
+ <property name="text">
+ <string>Physical device</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="simulator">
+ <property name="text">
+ <string>Simulator</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Debug token:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="Utils::PathChooser" name="debugToken" native="true"/>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>Utils::PathChooser</class>
+ <extends>QWidget</extends>
+ <header location="global">utils/pathchooser.h</header>
+ <container>1</container>
+ <slots>
+ <signal>editingFinished()</signal>
+ <signal>browsingFinished()</signal>
+ </slots>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>physicalDevice</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>debugToken</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>271</x>
+ <y>98</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>226</x>
+ <y>124</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/src/plugins/qnx/blackberrydeviceconfigurationwizardsshkeypage.ui b/src/plugins/qnx/blackberrydeviceconfigurationwizardsshkeypage.ui
new file mode 100644
index 0000000000..d2d11e670b
--- /dev/null
+++ b/src/plugins/qnx/blackberrydeviceconfigurationwizardsshkeypage.ui
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Qnx::Internal::BlackBerryDeviceConfigurationWizardSshKeyPage</class>
+ <widget class="QWizardPage" name="Qnx::Internal::BlackBerryDeviceConfigurationWizardSshKeyPage">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>413</width>
+ <height>88</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>WizardPage</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Private key file:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="Utils::PathChooser" name="privateKey" native="true"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Public key file:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QPushButton" name="generate">
+ <property name="text">
+ <string>Generate</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="publicKey">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>Utils::PathChooser</class>
+ <extends>QWidget</extends>
+ <header location="global">utils/pathchooser.h</header>
+ <container>1</container>
+ <slots>
+ <signal>editingFinished()</signal>
+ <signal>browsingFinished()</signal>
+ </slots>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/plugins/qnx/blackberryqtversion.cpp b/src/plugins/qnx/blackberryqtversion.cpp
new file mode 100644
index 0000000000..e176dd79c5
--- /dev/null
+++ b/src/plugins/qnx/blackberryqtversion.cpp
@@ -0,0 +1,176 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberryqtversion.h"
+
+#include "qnxconstants.h"
+
+#include <utils/qtcassert.h>
+
+#include <QTextStream>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+namespace {
+QMultiMap<QString, QString> parseEnvironmentFile(const QString &fileName)
+{
+ QMultiMap<QString, QString> result;
+
+ QFile file(fileName);
+ if (!file.open(QIODevice::ReadOnly))
+ return result;
+
+ QTextStream str(&file);
+ QMap<QString, QString> fileContent;
+ while (!str.atEnd()) {
+ QString line = str.readLine();
+ if (!line.contains(QLatin1Char('=')))
+ continue;
+
+ const QStringList lineContent = line.split(QLatin1Char('='));
+ QString var = lineContent.value(0);
+ //Remove set in front
+ if (var.startsWith(QLatin1String("set ")))
+ var = var.right(var.size() - 4);
+ QString value = lineContent.value(1).section(QLatin1Char('"'), 0, -1, QString::SectionSkipEmpty);
+
+ fileContent[var] = value;
+ }
+ file.close();
+
+ QMapIterator<QString, QString> it(fileContent);
+ while (it.hasNext()) {
+ it.next();
+#if defined Q_OS_WIN
+ QStringList values = it.value().split(QLatin1Char(';'));
+#elif defined Q_OS_UNIX
+ QStringList values = it.value().split(QLatin1Char(':'));
+#endif
+ QString key = it.key();
+ foreach (const QString &value, values) {
+ const QString ownKeyAsWindowsVar = QLatin1Char('%') + key + QLatin1Char('%');
+ const QString ownKeyAsUnixVar = QLatin1Char('$') + key;
+ if (!value.contains(ownKeyAsWindowsVar) && !value.contains(ownKeyAsUnixVar)) {
+ QString val = value;
+ if (val.contains(QLatin1Char('%')) || val.contains(QLatin1Char('$'))) {
+ QMapIterator<QString, QString> replaceIt(fileContent);
+ while (replaceIt.hasNext()) {
+ replaceIt.next();
+ const QString replaceKey = replaceIt.key();
+ if (replaceKey == key)
+ continue;
+
+ const QString keyAsWindowsVar = QLatin1Char('%') + replaceKey + QLatin1Char('%');
+ const QString keyAsUnixVar = QLatin1Char('$') + replaceKey;
+ if (val.contains(keyAsWindowsVar))
+ val.replace(keyAsWindowsVar, replaceIt.value());
+ if (val.contains(keyAsUnixVar))
+ val.replace(keyAsUnixVar, replaceIt.value());
+ }
+ }
+ result.insert(key, val);
+ }
+ }
+ }
+
+ return result;
+}
+}
+
+BlackBerryQtVersion::BlackBerryQtVersion()
+ : QnxAbstractQtVersion()
+{
+}
+
+BlackBerryQtVersion::BlackBerryQtVersion(QnxArchitecture arch, const Utils::FileName &path, bool isAutoDetected, const QString &autoDetectionSource)
+ : QnxAbstractQtVersion(arch, path, isAutoDetected, autoDetectionSource)
+{
+
+}
+
+BlackBerryQtVersion::~BlackBerryQtVersion()
+{
+
+}
+
+BlackBerryQtVersion *BlackBerryQtVersion::clone() const
+{
+ return new BlackBerryQtVersion(*this);
+}
+
+QString BlackBerryQtVersion::type() const
+{
+ return QLatin1String(Constants::QNX_BB_QT);
+}
+
+QString BlackBerryQtVersion::description() const
+{
+ return QCoreApplication::translate("QtVersion", "BlackBerry %1", "Qt Version is meant for BlackBerry").arg(archString());
+}
+
+QMultiMap<QString, QString> BlackBerryQtVersion::environment() const
+{
+ QTC_CHECK(!sdkPath().isEmpty());
+ if (sdkPath().isEmpty())
+ return QMultiMap<QString, QString>();
+
+#if defined Q_OS_WIN
+ const QString envFile = sdkPath() + QLatin1String("/bbndk-env.bat");
+#elif defined Q_OS_UNIX
+ const QString envFile = sdkPath() + QLatin1String("/bbndk-env.sh");
+#endif
+ return parseEnvironmentFile(envFile);
+}
+
+Core::FeatureSet BlackBerryQtVersion::availableFeatures() const
+{
+ Core::FeatureSet features = QnxAbstractQtVersion::availableFeatures();
+ features |= Core::FeatureSet(Constants::QNX_BB_FEATURE);
+ return features;
+}
+
+QString BlackBerryQtVersion::platformName() const
+{
+ return QLatin1String(Constants::QNX_BB_PLATFORM_NAME);
+}
+
+QString BlackBerryQtVersion::platformDisplayName() const
+{
+ return QCoreApplication::tr("BlackBerry");
+}
+
+QString BlackBerryQtVersion::sdkDescription() const
+{
+ return QCoreApplication::tr("BlackBerry Native SDK:");
+}
diff --git a/src/plugins/qnx/blackberryqtversion.h b/src/plugins/qnx/blackberryqtversion.h
new file mode 100644
index 0000000000..3efce97036
--- /dev/null
+++ b/src/plugins/qnx/blackberryqtversion.h
@@ -0,0 +1,70 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYQTVERSION_H
+#define QNX_INTERNAL_BLACKBERRYQTVERSION_H
+
+#include "qnxconstants.h"
+#include "qnxabstractqtversion.h"
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryQtVersion : public QnxAbstractQtVersion
+{
+public:
+ BlackBerryQtVersion();
+ BlackBerryQtVersion(QnxArchitecture arch, const Utils::FileName &path,
+ bool isAutoDetected = false,
+ const QString &autoDetectionSource = QString());
+ BlackBerryQtVersion *clone() const;
+ ~BlackBerryQtVersion();
+
+ QString type() const;
+
+ QString description() const;
+
+ Core::FeatureSet availableFeatures() const;
+ QString platformName() const;
+ QString platformDisplayName() const;
+
+ QString sdkDescription() const;
+
+private:
+ QMultiMap<QString, QString> environment() const;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYQTVERSION_H
diff --git a/src/plugins/qnx/blackberryqtversionfactory.cpp b/src/plugins/qnx/blackberryqtversionfactory.cpp
new file mode 100644
index 0000000000..9d13c1bb27
--- /dev/null
+++ b/src/plugins/qnx/blackberryqtversionfactory.cpp
@@ -0,0 +1,89 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberryqtversionfactory.h"
+
+#include "qnxconstants.h"
+#include "blackberryqtversion.h"
+#include "qnxutils.h"
+
+#include <qtsupport/profilereader.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryQtVersionFactory::BlackBerryQtVersionFactory(QObject *parent) :
+ QtSupport::QtVersionFactory(parent)
+{
+}
+
+BlackBerryQtVersionFactory::~BlackBerryQtVersionFactory()
+{
+}
+
+bool BlackBerryQtVersionFactory::canRestore(const QString &type)
+{
+ return type == QLatin1String(Constants::QNX_BB_QT);
+}
+
+QtSupport::BaseQtVersion *BlackBerryQtVersionFactory::restore(const QString &type, const QVariantMap &data)
+{
+ if (!canRestore(type))
+ return 0;
+ BlackBerryQtVersion *v = new BlackBerryQtVersion();
+ v->fromMap(data);
+ return v;
+}
+
+int BlackBerryQtVersionFactory::priority() const
+{
+ return Constants::QNX_BB_QT_FACTORY_PRIO;
+}
+
+QtSupport::BaseQtVersion *BlackBerryQtVersionFactory::create(const Utils::FileName &qmakePath,
+ ProFileEvaluator *evaluator,
+ bool isAutoDetected,
+ const QString &autoDetectionSource)
+{
+ QFileInfo fi = qmakePath.toFileInfo();
+ if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
+ return 0;
+
+ if (evaluator->value(QLatin1String("CONFIG")).contains("blackberry")) {
+ QString cpuDir = evaluator->value(QLatin1String("QNX_CPUDIR"));
+ return new BlackBerryQtVersion(QnxUtils::cpudirToArch(cpuDir), qmakePath,
+ isAutoDetected, autoDetectionSource);
+ }
+
+ return 0;
+}
diff --git a/src/plugins/qnx/blackberryqtversionfactory.h b/src/plugins/qnx/blackberryqtversionfactory.h
new file mode 100644
index 0000000000..5d829d40b3
--- /dev/null
+++ b/src/plugins/qnx/blackberryqtversionfactory.h
@@ -0,0 +1,62 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYQTVERSIONFACTORY_H
+#define QNX_INTERNAL_BLACKBERRYQTVERSIONFACTORY_H
+
+#include <qtsupport/qtversionfactory.h>
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryQtVersionFactory : public QtSupport::QtVersionFactory
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryQtVersionFactory(QObject *parent = 0);
+ ~BlackBerryQtVersionFactory();
+
+ virtual bool canRestore(const QString &type);
+ virtual QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data);
+
+ virtual int priority() const;
+ virtual QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath,
+ ProFileEvaluator *evaluator,
+ bool isAutoDetected = false,
+ const QString &autoDetectionSource = QString());
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYQTVERSIONFACTORY_H
diff --git a/src/plugins/qnx/blackberryrunconfiguration.cpp b/src/plugins/qnx/blackberryrunconfiguration.cpp
new file mode 100644
index 0000000000..8ff054639e
--- /dev/null
+++ b/src/plugins/qnx/blackberryrunconfiguration.cpp
@@ -0,0 +1,153 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberryrunconfiguration.h"
+#include "qnxconstants.h"
+#include "blackberrydeployconfiguration.h"
+#include "blackberryrunconfigurationwidget.h"
+#include "blackberrydeployinformation.h"
+
+#include <projectexplorer/target.h>
+#include <qt4projectmanager/qt4buildconfiguration.h>
+#include <qt4projectmanager/qt4nodes.h>
+#include <qt4projectmanager/qt4project.h>
+#include <ssh/sshconnection.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryRunConfiguration::BlackBerryRunConfiguration(ProjectExplorer::Target *parent, const Core::Id id, const QString &path)
+ : ProjectExplorer::RunConfiguration(parent, id)
+ , m_proFilePath(path)
+{
+ init();
+}
+
+BlackBerryRunConfiguration::BlackBerryRunConfiguration(ProjectExplorer::Target *parent,
+ BlackBerryRunConfiguration *source)
+ : ProjectExplorer::RunConfiguration(parent, source)
+ , m_proFilePath(source->m_proFilePath)
+{
+ init();
+}
+
+void BlackBerryRunConfiguration::init()
+{
+ updateDisplayName();
+}
+
+void BlackBerryRunConfiguration::updateDisplayName()
+{
+ if (!m_proFilePath.isEmpty())
+ setDefaultDisplayName(tr("%1 on BlackBerry device").arg(QFileInfo(m_proFilePath).completeBaseName()));
+ else
+ setDefaultDisplayName(tr("Run on BlackBerry device"));
+}
+
+QWidget *BlackBerryRunConfiguration::createConfigurationWidget()
+{
+ return new BlackBerryRunConfigurationWidget(this);
+}
+
+QString BlackBerryRunConfiguration::proFilePath() const
+{
+ return m_proFilePath;
+}
+
+QString BlackBerryRunConfiguration::deviceName() const
+{
+ return deployConfiguration()->deviceName();
+}
+
+QString BlackBerryRunConfiguration::barPackage() const
+{
+ BlackBerryDeployConfiguration *dc = deployConfiguration();
+ if (!dc)
+ return QString();
+
+ QList<BarPackageDeployInformation> packages = dc->deploymentInfo()->enabledPackages();
+ foreach (const BarPackageDeployInformation package, packages) {
+ if (package.proFilePath == proFilePath()) {
+ return package.packagePath;
+ }
+ }
+ return QString();
+}
+
+QString BlackBerryRunConfiguration::localExecutableFilePath() const
+{
+ Qt4ProjectManager::Qt4Project *qt4Project = static_cast<Qt4ProjectManager::Qt4Project *>(target()->project());
+ if (!qt4Project)
+ return QString();
+
+ Qt4ProjectManager::TargetInformation ti = qt4Project->rootQt4ProjectNode()->targetInformation(m_proFilePath);
+ if (!ti.valid)
+ return QString();
+
+ return QDir::cleanPath(ti.buildDir + QLatin1Char('/') + ti.target);
+}
+
+bool BlackBerryRunConfiguration::fromMap(const QVariantMap &map)
+{
+ if (!ProjectExplorer::RunConfiguration::fromMap(map))
+ return false;
+
+ m_proFilePath = map.value(QLatin1String(Constants::QNX_PROFILEPATH_KEY)).toString();
+ if (m_proFilePath.isEmpty() || !QFileInfo(m_proFilePath).exists())
+ return false;
+
+ init();
+ return true;
+}
+
+QVariantMap BlackBerryRunConfiguration::toMap() const
+{
+ QVariantMap map(ProjectExplorer::RunConfiguration::toMap());
+ map.insert(QLatin1String(Constants::QNX_PROFILEPATH_KEY), m_proFilePath);
+ return map;
+}
+
+BlackBerryDeployConfiguration *BlackBerryRunConfiguration::deployConfiguration() const
+{
+ return qobject_cast<BlackBerryDeployConfiguration *>(target()->activeDeployConfiguration());
+}
+
+Qt4ProjectManager::Qt4BuildConfiguration *BlackBerryRunConfiguration::activeQt4BuildConfiguration() const
+{
+ return static_cast<Qt4ProjectManager::Qt4BuildConfiguration *>(activeBuildConfiguration());
+}
+
+QString BlackBerryRunConfiguration::key() const
+{
+ return barPackage() + QLatin1Char('_') + BlackBerryDeviceConfiguration::device(target()->profile())->sshParameters().host;
+}
diff --git a/src/plugins/qnx/blackberryrunconfiguration.h b/src/plugins/qnx/blackberryrunconfiguration.h
new file mode 100644
index 0000000000..c0f141d34b
--- /dev/null
+++ b/src/plugins/qnx/blackberryrunconfiguration.h
@@ -0,0 +1,94 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYRUNCONFIGURATION_H
+#define QNX_INTERNAL_BLACKBERRYRUNCONFIGURATION_H
+
+#include <projectexplorer/runconfiguration.h>
+
+namespace ProjectExplorer {
+class Target;
+}
+
+namespace Qt4ProjectManager {
+class Qt4BuildConfiguration;
+class Qt4Project;
+}
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryDeployConfiguration;
+
+class BlackBerryRunConfiguration : public ProjectExplorer::RunConfiguration
+{
+ Q_OBJECT
+ friend class BlackBerryRunConfigurationFactory;
+
+public:
+ explicit BlackBerryRunConfiguration(ProjectExplorer::Target *parent, const Core::Id id, const QString &path);
+
+ QWidget *createConfigurationWidget();
+
+ QString proFilePath() const;
+
+ QString deviceName() const;
+ QString barPackage() const;
+
+ QString localExecutableFilePath() const;
+
+ bool fromMap(const QVariantMap &map);
+ QVariantMap toMap() const;
+
+ BlackBerryDeployConfiguration *deployConfiguration() const;
+ Qt4ProjectManager::Qt4BuildConfiguration *activeQt4BuildConfiguration() const;
+
+ QString key() const;
+
+signals:
+ void targetInformationChanged();
+
+protected:
+ BlackBerryRunConfiguration(ProjectExplorer::Target *parent, BlackBerryRunConfiguration *source);
+
+private:
+ void init();
+ void updateDisplayName();
+
+ QString m_proFilePath;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYRUNCONFIGURATION_H
diff --git a/src/plugins/qnx/blackberryrunconfigurationfactory.cpp b/src/plugins/qnx/blackberryrunconfigurationfactory.cpp
new file mode 100644
index 0000000000..490e20914f
--- /dev/null
+++ b/src/plugins/qnx/blackberryrunconfigurationfactory.cpp
@@ -0,0 +1,170 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberryrunconfigurationfactory.h"
+#include "qnxconstants.h"
+#include "blackberryrunconfiguration.h"
+#include "blackberrydeviceconfigurationfactory.h"
+
+#include <projectexplorer/profileinformation.h>
+#include <projectexplorer/target.h>
+#include <qt4projectmanager/qt4project.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+namespace {
+QString pathFromId(const Core::Id id)
+{
+ QString idStr = id.toString();
+ if (idStr.startsWith(QLatin1String(Constants::QNX_BB_RUNCONFIGURATION_PREFIX)))
+ return idStr.mid(QString::fromLatin1(Constants::QNX_BB_RUNCONFIGURATION_PREFIX).size());
+
+ return QString();
+}
+}
+
+BlackBerryRunConfigurationFactory::BlackBerryRunConfigurationFactory(QObject *parent) :
+ ProjectExplorer::IRunConfigurationFactory(parent)
+{
+}
+
+QList<Core::Id> BlackBerryRunConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const
+{
+ QList<Core::Id> ids;
+ if (!canHandle(parent))
+ return ids;
+
+ Qt4ProjectManager::Qt4Project *qt4Project = qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project());
+ if (!qt4Project)
+ return ids;
+
+ QStringList proFiles = qt4Project->applicationProFilePathes(QLatin1String(Constants::QNX_BB_RUNCONFIGURATION_PREFIX));
+ foreach (const QString &pf, proFiles)
+ ids << Core::Id(pf);
+
+ return ids;
+}
+
+QString BlackBerryRunConfigurationFactory::displayNameForId(const Core::Id id) const
+{
+ const QString path = pathFromId(id);
+ if (path.isEmpty())
+ return QString();
+
+ if (id.toString().startsWith(QLatin1String(Constants::QNX_BB_RUNCONFIGURATION_PREFIX)))
+ return tr("%1 on BlackBerry Device").arg(QFileInfo(path).completeBaseName());
+
+ return QString();
+}
+
+bool BlackBerryRunConfigurationFactory::canCreate(ProjectExplorer::Target *parent, const Core::Id id) const
+{
+ if (!canHandle(parent))
+ return false;
+
+ Qt4ProjectManager::Qt4Project *qt4Project = qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project());
+ if (!qt4Project)
+ return false;
+
+ if (!id.toString().startsWith(QLatin1String(Constants::QNX_BB_RUNCONFIGURATION_PREFIX)))
+ return false;
+
+ return qt4Project->hasApplicationProFile(pathFromId(id));
+}
+
+ProjectExplorer::RunConfiguration *BlackBerryRunConfigurationFactory::create(ProjectExplorer::Target *parent,
+ const Core::Id id)
+{
+ if (!canCreate(parent, id))
+ return 0;
+
+ return new BlackBerryRunConfiguration(parent, id, pathFromId(id));
+}
+
+bool BlackBerryRunConfigurationFactory::canRestore(ProjectExplorer::Target *parent,
+ const QVariantMap &map) const
+{
+ if (!canHandle(parent))
+ return false;
+
+ return ProjectExplorer::idFromMap(map).toString().startsWith(Constants::QNX_BB_RUNCONFIGURATION_PREFIX);
+}
+
+ProjectExplorer::RunConfiguration *BlackBerryRunConfigurationFactory::restore(
+ ProjectExplorer::Target *parent,
+ const QVariantMap &map)
+{
+ if (!canRestore(parent, map))
+ return 0;
+
+ ProjectExplorer::RunConfiguration *rc = 0;
+ rc = new BlackBerryRunConfiguration(parent, Core::Id(Constants::QNX_BB_RUNCONFIGURATION_PREFIX), QString());
+ if (rc->fromMap(map))
+ return rc;
+
+ delete rc;
+ return 0;
+}
+
+bool BlackBerryRunConfigurationFactory::canClone(ProjectExplorer::Target *parent,
+ ProjectExplorer::RunConfiguration *source) const
+{
+ return canCreate(parent, source->id());
+}
+
+ProjectExplorer::RunConfiguration *BlackBerryRunConfigurationFactory::clone(
+ ProjectExplorer::Target *parent,
+ ProjectExplorer::RunConfiguration *source)
+{
+ if (!canClone(parent, source))
+ return 0;
+
+ BlackBerryRunConfiguration *old = static_cast<BlackBerryRunConfiguration *>(source);
+ return new BlackBerryRunConfiguration(parent, old);
+
+}
+
+bool BlackBerryRunConfigurationFactory::canHandle(ProjectExplorer::Target *t) const
+{
+ if (!t->project()->supportsProfile(t->profile()))
+ return false;
+ if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(t->project()))
+ return false;
+
+ Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(t->profile());
+ if (deviceType != BlackBerryDeviceConfigurationFactory::deviceType())
+ return false;
+
+ return true;
+}
diff --git a/src/plugins/qnx/blackberryrunconfigurationfactory.h b/src/plugins/qnx/blackberryrunconfigurationfactory.h
new file mode 100644
index 0000000000..27a50dad04
--- /dev/null
+++ b/src/plugins/qnx/blackberryrunconfigurationfactory.h
@@ -0,0 +1,68 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYRUNCONFIGURATIONFACTORY_H
+#define QNX_INTERNAL_BLACKBERRYRUNCONFIGURATIONFACTORY_H
+
+#include <projectexplorer/runconfiguration.h>
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryRunConfigurationFactory(QObject *parent = 0);
+
+ QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const;
+ QString displayNameForId(const Core::Id id) const;
+
+ bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
+ ProjectExplorer::RunConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id);
+
+ bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
+ ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent,
+ const QVariantMap &map);
+
+ bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const;
+ ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent,
+ ProjectExplorer::RunConfiguration *source);
+
+ bool canHandle(ProjectExplorer::Target *t) const;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYRUNCONFIGURATIONFACTORY_H
diff --git a/src/plugins/qnx/blackberryrunconfigurationwidget.cpp b/src/plugins/qnx/blackberryrunconfigurationwidget.cpp
new file mode 100644
index 0000000000..1993e186e4
--- /dev/null
+++ b/src/plugins/qnx/blackberryrunconfigurationwidget.cpp
@@ -0,0 +1,62 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberryrunconfigurationwidget.h"
+#include "ui_blackberryrunconfigurationwidget.h"
+#include "blackberryrunconfiguration.h"
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryRunConfigurationWidget::BlackBerryRunConfigurationWidget(BlackBerryRunConfiguration *config, QWidget *parent)
+ : QWidget(parent)
+ , m_ui(new Ui::BlackBerryRunConfigurationWidget)
+ , m_runConfiguration(config)
+{
+ m_ui->setupUi(this);
+
+ updateUi();
+
+ connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this, SLOT(updateUi()));
+}
+
+BlackBerryRunConfigurationWidget::~BlackBerryRunConfigurationWidget()
+{
+ delete m_ui;
+}
+
+void BlackBerryRunConfigurationWidget::updateUi()
+{
+ m_ui->deviceLabel->setText(m_runConfiguration->deviceName());
+ m_ui->packageLabel->setText(m_runConfiguration->barPackage());
+}
diff --git a/src/plugins/qnx/blackberryrunconfigurationwidget.h b/src/plugins/qnx/blackberryrunconfigurationwidget.h
new file mode 100644
index 0000000000..e110fb03bd
--- /dev/null
+++ b/src/plugins/qnx/blackberryrunconfigurationwidget.h
@@ -0,0 +1,68 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYRUNCONFIGURATIONWIDGET_H
+#define QNX_INTERNAL_BLACKBERRYRUNCONFIGURATIONWIDGET_H
+
+#include <QWidget>
+
+namespace Qnx {
+namespace Internal {
+
+namespace Ui {
+class BlackBerryRunConfigurationWidget;
+}
+
+class BlackBerryRunConfiguration;
+
+class BlackBerryRunConfigurationWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit BlackBerryRunConfigurationWidget(BlackBerryRunConfiguration *config, QWidget *parent = 0);
+ ~BlackBerryRunConfigurationWidget();
+
+private slots:
+ void updateUi();
+
+private:
+ Ui::BlackBerryRunConfigurationWidget *m_ui;
+
+ BlackBerryRunConfiguration *m_runConfiguration;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYRUNCONFIGURATIONWIDGET_H
diff --git a/src/plugins/qnx/blackberryrunconfigurationwidget.ui b/src/plugins/qnx/blackberryrunconfigurationwidget.ui
new file mode 100644
index 0000000000..a76e316cd3
--- /dev/null
+++ b/src/plugins/qnx/blackberryrunconfigurationwidget.ui
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Qnx::Internal::BlackBerryRunConfigurationWidget</class>
+ <widget class="QWidget" name="Qnx::Internal::BlackBerryRunConfigurationWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>374</width>
+ <height>53</height>
+ </rect>
+ </property>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Device:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLabel" name="deviceLabel"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Package:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="packageLabel"/>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/plugins/qnx/blackberryruncontrol.cpp b/src/plugins/qnx/blackberryruncontrol.cpp
new file mode 100644
index 0000000000..b53c658de3
--- /dev/null
+++ b/src/plugins/qnx/blackberryruncontrol.cpp
@@ -0,0 +1,99 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberryruncontrol.h"
+#include "blackberryapplicationrunner.h"
+#include "blackberryrunconfiguration.h"
+#include "blackberryconnect.h"
+
+#include <QIcon>
+#include <QTimer>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryRunControl::BlackBerryRunControl(BlackBerryRunConfiguration *runConfiguration)
+ : ProjectExplorer::RunControl(runConfiguration, ProjectExplorer::NormalRunMode)
+{
+ m_runner = new BlackBerryApplicationRunner(false, runConfiguration, this);
+ m_connector = BlackBerryConnect::instance(runConfiguration);
+
+ connect(m_runner, SIGNAL(started()), this, SIGNAL(started()));
+ connect(m_runner, SIGNAL(started()), m_connector, SLOT(connectToDevice()));
+ connect(m_runner, SIGNAL(finished()), this, SIGNAL(finished()));
+ connect(m_runner, SIGNAL(finished()), m_connector, SLOT(disconnectFromDevice()));
+ connect(m_runner, SIGNAL(output(QString,Utils::OutputFormat)),
+ this, SLOT(appendMessage(QString,Utils::OutputFormat)));
+ connect(m_runner, SIGNAL(startFailed(QString)), this, SLOT(handleStartFailed(QString)));
+
+ connect(m_connector, SIGNAL(connected()), this, SLOT(launchTailProcess()));
+ connect(m_connector, SIGNAL(output(QString,Utils::OutputFormat)),
+ this, SLOT(appendMessage(QString,Utils::OutputFormat)));
+}
+
+BlackBerryRunControl::~BlackBerryRunControl()
+{
+ BlackBerryConnect::cleanup(m_connector);
+}
+
+void BlackBerryRunControl::start()
+{
+ m_runner->start();
+}
+
+ProjectExplorer::RunControl::StopResult BlackBerryRunControl::stop()
+{
+ return m_runner->stop();
+}
+
+bool BlackBerryRunControl::isRunning() const
+{
+ return m_runner->isRunning();
+}
+
+QIcon BlackBerryRunControl::icon() const
+{
+ return QIcon(ProjectExplorer::Constants::ICON_RUN_SMALL);
+}
+
+void BlackBerryRunControl::handleStartFailed(const QString &message)
+{
+ appendMessage(message, Utils::StdErrFormat);
+}
+
+void BlackBerryRunControl::launchTailProcess()
+{
+ // Delay the launch of "tail" to ensure the blackberry-connect
+ // connection has been properly established
+ QTimer::singleShot(500, m_runner, SLOT(tailApplicationLog()));
+}
diff --git a/src/plugins/qnx/blackberryruncontrol.h b/src/plugins/qnx/blackberryruncontrol.h
new file mode 100644
index 0000000000..9b0419c67b
--- /dev/null
+++ b/src/plugins/qnx/blackberryruncontrol.h
@@ -0,0 +1,74 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYRUNCONTROL_H
+#define QNX_INTERNAL_BLACKBERRYRUNCONTROL_H
+
+#include <projectexplorer/runconfiguration.h>
+
+namespace Qt4ProjectManager {
+class Qt4BuildConfiguration;
+}
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryConnect;
+class BlackBerryRunConfiguration;
+class BlackBerryApplicationRunner;
+
+class BlackBerryRunControl : public ProjectExplorer::RunControl
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryRunControl(BlackBerryRunConfiguration *runConfiguration);
+ ~BlackBerryRunControl();
+
+ void start();
+ ProjectExplorer::RunControl::StopResult stop();
+ bool isRunning() const;
+ QIcon icon() const;
+
+private slots:
+ void handleStartFailed(const QString &message);
+ void launchTailProcess();
+
+private:
+ BlackBerryApplicationRunner *m_runner;
+ BlackBerryConnect *m_connector;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYRUNCONTROL_H
diff --git a/src/plugins/qnx/blackberryruncontrolfactory.cpp b/src/plugins/qnx/blackberryruncontrolfactory.cpp
new file mode 100644
index 0000000000..d1abfc3046
--- /dev/null
+++ b/src/plugins/qnx/blackberryruncontrolfactory.cpp
@@ -0,0 +1,172 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberryruncontrolfactory.h"
+#include "blackberryrunconfiguration.h"
+#include "blackberryruncontrol.h"
+#include "blackberrydeployconfiguration.h"
+#include "blackberrydebugsupport.h"
+#include "blackberryqtversion.h"
+#include "qnxutils.h"
+
+#include <debugger/debuggerplugin.h>
+#include <debugger/debuggerrunner.h>
+#include <debugger/debuggerprofileinformation.h>
+#include <projectexplorer/deployconfiguration.h>
+#include <projectexplorer/project.h>
+#include <projectexplorer/target.h>
+#include <projectexplorer/toolchain.h>
+#include <qt4projectmanager/qt4buildconfiguration.h>
+#include <qtsupport/qtprofileinformation.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryRunControlFactory::BlackBerryRunControlFactory(QObject *parent)
+ : ProjectExplorer::IRunControlFactory(parent)
+{
+}
+
+bool BlackBerryRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfiguration,
+ ProjectExplorer::RunMode mode) const
+{
+ Q_UNUSED(mode);
+
+ BlackBerryRunConfiguration *rc = qobject_cast<BlackBerryRunConfiguration *>(runConfiguration);
+ if (!rc)
+ return false;
+
+ // The device can only run the same application once, any subsequent runs will
+ // not launch a second instance. Disable the Run button if the application is already
+ // running on the device.
+ if (m_activeRunControls.contains(rc->key())) {
+ QWeakPointer<ProjectExplorer::RunControl> activeRunControl = m_activeRunControls[rc->key()];
+ if (activeRunControl && activeRunControl.data()->isRunning())
+ return false;
+ else
+ m_activeRunControls.remove(rc->key());
+ }
+
+ BlackBerryDeployConfiguration *activeDeployConf = qobject_cast<BlackBerryDeployConfiguration *>(
+ rc->target()->activeDeployConfiguration());
+ return activeDeployConf != 0;
+}
+
+ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(
+ ProjectExplorer::RunConfiguration *runConfiguration,
+ ProjectExplorer::RunMode mode)
+{
+ BlackBerryRunConfiguration *rc = qobject_cast<BlackBerryRunConfiguration *>(runConfiguration);
+ if (!rc)
+ return 0;
+
+ BlackBerryDeployConfiguration *activeDeployConf = qobject_cast<BlackBerryDeployConfiguration *>(
+ rc->target()->activeDeployConfiguration());
+ if (!activeDeployConf)
+ return 0;
+
+ if (mode == ProjectExplorer::NormalRunMode) {
+ BlackBerryRunControl *runControl = new BlackBerryRunControl(rc);
+ m_activeRunControls[rc->key()] = QWeakPointer<ProjectExplorer::RunControl>(runControl);
+ return runControl;
+ }
+
+ Debugger::DebuggerRunControl * const runControl =
+ Debugger::DebuggerPlugin::createDebugger(startParameters(rc), runConfiguration);
+ if (!runControl)
+ return 0;
+
+ new BlackBerryDebugSupport(rc, runControl);
+ m_activeRunControls[rc->key()] = QWeakPointer<ProjectExplorer::RunControl>(runControl);
+ return runControl;
+}
+
+QString BlackBerryRunControlFactory::displayName() const
+{
+ return tr("Run on BlackBerry Device");
+}
+
+ProjectExplorer::RunConfigWidget *BlackBerryRunControlFactory::createConfigurationWidget(
+ ProjectExplorer::RunConfiguration *runConfiguration)
+{
+ Q_UNUSED(runConfiguration);
+ return 0;
+}
+
+Debugger::DebuggerStartParameters BlackBerryRunControlFactory::startParameters(
+ const BlackBerryRunConfiguration *runConfig)
+{
+ Debugger::DebuggerStartParameters params;
+ ProjectExplorer::Target *target = runConfig->target();
+ ProjectExplorer::Profile *profile = target->profile();
+
+ params.startMode = Debugger::AttachToRemoteServer;
+ params.debuggerCommand = Debugger::DebuggerProfileInformation::debuggerCommand(profile).toString();
+ params.sysRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(profile).toString();
+
+ if (ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(profile)) {
+ params.toolChainAbi = tc->targetAbi();
+ params.remoteArchitecture = ProjectExplorer::Abi::toString(tc->targetAbi().architecture());
+ }
+
+ params.executable = runConfig->localExecutableFilePath();
+ params.remoteChannel = runConfig->deployConfiguration()->deviceHost() + QLatin1String(":8000");
+ params.displayName = runConfig->displayName();
+ params.remoteSetupNeeded = true;
+
+ if (runConfig->debuggerAspect()->useQmlDebugger()) {
+ BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(runConfig->target()->profile());
+ if (device) {
+ params.qmlServerAddress = device->sshParameters().host;
+ params.qmlServerPort = runConfig->debuggerAspect()->qmlDebugServerPort();
+ params.languages |= Debugger::QmlLanguage;
+ }
+ }
+ if (runConfig->debuggerAspect()->useCppDebugger())
+ params.languages |= Debugger::CppLanguage;
+
+ if (const ProjectExplorer::Project *project = runConfig->target()->project()) {
+ params.projectSourceDirectory = project->projectDirectory();
+ if (const ProjectExplorer::BuildConfiguration *buildConfig = runConfig->target()->activeBuildConfiguration()) {
+ params.projectBuildDirectory = buildConfig->buildDirectory();
+ }
+ params.projectSourceFiles = project->files(ProjectExplorer::Project::ExcludeGeneratedFiles);
+ }
+
+ BlackBerryQtVersion *qtVersion =
+ dynamic_cast<BlackBerryQtVersion *>(QtSupport::QtProfileInformation::qtVersion(profile));
+ if (qtVersion)
+ params.solibSearchPath = QnxUtils::searchPaths(qtVersion);
+
+ return params;
+}
diff --git a/src/plugins/qnx/blackberryruncontrolfactory.h b/src/plugins/qnx/blackberryruncontrolfactory.h
new file mode 100644
index 0000000000..78ad4729ce
--- /dev/null
+++ b/src/plugins/qnx/blackberryruncontrolfactory.h
@@ -0,0 +1,76 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYRUNCONTROLFACTORY_H
+#define QNX_INTERNAL_BLACKBERRYRUNCONTROLFACTORY_H
+
+#include <debugger/debuggerstartparameters.h>
+
+#include <projectexplorer/runconfiguration.h>
+
+namespace RemoteLinux {
+class RemoteLinuxRunConfiguration;
+}
+
+namespace Qnx {
+namespace Internal {
+
+class BlackBerryRunConfiguration;
+
+class BlackBerryRunControlFactory : public ProjectExplorer::IRunControlFactory
+{
+ Q_OBJECT
+
+public:
+ BlackBerryRunControlFactory(QObject *parent = 0);
+
+ bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
+ ProjectExplorer::RunMode mode) const;
+ ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
+ ProjectExplorer::RunMode mode);
+
+ QString displayName() const;
+
+ ProjectExplorer::RunConfigWidget *createConfigurationWidget(
+ ProjectExplorer::RunConfiguration *runConfiguration);
+
+private:
+ static Debugger::DebuggerStartParameters startParameters( const BlackBerryRunConfiguration *runConfig);
+
+ mutable QMap<QString, QWeakPointer<ProjectExplorer::RunControl> > m_activeRunControls;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYRUNCONTROLFACTORY_H
diff --git a/src/plugins/qnx/blackberrywizardextension.cpp b/src/plugins/qnx/blackberrywizardextension.cpp
new file mode 100644
index 0000000000..67191068b2
--- /dev/null
+++ b/src/plugins/qnx/blackberrywizardextension.cpp
@@ -0,0 +1,139 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "blackberrywizardextension.h"
+
+#include "bardescriptorfileimagewizardpage.h"
+#include "qnxconstants.h"
+
+#include <coreplugin/dialogs/iwizard.h>
+#include <coreplugin/generatedfile.h>
+
+#include <QFileInfo>
+#include <QDomDocument>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+BlackBerryWizardExtension::BlackBerryWizardExtension()
+ : m_imageWizardPage(0)
+{
+}
+
+QList<QWizardPage *> BlackBerryWizardExtension::extensionPages(const Core::IWizard *wizard)
+{
+ QStringList validIds;
+ validIds << QLatin1String(Constants::QNX_BAR_DESCRIPTOR_WIZARD_ID);
+ validIds << QLatin1String(Constants::QNX_BLACKBERRY_QTQUICK_APP_WIZARD_ID);
+ validIds << QLatin1String(Constants::QNX_BLACKBERRY_GUI_APP_WIZARD_ID);
+ validIds << QLatin1String(Constants::QNX_BLACKBERRY_QTQUICK2_APP_WIZARD_ID);
+
+ QList<QWizardPage*> pages;
+
+ if (!validIds.contains(wizard->id()))
+ return pages;
+
+ m_imageWizardPage = new BarDescriptorFileImageWizardPage;
+
+ pages << m_imageWizardPage;
+
+ return pages;
+}
+
+bool BlackBerryWizardExtension::processFiles(const QList<Core::GeneratedFile> &files, bool *removeOpenProjectAttribute, QString *errorMessage)
+{
+ Q_UNUSED(files);
+ Q_UNUSED(removeOpenProjectAttribute);
+ Q_UNUSED(errorMessage);
+
+ return true;
+}
+
+void BlackBerryWizardExtension::applyCodeStyle(Core::GeneratedFile *file) const
+{
+ QFileInfo fi(file->path());
+ if (fi.fileName() == QLatin1String("bar-descriptor.xml"))
+ addImagesToBarDescriptor(file);
+}
+
+void BlackBerryWizardExtension::addImagesToBarDescriptor(Core::GeneratedFile *file) const
+{
+ QDomDocument doc;
+ doc.setContent(file->contents());
+
+ QDomElement docElem = doc.documentElement();
+
+ // Add asset elements
+ QStringList fileAssets;
+ fileAssets << m_imageWizardPage->icon();
+ fileAssets << m_imageWizardPage->landscapeSplashScreen();
+ fileAssets << m_imageWizardPage->portraitSplashScreen();
+ Q_FOREACH (const QString &asset, fileAssets) {
+ if (asset.isEmpty())
+ continue;
+
+ QDomElement assetElem = doc.createElement(QLatin1String("asset"));
+ assetElem.setAttribute(QLatin1String("path"), asset);
+
+ QDomText fileNameText = doc.createTextNode(QFileInfo(asset).fileName());
+ assetElem.appendChild(fileNameText);
+
+ docElem.appendChild(assetElem);
+ }
+
+ // Add icon element
+ if (!m_imageWizardPage->icon().isEmpty()) {
+ QDomElement iconElem = doc.createElement(QLatin1String("icon"));
+ QDomElement imageElem = doc.createElement(QLatin1String("image"));
+ QDomText fileNameText = doc.createTextNode(QFileInfo(m_imageWizardPage->icon()).fileName());
+
+ imageElem.appendChild(fileNameText);
+ iconElem.appendChild(imageElem);
+ docElem.appendChild(iconElem);
+ }
+
+ // Add splashscreen element
+ QString splashScreenEntry = QFileInfo(m_imageWizardPage->landscapeSplashScreen()).fileName();
+ if (!m_imageWizardPage->portraitSplashScreen().isEmpty())
+ splashScreenEntry.append(QLatin1Char(':') + QFileInfo(m_imageWizardPage->portraitSplashScreen()).fileName());
+
+ if (!splashScreenEntry.isEmpty()) {
+ QDomElement splashScreenElem = doc.createElement(QLatin1String("splashscreen"));
+ QDomText splashScreenText = doc.createTextNode(splashScreenEntry);
+
+ splashScreenElem.appendChild(splashScreenText);
+ docElem.appendChild(splashScreenElem);
+ }
+
+ file->setContents(doc.toString(4));
+}
diff --git a/src/plugins/qnx/blackberrywizardextension.h b/src/plugins/qnx/blackberrywizardextension.h
new file mode 100644
index 0000000000..c8b4df17f5
--- /dev/null
+++ b/src/plugins/qnx/blackberrywizardextension.h
@@ -0,0 +1,67 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_BLACKBERRYWIZARDEXTENSION_H
+#define QNX_INTERNAL_BLACKBERRYWIZARDEXTENSION_H
+
+#include <coreplugin/ifilewizardextension.h>
+
+namespace Qnx {
+namespace Internal {
+
+class BarDescriptorFileImageWizardPage;
+
+class BlackBerryWizardExtension : public Core::IFileWizardExtension
+{
+ Q_OBJECT
+public:
+ explicit BlackBerryWizardExtension();
+
+ QList<QWizardPage *> extensionPages(const Core::IWizard *wizard);
+
+ bool processFiles(const QList<Core::GeneratedFile> &files,
+ bool *removeOpenProjectAttribute,
+ QString *errorMessage);
+
+ void applyCodeStyle(Core::GeneratedFile *file) const;
+
+private:
+ void addImagesToBarDescriptor(Core::GeneratedFile *file) const;
+
+ BarDescriptorFileImageWizardPage *m_imageWizardPage;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_BLACKBERRYWIZARDEXTENSION_H
diff --git a/src/plugins/qnx/images/target-small.png b/src/plugins/qnx/images/target-small.png
new file mode 100644
index 0000000000..c8ead87cdf
--- /dev/null
+++ b/src/plugins/qnx/images/target-small.png
Binary files differ
diff --git a/src/plugins/qnx/images/target.png b/src/plugins/qnx/images/target.png
new file mode 100644
index 0000000000..6bbf3761ef
--- /dev/null
+++ b/src/plugins/qnx/images/target.png
Binary files differ
diff --git a/src/plugins/qnx/pathchooserdelegate.cpp b/src/plugins/qnx/pathchooserdelegate.cpp
new file mode 100644
index 0000000000..2e1df39d75
--- /dev/null
+++ b/src/plugins/qnx/pathchooserdelegate.cpp
@@ -0,0 +1,99 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "pathchooserdelegate.h"
+
+#include <utils/pathchooser.h>
+
+#include <QLineEdit>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+PathChooserDelegate::PathChooserDelegate(QObject *parent)
+ : QStyledItemDelegate(parent)
+ , m_kind(Utils::PathChooser::ExistingDirectory)
+{
+}
+
+void PathChooserDelegate::setExpectedKind(Utils::PathChooser::Kind kind)
+{
+ m_kind = kind;
+}
+
+void PathChooserDelegate::setPromptDialogFilter(const QString &filter)
+{
+ m_filter = filter;
+}
+
+QWidget *PathChooserDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
+{
+ Q_UNUSED(option);
+ Q_UNUSED(index);
+
+ Utils::PathChooser *editor = new Utils::PathChooser(parent);
+
+ editor->setAutoFillBackground(true); // To hide the text beneath the editor widget
+ editor->lineEdit()->setMinimumWidth(0);
+
+ return editor;
+}
+
+void PathChooserDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
+{
+ QString value = index.model()->data(index, Qt::EditRole).toString();
+
+ Utils::PathChooser *pathChooser = qobject_cast<Utils::PathChooser *>(editor);
+ if (!pathChooser)
+ return;
+
+ pathChooser->setExpectedKind(m_kind);
+ pathChooser->setPromptDialogFilter(m_filter);
+ pathChooser->setPath(value);
+}
+
+void PathChooserDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
+{
+ Utils::PathChooser *pathChooser = qobject_cast<Utils::PathChooser *>(editor);
+ if (!pathChooser)
+ return;
+
+ model->setData(index, pathChooser->path(), Qt::EditRole);
+}
+
+void PathChooserDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
+{
+ Q_UNUSED(index);
+
+ editor->setGeometry(option.rect);
+}
diff --git a/src/plugins/qnx/pathchooserdelegate.h b/src/plugins/qnx/pathchooserdelegate.h
new file mode 100644
index 0000000000..7de7c248dc
--- /dev/null
+++ b/src/plugins/qnx/pathchooserdelegate.h
@@ -0,0 +1,73 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_PATHCHOOSERDELEGATE_H
+#define QNX_INTERNAL_PATHCHOOSERDELEGATE_H
+
+#include <QStyledItemDelegate>
+
+#include <utils/pathchooser.h>
+
+namespace Qnx {
+namespace Internal {
+
+// TODO: This whole class should probably go into utils
+
+class PathChooserDelegate : public QStyledItemDelegate
+{
+ Q_OBJECT
+public:
+ explicit PathChooserDelegate(QObject *parent = 0);
+
+ void setExpectedKind(Utils::PathChooser::Kind kind);
+ void setPromptDialogFilter(const QString &filter);
+
+ QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
+ const QModelIndex &index) const;
+
+ void setEditorData(QWidget *editor, const QModelIndex &index) const;
+ void setModelData(QWidget *editor, QAbstractItemModel *model,
+ const QModelIndex &index) const;
+
+ void updateEditorGeometry(QWidget *editor,
+ const QStyleOptionViewItem &option, const QModelIndex &index) const;
+
+private:
+ Utils::PathChooser::Kind m_kind;
+ QString m_filter;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_PATHCHOOSERDELEGATE_H
diff --git a/src/plugins/qnx/qnx.pro b/src/plugins/qnx/qnx.pro
new file mode 100644
index 0000000000..875d8548dd
--- /dev/null
+++ b/src/plugins/qnx/qnx.pro
@@ -0,0 +1,120 @@
+TEMPLATE = lib
+TARGET = Qnx
+QT += network xml
+PROVIDER = RIM
+
+include(../../qtcreatorplugin.pri)
+include(qnx_dependencies.pri)
+
+SOURCES += qnxplugin.cpp \
+ blackberryqtversionfactory.cpp \
+ blackberryqtversion.cpp \
+ qnxbaseqtconfigwidget.cpp \
+ blackberrydeployconfigurationfactory.cpp \
+ blackberrydeployconfiguration.cpp \
+ blackberrycreatepackagestep.cpp \
+ blackberrycreatepackagestepconfigwidget.cpp \
+ blackberrycreatepackagestepfactory.cpp \
+ blackberrydeploystep.cpp \
+ blackberrydeployconfigurationwidget.cpp \
+ blackberrydeploystepconfigwidget.cpp \
+ blackberrydeviceconfigurationfactory.cpp \
+ blackberrydeviceconfigurationwizard.cpp \
+ blackberrydeviceconfigurationwizardpages.cpp \
+ blackberrydeploystepfactory.cpp \
+ blackberryrunconfiguration.cpp \
+ blackberryrunconfigurationwidget.cpp \
+ blackberryrunconfigurationfactory.cpp \
+ blackberryruncontrolfactory.cpp \
+ blackberryruncontrol.cpp \
+ blackberrydebugsupport.cpp \
+ blackberryapplicationrunner.cpp \
+ blackberryconnect.cpp \
+ qnxutils.cpp \
+ blackberrydeviceconfigurationwidget.cpp \
+ qnxdeviceconfigurationfactory.cpp \
+ qnxdeviceconfigurationwizard.cpp \
+ qnxdeviceconfigurationwizardpages.cpp \
+ qnxrunconfiguration.cpp \
+ qnxruncontrolfactory.cpp \
+ qnxdebugsupport.cpp \
+ qnxapplicationrunner.cpp \
+ qnxdeploystepfactory.cpp \
+ qnxdeployconfigurationfactory.cpp \
+ qnxrunconfigurationfactory.cpp \
+ qnxruncontrol.cpp \
+ qnxqtversionfactory.cpp \
+ qnxqtversion.cpp \
+ qnxabstractqtversion.cpp \
+ bardescriptorfileimagewizardpage.cpp \
+ blackberrywizardextension.cpp \
+ blackberrydeviceconfiguration.cpp \
+ qnxdeployconfiguration.cpp \
+ qnxdeviceconfiguration.cpp \
+ blackberrydeployinformation.cpp \
+ pathchooserdelegate.cpp \
+ blackberryabstractdeploystep.cpp
+
+HEADERS += qnxplugin.h\
+ qnxconstants.h \
+ blackberryqtversionfactory.h \
+ blackberryqtversion.h \
+ qnxbaseqtconfigwidget.h \
+ blackberrydeployconfigurationfactory.h \
+ blackberrydeployconfiguration.h \
+ blackberrycreatepackagestep.h \
+ blackberrycreatepackagestepconfigwidget.h \
+ blackberrycreatepackagestepfactory.h \
+ blackberrydeploystep.h \
+ blackberrydeployconfigurationwidget.h \
+ blackberrydeploystepconfigwidget.h \
+ blackberrydeviceconfigurationfactory.h \
+ blackberrydeviceconfigurationwizard.h \
+ blackberrydeviceconfigurationwizardpages.h \
+ blackberrydeploystepfactory.h \
+ blackberryrunconfiguration.h \
+ blackberryrunconfigurationwidget.h \
+ blackberryrunconfigurationfactory.h \
+ blackberryruncontrolfactory.h \
+ blackberryruncontrol.h \
+ blackberrydebugsupport.h \
+ blackberryapplicationrunner.h \
+ blackberryconnect.h \
+ qnxutils.h \
+ blackberrydeviceconfigurationwidget.h \
+ qnxdeviceconfigurationfactory.h \
+ qnxdeviceconfigurationwizard.h \
+ qnxdeviceconfigurationwizardpages.h \
+ qnxrunconfiguration.h \
+ qnxruncontrolfactory.h \
+ qnxdebugsupport.h \
+ qnxapplicationrunner.h \
+ qnxdeploystepfactory.h \
+ qnxdeployconfigurationfactory.h \
+ qnxrunconfigurationfactory.h \
+ qnxruncontrol.h \
+ qnxqtversionfactory.h \
+ qnxqtversion.h \
+ qnxabstractqtversion.h \
+ bardescriptorfileimagewizardpage.h \
+ blackberrywizardextension.h \
+ blackberrydeviceconfiguration.h \
+ qnxdeployconfiguration.h \
+ qnxdeviceconfiguration.h \
+ blackberrydeployinformation.h \
+ pathchooserdelegate.h \
+ blackberryabstractdeploystep.h
+
+FORMS += \
+ blackberrydeviceconfigurationwizardsetuppage.ui \
+ blackberryrunconfigurationwidget.ui \
+ blackberrydeviceconfigurationwizardsshkeypage.ui \
+ blackberrydeployconfigurationwidget.ui \
+ blackberrydeviceconfigurationwidget.ui \
+ qnxbaseqtconfigwidget.ui \
+ bardescriptorfileimagewizardpage.ui
+
+DEFINES += QT_NO_CAST_TO_ASCII
+
+RESOURCES += \
+ qnx.qrc
diff --git a/src/plugins/qnx/qnx.qrc b/src/plugins/qnx/qnx.qrc
new file mode 100644
index 0000000000..04a66a42ed
--- /dev/null
+++ b/src/plugins/qnx/qnx.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/qnx">
+ <file>images/target-small.png</file>
+ <file>images/target.png</file>
+ </qresource>
+</RCC>
diff --git a/src/plugins/qnx/qnx_dependencies.pri b/src/plugins/qnx/qnx_dependencies.pri
new file mode 100644
index 0000000000..9077f38f6f
--- /dev/null
+++ b/src/plugins/qnx/qnx_dependencies.pri
@@ -0,0 +1,3 @@
+include(../../plugins/coreplugin/coreplugin.pri)
+include(../../plugins/qt4projectmanager/qt4projectmanager.pri)
+include(../../plugins/remotelinux/remotelinux.pri)
diff --git a/src/plugins/qnx/qnxabstractqtversion.cpp b/src/plugins/qnx/qnxabstractqtversion.cpp
new file mode 100644
index 0000000000..4d7b1b63f9
--- /dev/null
+++ b/src/plugins/qnx/qnxabstractqtversion.cpp
@@ -0,0 +1,173 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxabstractqtversion.h"
+
+#include "qnxbaseqtconfigwidget.h"
+
+#include <utils/environment.h>
+
+#include <QDir>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+QnxAbstractQtVersion::QnxAbstractQtVersion()
+ : QtSupport::BaseQtVersion()
+ , m_arch(UnknownArch)
+{
+}
+
+QnxAbstractQtVersion::QnxAbstractQtVersion(QnxArchitecture arch, const Utils::FileName &path, bool isAutoDetected, const QString &autoDetectionSource)
+ : QtSupport::BaseQtVersion(path, isAutoDetected, autoDetectionSource)
+ , m_arch(arch)
+{
+}
+
+QnxArchitecture QnxAbstractQtVersion::architecture() const
+{
+ return m_arch;
+}
+
+QString QnxAbstractQtVersion::archString() const
+{
+ switch (m_arch) {
+ case X86:
+ return QLatin1String("x86");
+ case ArmLeV7:
+ return QLatin1String("ARMle-v7");
+ case UnknownArch:
+ return QString();
+ }
+
+ return QString();
+}
+
+QVariantMap QnxAbstractQtVersion::toMap() const
+{
+ QVariantMap result = BaseQtVersion::toMap();
+ result.insert(QLatin1String("SDKPath"), sdkPath());
+ result.insert(QLatin1String("Arch"), m_arch);
+ return result;
+}
+
+void QnxAbstractQtVersion::fromMap(const QVariantMap &map)
+{
+ BaseQtVersion::fromMap(map);
+ setSdkPath(QDir::fromNativeSeparators(map.value(QLatin1String("SDKPath")).toString()));
+ m_arch = static_cast<QnxArchitecture>(map.value(QLatin1String("Arch"), UnknownArch).toInt());
+}
+
+QList<ProjectExplorer::Abi> QnxAbstractQtVersion::detectQtAbis() const
+{
+ ensureMkSpecParsed();
+ return qtAbisFromLibrary(qtCorePath(versionInfo(), qtVersionString()));
+}
+
+void QnxAbstractQtVersion::addToEnvironment(const ProjectExplorer::Profile *p, Utils::Environment &env) const
+{
+ QtSupport::BaseQtVersion::addToEnvironment(p, env);
+
+ if (!m_environmentUpToDate)
+ updateEnvironment();
+
+ QMultiMap<QString, QString>::const_iterator it;
+ QMultiMap<QString, QString>::const_iterator end(m_envMap.constEnd());
+ for (it = m_envMap.constBegin(); it != end; ++it) {
+ const QString key = it.key();
+ const QString value = it.value();
+
+ if (key == QLatin1String("PATH"))
+ env.prependOrSetPath(value);
+ else if (key == QLatin1String("LD_LIBRARY_PATH"))
+ env.prependOrSetLibrarySearchPath(value);
+ else
+ env.set(key, value);
+ }
+
+ env.prependOrSetLibrarySearchPath(versionInfo().value(QLatin1String("QT_INSTALL_LIBS")));
+}
+
+QString QnxAbstractQtVersion::sdkPath() const
+{
+ return m_sdkPath;
+}
+
+void QnxAbstractQtVersion::setSdkPath(const QString &sdkPath)
+{
+ if (m_sdkPath == sdkPath)
+ return;
+
+ m_sdkPath = sdkPath;
+ m_environmentUpToDate = false;
+}
+
+void QnxAbstractQtVersion::updateEnvironment() const
+{
+ m_envMap = environment();
+ m_environmentUpToDate = true;
+}
+
+QString QnxAbstractQtVersion::qnxHost() const
+{
+ if (!m_environmentUpToDate)
+ updateEnvironment();
+
+ return m_envMap.value(QLatin1String(Constants::QNX_HOST_KEY));
+}
+
+QString QnxAbstractQtVersion::qnxTarget() const
+{
+ if (!m_environmentUpToDate)
+ updateEnvironment();
+
+ return m_envMap.value(QLatin1String(Constants::QNX_TARGET_KEY));
+}
+
+QtSupport::QtConfigWidget *QnxAbstractQtVersion::createConfigurationWidget() const
+{
+ return new QnxBaseQtConfigWidget(const_cast<QnxAbstractQtVersion *>(this));
+}
+
+bool QnxAbstractQtVersion::isValid() const
+{
+ return QtSupport::BaseQtVersion::isValid() && !sdkPath().isEmpty();
+}
+
+QString QnxAbstractQtVersion::invalidReason() const
+{
+ if (sdkPath().isEmpty())
+ return QCoreApplication::translate("QtVersion", "No SDK path set");
+
+ return QtSupport::BaseQtVersion::invalidReason();
+}
diff --git a/src/plugins/qnx/qnxabstractqtversion.h b/src/plugins/qnx/qnxabstractqtversion.h
new file mode 100644
index 0000000000..ea01cddfb1
--- /dev/null
+++ b/src/plugins/qnx/qnxabstractqtversion.h
@@ -0,0 +1,92 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXABSTRACTQTVERSION_H
+#define QNX_INTERNAL_QNXABSTRACTQTVERSION_H
+
+#include "qnxconstants.h"
+
+#include <qtsupport/baseqtversion.h>
+
+namespace Qnx {
+namespace Internal {
+
+class QnxAbstractQtVersion : public QtSupport::BaseQtVersion
+{
+ friend class QnxBaseQtConfigWidget;
+public:
+ QnxAbstractQtVersion();
+ QnxAbstractQtVersion(QnxArchitecture arch, const Utils::FileName &path,
+ bool isAutoDetected = false,
+ const QString &autoDetectionSource = QString());
+
+ QString qnxHost() const;
+ QString qnxTarget() const;
+
+ QnxArchitecture architecture() const;
+ QString archString() const;
+
+ QVariantMap toMap() const;
+ void fromMap(const QVariantMap &map);
+
+ QList<ProjectExplorer::Abi> detectQtAbis() const;
+
+ void addToEnvironment(const ProjectExplorer::Profile *p, Utils::Environment &env) const;
+
+ QtSupport::QtConfigWidget *createConfigurationWidget() const;
+
+ bool isValid() const;
+ QString invalidReason() const;
+
+ virtual QString sdkDescription() const = 0;
+
+protected:
+ QString sdkPath() const;
+
+private:
+ void updateEnvironment() const;
+ virtual QMultiMap<QString, QString> environment() const = 0;
+
+ void setSdkPath(const QString &sdkPath);
+
+ QnxArchitecture m_arch;
+ QString m_sdkPath;
+
+ mutable bool m_environmentUpToDate;
+ mutable QMultiMap<QString, QString> m_envMap;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXABSTRACTQTVERSION_H
diff --git a/src/plugins/qnx/qnxapplicationrunner.cpp b/src/plugins/qnx/qnxapplicationrunner.cpp
new file mode 100644
index 0000000000..56cbf879b2
--- /dev/null
+++ b/src/plugins/qnx/qnxapplicationrunner.cpp
@@ -0,0 +1,87 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxapplicationrunner.h"
+#include "qnxrunconfiguration.h"
+#include "qnxconstants.h"
+
+#include <remotelinux/remotelinuxusedportsgatherer.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+QnxApplicationRunner::QnxApplicationRunner(QnxRunConfiguration *runConfig, QObject *parent)
+ : RemoteLinux::AbstractRemoteLinuxApplicationRunner(runConfig, parent)
+ , m_debugMode(false)
+{
+ usedPortsGatherer()->setCommand(QLatin1String(Constants::QNX_PORT_GATHERER_COMMAND));
+}
+
+void QnxApplicationRunner::setDebugMode(bool debugMode)
+{
+ m_debugMode = debugMode;
+}
+
+void QnxApplicationRunner::doDeviceSetup()
+{
+ handleDeviceSetupDone(true);
+}
+
+void QnxApplicationRunner::doAdditionalInitialCleanup()
+{
+ handleInitialCleanupDone(true);
+}
+
+void QnxApplicationRunner::doAdditionalInitializations()
+{
+ handleInitializationsDone(true);
+}
+
+void QnxApplicationRunner::doPostRunCleanup()
+{
+ handlePostRunCleanupDone();
+}
+
+void QnxApplicationRunner::doAdditionalConnectionErrorHandling()
+{
+}
+
+QString QnxApplicationRunner::killApplicationCommandLine() const
+{
+ QString executable = m_debugMode ? QLatin1String(Constants::QNX_DEBUG_EXECUTABLE) : remoteExecutable();
+ executable.replace(QLatin1String("/"), QLatin1String("\\/"));
+ return QString::fromLatin1("for PID in $(ps -f -o pid,comm | grep %1 | awk '/%1/ {print $1}'); "
+ "do "
+ "kill $PID; sleep 1; kill -9 $PID; "
+ "done").arg(executable);
+}
diff --git a/src/plugins/qnx/qnxapplicationrunner.h b/src/plugins/qnx/qnxapplicationrunner.h
new file mode 100644
index 0000000000..bcd861954f
--- /dev/null
+++ b/src/plugins/qnx/qnxapplicationrunner.h
@@ -0,0 +1,69 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXAPPLICATIONRUNNER_H
+#define QNX_INTERNAL_QNXAPPLICATIONRUNNER_H
+
+#include <remotelinux/remotelinuxapplicationrunner.h>
+
+namespace Qnx {
+namespace Internal {
+
+class QnxRunConfiguration;
+
+class QnxApplicationRunner : public RemoteLinux::AbstractRemoteLinuxApplicationRunner
+{
+ Q_OBJECT
+public:
+ explicit QnxApplicationRunner(QnxRunConfiguration *runConfig,
+ QObject *parent = 0);
+
+ void setDebugMode(bool debugMode);
+
+protected:
+ void doDeviceSetup();
+ void doAdditionalInitialCleanup();
+ void doAdditionalInitializations();
+ void doPostRunCleanup();
+ void doAdditionalConnectionErrorHandling();
+
+private:
+ QString killApplicationCommandLine() const;
+
+ bool m_debugMode;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXAPPLICATIONRUNNER_H
diff --git a/src/plugins/qnx/qnxbaseqtconfigwidget.cpp b/src/plugins/qnx/qnxbaseqtconfigwidget.cpp
new file mode 100644
index 0000000000..df1544104d
--- /dev/null
+++ b/src/plugins/qnx/qnxbaseqtconfigwidget.cpp
@@ -0,0 +1,72 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxbaseqtconfigwidget.h"
+#include "ui_qnxbaseqtconfigwidget.h"
+
+#include "qnxabstractqtversion.h"
+
+#include <utils/pathchooser.h>
+
+#include <QDir>
+#include <QFormLayout>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+QnxBaseQtConfigWidget::QnxBaseQtConfigWidget(QnxAbstractQtVersion *version)
+ : QtSupport::QtConfigWidget()
+ , m_version(version)
+{
+ m_ui = new Ui::QnxBaseQtConfigWidget;
+ m_ui->setupUi(this);
+
+ m_ui->sdkLabel->setText(version->sdkDescription());
+
+ m_ui->sdkPath->setExpectedKind(Utils::PathChooser::ExistingDirectory);
+ m_ui->sdkPath->setPath(version->sdkPath());
+
+ connect(m_ui->sdkPath, SIGNAL(changed(QString)), this, SLOT(updateSdkPath(QString)));
+}
+
+QnxBaseQtConfigWidget::~QnxBaseQtConfigWidget()
+{
+ delete m_ui;
+ m_ui = 0;
+}
+
+void QnxBaseQtConfigWidget::updateSdkPath(const QString &path)
+{
+ m_version->setSdkPath(path);
+ emit changed();
+}
diff --git a/src/plugins/qnx/qnxbaseqtconfigwidget.h b/src/plugins/qnx/qnxbaseqtconfigwidget.h
new file mode 100644
index 0000000000..b7571f8ba0
--- /dev/null
+++ b/src/plugins/qnx/qnxbaseqtconfigwidget.h
@@ -0,0 +1,66 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXBASEQTCONFIGWIDGET_H
+#define QNX_INTERNAL_QNXBASEQTCONFIGWIDGET_H
+
+#include <qtsupport/baseqtversion.h>
+
+namespace Qnx {
+namespace Internal {
+namespace Ui {
+class QnxBaseQtConfigWidget;
+}
+
+class QnxAbstractQtVersion;
+
+class QnxBaseQtConfigWidget : public QtSupport::QtConfigWidget
+{
+ Q_OBJECT
+public:
+ explicit QnxBaseQtConfigWidget(QnxAbstractQtVersion *version);
+ ~QnxBaseQtConfigWidget();
+
+private slots:
+ void updateSdkPath(const QString &path);
+
+private:
+ QnxAbstractQtVersion *m_version;
+
+ Ui::QnxBaseQtConfigWidget *m_ui;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXBASEQTCONFIGWIDGET_H
diff --git a/src/plugins/qnx/qnxbaseqtconfigwidget.ui b/src/plugins/qnx/qnxbaseqtconfigwidget.ui
new file mode 100644
index 0000000000..8b00c1e0d3
--- /dev/null
+++ b/src/plugins/qnx/qnxbaseqtconfigwidget.ui
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Qnx::Internal::QnxBaseQtConfigWidget</class>
+ <widget class="QWidget" name="Qnx::Internal::QnxBaseQtConfigWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>778</width>
+ <height>23</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="1">
+ <widget class="Utils::PathChooser" name="sdkPath" native="true"/>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="sdkLabel">
+ <property name="text">
+ <string>SDK:</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>Utils::PathChooser</class>
+ <extends>QWidget</extends>
+ <header location="global">utils/pathchooser.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/plugins/qnx/qnxconstants.h b/src/plugins/qnx/qnxconstants.h
new file mode 100644
index 0000000000..26c68cd835
--- /dev/null
+++ b/src/plugins/qnx/qnxconstants.h
@@ -0,0 +1,101 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_QNXCONSTANTS_H
+#define QNX_QNXCONSTANTS_H
+
+namespace Qnx {
+
+enum QnxArchitecture {
+ X86,
+ ArmLeV7,
+ UnknownArch
+};
+
+namespace Constants {
+
+const int QNX_BB_QT_FACTORY_PRIO = 60;
+const int QNX_QNX_QT_FACTORY_PRIO = 50;
+
+const char QNX_TARGET_KEY[] = "QNX_TARGET";
+const char QNX_HOST_KEY[] = "QNX_HOST";
+
+const char QNX_BB_QT[] = "Qt4ProjectManager.QtVersion.QNX.BlackBerry";
+const char QNX_QNX_QT[] = "Qt4ProjectManager.QtVersion.QNX.QNX";
+
+const char QNX_BB_FEATURE[] = "QtSupport.Wizards.FeatureBlackBerry";
+const char QNX_QNX_FEATURE[] = "QtSupport.Wizards.FeatureQNX";
+
+const char QNX_BB_X86_TARGET_ID[] = "Qt4ProjectManager.Target.QNX.BBX86Target";
+const char QNX_BB_ARMLEV7_TARGET_ID[] = "Qt4ProjectManager.Target.QNX.BBArmLeV7Target";
+const char QNX_QNX_X86_TARGET_ID[] = "Qt4ProjectManager.Target.QNX.QNXX86Target";
+const char QNX_QNX_ARMLEV7_TARGET_ID[] = "Qt4ProjectManager.Target.QNX.QNXArmLeV7Target";
+
+const char QNX_BB_DEPLOYCONFIGURATION_ID[] = "Qt4ProjectManager.QNX.BBDeployConfiguration";
+const char QNX_QNX_DEPLOYCONFIGURATION_ID[] = "Qt4ProjectManager.QNX.QNXDeployConfiguration";
+
+const char QNX_BB_RUNCONFIGURATION_PREFIX[] = "Qt4ProjectManager.QNX.BBRunConfiguration.";
+const char QNX_QNX_RUNCONFIGURATION_PREFIX[] = "Qt4ProjectManager.QNX.QNXRunConfiguration.";
+
+const char QNX_CREATE_PACKAGE_BS_ID[] = "Qt4ProjectManager.QnxCreatePackageBuildStep";
+const char QNX_DEPLOY_PACKAGE_BS_ID[] = "Qt4ProjectManager.QnxDeployPackageBuildStep";
+
+const char QNX_PROFILEPATH_KEY[] = "Qt4ProjectManager.QnxRunConfiguration.ProFilePath";
+
+const char QNX_BB_OS_TYPE[] = "BBOsType";
+const char QNX_QNX_OS_TYPE[] = "QnxOsType";
+
+const char QNX_DEBUG_TOKEN_KEY[] = "debugToken";
+
+const char QNX_PORT_GATHERER_COMMAND[] = "netstat -na "
+ "| sed 's/[a-z]\\+\\s\\+[0-9]\\+\\s\\+[0-9]\\+\\s\\+\\(\\*\\|[0-9\\.]\\+\\)\\.\\([0-9]\\+\\).*/\\2/g' "
+ "| while read line; do "
+ "if [[ $line != udp* ]] && [[ $line != Active* ]]; then "
+ "printf '%x\n' $line; "
+ "fi; "
+ "done";
+
+const char QNX_BAR_DESCRIPTOR_WIZARD_ID[] = "Q.QnxBlackBerryBarDescriptor";
+const char QNX_BLACKBERRY_QTQUICK_APP_WIZARD_ID[] = "Q.QnxBlackBerryQQApp";
+const char QNX_BLACKBERRY_QTQUICK2_APP_WIZARD_ID[] = "Q.QnxBlackBerryQQ2App";
+const char QNX_BLACKBERRY_GUI_APP_WIZARD_ID[] = "Q.QnxBlackBerryGuiApp";
+
+const char QNX_QNX_PLATFORM_NAME[] = "QNX";
+const char QNX_BB_PLATFORM_NAME[] = "BlackBerry";
+
+const char QNX_DEBUG_EXECUTABLE[] = "pdebug";
+
+} // namespace Constants
+} // namespace Qnx
+
+#endif // QNX_QNXCONSTANTS_H
diff --git a/src/plugins/qnx/qnxdebugsupport.cpp b/src/plugins/qnx/qnxdebugsupport.cpp
new file mode 100644
index 0000000000..d297c95346
--- /dev/null
+++ b/src/plugins/qnx/qnxdebugsupport.cpp
@@ -0,0 +1,147 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxdebugsupport.h"
+#include "qnxapplicationrunner.h"
+#include "qnxconstants.h"
+
+#include <debugger/debuggerengine.h>
+#include <remotelinux/remotelinuxusedportsgatherer.h>
+#include <utils/qtcassert.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+QnxDebugSupport::QnxDebugSupport(QnxRunConfiguration *runConfig, Debugger::DebuggerEngine *engine)
+ : QObject(engine)
+ , m_engine(engine)
+ , m_port(-1)
+ , m_state(Inactive)
+{
+ m_runner = new QnxApplicationRunner(runConfig, this);
+ m_runner->setDebugMode(true);
+
+ connect(m_engine, SIGNAL(requestRemoteSetup()), this, SLOT(handleAdapterSetupRequested()));
+}
+
+void QnxDebugSupport::handleAdapterSetupRequested()
+{
+ QTC_ASSERT(m_state == Inactive, return);
+
+ m_state = StartingRunner;
+ if (m_engine)
+ m_engine->showMessage(tr("Preparing remote side...\n"), Debugger::AppStuff);
+
+ connect(m_runner, SIGNAL(error(QString)), this, SLOT(handleSshError(QString)));
+ connect(m_runner, SIGNAL(readyForExecution()), this, SLOT(startExecution()));
+ connect(m_runner, SIGNAL(remoteProcessStarted()), this, SLOT(handleRemoteProcessStarted()));
+ connect(m_runner, SIGNAL(remoteProcessFinished(qint64)), this, SLOT(handleRemoteProcessFinished(qint64)));
+ connect(m_runner, SIGNAL(reportProgress(QString)), this, SLOT(handleProgressReport(QString)));
+ connect(m_runner, SIGNAL(remoteOutput(QByteArray)), this, SLOT(handleRemoteOutput(QByteArray)));
+
+ m_runner->start();
+}
+
+void QnxDebugSupport::startExecution()
+{
+ if (m_state == Inactive)
+ return;
+
+ QTC_ASSERT(m_state == StartingRunner, return);
+
+ m_state = StartingRemoteProcess;
+ m_port = m_runner->usedPortsGatherer()->getNextFreePort(m_runner->freePorts());
+
+ const QString remoteCommandLine = QString::fromLatin1("%1 %2 %3").arg(m_runner->commandPrefix()).arg(QLatin1String(Constants::QNX_DEBUG_EXECUTABLE)).arg(m_port);
+ m_runner->startExecution(remoteCommandLine.toUtf8());
+}
+
+void QnxDebugSupport::handleRemoteProcessStarted()
+{
+ if (m_engine)
+ m_engine->notifyEngineRemoteSetupDone(m_port, -1);
+}
+
+void QnxDebugSupport::handleRemoteProcessFinished(qint64 exitCode)
+{
+ if (m_engine || m_state == Inactive)
+ return;
+
+ if (m_state == Debugging) {
+ if (exitCode != 0)
+ m_engine->notifyInferiorIll();
+
+ } else {
+ const QString errorMsg = tr("The %1 process closed unexpectedly.").arg(QLatin1String(Constants::QNX_DEBUG_EXECUTABLE));
+ m_engine->notifyEngineRemoteSetupFailed(errorMsg);
+ }
+}
+
+void QnxDebugSupport::handleDebuggingFinished()
+{
+ setFinished();
+}
+
+void QnxDebugSupport::setFinished()
+{
+ m_state = Inactive;
+ m_runner->stop();
+}
+
+void QnxDebugSupport::handleProgressReport(const QString &progressOutput)
+{
+ if (m_engine)
+ m_engine->showMessage(progressOutput + QLatin1Char('\n'), Debugger::AppStuff);
+}
+
+void QnxDebugSupport::handleRemoteOutput(const QByteArray &output)
+{
+ QTC_ASSERT(m_state == Inactive || m_state == Debugging, return);
+
+ if (m_engine)
+ m_engine->showMessage(QString::fromUtf8(output), Debugger::AppOutput);
+}
+
+void QnxDebugSupport::handleSshError(const QString &error)
+{
+ if (m_state == Debugging) {
+ if (m_engine) {
+ m_engine->showMessage(error, Debugger::AppError);
+ m_engine->notifyInferiorIll();
+ }
+ } else if (m_state != Inactive) {
+ setFinished();
+ if (m_engine)
+ m_engine->notifyEngineRemoteSetupFailed(tr("Initial setup failed: %1").arg(error));
+ }
+}
diff --git a/src/plugins/qnx/qnxdebugsupport.h b/src/plugins/qnx/qnxdebugsupport.h
new file mode 100644
index 0000000000..f2a9dd2b06
--- /dev/null
+++ b/src/plugins/qnx/qnxdebugsupport.h
@@ -0,0 +1,90 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXDEBUGSUPPORT_H
+#define QNX_INTERNAL_QNXDEBUGSUPPORT_H
+
+#include <QObject>
+
+namespace Debugger {
+class DebuggerEngine;
+}
+
+namespace Qnx {
+namespace Internal {
+
+class QnxApplicationRunner;
+class QnxRunConfiguration;
+
+class QnxDebugSupport : public QObject
+{
+ Q_OBJECT
+public:
+ explicit QnxDebugSupport(QnxRunConfiguration *runConfig,
+ Debugger::DebuggerEngine *engine);
+
+public slots:
+ void handleDebuggingFinished();
+
+private slots:
+ void handleAdapterSetupRequested();
+
+ void startExecution();
+ void handleRemoteProcessStarted();
+ void handleRemoteProcessFinished(qint64 exitCode);
+ void handleProgressReport(const QString &progressOutput);
+ void handleRemoteOutput(const QByteArray &output);
+ void handleSshError(const QString &error);
+
+private:
+ void setFinished();
+
+ enum State {
+ Inactive,
+ StartingRunner,
+ StartingRemoteProcess,
+ Debugging
+ };
+
+ QnxApplicationRunner *m_runner;
+
+ Debugger::DebuggerEngine *m_engine;
+ int m_port;
+
+ State m_state;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXDEBUGSUPPORT_H
diff --git a/src/plugins/qnx/qnxdeployconfiguration.cpp b/src/plugins/qnx/qnxdeployconfiguration.cpp
new file mode 100644
index 0000000000..9d6efacdce
--- /dev/null
+++ b/src/plugins/qnx/qnxdeployconfiguration.cpp
@@ -0,0 +1,47 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxdeployconfiguration.h"
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+QnxDeployConfiguration::QnxDeployConfiguration(ProjectExplorer::Target *target, const Core::Id id, const QString &defaultDisplayName)
+ : RemoteLinux::RemoteLinuxDeployConfiguration(target, id, defaultDisplayName)
+{
+}
+
+QnxDeployConfiguration::QnxDeployConfiguration(ProjectExplorer::Target *target, QnxDeployConfiguration *source)
+ : RemoteLinux::RemoteLinuxDeployConfiguration(target, source)
+{
+}
diff --git a/src/plugins/qnx/qnxdeployconfiguration.h b/src/plugins/qnx/qnxdeployconfiguration.h
new file mode 100644
index 0000000000..d0516c81ec
--- /dev/null
+++ b/src/plugins/qnx/qnxdeployconfiguration.h
@@ -0,0 +1,59 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXDEPLOYCONFIGURATION_H
+#define QNX_INTERNAL_QNXDEPLOYCONFIGURATION_H
+
+#include <remotelinux/remotelinuxdeployconfiguration.h>
+
+namespace Qnx {
+namespace Internal {
+
+class QnxDeployConfiguration : public RemoteLinux::RemoteLinuxDeployConfiguration
+{
+ Q_OBJECT
+public:
+ QnxDeployConfiguration(ProjectExplorer::Target *target, const Core::Id id,
+ const QString &defaultDisplayName);
+
+ QnxDeployConfiguration(ProjectExplorer::Target *target,
+ QnxDeployConfiguration *source);
+
+private:
+ friend class QnxDeployConfigurationFactory;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXDEPLOYCONFIGURATION_H
diff --git a/src/plugins/qnx/qnxdeployconfigurationfactory.cpp b/src/plugins/qnx/qnxdeployconfigurationfactory.cpp
new file mode 100644
index 0000000000..7cb1c6fcdb
--- /dev/null
+++ b/src/plugins/qnx/qnxdeployconfigurationfactory.cpp
@@ -0,0 +1,128 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxdeployconfigurationfactory.h"
+
+#include "qnxconstants.h"
+#include "qnxdeployconfiguration.h"
+#include "qnxdeviceconfigurationfactory.h"
+
+#include <projectexplorer/profileinformation.h>
+#include <projectexplorer/target.h>
+#include <remotelinux/genericdirectuploadstep.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+QnxDeployConfigurationFactory::QnxDeployConfigurationFactory(QObject *parent)
+ : ProjectExplorer::DeployConfigurationFactory(parent)
+{
+}
+
+QList<Core::Id> QnxDeployConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const
+{
+ QList<Core::Id> ids;
+
+ if (canHandle(parent))
+ ids << Core::Id(Constants::QNX_QNX_DEPLOYCONFIGURATION_ID);
+
+ return ids;
+}
+
+QString QnxDeployConfigurationFactory::displayNameForId(const Core::Id id) const
+{
+ if (id.toString().startsWith(QLatin1String(Constants::QNX_QNX_DEPLOYCONFIGURATION_ID)))
+ return tr("Deploy to QNX Device");
+
+ return QString();
+}
+
+bool QnxDeployConfigurationFactory::canCreate(ProjectExplorer::Target *parent, const Core::Id id) const
+{
+ if (!canHandle(parent)
+ || !id.toString().startsWith(QLatin1String(Constants::QNX_QNX_DEPLOYCONFIGURATION_ID)))
+ return false;
+
+ return true;
+}
+
+ProjectExplorer::DeployConfiguration *QnxDeployConfigurationFactory::create(ProjectExplorer::Target *parent, const Core::Id id)
+{
+ if (!canCreate(parent, id))
+ return 0;
+
+ ProjectExplorer::DeployConfiguration * const dc = new QnxDeployConfiguration(parent, id,
+ displayNameForId(id));
+ dc->stepList()->insertStep(0, new RemoteLinux::GenericDirectUploadStep(dc->stepList(),
+ RemoteLinux::GenericDirectUploadStep::stepId()));
+ return dc;
+}
+
+bool QnxDeployConfigurationFactory::canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const
+{
+ return canCreate(parent, ProjectExplorer::idFromMap(map));
+}
+
+ProjectExplorer::DeployConfiguration *QnxDeployConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map)
+{
+ if (!canRestore(parent, map))
+ return 0;
+ Core::Id id = ProjectExplorer::idFromMap(map);
+ QnxDeployConfiguration * const dc = new QnxDeployConfiguration(parent, id, displayNameForId(id));
+ if (!dc->fromMap(map)) {
+ delete dc;
+ return 0;
+ }
+ return dc;
+}
+
+bool QnxDeployConfigurationFactory::canClone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source) const
+{
+ return canCreate(parent, source->id());
+}
+
+ProjectExplorer::DeployConfiguration *QnxDeployConfigurationFactory::clone(ProjectExplorer::Target *parent, ProjectExplorer::DeployConfiguration *source)
+{
+ if (!canClone(parent, source))
+ return 0;
+ return new QnxDeployConfiguration(parent, qobject_cast<QnxDeployConfiguration *>(source));
+}
+
+bool QnxDeployConfigurationFactory::canHandle(ProjectExplorer::Target *t) const
+{
+ Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(t->profile());
+ if (deviceType != QnxDeviceConfigurationFactory::deviceType())
+ return false;
+
+ return true;
+}
diff --git a/src/plugins/qnx/qnxdeployconfigurationfactory.h b/src/plugins/qnx/qnxdeployconfigurationfactory.h
new file mode 100644
index 0000000000..c7d7477f63
--- /dev/null
+++ b/src/plugins/qnx/qnxdeployconfigurationfactory.h
@@ -0,0 +1,70 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXDEPLOYCONFIGURATIONFACTORY_H
+#define QNX_INTERNAL_QNXDEPLOYCONFIGURATIONFACTORY_H
+
+#include <projectexplorer/deployconfiguration.h>
+
+namespace Qnx {
+namespace Internal {
+
+class QnxDeployConfigurationFactory : public ProjectExplorer::DeployConfigurationFactory
+{
+ Q_OBJECT
+public:
+ explicit QnxDeployConfigurationFactory(QObject *parent = 0);
+
+ QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const;
+ QString displayNameForId(const Core::Id id) const;
+
+ bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
+ ProjectExplorer::DeployConfiguration *create(ProjectExplorer::Target *parent,
+ const Core::Id id);
+
+ bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
+ ProjectExplorer::DeployConfiguration *restore(ProjectExplorer::Target *parent,
+ const QVariantMap &map);
+
+ bool canClone(ProjectExplorer::Target *parent,
+ ProjectExplorer::DeployConfiguration *source) const;
+ ProjectExplorer::DeployConfiguration *clone(ProjectExplorer::Target *parent,
+ ProjectExplorer::DeployConfiguration *source);
+
+ bool canHandle(ProjectExplorer::Target *t) const;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXDEPLOYCONFIGURATIONFACTORY_H
diff --git a/src/plugins/qnx/qnxdeploystepfactory.cpp b/src/plugins/qnx/qnxdeploystepfactory.cpp
new file mode 100644
index 0000000000..4ed0433d7b
--- /dev/null
+++ b/src/plugins/qnx/qnxdeploystepfactory.cpp
@@ -0,0 +1,109 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxdeploystepfactory.h"
+#include "qnxconstants.h"
+#include "qnxdeviceconfigurationfactory.h"
+
+#include <projectexplorer/buildsteplist.h>
+#include <projectexplorer/profileinformation.h>
+#include <projectexplorer/projectexplorerconstants.h>
+#include <projectexplorer/target.h>
+#include <remotelinux/genericdirectuploadstep.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+QnxDeployStepFactory::QnxDeployStepFactory()
+ : ProjectExplorer::IBuildStepFactory()
+{
+}
+
+QList<Core::Id> QnxDeployStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const
+{
+ if (parent->id() != Core::Id(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY))
+ return QList<Core::Id>();
+
+ Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(parent->target()->profile());
+ if (deviceType != QnxDeviceConfigurationFactory::deviceType())
+ return QList<Core::Id>();
+
+ return QList<Core::Id>() << RemoteLinux::GenericDirectUploadStep::stepId();
+}
+
+QString QnxDeployStepFactory::displayNameForId(const Core::Id id) const
+{
+ if (id == RemoteLinux::GenericDirectUploadStep::stepId())
+ return RemoteLinux::GenericDirectUploadStep::displayName();
+ return QString();
+}
+
+bool QnxDeployStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
+{
+ return availableCreationIds(parent).contains(id);
+}
+
+ProjectExplorer::BuildStep *QnxDeployStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id)
+{
+ if (!canCreate(parent, id))
+ return 0;
+ return new RemoteLinux::GenericDirectUploadStep(parent, id);
+}
+
+bool QnxDeployStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const
+{
+ return canCreate(parent, ProjectExplorer::idFromMap(map));
+}
+
+ProjectExplorer::BuildStep *QnxDeployStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map)
+{
+ if (!canRestore(parent, map))
+ return 0;
+ ProjectExplorer::BuildStep * const bs = create(parent, ProjectExplorer::idFromMap(map));
+ if (bs->fromMap(map))
+ return bs;
+ delete bs;
+ return 0;
+}
+
+bool QnxDeployStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const
+{
+ return canCreate(parent, product->id());
+}
+
+ProjectExplorer::BuildStep *QnxDeployStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product)
+{
+ if (!canClone(parent, product))
+ return 0;
+ return new RemoteLinux::GenericDirectUploadStep(parent, static_cast<RemoteLinux::GenericDirectUploadStep *>(product));
+}
diff --git a/src/plugins/qnx/qnxdeploystepfactory.h b/src/plugins/qnx/qnxdeploystepfactory.h
new file mode 100644
index 0000000000..31cd54a3e5
--- /dev/null
+++ b/src/plugins/qnx/qnxdeploystepfactory.h
@@ -0,0 +1,68 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXDEPLOYSTEPFACTORY_H
+#define QNX_INTERNAL_QNXDEPLOYSTEPFACTORY_H
+
+#include <projectexplorer/buildstep.h>
+
+namespace Qnx {
+namespace Internal {
+
+class QnxDeployStepFactory : public ProjectExplorer::IBuildStepFactory
+{
+ Q_OBJECT
+public:
+ explicit QnxDeployStepFactory();
+
+ QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
+ QString displayNameForId(const Core::Id id) const;
+
+ bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
+ ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent,
+ const Core::Id id);
+
+ bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
+ ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent,
+ const QVariantMap &map);
+
+ bool canClone(ProjectExplorer::BuildStepList *parent,
+ ProjectExplorer::BuildStep *product) const;
+ ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent,
+ ProjectExplorer::BuildStep *product);
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXDEPLOYSTEPFACTORY_H
diff --git a/src/plugins/qnx/qnxdeviceconfiguration.cpp b/src/plugins/qnx/qnxdeviceconfiguration.cpp
new file mode 100644
index 0000000000..8eacdb89e9
--- /dev/null
+++ b/src/plugins/qnx/qnxdeviceconfiguration.cpp
@@ -0,0 +1,74 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxdeviceconfiguration.h"
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+QnxDeviceConfiguration::QnxDeviceConfiguration()
+ : RemoteLinux::LinuxDeviceConfiguration()
+{
+}
+
+QnxDeviceConfiguration::QnxDeviceConfiguration(const QString &name, Core::Id type, MachineType machineType, Origin origin, Core::Id id)
+ : RemoteLinux::LinuxDeviceConfiguration(name, type, machineType, origin, id)
+{
+}
+
+QnxDeviceConfiguration::QnxDeviceConfiguration(const QnxDeviceConfiguration &other)
+ : RemoteLinux::LinuxDeviceConfiguration(other)
+{
+}
+
+
+QnxDeviceConfiguration::Ptr QnxDeviceConfiguration::create()
+{
+ return Ptr(new QnxDeviceConfiguration);
+}
+
+QnxDeviceConfiguration::Ptr QnxDeviceConfiguration::create(const QString &name, Core::Id type, RemoteLinux::LinuxDeviceConfiguration::MachineType machineType, ProjectExplorer::IDevice::Origin origin, Core::Id id)
+{
+ return Ptr(new QnxDeviceConfiguration(name, type, machineType, origin, id));
+}
+
+QString QnxDeviceConfiguration::displayType() const
+{
+ return tr("QNX");
+}
+
+ProjectExplorer::IDevice::Ptr QnxDeviceConfiguration::clone() const
+{
+ return Ptr(new QnxDeviceConfiguration(*this));
+}
+
diff --git a/src/plugins/qnx/qnxdeviceconfiguration.h b/src/plugins/qnx/qnxdeviceconfiguration.h
new file mode 100644
index 0000000000..bd8d228cab
--- /dev/null
+++ b/src/plugins/qnx/qnxdeviceconfiguration.h
@@ -0,0 +1,66 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXDEVICECONFIGURATION_H
+#define QNX_INTERNAL_QNXDEVICECONFIGURATION_H
+
+#include <remotelinux/linuxdeviceconfiguration.h>
+
+namespace Qnx {
+namespace Internal {
+
+class QnxDeviceConfiguration : public RemoteLinux::LinuxDeviceConfiguration
+{
+public:
+ typedef QSharedPointer<QnxDeviceConfiguration> Ptr;
+ typedef QSharedPointer<const QnxDeviceConfiguration> ConstPtr;
+
+ static Ptr create();
+ static Ptr create(const QString &name, Core::Id type, MachineType machineType,
+ Origin origin = ManuallyAdded, Core::Id id = Core::Id());
+ ProjectExplorer::IDevice::Ptr clone() const;
+
+ QString displayType() const;
+
+
+protected:
+ QnxDeviceConfiguration();
+ QnxDeviceConfiguration(const QString &name, Core::Id type, MachineType machineType,
+ Origin origin, Core::Id id);
+ QnxDeviceConfiguration(const QnxDeviceConfiguration &other);
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXDEVICECONFIGURATION_H
diff --git a/src/plugins/qnx/qnxdeviceconfigurationfactory.cpp b/src/plugins/qnx/qnxdeviceconfigurationfactory.cpp
new file mode 100644
index 0000000000..59afb92fd3
--- /dev/null
+++ b/src/plugins/qnx/qnxdeviceconfigurationfactory.cpp
@@ -0,0 +1,94 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxdeviceconfigurationfactory.h"
+
+#include "qnxconstants.h"
+#include "qnxdeviceconfigurationwizard.h"
+#include "qnxdeviceconfiguration.h"
+
+#include <utils/qtcassert.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+QnxDeviceConfigurationFactory::QnxDeviceConfigurationFactory(QObject *parent) :
+ ProjectExplorer::IDeviceFactory(parent)
+{
+}
+
+QString QnxDeviceConfigurationFactory::displayNameForId(Core::Id type) const
+{
+ Q_UNUSED(type);
+ return tr("QNX Device");
+}
+
+QList<Core::Id> QnxDeviceConfigurationFactory::availableCreationIds() const
+{
+ QList<Core::Id> result;
+ result << Core::Id(Constants::QNX_QNX_OS_TYPE);
+ return result;
+}
+
+bool QnxDeviceConfigurationFactory::canCreate() const
+{
+ return true;
+}
+
+ProjectExplorer::IDevice::Ptr QnxDeviceConfigurationFactory::create(Core::Id id) const
+{
+ Q_UNUSED(id);
+ QnxDeviceConfigurationWizard wizard;
+ if (wizard.exec() != QDialog::Accepted) {
+ return ProjectExplorer::IDevice::Ptr();
+ }
+ return wizard.device();
+}
+
+bool QnxDeviceConfigurationFactory::canRestore(const QVariantMap &map) const
+{
+ return ProjectExplorer::IDevice::typeFromMap(map) == Core::Id(Constants::QNX_QNX_OS_TYPE);
+}
+
+ProjectExplorer::IDevice::Ptr QnxDeviceConfigurationFactory::restore(const QVariantMap &map) const
+{
+ QTC_ASSERT(canRestore(map), return QnxDeviceConfiguration::Ptr());
+ const QnxDeviceConfiguration::Ptr device = QnxDeviceConfiguration::create();
+ device->fromMap(map);
+ return device;
+}
+
+Core::Id QnxDeviceConfigurationFactory::deviceType()
+{
+ return Core::Id(Constants::QNX_QNX_OS_TYPE);
+}
diff --git a/src/plugins/qnx/qnxdeviceconfigurationfactory.h b/src/plugins/qnx/qnxdeviceconfigurationfactory.h
new file mode 100644
index 0000000000..a229601078
--- /dev/null
+++ b/src/plugins/qnx/qnxdeviceconfigurationfactory.h
@@ -0,0 +1,63 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXDEVICECONFIGURATIONFACTORY_H
+#define QNX_INTERNAL_QNXDEVICECONFIGURATIONFACTORY_H
+
+#include <projectexplorer/devicesupport/idevicefactory.h>
+
+namespace Qnx {
+namespace Internal {
+
+class QnxDeviceConfigurationFactory : public ProjectExplorer::IDeviceFactory
+{
+ Q_OBJECT
+public:
+ explicit QnxDeviceConfigurationFactory(QObject *parent = 0);
+
+ QString displayNameForId(Core::Id type) const;
+ QList<Core::Id> availableCreationIds() const;
+
+ bool canCreate() const;
+ ProjectExplorer::IDevice::Ptr create(Core::Id id) const;
+
+ bool canRestore(const QVariantMap &map) const;
+ ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const;
+
+ static Core::Id deviceType();
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXDEVICECONFIGURATIONFACTORY_H
diff --git a/src/plugins/qnx/qnxdeviceconfigurationwizard.cpp b/src/plugins/qnx/qnxdeviceconfigurationwizard.cpp
new file mode 100644
index 0000000000..46b815c428
--- /dev/null
+++ b/src/plugins/qnx/qnxdeviceconfigurationwizard.cpp
@@ -0,0 +1,90 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxdeviceconfigurationwizard.h"
+
+#include "qnxconstants.h"
+#include "qnxdeviceconfigurationwizardpages.h"
+#include "qnxdeviceconfiguration.h"
+
+#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h>
+#include <remotelinux/linuxdevicetestdialog.h>
+#include <remotelinux/linuxdevicetester.h>
+#include <utils/portlist.h>
+#include <remotelinux/remotelinuxusedportsgatherer.h>
+#include <ssh/sshconnection.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+QnxDeviceConfigurationWizard::QnxDeviceConfigurationWizard(QWidget *parent) :
+ QWizard(parent)
+{
+ setWindowTitle(tr("New QNX Device Configuration Setup"));
+
+ m_setupPage = new QnxDeviceConfigurationWizardSetupPage(this);
+ m_finalPage = new RemoteLinux::GenericLinuxDeviceConfigurationWizardFinalPage(this);
+
+ setPage(SetupPageId, m_setupPage);
+ setPage(FinalPageId, m_finalPage);
+ m_finalPage->setCommitPage(true);
+}
+
+ProjectExplorer::IDevice::Ptr QnxDeviceConfigurationWizard::device()
+{
+ QSsh::SshConnectionParameters sshParams;
+ sshParams.proxyType = QSsh::SshConnectionParameters::NoProxy;
+ sshParams.host = m_setupPage->hostName();
+ sshParams.userName = m_setupPage->userName();
+ sshParams.port = 22;
+ sshParams.timeout = 10;
+ sshParams.authenticationType = m_setupPage->authenticationType();
+ if (sshParams.authenticationType == QSsh::SshConnectionParameters::AuthenticationByPassword) {
+ sshParams.password = m_setupPage->password();
+ } else {
+ sshParams.privateKeyFile = m_setupPage->privateKeyFilePath();
+ }
+
+ QnxDeviceConfiguration::Ptr devConf = QnxDeviceConfiguration::create(m_setupPage->configurationName(),
+ Core::Id(Constants::QNX_QNX_OS_TYPE), RemoteLinux::LinuxDeviceConfiguration::Hardware);
+ devConf->setSshParameters(sshParams);
+ devConf->setFreePorts(Utils::PortList::fromString(QLatin1String("10000-10100")));
+
+ RemoteLinux::GenericLinuxDeviceTester *devTester = new RemoteLinux::GenericLinuxDeviceTester(this);
+ devTester->usedPortsGatherer()->setCommand(QLatin1String(Constants::QNX_PORT_GATHERER_COMMAND));
+
+ RemoteLinux::LinuxDeviceTestDialog dlg(devConf, devTester, this);
+ dlg.exec();
+
+ return devConf;
+}
diff --git a/src/plugins/qnx/qnxdeviceconfigurationwizard.h b/src/plugins/qnx/qnxdeviceconfigurationwizard.h
new file mode 100644
index 0000000000..fd2df1fb88
--- /dev/null
+++ b/src/plugins/qnx/qnxdeviceconfigurationwizard.h
@@ -0,0 +1,70 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARD_H
+#define QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARD_H
+
+#include <QWizard>
+
+#include <projectexplorer/devicesupport/idevice.h>
+
+namespace RemoteLinux {
+class GenericLinuxDeviceConfigurationWizardSetupPage;
+class GenericLinuxDeviceConfigurationWizardFinalPage;
+}
+
+namespace Qnx {
+namespace Internal {
+
+class QnxDeviceConfigurationWizard : public QWizard
+{
+ Q_OBJECT
+public:
+ explicit QnxDeviceConfigurationWizard(QWidget *parent = 0);
+
+ ProjectExplorer::IDevice::Ptr device();
+
+private:
+ enum PageId {
+ SetupPageId,
+ FinalPageId
+ };
+
+ RemoteLinux::GenericLinuxDeviceConfigurationWizardSetupPage *m_setupPage;
+ RemoteLinux::GenericLinuxDeviceConfigurationWizardFinalPage *m_finalPage;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARD_H
diff --git a/src/plugins/qnx/qnxdeviceconfigurationwizardpages.cpp b/src/plugins/qnx/qnxdeviceconfigurationwizardpages.cpp
new file mode 100644
index 0000000000..d61ec7b705
--- /dev/null
+++ b/src/plugins/qnx/qnxdeviceconfigurationwizardpages.cpp
@@ -0,0 +1,50 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxdeviceconfigurationwizardpages.h"
+
+namespace Qnx {
+namespace Internal {
+
+QnxDeviceConfigurationWizardSetupPage::QnxDeviceConfigurationWizardSetupPage(QWidget *parent) :
+ RemoteLinux::GenericLinuxDeviceConfigurationWizardSetupPage(parent)
+{
+}
+
+QString QnxDeviceConfigurationWizardSetupPage::defaultConfigurationName() const
+{
+ return tr("QNX Device");
+}
+
+} // namespace Internal
+} // namespace Qnx
diff --git a/src/plugins/qnx/qnxdeviceconfigurationwizardpages.h b/src/plugins/qnx/qnxdeviceconfigurationwizardpages.h
new file mode 100644
index 0000000000..88fb40df48
--- /dev/null
+++ b/src/plugins/qnx/qnxdeviceconfigurationwizardpages.h
@@ -0,0 +1,54 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARDPAGES_H
+#define QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARDPAGES_H
+
+#include <remotelinux/genericlinuxdeviceconfigurationwizardpages.h>
+
+namespace Qnx {
+namespace Internal {
+
+class QnxDeviceConfigurationWizardSetupPage : public RemoteLinux::GenericLinuxDeviceConfigurationWizardSetupPage
+{
+ Q_OBJECT
+public:
+ explicit QnxDeviceConfigurationWizardSetupPage(QWidget *parent = 0);
+
+ QString defaultConfigurationName() const;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXDEVICECONFIGURATIONWIZARDPAGES_H
diff --git a/src/plugins/qnx/qnxplugin.cpp b/src/plugins/qnx/qnxplugin.cpp
new file mode 100644
index 0000000000..3283efe7d0
--- /dev/null
+++ b/src/plugins/qnx/qnxplugin.cpp
@@ -0,0 +1,99 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxplugin.h"
+
+#include "blackberrydeviceconfigurationfactory.h"
+#include "qnxconstants.h"
+#include "blackberryqtversionfactory.h"
+#include "blackberrydeployconfigurationfactory.h"
+#include "blackberrycreatepackagestepfactory.h"
+#include "blackberrydeploystepfactory.h"
+#include "blackberryrunconfigurationfactory.h"
+#include "blackberryruncontrolfactory.h"
+#include "qnxdeviceconfigurationfactory.h"
+#include "qnxruncontrolfactory.h"
+#include "qnxdeploystepfactory.h"
+#include "qnxdeployconfigurationfactory.h"
+#include "qnxrunconfigurationfactory.h"
+#include "qnxqtversionfactory.h"
+#include "blackberrywizardextension.h"
+
+#include <QtPlugin>
+
+using namespace Qnx::Internal;
+
+QNXPlugin::QNXPlugin()
+{
+}
+
+QNXPlugin::~QNXPlugin()
+{
+}
+
+bool QNXPlugin::initialize(const QStringList &arguments, QString *errorString)
+{
+ Q_UNUSED(arguments)
+ Q_UNUSED(errorString)
+
+ // Handles BlackBerry
+ addAutoReleasedObject(new BlackBerryQtVersionFactory);
+ addAutoReleasedObject(new BlackBerryDeployConfigurationFactory);
+ addAutoReleasedObject(new BlackBerryDeviceConfigurationFactory);
+ addAutoReleasedObject(new BlackBerryCreatePackageStepFactory);
+ addAutoReleasedObject(new BlackBerryDeployStepFactory);
+ addAutoReleasedObject(new BlackBerryRunConfigurationFactory);
+ addAutoReleasedObject(new BlackBerryRunControlFactory);
+ addAutoReleasedObject(new BlackBerryWizardExtension);
+
+ // Handles QNX
+ addAutoReleasedObject(new QnxQtVersionFactory);
+ addAutoReleasedObject(new QnxDeviceConfigurationFactory);
+ addAutoReleasedObject(new QnxRunControlFactory);
+ addAutoReleasedObject(new QnxDeployStepFactory);
+ addAutoReleasedObject(new QnxDeployConfigurationFactory);
+ addAutoReleasedObject(new QnxRunConfigurationFactory);
+
+ return true;
+}
+
+void QNXPlugin::extensionsInitialized()
+{
+}
+
+ExtensionSystem::IPlugin::ShutdownFlag QNXPlugin::aboutToShutdown()
+{
+ return SynchronousShutdown;
+}
+
+Q_EXPORT_PLUGIN2(QNX, QNXPlugin)
diff --git a/src/plugins/qnx/qnxplugin.h b/src/plugins/qnx/qnxplugin.h
new file mode 100644
index 0000000000..26ed93e31d
--- /dev/null
+++ b/src/plugins/qnx/qnxplugin.h
@@ -0,0 +1,58 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXPLUGIN_H
+#define QNX_INTERNAL_QNXPLUGIN_H
+
+#include <extensionsystem/iplugin.h>
+
+namespace Qnx {
+namespace Internal {
+
+class QNXPlugin : public ExtensionSystem::IPlugin
+{
+ Q_OBJECT
+
+public:
+ QNXPlugin();
+ ~QNXPlugin();
+
+ bool initialize(const QStringList &arguments, QString *errorString);
+ void extensionsInitialized();
+ ShutdownFlag aboutToShutdown();
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXPLUGIN_H
diff --git a/src/plugins/qnx/qnxqtversion.cpp b/src/plugins/qnx/qnxqtversion.cpp
new file mode 100644
index 0000000000..5851b78d13
--- /dev/null
+++ b/src/plugins/qnx/qnxqtversion.cpp
@@ -0,0 +1,123 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxqtversion.h"
+
+#include "qnxconstants.h"
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+QnxQtVersion::QnxQtVersion()
+ : QnxAbstractQtVersion()
+{
+}
+
+QnxQtVersion::QnxQtVersion(QnxArchitecture arch, const Utils::FileName &path, bool isAutoDetected, const QString &autoDetectionSource)
+ : QnxAbstractQtVersion(arch, path, isAutoDetected, autoDetectionSource)
+{
+}
+
+QnxQtVersion *QnxQtVersion::clone() const
+{
+ return new QnxQtVersion(*this);
+}
+
+QnxQtVersion::~QnxQtVersion()
+{
+}
+
+QString QnxQtVersion::type() const
+{
+ return QLatin1String(Constants::QNX_QNX_QT);
+}
+
+QString QnxQtVersion::description() const
+{
+ return QCoreApplication::translate("QtVersion", "QNX %1", "Qt Version is meant for QNX").arg(archString());
+}
+
+Core::FeatureSet QnxQtVersion::availableFeatures() const
+{
+ Core::FeatureSet features = QnxAbstractQtVersion::availableFeatures();
+ features |= Core::FeatureSet(Constants::QNX_QNX_FEATURE);
+ return features;
+}
+
+QString QnxQtVersion::platformName() const
+{
+ return QString::fromLatin1(Constants::QNX_QNX_PLATFORM_NAME);
+}
+
+QString QnxQtVersion::platformDisplayName() const
+{
+ return QCoreApplication::tr("QNX");
+}
+
+QString QnxQtVersion::sdkDescription() const
+{
+ return QCoreApplication::tr("QNX Software Development Platform:");
+}
+
+QMultiMap<QString, QString> QnxQtVersion::environment() const
+{
+ // Mimic what the SDP installer puts into the system environment
+
+ QMultiMap<QString, QString> environment;
+
+#if defined Q_OS_WIN
+ // TODO:
+ //environment.insert(QLatin1String("QNX_CONFIGURATION"), QLatin1String("/etc/qnx"));
+ environment.insert(QLatin1String(Constants::QNX_TARGET_KEY), sdkPath() + QLatin1String("/target/qnx6"));
+ environment.insert(QLatin1String(Constants::QNX_HOST_KEY), sdkPath() + QLatin1String("/host/win32/x86"));
+
+ environment.insert(QLatin1String("PATH"), sdkPath() + QLatin1String("/host/win32/x86/usr/bin"));
+
+ // TODO:
+ //environment.insert(QLatin1String("PATH"), QLatin1String("/etc/qnx/bin"));
+#elif defined Q_OS_UNIX
+ environment.insert(QLatin1String("QNX_CONFIGURATION"), QLatin1String("/etc/qnx"));
+ environment.insert(QLatin1String(Constants::QNX_TARGET_KEY), sdkPath() + QLatin1String("/target/qnx6"));
+ environment.insert(QLatin1String(Constants::QNX_HOST_KEY), sdkPath() + QLatin1String("/host/linux/x86"));
+
+ environment.insert(QLatin1String("PATH"), sdkPath() + QLatin1String("/host/linux/x86/usr/bin"));
+ environment.insert(QLatin1String("PATH"), QLatin1String("/etc/qnx/bin"));
+
+ environment.insert(QLatin1String("LD_LIBRARY_PATH"), sdkPath() + QLatin1String("/host/linux/x86/usr/lib"));
+#endif
+
+ environment.insert(QLatin1String("QNX_JAVAHOME"), sdkPath() + QLatin1String("/_jvm"));
+ environment.insert(QLatin1String("MAKEFLAGS"), QLatin1String("-I") + sdkPath() + QLatin1String("/target/qnx6/usr/include"));
+
+ return environment;
+}
diff --git a/src/plugins/qnx/qnxqtversion.h b/src/plugins/qnx/qnxqtversion.h
new file mode 100644
index 0000000000..574cbb94c2
--- /dev/null
+++ b/src/plugins/qnx/qnxqtversion.h
@@ -0,0 +1,70 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXQTVERSION_H
+#define QNX_INTERNAL_QNXQTVERSION_H
+
+#include "qnxconstants.h"
+#include "qnxabstractqtversion.h"
+
+namespace Qnx {
+namespace Internal {
+
+class QnxQtVersion : public QnxAbstractQtVersion
+{
+public:
+ QnxQtVersion();
+ QnxQtVersion(QnxArchitecture arch, const Utils::FileName &path,
+ bool isAutoDetected = false,
+ const QString &autoDetectionSource = QString());
+ QnxQtVersion *clone() const;
+ ~QnxQtVersion();
+
+ QString type() const;
+
+ QString description() const;
+
+ Core::FeatureSet availableFeatures() const;
+ QString platformName() const;
+ QString platformDisplayName() const;
+
+ QString sdkDescription() const;
+
+private:
+ QMultiMap<QString, QString> environment() const;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXQTVERSION_H
diff --git a/src/plugins/qnx/qnxqtversionfactory.cpp b/src/plugins/qnx/qnxqtversionfactory.cpp
new file mode 100644
index 0000000000..e39e0d03e2
--- /dev/null
+++ b/src/plugins/qnx/qnxqtversionfactory.cpp
@@ -0,0 +1,89 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxqtversionfactory.h"
+
+#include "qnxconstants.h"
+#include "qnxutils.h"
+#include "qnxqtversion.h"
+
+#include <qtsupport/profilereader.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+QnxQtVersionFactory::QnxQtVersionFactory(QObject *parent) :
+ QtSupport::QtVersionFactory(parent)
+{
+}
+
+QnxQtVersionFactory::~QnxQtVersionFactory()
+{
+}
+
+bool QnxQtVersionFactory::canRestore(const QString &type)
+{
+ return type == QLatin1String(Constants::QNX_QNX_QT);
+}
+
+QtSupport::BaseQtVersion *QnxQtVersionFactory::restore(const QString &type, const QVariantMap &data)
+{
+ if (!canRestore(type))
+ return 0;
+ QnxQtVersion *v = new QnxQtVersion();
+ v->fromMap(data);
+ return v;
+}
+
+int QnxQtVersionFactory::priority() const
+{
+ return Constants::QNX_QNX_QT_FACTORY_PRIO;
+}
+
+QtSupport::BaseQtVersion *QnxQtVersionFactory::create(const Utils::FileName &qmakePath,
+ ProFileEvaluator *evaluator,
+ bool isAutoDetected,
+ const QString &autoDetectionSource)
+{
+ QFileInfo fi = qmakePath.toFileInfo();
+ if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
+ return 0;
+
+ if (evaluator->contains(QLatin1String("QNX_CPUDIR"))) {
+ QString cpuDir = evaluator->value(QLatin1String("QNX_CPUDIR"));
+ return new QnxQtVersion(QnxUtils::cpudirToArch(cpuDir), qmakePath,
+ isAutoDetected, autoDetectionSource);
+ }
+
+ return 0;
+}
diff --git a/src/plugins/qnx/qnxqtversionfactory.h b/src/plugins/qnx/qnxqtversionfactory.h
new file mode 100644
index 0000000000..cb21abda9d
--- /dev/null
+++ b/src/plugins/qnx/qnxqtversionfactory.h
@@ -0,0 +1,62 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXQTVERSIONFACTORY_H
+#define QNX_INTERNAL_QNXQTVERSIONFACTORY_H
+
+#include <qtsupport/qtversionfactory.h>
+
+namespace Qnx {
+namespace Internal {
+
+class QnxQtVersionFactory : public QtSupport::QtVersionFactory
+{
+ Q_OBJECT
+public:
+ explicit QnxQtVersionFactory(QObject *parent = 0);
+ ~QnxQtVersionFactory();
+
+ virtual bool canRestore(const QString &type);
+ virtual QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data);
+
+ virtual int priority() const;
+ virtual QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath,
+ ProFileEvaluator *evaluator,
+ bool isAutoDetected = false,
+ const QString &autoDetectionSource = QString());
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXQTVERSIONFACTORY_H
diff --git a/src/plugins/qnx/qnxrunconfiguration.cpp b/src/plugins/qnx/qnxrunconfiguration.cpp
new file mode 100644
index 0000000000..64eca68627
--- /dev/null
+++ b/src/plugins/qnx/qnxrunconfiguration.cpp
@@ -0,0 +1,112 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxrunconfiguration.h"
+#include "qnxconstants.h"
+
+#include <remotelinux/remotelinuxrunconfigurationwidget.h>
+
+#include <QLabel>
+#include <QLineEdit>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+namespace {
+const char QtLibPathKey[] = "Qt4ProjectManager.QnxRunConfiguration.QtLibPath";
+}
+
+QnxRunConfiguration::QnxRunConfiguration(ProjectExplorer::Target *parent, const Core::Id id, const QString &proFilePath)
+ : RemoteLinux::RemoteLinuxRunConfiguration(parent, id, proFilePath)
+{
+}
+
+QnxRunConfiguration::QnxRunConfiguration(ProjectExplorer::Target *parent, QnxRunConfiguration *source)
+ : RemoteLinux::RemoteLinuxRunConfiguration(parent, source)
+ , m_qtLibPath(source->m_qtLibPath)
+{
+}
+
+void QnxRunConfiguration::setQtLibPath(const QString &path)
+{
+ m_qtLibPath = path;
+}
+
+QString QnxRunConfiguration::environmentPreparationCommand() const
+{
+ QString command;
+ const QStringList filesToSource = QStringList() << QLatin1String("/etc/profile")
+ << QLatin1String("$HOME/.profile");
+ foreach (const QString &filePath, filesToSource)
+ command += QString::fromLatin1("test -f %1 && . %1;").arg(filePath);
+ if (!workingDirectory().isEmpty())
+ command += QLatin1String("cd ") + workingDirectory() + QLatin1String(";");
+
+ if (!m_qtLibPath.isEmpty())
+ command += QLatin1String("LD_LIBRARY_PATH=") + m_qtLibPath + QLatin1String(":$LD_LIBRARY_PATH");
+ else
+ command.chop(1); // Trailing semicolon.
+
+ return command;
+}
+
+QWidget *QnxRunConfiguration::createConfigurationWidget()
+{
+ RemoteLinux::RemoteLinuxRunConfigurationWidget *rcWidget =
+ qobject_cast<RemoteLinux::RemoteLinuxRunConfigurationWidget *>(RemoteLinux::RemoteLinuxRunConfiguration::createConfigurationWidget());
+
+ QLabel *label = new QLabel(tr("Path to Qt libraries on device:"));
+ QLineEdit *lineEdit = new QLineEdit(m_qtLibPath);
+
+ connect(lineEdit, SIGNAL(textChanged(QString)), this, SLOT(setQtLibPath(QString)));
+
+ rcWidget->addFormLayoutRow(label, lineEdit);
+
+ return rcWidget;
+}
+
+QVariantMap QnxRunConfiguration::toMap() const
+{
+ QVariantMap map(RemoteLinux::RemoteLinuxRunConfiguration::toMap());
+ map.insert(QLatin1String(QtLibPathKey), m_qtLibPath);
+ return map;
+}
+
+bool QnxRunConfiguration::fromMap(const QVariantMap &map)
+{
+ if (!RemoteLinux::RemoteLinuxRunConfiguration::fromMap(map))
+ return false;
+
+ setQtLibPath(map.value(QLatin1String(QtLibPathKey)).toString());
+ return true;
+}
diff --git a/src/plugins/qnx/qnxrunconfiguration.h b/src/plugins/qnx/qnxrunconfiguration.h
new file mode 100644
index 0000000000..fb43cad240
--- /dev/null
+++ b/src/plugins/qnx/qnxrunconfiguration.h
@@ -0,0 +1,72 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXRUNCONFIGURATION_H
+#define QNX_INTERNAL_QNXRUNCONFIGURATION_H
+
+#include <remotelinux/remotelinuxrunconfiguration.h>
+
+namespace Qnx {
+namespace Internal {
+
+class QnxRunConfiguration : public RemoteLinux::RemoteLinuxRunConfiguration
+{
+ Q_OBJECT
+public:
+ QnxRunConfiguration(ProjectExplorer::Target *parent, const Core::Id id, const QString &proFilePath);
+
+ QString environmentPreparationCommand() const;
+
+ QWidget *createConfigurationWidget();
+
+ QVariantMap toMap() const;
+
+protected:
+ friend class QnxRunConfigurationFactory;
+
+ QnxRunConfiguration(ProjectExplorer::Target *parent,
+ QnxRunConfiguration *source);
+
+ bool fromMap(const QVariantMap &map);
+
+private slots:
+ void setQtLibPath(const QString &path);
+
+private:
+ QString m_qtLibPath;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXRUNCONFIGURATION_H
diff --git a/src/plugins/qnx/qnxrunconfigurationfactory.cpp b/src/plugins/qnx/qnxrunconfigurationfactory.cpp
new file mode 100644
index 0000000000..1c1e37e8e5
--- /dev/null
+++ b/src/plugins/qnx/qnxrunconfigurationfactory.cpp
@@ -0,0 +1,157 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxrunconfigurationfactory.h"
+
+#include "qnxconstants.h"
+#include "qnxrunconfiguration.h"
+#include "qnxdeviceconfigurationfactory.h"
+
+#include <projectexplorer/profileinformation.h>
+#include <projectexplorer/target.h>
+#include <qt4projectmanager/qt4project.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+namespace {
+QString pathFromId(const Core::Id id)
+{
+ const QString idStr = id.toString();
+ if (idStr.startsWith(QLatin1String(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX)))
+ return idStr.mid(QString::fromLatin1(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX).size());
+
+ return QString();
+}
+}
+
+QnxRunConfigurationFactory::QnxRunConfigurationFactory(QObject *parent) :
+ ProjectExplorer::IRunConfigurationFactory(parent)
+{
+}
+
+QList<Core::Id> QnxRunConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const
+{
+ QList<Core::Id> ids;
+ if (!canHandle(parent))
+ return ids;
+
+ Qt4ProjectManager::Qt4Project *qt4Project = qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project());
+ if (!qt4Project)
+ return ids;
+
+ QStringList proFiles = qt4Project->applicationProFilePathes(QLatin1String(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX));
+ foreach (const QString &pf, proFiles)
+ ids << Core::Id(pf);
+ return ids;
+}
+
+QString QnxRunConfigurationFactory::displayNameForId(const Core::Id id) const
+{
+ const QString path = pathFromId(id);
+ if (path.isEmpty())
+ return QString();
+
+ if (id.toString().startsWith(QLatin1String(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX)))
+ return tr("%1 on QNX Device").arg(QFileInfo(path).completeBaseName());
+
+ return QString();
+}
+
+bool QnxRunConfigurationFactory::canCreate(ProjectExplorer::Target *parent, const Core::Id id) const
+{
+ if (!canHandle(parent))
+ return false;
+
+ Qt4ProjectManager::Qt4Project *qt4Project = qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project());
+ if (!qt4Project)
+ return false;
+
+ return qt4Project->hasApplicationProFile(pathFromId(id));
+}
+
+ProjectExplorer::RunConfiguration *QnxRunConfigurationFactory::create(ProjectExplorer::Target *parent, const Core::Id id)
+{
+ if (!canCreate(parent, id))
+ return 0;
+
+ if (id.toString().startsWith(QLatin1String(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX)))
+ return new QnxRunConfiguration(parent, id, pathFromId(id));
+
+ return 0;
+}
+
+bool QnxRunConfigurationFactory::canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const
+{
+ if (!canHandle(parent))
+ return false;
+
+ return ProjectExplorer::idFromMap(map).toString().startsWith(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX);
+}
+
+ProjectExplorer::RunConfiguration *QnxRunConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map)
+{
+ if (!canRestore(parent, map))
+ return 0;
+
+ ProjectExplorer::RunConfiguration *rc = 0;
+ rc = new QnxRunConfiguration(parent, Core::Id(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX), QString());
+ if (rc->fromMap(map))
+ return rc;
+
+ delete rc;
+ return 0;
+}
+
+bool QnxRunConfigurationFactory::canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const
+{
+ return canCreate(parent, source->id());
+}
+
+ProjectExplorer::RunConfiguration *QnxRunConfigurationFactory::clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source)
+{
+ if (!canClone(parent, source))
+ return 0;
+
+ QnxRunConfiguration *old = static_cast<QnxRunConfiguration *>(source);
+ return new QnxRunConfiguration(parent, old);
+}
+
+bool QnxRunConfigurationFactory::canHandle(ProjectExplorer::Target *t) const
+{
+ Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(t->profile());
+ if (deviceType != QnxDeviceConfigurationFactory::deviceType())
+ return false;
+
+ return true;
+}
diff --git a/src/plugins/qnx/qnxrunconfigurationfactory.h b/src/plugins/qnx/qnxrunconfigurationfactory.h
new file mode 100644
index 0000000000..ab2bf72b0b
--- /dev/null
+++ b/src/plugins/qnx/qnxrunconfigurationfactory.h
@@ -0,0 +1,68 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXRUNCONFIGURATIONFACTORY_H
+#define QNX_INTERNAL_QNXRUNCONFIGURATIONFACTORY_H
+
+#include <projectexplorer/runconfiguration.h>
+
+namespace Qnx {
+namespace Internal {
+
+class QnxRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
+{
+ Q_OBJECT
+public:
+ explicit QnxRunConfigurationFactory(QObject *parent = 0);
+
+ QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const;
+ QString displayNameForId(const Core::Id id) const;
+
+ bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
+ ProjectExplorer::RunConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id);
+
+ bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
+ ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent,
+ const QVariantMap &map);
+
+ bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const;
+ ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent,
+ ProjectExplorer::RunConfiguration *source);
+
+ bool canHandle(ProjectExplorer::Target *t) const;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXRUNCONFIGURATIONFACTORY_H
diff --git a/src/plugins/qnx/qnxruncontrol.cpp b/src/plugins/qnx/qnxruncontrol.cpp
new file mode 100644
index 0000000000..187317fe11
--- /dev/null
+++ b/src/plugins/qnx/qnxruncontrol.cpp
@@ -0,0 +1,52 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxruncontrol.h"
+#include "qnxapplicationrunner.h"
+#include "qnxrunconfiguration.h"
+
+#include <projectexplorer/runconfiguration.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+QnxRunControl::QnxRunControl(ProjectExplorer::RunConfiguration *runConfig)
+ : RemoteLinux::AbstractRemoteLinuxRunControl(runConfig)
+ , m_runner(new QnxApplicationRunner(qobject_cast<QnxRunConfiguration *>(runConfig), this))
+{
+}
+
+RemoteLinux::AbstractRemoteLinuxApplicationRunner *QnxRunControl::runner() const
+{
+ return m_runner;
+}
diff --git a/src/plugins/qnx/qnxruncontrol.h b/src/plugins/qnx/qnxruncontrol.h
new file mode 100644
index 0000000000..f96ac525d0
--- /dev/null
+++ b/src/plugins/qnx/qnxruncontrol.h
@@ -0,0 +1,59 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXRUNCONTROL_H
+#define QNX_INTERNAL_QNXRUNCONTROL_H
+
+#include <remotelinux/remotelinuxruncontrol.h>
+
+namespace Qnx {
+namespace Internal {
+
+class QnxApplicationRunner;
+
+class QnxRunControl : public RemoteLinux::AbstractRemoteLinuxRunControl
+{
+ Q_OBJECT
+public:
+ explicit QnxRunControl(ProjectExplorer::RunConfiguration *runConfig);
+
+ RemoteLinux::AbstractRemoteLinuxApplicationRunner *runner() const;
+
+private:
+ QnxApplicationRunner * const m_runner;
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXRUNCONTROL_H
diff --git a/src/plugins/qnx/qnxruncontrolfactory.cpp b/src/plugins/qnx/qnxruncontrolfactory.cpp
new file mode 100644
index 0000000000..b0125af6c8
--- /dev/null
+++ b/src/plugins/qnx/qnxruncontrolfactory.cpp
@@ -0,0 +1,153 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxruncontrolfactory.h"
+#include "qnxconstants.h"
+#include "qnxrunconfiguration.h"
+#include "qnxdebugsupport.h"
+#include "qnxqtversion.h"
+#include "qnxruncontrol.h"
+#include "qnxutils.h"
+#include "qnxdeviceconfiguration.h"
+
+#include <debugger/debuggerengine.h>
+#include <debugger/debuggerplugin.h>
+#include <debugger/debuggerrunner.h>
+#include <debugger/debuggerstartparameters.h>
+#include <debugger/debuggerprofileinformation.h>
+#include <projectexplorer/target.h>
+#include <projectexplorer/toolchain.h>
+#include <qt4projectmanager/qt4buildconfiguration.h>
+#include <qtsupport/qtprofileinformation.h>
+#include <utils/portlist.h>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+QnxRunControlFactory::QnxRunControlFactory(QObject *parent)
+ : IRunControlFactory(parent)
+{
+}
+
+QnxRunControlFactory::~QnxRunControlFactory()
+{
+}
+
+bool QnxRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const
+{
+ if (mode != ProjectExplorer::NormalRunMode && mode != ProjectExplorer::DebugRunMode)
+ return false;
+
+ if (!runConfiguration->isEnabled()
+ || !runConfiguration->id().toString().startsWith(QLatin1String(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX))) {
+ return false;
+ }
+
+
+ const QnxRunConfiguration * const rc = qobject_cast<QnxRunConfiguration *>(runConfiguration);
+ if (mode == ProjectExplorer::DebugRunMode) {
+ const QnxDeviceConfiguration::ConstPtr dev = ProjectExplorer::DeviceProfileInformation::device(runConfiguration->target()->profile())
+ .dynamicCast<const QnxDeviceConfiguration>();
+ if (dev.isNull())
+ return false;
+ return rc->portsUsedByDebuggers() <= dev->freePorts().count();
+ }
+ return true;
+}
+
+ProjectExplorer::RunControl *QnxRunControlFactory::create(ProjectExplorer::RunConfiguration *runConfig, ProjectExplorer::RunMode mode)
+{
+ Q_ASSERT(canRun(runConfig, mode));
+
+ QnxRunConfiguration *rc = qobject_cast<QnxRunConfiguration *>(runConfig);
+ Q_ASSERT(rc);
+ if (mode == ProjectExplorer::NormalRunMode)
+ return new QnxRunControl(rc);
+
+ const Debugger::DebuggerStartParameters params = startParameters(rc);
+ Debugger::DebuggerRunControl * const runControl = Debugger::DebuggerPlugin::createDebugger(params, rc);
+ if (!runControl)
+ return 0;
+
+ QnxDebugSupport *debugSupport = new QnxDebugSupport(rc, runControl->engine());
+ connect(runControl, SIGNAL(finished()), debugSupport, SLOT(handleDebuggingFinished()));
+
+ return runControl;
+}
+
+QString QnxRunControlFactory::displayName() const
+{
+ return tr("Run on remote QNX device");
+}
+
+ProjectExplorer::RunConfigWidget *QnxRunControlFactory::createConfigurationWidget(ProjectExplorer::RunConfiguration *config)
+{
+ Q_UNUSED(config)
+ return 0;
+}
+
+Debugger::DebuggerStartParameters QnxRunControlFactory::startParameters(
+ const QnxRunConfiguration *runConfig)
+{
+ Debugger::DebuggerStartParameters params;
+ ProjectExplorer::Target *target = runConfig->target();
+ ProjectExplorer::Profile *profile = target->profile();
+
+ const QnxDeviceConfiguration::ConstPtr devConf = ProjectExplorer::DeviceProfileInformation::device(runConfig->target()->profile())
+ .dynamicCast<const QnxDeviceConfiguration>();
+ if (devConf.isNull())
+ return params;
+
+ params.startMode = Debugger::AttachToRemoteServer;
+ params.debuggerCommand = Debugger::DebuggerProfileInformation::debuggerCommand(profile).toString();
+ params.sysRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(profile).toString();
+
+ if (ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(profile)) {
+ params.toolChainAbi = tc->targetAbi();
+ params.remoteArchitecture = ProjectExplorer::Abi::toString(tc->targetAbi().architecture());
+ }
+
+ params.symbolFileName = runConfig->localExecutableFilePath();
+ params.remoteExecutable = runConfig->remoteExecutableFilePath();
+ params.remoteChannel = devConf->sshParameters().host + QLatin1String(":-1");
+ params.displayName = runConfig->displayName();
+ params.remoteSetupNeeded = true;
+ params.closeMode = Debugger::DetachAtClose;
+
+ QnxQtVersion *qtVersion =
+ dynamic_cast<QnxQtVersion *>(QtSupport::QtProfileInformation::qtVersion(profile));
+ if (qtVersion)
+ params.solibSearchPath = QnxUtils::searchPaths(qtVersion);
+
+ return params;
+}
diff --git a/src/plugins/qnx/qnxruncontrolfactory.h b/src/plugins/qnx/qnxruncontrolfactory.h
new file mode 100644
index 0000000000..7c63b70f36
--- /dev/null
+++ b/src/plugins/qnx/qnxruncontrolfactory.h
@@ -0,0 +1,67 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXRUNCONTROLFACTORY_H
+#define QNX_INTERNAL_QNXRUNCONTROLFACTORY_H
+
+#include <debugger/debuggerstartparameters.h>
+#include <projectexplorer/runconfiguration.h>
+
+namespace Qnx {
+namespace Internal {
+
+class QnxRunConfiguration;
+
+class QnxRunControlFactory : public ProjectExplorer::IRunControlFactory
+{
+ Q_OBJECT
+public:
+ explicit QnxRunControlFactory(QObject *parent = 0);
+ ~QnxRunControlFactory();
+
+ QString displayName() const;
+ ProjectExplorer::RunConfigWidget *createConfigurationWidget(ProjectExplorer::RunConfiguration *runConfiguration);
+
+ bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
+ ProjectExplorer::RunMode mode) const;
+ ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
+ ProjectExplorer::RunMode mode);
+
+private:
+ static Debugger::DebuggerStartParameters startParameters( const QnxRunConfiguration *runConfig);
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXRUNCONTROLFACTORY_H
diff --git a/src/plugins/qnx/qnxutils.cpp b/src/plugins/qnx/qnxutils.cpp
new file mode 100644
index 0000000000..4ef95137c9
--- /dev/null
+++ b/src/plugins/qnx/qnxutils.cpp
@@ -0,0 +1,77 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#include "qnxutils.h"
+
+#include "qnxabstractqtversion.h"
+
+#include <QDir>
+
+using namespace Qnx;
+using namespace Qnx::Internal;
+
+QString QnxUtils::addQuotes(const QString &string)
+{
+ return QLatin1Char('"') + string + QLatin1Char('"');
+}
+
+Qnx::QnxArchitecture QnxUtils::cpudirToArch(const QString &cpuDir)
+{
+ if (cpuDir == QLatin1String("x86"))
+ return Qnx::X86;
+ else if (cpuDir == QLatin1String("armle-v7"))
+ return Qnx::ArmLeV7;
+ else
+ return Qnx::UnknownArch;
+}
+
+QStringList QnxUtils::searchPaths(QnxAbstractQtVersion *qtVersion)
+{
+ const QDir pluginDir(qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_PLUGINS")));
+ const QStringList pluginSubDirs = pluginDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
+
+ QStringList searchPaths;
+
+ Q_FOREACH (const QString &dir, pluginSubDirs) {
+ searchPaths << qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_PLUGINS"))
+ + QLatin1Char('/') + dir;
+ }
+
+ searchPaths << qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_LIBS"));
+ searchPaths << qtVersion->qnxTarget() + QLatin1Char('/') + qtVersion->archString().toLower()
+ + QLatin1String("/lib");
+ searchPaths << qtVersion->qnxTarget() + QLatin1Char('/') + qtVersion->archString().toLower()
+ + QLatin1String("/usr/lib");
+
+ return searchPaths;
+}
diff --git a/src/plugins/qnx/qnxutils.h b/src/plugins/qnx/qnxutils.h
new file mode 100644
index 0000000000..1195f87c57
--- /dev/null
+++ b/src/plugins/qnx/qnxutils.h
@@ -0,0 +1,57 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (C) 2011 - 2012 Research In Motion
+**
+** Contact: Research In Motion (blackberry-qt@qnx.com)
+** Contact: KDAB (info@kdab.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+
+#ifndef QNX_INTERNAL_QNXUTILS_H
+#define QNX_INTERNAL_QNXUTILS_H
+
+#include "qnxconstants.h"
+
+#include <QString>
+
+namespace Qnx {
+namespace Internal {
+
+class QnxAbstractQtVersion;
+
+class QnxUtils
+{
+public:
+ static QString addQuotes(const QString &string);
+ static Qnx::QnxArchitecture cpudirToArch(const QString &cpuDir);
+ static QStringList searchPaths(QnxAbstractQtVersion *qtVersion);
+};
+
+} // namespace Internal
+} // namespace Qnx
+
+#endif // QNX_INTERNAL_QNXUTILS_H
diff --git a/src/plugins/remotelinux/linuxdevicetester.cpp b/src/plugins/remotelinux/linuxdevicetester.cpp
index 547d7731be..24b2f52f9e 100644
--- a/src/plugins/remotelinux/linuxdevicetester.cpp
+++ b/src/plugins/remotelinux/linuxdevicetester.cpp
@@ -115,6 +115,11 @@ void GenericLinuxDeviceTester::stopTest()
setFinished(TestFailure);
}
+RemoteLinuxUsedPortsGatherer *GenericLinuxDeviceTester::usedPortsGatherer() const
+{
+ return &d->portsGatherer;
+}
+
void GenericLinuxDeviceTester::handleConnected()
{
QTC_ASSERT(d->state == Connecting, return);
diff --git a/src/plugins/remotelinux/linuxdevicetester.h b/src/plugins/remotelinux/linuxdevicetester.h
index e8c3aa0053..e21d83b099 100644
--- a/src/plugins/remotelinux/linuxdevicetester.h
+++ b/src/plugins/remotelinux/linuxdevicetester.h
@@ -45,6 +45,7 @@ class SshConnection;
namespace RemoteLinux {
class LinuxDeviceConfiguration;
+class RemoteLinuxUsedPortsGatherer;
namespace Internal {
class GenericLinuxDeviceTesterPrivate;
@@ -80,6 +81,8 @@ public:
void testDevice(const QSharedPointer<const LinuxDeviceConfiguration> &deviceConfiguration);
void stopTest();
+ RemoteLinuxUsedPortsGatherer *usedPortsGatherer() const;
+
private slots:
void handleConnected();
void handleConnectionFailure();
diff --git a/src/plugins/remotelinux/remotelinuxapplicationrunner.cpp b/src/plugins/remotelinux/remotelinuxapplicationrunner.cpp
index 5744373eea..795f6b5123 100644
--- a/src/plugins/remotelinux/remotelinuxapplicationrunner.cpp
+++ b/src/plugins/remotelinux/remotelinuxapplicationrunner.cpp
@@ -122,7 +122,7 @@ LinuxDeviceConfiguration::ConstPtr AbstractRemoteLinuxApplicationRunner::devConf
return d->devConfig;
}
-const RemoteLinuxUsedPortsGatherer *AbstractRemoteLinuxApplicationRunner::usedPortsGatherer() const
+RemoteLinuxUsedPortsGatherer *AbstractRemoteLinuxApplicationRunner::usedPortsGatherer() const
{
return &d->portsGatherer;
}
diff --git a/src/plugins/remotelinux/remotelinuxapplicationrunner.h b/src/plugins/remotelinux/remotelinuxapplicationrunner.h
index b23198778d..b67c246e08 100644
--- a/src/plugins/remotelinux/remotelinuxapplicationrunner.h
+++ b/src/plugins/remotelinux/remotelinuxapplicationrunner.h
@@ -64,7 +64,7 @@ public:
QSharedPointer<const LinuxDeviceConfiguration> devConfig() const;
QSsh::SshConnection *connection() const;
- const RemoteLinuxUsedPortsGatherer *usedPortsGatherer() const;
+ RemoteLinuxUsedPortsGatherer *usedPortsGatherer() const;
Utils::PortList *freePorts();
QString remoteExecutable() const;
QString arguments() const;
diff --git a/src/plugins/remotelinux/remotelinuxusedportsgatherer.cpp b/src/plugins/remotelinux/remotelinuxusedportsgatherer.cpp
index e40c37a0d7..e2fafd760d 100644
--- a/src/plugins/remotelinux/remotelinuxusedportsgatherer.cpp
+++ b/src/plugins/remotelinux/remotelinuxusedportsgatherer.cpp
@@ -55,6 +55,7 @@ class RemoteLinuxUsedPortsGathererPrivate
QList<int> usedPorts;
QByteArray remoteStdout;
QByteArray remoteStderr;
+ QString command;
};
} // namespace Internal
@@ -90,18 +91,21 @@ void RemoteLinuxUsedPortsGatherer::start(const LinuxDeviceConfiguration::ConstPt
void RemoteLinuxUsedPortsGatherer::handleConnectionEstablished()
{
- QString procFilePath;
- int addressLength;
- if (d->connection->connectionInfo().localAddress.protocol() == QAbstractSocket::IPv4Protocol) {
- procFilePath = QLatin1String("/proc/net/tcp");
- addressLength = 8;
- } else {
- procFilePath = QLatin1String("/proc/net/tcp6");
- addressLength = 32;
+ QString command = d->command;
+ if (command.isEmpty()) {
+ QString procFilePath;
+ int addressLength;
+ if (d->connection->connectionInfo().localAddress.protocol() == QAbstractSocket::IPv4Protocol) {
+ procFilePath = QLatin1String("/proc/net/tcp");
+ addressLength = 8;
+ } else {
+ procFilePath = QLatin1String("/proc/net/tcp6");
+ addressLength = 32;
+ }
+ command = QString::fromLatin1("sed "
+ "'s/.*: [[:xdigit:]]\\{%1\\}:\\([[:xdigit:]]\\{4\\}\\).*/\\1/g' %2")
+ .arg(addressLength).arg(procFilePath);
}
- const QString command = QString::fromLatin1("sed "
- "'s/.*: [[:xdigit:]]\\{%1\\}:\\([[:xdigit:]]\\{4\\}\\).*/\\1/g' %2")
- .arg(addressLength).arg(procFilePath);
d->process = d->connection->createRemoteProcess(command.toUtf8());
connect(d->process.data(), SIGNAL(closed(int)), SLOT(handleProcessClosed(int)));
@@ -141,6 +145,11 @@ QList<int> RemoteLinuxUsedPortsGatherer::usedPorts() const
return d->usedPorts;
}
+void RemoteLinuxUsedPortsGatherer::setCommand(const QString &command)
+{
+ d->command = command;
+}
+
void RemoteLinuxUsedPortsGatherer::setupUsedPorts()
{
QList<QByteArray> portStrings = d->remoteStdout.split('\n');
diff --git a/src/plugins/remotelinux/remotelinuxusedportsgatherer.h b/src/plugins/remotelinux/remotelinuxusedportsgatherer.h
index f3efb31ee1..0d215ba697 100644
--- a/src/plugins/remotelinux/remotelinuxusedportsgatherer.h
+++ b/src/plugins/remotelinux/remotelinuxusedportsgatherer.h
@@ -60,6 +60,8 @@ public:
int getNextFreePort(Utils::PortList *freePorts) const; // returns -1 if no more are left
QList<int> usedPorts() const;
+ void setCommand(const QString &command); // Will use default command if not set
+
signals:
void error(const QString &errMsg);
void portListReady();