Merge lp:~doflah/ubuntu-clock-app/empty_alarm_page into lp:ubuntu-clock-app

Proposed by Dennis O'Flaherty
Status: Merged
Approved by: Nekhelesh Ramananthan
Approved revision: 96
Merged at revision: 96
Proposed branch: lp:~doflah/ubuntu-clock-app/empty_alarm_page
Merge into: lp:ubuntu-clock-app
Diff against target: 184 lines (+87/-12)
4 files modified
app/alarm/AlarmPage.qml (+12/-1)
app/components/EmptyState.qml (+53/-0)
debian/changelog (+3/-0)
po/com.ubuntu.clock.pot (+19/-11)
To merge this branch: bzr merge lp:~doflah/ubuntu-clock-app/empty_alarm_page
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Nekhelesh Ramananthan Approve
Victor Thompson Needs Information
Review via email: mp+233608@code.launchpad.net

Commit message

Added an empty alarm state to indicate that there are no saved alarms.

Description of the change

Show "No alarms have been saved" on an empty alarm page to fix #1364555

To post a comment you must log in.
Revision history for this message
Victor Thompson (vthompson) wrote :

The code looks OK, I'm just not a fan of the design.

Could we implement Nik's proposal?

"No stored alarms
Tap the plus symbol to add an alarm."

review: Needs Fixing
Revision history for this message
Victor Thompson (vthompson) wrote :
88. By Dennis O'Flaherty

Reposition items based on feedback

89. By Dennis O'Flaherty

Updated translation template

90. By Dennis O'Flaherty

Fix spacing

Revision history for this message
Dennis O'Flaherty (doflah) wrote :

Is that better?

91. By Dennis O'Flaherty

Fix spacing again

Revision history for this message
Victor Thompson (vthompson) wrote :

Looks much better, IMO. But still needs a design review.

"UbuntuColors.warmGrey" seems to have been phased out from the API [1]--also "UbuntuColors.lightGrey" (in the API) looks better IMO.

[1] http://developer.ubuntu.com/api/qml/sdk-14.10/Ubuntu.Components.UbuntuColors/

review: Needs Information
Revision history for this message
Dennis O'Flaherty (doflah) wrote :

Yeah. I went with warmGrey since that was what the Icon docs (http://developer.ubuntu.com/api/qml/sdk-14.10/Ubuntu.Components.Icon/) had - should that get updated?

How does the design review process work?

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Thanks a lot for your code contributions Dennis. The way the design process usually works is that, when a bug is reported which requires a design decision, the designers think it over and see the best way to fix the bug while maintaining consistency among the other applications. After that they propose a solution in the bug report which we developers then implement.

In this case, I suggested a solution which other 3rd party apps use and one that I liked as well. However a designer would still need to approve it. I will be in contact with the designers on monday where I will bring this up and update this MP with the design solution that they came up with. Meanwhile we need to wait.

Also I tried your branch and tweaked the font size and color a little bit to make it look like https://imgur.com/DfDx1yL for the fun of it :D.

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

#blocked on design (waiting on a resolution from Michal). Will update MP with appropriate status when I hear back from him.

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

#unblocked

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

So after showing it to another designer, they suggested some fixes after which we are good to go :)

1. Change the icon color to "#BBBBBB" and increase its height to 10 grid units.

2. Increase the padding between the icon and the "No Saved alarms" by 5 grid units.

3. Change the text to "Tap the + icon to add an alarm"

4. The font size of "No Saved alarms" should be "large" while the "Tap the + icon...." text should "medium". By default the SDK uses font size medium. So just remove the fontSize declaration for that label.

review: Needs Fixing
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

From a developer's perspective, please move the following code into a new file called "EmptyState.qml" in the components folder. This way we can reuse this code in other places if required.

15 + Item {
16 + visible: alarmModel.count === 0
17 + anchors.verticalCenter: parent.verticalCenter
18 + width: parent.width
19 + height: childrenRect.height
20 +
21 + Icon {
22 + id: noAlarmIcon
23 + name: "alarm-clock"
24 + anchors.horizontalCenter: parent.horizontalCenter
25 + height: units.gu(10)
26 + width: height
27 + color: UbuntuColors.warmGrey
28 + }
29 +
30 + Label {
31 + id: noAlarmLabel
32 + text: i18n.tr("No saved alarms")
33 + anchors.top: noAlarmIcon.bottom
34 + anchors.horizontalCenter: parent.horizontalCenter
35 + fontSize: "x-large"
36 + font.bold: true
37 + }
38 +
39 + Label {
40 + text: i18n.tr("Tap the plus icon to add an alarm.")
41 + anchors.top: noAlarmLabel.bottom
42 + anchors.horizontalCenter: parent.horizontalCenter
43 + fontSize: "large"
44 + }
45 + }

