diff options
author | Robert Griebl <robert.griebl@pelagicore.com> | 2018-10-17 18:05:05 +0200 |
---|---|---|
committer | Daniel d'Andrada <daniel.dandrada@luxoft.com> | 2018-10-24 14:54:55 +0000 |
commit | 68c88b3456c20bcdea5df1b297fce03deed954ed (patch) | |
tree | fe7637a99ffc90d16a6e918df63f08ead325f9fa /examples/applicationmanager/intents/apps | |
parent | 5c08826b6c794fe67ed2ebecca4a53ecf918ecca (diff) |
Heavily extended the intents example
These intents features are now available:
- requests from the system-ui
- disambiguation when no applicationId is specified
- requesting from/replying to an in-process app
(green is always running as a single-process app)
- private intents (blue-window-private)
- intents that require capabilities
(only the sysui and red can call rotate-window on blue)
Also, the example wrapper script is now able to deal with
developer builds.
Change-Id: I9ff2d6012b2c9cf29e32abaaa7d4fa3b3122944e
Reviewed-by: Daniel d'Andrada <daniel.dandrada@luxoft.com>
Diffstat (limited to 'examples/applicationmanager/intents/apps')
12 files changed, 52 insertions, 91 deletions
diff --git a/examples/applicationmanager/intents/apps/hello-world.blue/info.yaml b/examples/applicationmanager/intents/apps/hello-world.blue/info.yaml deleted file mode 100644 index 876f2ed9..00000000 --- a/examples/applicationmanager/intents/apps/hello-world.blue/info.yaml +++ /dev/null @@ -1,15 +0,0 @@ -formatVersion: 1 -formatType: am-application ---- -id: 'hello-world.blue' -icon: 'icon.png' -code: 'main.qml' -runtime: 'qml' -name: - en: 'Hello Blue' - -intents: -- id: io.qt.blue - requiredCapabilities: [ "foo" ] -- id: io.qt.blue.private - visibility: private diff --git a/examples/applicationmanager/intents/apps/hello-world.green/info.yaml b/examples/applicationmanager/intents/apps/hello-world.green/info.yaml deleted file mode 100644 index 4455d4b5..00000000 --- a/examples/applicationmanager/intents/apps/hello-world.green/info.yaml +++ /dev/null @@ -1,13 +0,0 @@ -formatVersion: 1 -formatType: am-application ---- -id: 'hello-world.green' -icon: 'icon.png' -code: 'main.qml' -runtime: 'qml' -name: - en: 'Hello Green' - -intents: - - id: io.qt.green - parameterMatch: { "url": "^image/.*$" } diff --git a/examples/applicationmanager/intents/apps/hello-world.red/info.yaml b/examples/applicationmanager/intents/apps/hello-world.red/info.yaml deleted file mode 100644 index 2663f608..00000000 --- a/examples/applicationmanager/intents/apps/hello-world.red/info.yaml +++ /dev/null @@ -1,14 +0,0 @@ -formatVersion: 1 -formatType: am-application ---- -id: 'hello-world.red' -icon: 'icon.png' -code: 'main.qml' -runtime: 'qml' -name: - en: 'Hello Red' - -capabilities: 'foo' - -intents: -- id: io.qt.red diff --git a/examples/applicationmanager/intents/apps/hello-world.blue/icon.png b/examples/applicationmanager/intents/apps/intents.blue/icon.png Binary files differindex be6ffc57..be6ffc57 100644 --- a/examples/applicationmanager/intents/apps/hello-world.blue/icon.png +++ b/examples/applicationmanager/intents/apps/intents.blue/icon.png diff --git a/examples/applicationmanager/intents/apps/intents.blue/info.yaml b/examples/applicationmanager/intents/apps/intents.blue/info.yaml new file mode 100644 index 00000000..19f252c4 --- /dev/null +++ b/examples/applicationmanager/intents/apps/intents.blue/info.yaml @@ -0,0 +1,17 @@ +formatVersion: 1 +formatType: am-application +--- +id: 'intents.blue' +icon: 'icon.png' +code: 'main.qml' +runtime: 'qml' +name: + en: 'Blue Intents' + +intents: +- id: rotate-window + requiredCapabilities: [ 'call-blue' ] +- id: scale-window +- id: blink-window +- id: blue-window-private + visibility: private diff --git a/examples/applicationmanager/intents/apps/hello-world.green/main.qml b/examples/applicationmanager/intents/apps/intents.blue/main.qml index 2c0dea9e..6f2df6c6 100644 --- a/examples/applicationmanager/intents/apps/hello-world.green/main.qml +++ b/examples/applicationmanager/intents/apps/intents.blue/main.qml @@ -50,14 +50,6 @@ ** ****************************************************************************/ -import QtQuick 2.4 -import QtApplicationManager 1.0 +import "../../shared" -ApplicationManagerWindow { - color: "Green" - - Text { - anchors.centerIn: parent - text: "Hello World!" - } -} +IntentClient { } diff --git a/examples/applicationmanager/intents/apps/hello-world.green/icon.png b/examples/applicationmanager/intents/apps/intents.green/icon.png Binary files differindex b149340c..b149340c 100644 --- a/examples/applicationmanager/intents/apps/hello-world.green/icon.png +++ b/examples/applicationmanager/intents/apps/intents.green/icon.png diff --git a/examples/applicationmanager/intents/apps/intents.green/info.yaml b/examples/applicationmanager/intents/apps/intents.green/info.yaml new file mode 100644 index 00000000..97503419 --- /dev/null +++ b/examples/applicationmanager/intents/apps/intents.green/info.yaml @@ -0,0 +1,13 @@ +formatVersion: 1 +formatType: am-application +--- +id: 'intents.green' +icon: 'icon.png' +code: 'main.qml' +runtime: 'qml-inprocess' +name: + en: 'Green Intents' + +intents: +- id: rotate-window +- id: scale-window diff --git a/examples/applicationmanager/intents/apps/hello-world.blue/main.qml b/examples/applicationmanager/intents/apps/intents.green/main.qml index 81ea5b22..6f2df6c6 100644 --- a/examples/applicationmanager/intents/apps/hello-world.blue/main.qml +++ b/examples/applicationmanager/intents/apps/intents.green/main.qml @@ -50,21 +50,6 @@ ** ****************************************************************************/ -import QtQuick 2.4 -import QtApplicationManager 1.0 +import "../../shared" -ApplicationManagerWindow { - color: "blue" - - Text { - anchors.centerIn: parent - text: "Hello World!" - } - - IntentHandler { - intentIds: [ "io.qt.blue" ] - onReceivedRequest: { - request.sendReply({ "this": "is a result", "nested": { "a": 1, "b": 2 } }) - } - } -} +IntentClient { } diff --git a/examples/applicationmanager/intents/apps/hello-world.red/icon.png b/examples/applicationmanager/intents/apps/intents.red/icon.png Binary files differindex 04ca44dd..04ca44dd 100644 --- a/examples/applicationmanager/intents/apps/hello-world.red/icon.png +++ b/examples/applicationmanager/intents/apps/intents.red/icon.png diff --git a/examples/applicationmanager/intents/apps/intents.red/info.yaml b/examples/applicationmanager/intents/apps/intents.red/info.yaml new file mode 100644 index 00000000..a08392fc --- /dev/null +++ b/examples/applicationmanager/intents/apps/intents.red/info.yaml @@ -0,0 +1,16 @@ +formatVersion: 1 +formatType: am-application +--- +id: 'intents.red' +icon: 'icon.png' +code: 'main.qml' +runtime: 'qml' +name: + en: 'Red Intents' + +capabilities: 'call-blue' + +intents: +- id: rotate-window +- id: scale-window +- id: blink-window diff --git a/examples/applicationmanager/intents/apps/hello-world.red/main.qml b/examples/applicationmanager/intents/apps/intents.red/main.qml index b1cce59b..6f2df6c6 100644 --- a/examples/applicationmanager/intents/apps/hello-world.red/main.qml +++ b/examples/applicationmanager/intents/apps/intents.red/main.qml @@ -50,26 +50,6 @@ ** ****************************************************************************/ -import QtQuick 2.4 -import QtApplicationManager 1.0 +import "../../shared" -ApplicationManagerWindow { - color: "red" - - Text { - anchors.fill: parent - text: "Hello World!" - - MouseArea { - anchors.fill: parent - onClicked: { - var request = ApplicationInterface.createIntentRequest("io.qt.blue", { "hello": "world", "number": 42 }) - request.onFinished.connect(function() { - console.warn("Request finished " + request.requestId - + (request.succeeded ? (" Result: " + JSON.stringify(request.result)) - : (" Error: " + request.errorString))) - }) - } - } - } -} +IntentClient { } |