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

Proposed by Alexandre Abreu
Status: Merged
Approved by: Alberto Mardegan
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) Approve
PS Jenkins bot (community) continuous-integration Approve
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.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alberto Mardegan (mardy) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Ubuntu/UnityWebApps/UnityWebApps.qml'
--- src/Ubuntu/UnityWebApps/UnityWebApps.qml 2015-07-10 17:58:08 +0000
+++ src/Ubuntu/UnityWebApps/UnityWebApps.qml 2016-02-26 19:27:49 +0000
@@ -152,6 +152,15 @@
152 property var customBackendProxies: null152 property var customBackendProxies: null
153153
154 /*!154 /*!
155 \qmlproperty string [optional] UnityWebApps::embeddedUiComponentParent
156
157 Specifies a parent view for potential embedded ui components being created
158 by using api.launchEmbeddedUI
159
160 */
161 property var embeddedUiComponentParent: null
162
163 /*!
155 \qmlproperty string UnityWebApps::_opt_clientApiFileUrl164 \qmlproperty string UnityWebApps::_opt_clientApiFileUrl
156165
157 Used only for testing.166 Used only for testing.
@@ -651,6 +660,11 @@
651660
652 var uicomponent;661 var uicomponent;
653 function onCreated() {662 function onCreated() {
663 if (uicomponent.status == Component.Error) {
664 console.log("Error loading embedded ui component:", uicomponent.errorString())
665 return
666 }
667
654 var args = {}668 var args = {}
655 for (var k in params) {669 for (var k in params) {
656 if (params.hasOwnProperty(k)) {670 if (params.hasOwnProperty(k)) {
@@ -680,8 +694,8 @@
680 uiobject.onCompleted.connect(_onCompleted);694 uiobject.onCompleted.connect(_onCompleted);
681 };695 };
682696
683 var uicomponent = Qt.createComponent(path + "/" + name + ".qml");697 uicomponent = Qt.createComponent(path + "/" + name + ".qml");
684 if (uicomponent.status === Component.Ready)698 if (uicomponent.status == Component.Ready)
685 onCreated()699 onCreated()
686 else700 else
687 uicomponent.statusChanged.connect(onCreated)701 uicomponent.statusChanged.connect(onCreated)
688702
=== modified file 'src/Ubuntu/UnityWebApps/UnityWebAppsBackendComponents.js'
--- src/Ubuntu/UnityWebApps/UnityWebAppsBackendComponents.js 2014-05-16 16:29:35 +0000
+++ src/Ubuntu/UnityWebApps/UnityWebAppsBackendComponents.js 2016-02-26 19:27:49 +0000
@@ -203,7 +203,13 @@
203 },203 },
204204
205 parentView: function() {205 parentView: function() {
206 return this._parent ? this._parent.bindee : null;206 if (! this._parent) {
207 return null
208 }
209 if (this._parent.embeddedUiComponentParent) {
210 return this._parent.embeddedUiComponentParent
211 }
212 return this._parent.bindee
207 },213 },
208214
209 isObjectProxyInfo: function(info) {215 isObjectProxyInfo: function(info) {

Subscribers

People subscribed via source and target branches

to all changes: