Merge lp:~mardy/friends-app/app-access2 into lp:friends-app

Proposed by Alberto Mardegan
Status: Merged
Merged at revision: 155
Proposed branch: lp:~mardy/friends-app/app-access2
Merge into: lp:friends-app
Diff against target: 156 lines (+55/-54)
3 files modified
debian/control (+2/-1)
qml/Setup.qml (+37/-38)
qml/friends-app.qml (+16/-15)
To merge this branch: bzr merge lp:~mardy/friends-app/app-access2
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Robert Bruce Park Approve
David Barth (community) Approve
Review via email: mp+211717@code.launchpad.net

Commit message

Request access to online accounts

When no enabled accounts are found, ask the Online Accounts trusted helper to create a new account or enabled an existing one.

UI wise, we should probably make this Setup screen accessible even if there are already some accounts enabled.

Description of the change

Request access to online accounts

When no enabled accounts are found, ask the Online Accounts trusted helper to create a new account or enabled an existing one.

UI wise, we should probably make this Setup screen accessible even if there are already some accounts enabled.

To post a comment you must log in.
Revision history for this message
David Barth (dbarth) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Robert Bruce Park (robru) wrote :

This jenkins failure is ignorable because it's not testing with the necessary depends in place. The CI Train silo will be able to test this much more effectively.

review: Approve
lp:~mardy/friends-app/app-access2 updated
152. By Alberto Mardegan

Merge from trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~mardy/friends-app/app-access2 updated
153. By Alberto Mardegan

Merge from trunk

[ Barry Warsaw ]
* Port autopilot tests to Python 3. Bump Standards-Version to 3.9.5
* debian/control: alternatively depend on the OpenGLES version of
  qtdeclarative5-ubuntu-ui-toolkit-plugin

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2014-05-01 14:18:24 +0000
3+++ debian/control 2014-05-02 07:38:13 +0000
4@@ -20,8 +20,9 @@
5 Architecture: any
6 Depends: ${shlibs:Depends},
7 ${misc:Depends},
8- qtdeclarative5-accounts-plugin,
9+ qtdeclarative5-accounts-plugin (>= 0.4),
10 qtdeclarative5-friends0.2,
11+ qtdeclarative5-online-accounts-client0.1 (>= 0.3),
12 qtdeclarative5-unity-action-plugin,
13 qtdeclarative5-ubuntu-ui-toolkit-plugin | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles,
14 qtdeclarative5-u1db1.0,
15
16=== modified file 'qml/Setup.qml'
17--- qml/Setup.qml 2014-03-06 13:35:39 +0000
18+++ qml/Setup.qml 2014-05-02 07:38:13 +0000
19@@ -16,43 +16,42 @@
20
21 import QtQuick 2.0
22 import Ubuntu.Components 0.1
23-
24-Column {
25-
26- Label {
27- id: header
28- text: i18n.tr("No online accounts configured")
29- anchors.horizontalCenter: parent.horizontalCenter
30- fontSize: "large"
31- font.bold: true
32- }
33-
34- Label {
35- text: i18n.tr("To configure accounts, go to System Settings and choose \"Online Accounts\".")
36- wrapMode: Text.WrapAtWordBoundaryOrAnywhere
37- horizontalAlignment: Text.AlignHCenter
38- anchors.horizontalCenter: parent.horizontalCenter
39- width: parent.width
40- }
41-
42-// Item {
43-// height: units.gu(4)
44-// width: parent.width
45-// }
46-
47-// Button {
48-// id: addButton
49-// anchors.horizontalCenter: parent.horizontalCenter
50-
51-// text: i18n.tr("Add account...")
52-// width: header.width - units.gu(2)//Math.min(header.width, parent.width * 3/4)
53-// onClicked: {
54-// console.log ("Add Accounts activated");
55-// Qt.openUrlExternally("settings:///system/credentials");
56-
57-// }
58-// }
59-
60-
61+import Ubuntu.Components.ListItems 0.1 as ListItem
62+import Ubuntu.OnlineAccounts 0.1
63+import Ubuntu.OnlineAccounts.Client 0.1
64+
65+ListView {
66+ id: listView
67+ header: headerComponent
68+ model: providerModel
69+ delegate: ListItem.Standard {
70+ text: model.displayName
71+ iconName: model.iconName
72+ width: listView.width
73+ onClicked: {
74+ setup.providerId = providerId
75+ setup.exec()
76+ }
77+ }
78+
79+ Component {
80+ id: headerComponent
81+ Label {
82+ text: i18n.tr("No online accounts configured")
83+ anchors.horizontalCenter: parent.horizontalCenter
84+ fontSize: "large"
85+ font.bold: true
86+ }
87+ }
88+
89+ ProviderModel {
90+ id: providerModel
91+ applicationId: "friends"
92+ }
93+
94+ Setup {
95+ id: setup
96+ applicationId: "friends"
97+ }
98 }
99
100
101=== modified file 'qml/friends-app.qml'
102--- qml/friends-app.qml 2014-03-06 13:35:39 +0000
103+++ qml/friends-app.qml 2014-05-02 07:38:13 +0000
104@@ -93,14 +93,19 @@
105 id: accounts
106 serviceType: "microblogging"
107
108- onCountChanged: {
109- if (pageStack.currentPage === noAccountsPage && count > 0) {
110- pageStack.pop()
111- }
112-
113- if (pageStack.currentPage !== noAccountsPage && count === 0) {
114- pageStack.push(noAccountsPage)
115- }
116+ onCountChanged: checkAccountsPage()
117+ }
118+
119+ function checkAccountsPage() {
120+ // If there's no current page, it means the UI is not fully initialized
121+ if (!pageStack.currentPage) return
122+
123+ if (pageStack.currentPage === noAccountsPage && accounts.count > 0) {
124+ pageStack.pop()
125+ }
126+
127+ if (pageStack.currentPage !== noAccountsPage && accounts.count === 0) {
128+ pageStack.push(noAccountsPage)
129 }
130 }
131
132@@ -114,10 +119,8 @@
133 Component.onCompleted: {
134 console.log ("accounts.count: "+accounts.count)
135
136- if (accounts.count < 1)
137- pageStack.push(noAccountsPage)
138- else
139- pageStack.push(feedTabs)
140+ pageStack.push(feedTabs)
141+ checkAccountsPage()
142 }
143
144 Page {
145@@ -126,10 +129,8 @@
146 Setup {
147 id: noAccounts
148 anchors {
149- centerIn: parent
150+ fill: parent
151 }
152-
153- width: parent.width - units.gu(4)
154 }
155 visible: false
156 tools: ToolbarItems {

Subscribers

People subscribed via source and target branches