Merge lp:~abreu-alexandre/unity-webapps-qml/embedded-ui-api-parent-view-property into lp:unity-webapps-qml

Proposed by Alexandre Abreu on 2016-02-26
Status: Merged
Approved by: Alberto Mardegan on 2016-03-30
Approved revision: 157
Merged at revision: 157
Proposed branch: lp:~abreu-alexandre/unity-webapps-qml/embedded-ui-api-parent-view-property
Merge into: lp:unity-webapps-qml
Diff against target: 61 lines (+23/-3)
2 files modified
src/Ubuntu/UnityWebApps/UnityWebApps.qml (+16/-2)
src/Ubuntu/UnityWebApps/UnityWebAppsBackendComponents.js (+7/-1)
To merge this branch: bzr merge lp:~abreu-alexandre/unity-webapps-qml/embedded-ui-api-parent-view-property
Reviewer Review Type Date Requested Status
Alberto Mardegan (community) 2016-02-26 Approve on 2016-03-30
PS Jenkins bot (community) continuous-integration Approve on 2016-02-26
Review via email: mp+287357@code.launchpad.net

Commit message

Allow one to specify a parent for embedded uis being launched by webapps

Description of the change

Allow one to specify a parent for embedded uis being launched by webapps

To post a comment you must log in.
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Alberto Mardegan (mardy) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/UnityWebApps/UnityWebApps.qml'
2--- src/Ubuntu/UnityWebApps/UnityWebApps.qml 2015-07-10 17:58:08 +0000
3+++ src/Ubuntu/UnityWebApps/UnityWebApps.qml 2016-02-26 19:27:49 +0000
4@@ -152,6 +152,15 @@
5 property var customBackendProxies: null
6
7 /*!
8+ \qmlproperty string [optional] UnityWebApps::embeddedUiComponentParent
9+
10+ Specifies a parent view for potential embedded ui components being created
11+ by using api.launchEmbeddedUI
12+
13+ */
14+ property var embeddedUiComponentParent: null
15+
16+ /*!
17 \qmlproperty string UnityWebApps::_opt_clientApiFileUrl
18
19 Used only for testing.
20@@ -651,6 +660,11 @@
21
22 var uicomponent;
23 function onCreated() {
24+ if (uicomponent.status == Component.Error) {
25+ console.log("Error loading embedded ui component:", uicomponent.errorString())
26+ return
27+ }
28+
29 var args = {}
30 for (var k in params) {
31 if (params.hasOwnProperty(k)) {
32@@ -680,8 +694,8 @@
33 uiobject.onCompleted.connect(_onCompleted);
34 };
35
36- var uicomponent = Qt.createComponent(path + "/" + name + ".qml");
37- if (uicomponent.status === Component.Ready)
38+ uicomponent = Qt.createComponent(path + "/" + name + ".qml");
39+ if (uicomponent.status == Component.Ready)
40 onCreated()
41 else
42 uicomponent.statusChanged.connect(onCreated)
43
44=== modified file 'src/Ubuntu/UnityWebApps/UnityWebAppsBackendComponents.js'
45--- src/Ubuntu/UnityWebApps/UnityWebAppsBackendComponents.js 2014-05-16 16:29:35 +0000
46+++ src/Ubuntu/UnityWebApps/UnityWebAppsBackendComponents.js 2016-02-26 19:27:49 +0000
47@@ -203,7 +203,13 @@
48 },
49
50 parentView: function() {
51- return this._parent ? this._parent.bindee : null;
52+ if (! this._parent) {
53+ return null
54+ }
55+ if (this._parent.embeddedUiComponentParent) {
56+ return this._parent.embeddedUiComponentParent
57+ }
58+ return this._parent.bindee
59 },
60
61 isObjectProxyInfo: function(info) {

Subscribers

People subscribed via source and target branches

to all changes: