Merge lp:~ibelieve/friends-app/improved-message into lp:friends-app

Proposed by Michael Spencer
Status: Merged
Approved by: Ken VanDine
Approved revision: 120
Merged at revision: 120
Proposed branch: lp:~ibelieve/friends-app/improved-message
Merge into: lp:friends-app
Diff against target: 150 lines (+59/-40)
2 files modified
qml/Setup.qml (+35/-36)
qml/friends-app.qml (+24/-4)
To merge this branch: bzr merge lp:~ibelieve/friends-app/improved-message
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Ken VanDine Approve
Review via email: mp+196322@code.launchpad.net

Commit message

Improved the no accounts message

Description of the change

Improved the No Accounts message, centered in, and hid the back button.

The message will also go away once an account is added.

To post a comment you must log in.
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Looks good, we'll be able to enable that addButton real soon. The API for online accounts to add accounts will be is ready to be merged :)

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Setup.qml'
2--- qml/Setup.qml 2013-07-22 13:40:57 +0000
3+++ qml/Setup.qml 2013-11-22 16:59:46 +0000
4@@ -17,43 +17,42 @@
5 import QtQuick 2.0
6 import Ubuntu.Components 0.1
7
8-Item {
9- anchors {
10- fill: parent
11- }
12- width: parent.width
13-
14-
15- Text {
16- id: noAccountsMsg
17- anchors {
18- margins: units.gu(2)
19- }
20- width: parent.width * 0.9
21- text: i18n.tr("No online accounts configured, you can add one in System Settings")
22- font.family: "Ubuntu"
23+Column {
24+
25+ Label {
26+ id: header
27+ text: i18n.tr("No online accounts configured")
28+ anchors.horizontalCenter: parent.horizontalCenter
29+ fontSize: "large"
30 font.bold: true
31- font.pointSize: 18
32- wrapMode: Text.WordWrap
33- color: Theme.palette.normal.baseText
34- }
35-
36- /*
37- Button {
38- id: addButton
39- anchors {
40- top: parent.top
41- left: noAccountsMsg.right
42- margins: units.gu(2)
43- }
44- text: i18n.tr("Add Accounts")
45- onClicked: {
46- console.log ("Add Accounts activated");
47- Qt.openUrlExternally("system:///credentials");
48-
49- }
50- }
51- */
52+ }
53+
54+ Label {
55+ text: i18n.tr("To configure accounts, go to System Settings and choose \"Online Accounts\".")
56+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
57+ horizontalAlignment: Text.AlignHCenter
58+ anchors.horizontalCenter: parent.horizontalCenter
59+ width: parent.width
60+ }
61+
62+// Item {
63+// height: units.gu(4)
64+// width: parent.width
65+// }
66+
67+// Button {
68+// id: addButton
69+// anchors.horizontalCenter: parent.horizontalCenter
70+
71+// text: i18n.tr("Add account...")
72+// width: header.width - units.gu(2)//Math.min(header.width, parent.width * 3/4)
73+// onClicked: {
74+// console.log ("Add Accounts activated");
75+// Qt.openUrlExternally("settings:///system/credentials");
76+
77+// }
78+// }
79+
80
81 }
82
83
84=== modified file 'qml/friends-app.qml'
85--- qml/friends-app.qml 2013-11-03 10:35:46 +0000
86+++ qml/friends-app.qml 2013-11-22 16:59:46 +0000
87@@ -28,8 +28,8 @@
88 objectName: "main"
89 automaticOrientation: true
90
91- width: units.gu(60)
92- height: units.gu(90)
93+ width: units.gu(48)
94+ height: units.gu(75)
95
96 backgroundColor: "#273d66"
97 headerColor: "#395996"
98@@ -64,6 +64,18 @@
99 AccountServiceModel {
100 id: accounts
101 serviceType: "microblogging"
102+
103+ onCountChanged: {
104+ if (!loaded) return
105+
106+ if (pageStack.currentPage === noAccountsPage && count > 0) {
107+ pageStack.pop()
108+ }
109+
110+ if (pageStack.currentPage !== noAccountsPage && count === 0) {
111+ pageStack.push(noAccountsPage)
112+ }
113+ }
114 }
115
116 FriendsDispatcher {
117@@ -72,24 +84,32 @@
118
119 PageStack {
120 id: pageStack
121+
122+ property bool loaded: false
123+
124 Component.onCompleted: {
125 console.log ("accounts.count: "+accounts.count);
126 pageStack.push(mainPage);
127 if (accounts.count < 1)
128 pageStack.push(noAccountsPage);
129+
130+ loaded = true
131 }
132
133 Page {
134 id: noAccountsPage
135- title: i18n.tr("Setup Accounts")
136+ title: i18n.tr("Friends")
137 Setup {
138 id: noAccounts
139 anchors {
140- fill: parent
141+ centerIn: parent
142 }
143+
144+ width: parent.width - units.gu(4)
145 }
146 visible: false
147 tools: ToolbarItems {
148+ back: null
149 }
150 }
151

Subscribers

People subscribed via source and target branches

to all changes: