Merge lp:~abreu-alexandre/cordova-ubuntu/expose-mainview into lp:cordova-ubuntu/2.8

Proposed by Alexandre Abreu
Status: Merged
Approved by: Alexandre Abreu
Approved revision: 254
Merged at revision: 252
Proposed branch: lp:~abreu-alexandre/cordova-ubuntu/expose-mainview
Merge into: lp:cordova-ubuntu/2.8
Diff against target: 64 lines (+14/-0)
3 files modified
Cordovaqt/CordovaViewInternal.qml (+5/-0)
qml/CordovaView.qml.in (+6/-0)
src/qmlplugin.h (+3/-0)
To merge this branch: bzr merge lp:~abreu-alexandre/cordova-ubuntu/expose-mainview
Reviewer Review Type Date Requested Status
Alexandre Abreu (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+203621@code.launchpad.net

Commit message

Expose the main webview to allow external elements to bind to possibly it.

Description of the change

Expose the main webview to allow external elements to bind to possibly it.

To post a comment you must log in.
Revision history for this message
Robert Bruce Park (robru) wrote :

How do I test this one? ;-)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandre Abreu (abreu-alexandre) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Cordovaqt/CordovaViewInternal.qml'
--- Cordovaqt/CordovaViewInternal.qml 2013-08-23 17:14:42 +0000
+++ Cordovaqt/CordovaViewInternal.qml 2014-01-28 19:21:13 +0000
@@ -13,6 +13,9 @@
13 property string wwwDir13 property string wwwDir
14 property string splashscreenPath14 property string splashscreenPath
15 property string inappbrowserUrl15 property string inappbrowserUrl
16
17 property var mainWebview
18
16 function exec(plugin, func, args) {19 function exec(plugin, func, args) {
17 CordovaWrapper.execMethod(plugin, func, args);20 CordovaWrapper.execMethod(plugin, func, args);
18 }21 }
@@ -101,6 +104,8 @@
101104
102 Component.onCompleted: {105 Component.onCompleted: {
103 webView.url = cordova.mainUrl106 webView.url = cordova.mainUrl
107
108 root.mainWebview = webView;
104 }109 }
105110
106 onTitleChanged: {111 onTitleChanged: {
107112
=== modified file 'qml/CordovaView.qml.in'
--- qml/CordovaView.qml.in 2013-07-17 02:52:18 +0000
+++ qml/CordovaView.qml.in 2014-01-28 19:21:13 +0000
@@ -4,6 +4,7 @@
4Item {4Item {
5 id: root5 id: root
6 property string wwwDir6 property string wwwDir
7 property var mainWebview
78
8 Cordova {9 Cordova {
9 id: cordova10 id: cordova
@@ -16,10 +17,15 @@
16 Loader {17 Loader {
17 id: loader18 id: loader
18 asynchronous: true19 asynchronous: true
20
19 visible: false21 visible: false
20 anchors.fill: parent22 anchors.fill: parent
23
21 onLoaded: {24 onLoaded: {
25 root.mainWebview = loader.item.mainWebview
26
22 cordova.parent = loader.item27 cordova.parent = loader.item
28
23 loader.item.completed.connect(function(){29 loader.item.completed.connect(function(){
24 loader.item.visible = true30 loader.item.visible = true
25 loader.visible = true31 loader.visible = true
2632
=== modified file 'src/qmlplugin.h'
--- src/qmlplugin.h 2013-07-17 02:52:18 +0000
+++ src/qmlplugin.h 2014-01-28 19:21:13 +0000
@@ -22,6 +22,9 @@
22 }22 }
2323
24 void setWwwDir(const QString &www) {24 void setWwwDir(const QString &www) {
25 if (www.trimmed().isEmpty()) {
26 return;
27 }
25 assert(!m_cordova.data());28 assert(!m_cordova.data());
26 m_cordova = QSharedPointer<Cordova>(new Cordova(QDir(www), this));29 m_cordova = QSharedPointer<Cordova>(new Cordova(QDir(www), this));
27 m_wwwDir = www;30 m_wwwDir = www;

Subscribers

People subscribed via source and target branches