Merge lp:~mardy/ubuntu-system-settings-online-accounts/popups-1428591 into lp:ubuntu-system-settings-online-accounts

Proposed by Alberto Mardegan
Status: Merged
Approved by: David Barth
Approved revision: 350
Merged at revision: 356
Proposed branch: lp:~mardy/ubuntu-system-settings-online-accounts/popups-1428591
Merge into: lp:ubuntu-system-settings-online-accounts
Diff against target: 85 lines (+38/-12)
3 files modified
plugins/module/ChromedWebView.qml (+18/-0)
plugins/module/WebView.qml (+19/-12)
plugins/module/module.pro (+1/-0)
To merge this branch: bzr merge lp:~mardy/ubuntu-system-settings-online-accounts/popups-1428591
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Pending
Online Accounts Pending
Review via email: mp+295478@code.launchpad.net

Commit message

Open popups in an overlaid webview

Description of the change

Open popups in an overlaid wabview

To post a comment you must log in.
347. By Alberto Mardegan

Install new QML file

348. By Alberto Mardegan

skip tests on arm64

349. By Alberto Mardegan

Add missing import

350. By Alberto Mardegan

Revert arm64 change, will be fixed in a separate MP

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'plugins/module/ChromedWebView.qml'
2--- plugins/module/ChromedWebView.qml 1970-01-01 00:00:00 +0000
3+++ plugins/module/ChromedWebView.qml 2016-06-06 12:10:41 +0000
4@@ -0,0 +1,18 @@
5+import QtQuick 2.0
6+import Ubuntu.Components 1.3
7+import Ubuntu.Web 0.2
8+
9+WebView {
10+ id: root
11+
12+ /* Taken from webbrowser-app */
13+ ProgressBar {
14+ anchors.top: parent.top
15+ anchors.left: parent.left
16+ anchors.right: parent.right
17+ height: units.dp(3)
18+ showProgressPercentage: false
19+ visible: root.loading
20+ value: root.loadProgress / 100
21+ }
22+}
23
24=== modified file 'plugins/module/WebView.qml'
25--- plugins/module/WebView.qml 2016-02-24 10:29:24 +0000
26+++ plugins/module/WebView.qml 2016-06-06 12:10:41 +0000
27@@ -2,11 +2,29 @@
28 import Ubuntu.Components 1.3
29 import Ubuntu.Web 0.2
30
31-WebView {
32+ChromedWebView {
33 id: root
34
35 property QtObject signonRequest
36
37+ onNewViewRequested: {
38+ var popup = popupComponent.createObject(root, {
39+ "context": context,
40+ "request": request,
41+ })
42+ popup.closeRequested.connect(function() {
43+ console.log("Close requested!")
44+ popup.destroy()
45+ })
46+ }
47+
48+ Component {
49+ id: popupComponent
50+ ChromedWebView {
51+ anchors.fill: parent
52+ }
53+ }
54+
55 onSignonRequestChanged: if (signonRequest) {
56 signonRequest.authenticated.connect(onAuthenticated)
57 url = signonRequest.startUrl
58@@ -39,15 +57,4 @@
59 function onGotCookies(requestId, cookies) {
60 signonRequest.setCookies(cookies)
61 }
62-
63- /* Taken from webbrowser-app */
64- ProgressBar {
65- anchors.top: parent.top
66- anchors.left: parent.left
67- anchors.right: parent.right
68- height: units.dp(3)
69- showProgressPercentage: false
70- visible: root.loading
71- value: root.loadProgress / 100
72- }
73 }
74
75=== modified file 'plugins/module/module.pro'
76--- plugins/module/module.pro 2016-03-08 08:48:26 +0000
77+++ plugins/module/module.pro 2016-06-06 12:10:41 +0000
78@@ -34,6 +34,7 @@
79 LIBS += -lonline-accounts-plugin
80
81 QML_SOURCES = \
82+ ChromedWebView.qml \
83 DuplicateAccount.qml \
84 ErrorItem.qml \
85 KeyboardRectangle.qml \

Subscribers

People subscribed via source and target branches