You will be obviously define some public properties like icon, title, subtitle etc to adjust these properties from outside.

So it should be used like,

EmptyState {
   id: alarmEmptyState

   visible: alarmModel.count === 0
   anchors.verticalCenter: parent.verticalCenter

   iconName: "alarm-clock"
   title: i18n.tr("No saved alarms")
   subtitle: i18n.tr("Tap the + icon to add an alarm.")
}

review: Needs Fixing
92. By Dennis O'Flaherty

Implement design feedback

93. By Dennis O'Flaherty

Updated translation template

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Code looks good :).. However there seems to be a conflict in your pot file according to jenkins. "Text conflict in po/com.ubuntu.clock.pot". Can you fix that and we are good to go.

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

if you want you can leave out the pot file update if you are unable to solve the conflict since I will be doing a pot file update tomorrow.

94. By Dennis O'Flaherty

* Fixed clock mode animations being too slow (LP: #1365440)
* Added alarm snooze settings (LP: #1354400)
* Fixed default alarm label not being translatable (LP: #1365012)

95. By Dennis O'Flaherty

Updated translation template

96. By Dennis O'Flaherty

Updated changelog

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

lgtm! Thanks for the contribution!

review: Approve
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 'app/alarm/AlarmPage.qml'
2--- app/alarm/AlarmPage.qml 2014-08-24 12:47:50 +0000
3+++ app/alarm/AlarmPage.qml 2014-09-12 19:29:13 +0000
4@@ -18,6 +18,8 @@
5
6 import QtQuick 2.3
7 import Ubuntu.Components 1.1
8+
9+import "../components"
10 import "../components/Utils.js" as Utils
11
12 Page {
13@@ -96,9 +98,18 @@
14 }
15 ]
16
17- AlarmList{
18+ AlarmList {
19 id: alarmListView
20 listModel: alarmModel
21 anchors.fill: parent
22 }
23+
24+ EmptyState {
25+ visible: alarmModel.count === 0
26+ anchors.verticalCenter: parent.verticalCenter
27+
28+ iconName: "alarm-clock"
29+ title: i18n.tr("No saved alarms")
30+ subTitle: i18n.tr("Tap the + icon to add an alarm")
31+ }
32 }
33
34=== added file 'app/components/EmptyState.qml'
35--- app/components/EmptyState.qml 1970-01-01 00:00:00 +0000
36+++ app/components/EmptyState.qml 2014-09-12 19:29:13 +0000
37@@ -0,0 +1,53 @@
38+/*
39+ * Copyright (C) 2014 Canonical Ltd
40+ *
41+ * This file is part of Ubuntu Clock App
42+ *
43+ * Ubuntu Clock App is free software: you can redistribute it and/or modify
44+ * it under the terms of the GNU General Public License version 3 as
45+ * published by the Free Software Foundation.
46+ *
47+ * Ubuntu Clock App is distributed in the hope that it will be useful,
48+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
49+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50+ * GNU General Public License for more details.
51+ *
52+ * You should have received a copy of the GNU General Public License
53+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
54+ */
55+
56+import QtQuick 2.3
57+import Ubuntu.Components 1.1
58+
59+Item {
60+
61+ property alias iconName: emptyIcon.name
62+ property alias title: emptyLabel.text
63+ property alias subTitle: emptySublabel.text
64+
65+ height: childrenRect.height
66+ width: parent.width
67+
68+ Icon {
69+ id: emptyIcon
70+ anchors.horizontalCenter: parent.horizontalCenter
71+ height: units.gu(10)
72+ width: height
73+ color: "#BBBBBB"
74+ }
75+
76+ Label {
77+ id: emptyLabel
78+ anchors.top: emptyIcon.bottom
79+ anchors.topMargin: units.gu(5)
80+ anchors.horizontalCenter: parent.horizontalCenter
81+ fontSize: "large"
82+ font.bold: true
83+ }
84+
85+ Label {
86+ id: emptySublabel
87+ anchors.top: emptyLabel.bottom
88+ anchors.horizontalCenter: parent.horizontalCenter
89+ }
90+}
91
92=== modified file 'debian/changelog'
93--- debian/changelog 2014-09-09 10:23:07 +0000
94+++ debian/changelog 2014-09-12 19:29:13 +0000
95@@ -44,6 +44,9 @@
96 * Removed 'Today/Tomorow/Yesterday' text string from world clock, replaced
97 'No time difference' with 'Same time' (LP: #1362093)
98
99+ [Dennis O'Flaherty]
100+ * Show a message to the user when the alarm list is empty (LP: #1364555)
101+
102 -- Nekhelesh Ramananthan <krnekhelesh@gmail.com> Wed, 13 Aug 2014 15:46:12 +0200
103
104 ubuntu-clock-app (3.0-0ubuntu1) utopic; urgency=medium
105
106=== modified file 'po/com.ubuntu.clock.pot'
107--- po/com.ubuntu.clock.pot 2014-09-08 22:22:09 +0000
108+++ po/com.ubuntu.clock.pot 2014-09-12 19:29:13 +0000
109@@ -8,7 +8,7 @@
110 msgstr ""
111 "Project-Id-Version: \n"
112 "Report-Msgid-Bugs-To: \n"
113-"POT-Creation-Date: 2014-09-09 00:21+0200\n"
114+"POT-Creation-Date: 2014-09-12 15:22-0400\n"
115 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
116 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
117 "Language-Team: LANGUAGE <LL@li.org>\n"
118@@ -33,33 +33,41 @@
119 msgstr ""
120
121 #: ../app/alarm/AlarmLabel.qml:30 ../app/alarm/AlarmLabel.qml:52
122-#: ../app/alarm/EditAlarmPage.qml:303
123+#: ../app/alarm/EditAlarmPage.qml:308
124 msgid "Label"
125 msgstr ""
126
127-#: ../app/alarm/AlarmList.qml:81 ../app/alarm/AlarmPage.qml:78
128+#: ../app/alarm/AlarmList.qml:81 ../app/alarm/AlarmPage.qml:80
129 #: ../app/worldclock/UserWorldCityList.qml:103
130 msgid "Delete"
131 msgstr ""
132
133-#: ../app/alarm/AlarmPage.qml:26 ../app/ubuntu-clock-app.qml:103
134+#: ../app/alarm/AlarmPage.qml:28 ../app/ubuntu-clock-app.qml:103
135 msgid "Alarms"
136 msgstr ""
137
138-#: ../app/alarm/AlarmPage.qml:42 ../app/alarm/EditAlarmPage.qml:55
139-#: ../app/alarm/EditAlarmPage.qml:178
140+#: ../app/alarm/AlarmPage.qml:44 ../app/alarm/EditAlarmPage.qml:55
141+#: ../app/alarm/EditAlarmPage.qml:183
142 msgid "Alarm"
143 msgstr ""
144
145-#: ../app/alarm/AlarmPage.qml:55
146+#: ../app/alarm/AlarmPage.qml:57
147 msgid "Cancel selection"
148 msgstr ""
149
150-#: ../app/alarm/AlarmPage.qml:64 ../app/alarm/AlarmRepeat.qml:35
151+#: ../app/alarm/AlarmPage.qml:66 ../app/alarm/AlarmRepeat.qml:35
152 msgid "Select All"
153 msgstr ""
154
155-#: ../app/alarm/AlarmRepeat.qml:31 ../app/alarm/EditAlarmPage.qml:293
156+#: ../app/alarm/AlarmPage.qml:112
157+msgid "No saved alarms"
158+msgstr ""
159+
160+#: ../app/alarm/AlarmPage.qml:113
161+msgid "Tap the + icon to add an alarm"
162+msgstr ""
163+
164+#: ../app/alarm/AlarmRepeat.qml:31 ../app/alarm/EditAlarmPage.qml:298
165 msgid "Repeat"
166 msgstr ""
167
168@@ -97,7 +105,7 @@
169 msgid "Change time and date"
170 msgstr ""
171
172-#: ../app/alarm/AlarmSound.qml:27 ../app/alarm/EditAlarmPage.qml:316
173+#: ../app/alarm/AlarmSound.qml:27 ../app/alarm/EditAlarmPage.qml:321
174 msgid "Sound"
175 msgstr ""
176
177@@ -125,7 +133,7 @@
178 msgid "Edit alarm"
179 msgstr ""
180
181-#: ../app/alarm/EditAlarmPage.qml:340
182+#: ../app/alarm/EditAlarmPage.qml:345
183 msgid "Delete alarm"
184 msgstr ""
185

Subscribers

People subscribed via source and target branches