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
=== modified file 'app/alarm/AlarmPage.qml'
--- app/alarm/AlarmPage.qml 2014-08-24 12:47:50 +0000
+++ app/alarm/AlarmPage.qml 2014-09-12 19:29:13 +0000
@@ -18,6 +18,8 @@
1818
19import QtQuick 2.319import QtQuick 2.3
20import Ubuntu.Components 1.120import Ubuntu.Components 1.1
21
22import "../components"
21import "../components/Utils.js" as Utils23import "../components/Utils.js" as Utils
2224
23Page {25Page {
@@ -96,9 +98,18 @@
96 }98 }
97 ]99 ]
98100
99 AlarmList{101 AlarmList {
100 id: alarmListView102 id: alarmListView
101 listModel: alarmModel103 listModel: alarmModel
102 anchors.fill: parent104 anchors.fill: parent
103 }105 }
106
107 EmptyState {
108 visible: alarmModel.count === 0
109 anchors.verticalCenter: parent.verticalCenter
110
111 iconName: "alarm-clock"
112 title: i18n.tr("No saved alarms")
113 subTitle: i18n.tr("Tap the + icon to add an alarm")
114 }
104}115}
105116
=== added file 'app/components/EmptyState.qml'
--- app/components/EmptyState.qml 1970-01-01 00:00:00 +0000
+++ app/components/EmptyState.qml 2014-09-12 19:29:13 +0000
@@ -0,0 +1,53 @@
1/*
2 * Copyright (C) 2014 Canonical Ltd
3 *
4 * This file is part of Ubuntu Clock App
5 *
6 * Ubuntu Clock App is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 3 as
8 * published by the Free Software Foundation.
9 *
10 * Ubuntu Clock App is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import QtQuick 2.3
20import Ubuntu.Components 1.1
21
22Item {
23
24 property alias iconName: emptyIcon.name
25 property alias title: emptyLabel.text
26 property alias subTitle: emptySublabel.text
27
28 height: childrenRect.height
29 width: parent.width
30
31 Icon {
32 id: emptyIcon
33 anchors.horizontalCenter: parent.horizontalCenter
34 height: units.gu(10)
35 width: height
36 color: "#BBBBBB"
37 }
38
39 Label {
40 id: emptyLabel
41 anchors.top: emptyIcon.bottom
42 anchors.topMargin: units.gu(5)
43 anchors.horizontalCenter: parent.horizontalCenter
44 fontSize: "large"
45 font.bold: true
46 }
47
48 Label {
49 id: emptySublabel
50 anchors.top: emptyLabel.bottom
51 anchors.horizontalCenter: parent.horizontalCenter
52 }
53}
054
=== modified file 'debian/changelog'
--- debian/changelog 2014-09-09 10:23:07 +0000
+++ debian/changelog 2014-09-12 19:29:13 +0000
@@ -44,6 +44,9 @@
44 * Removed 'Today/Tomorow/Yesterday' text string from world clock, replaced44 * Removed 'Today/Tomorow/Yesterday' text string from world clock, replaced
45 'No time difference' with 'Same time' (LP: #1362093)45 'No time difference' with 'Same time' (LP: #1362093)
4646
47 [Dennis O'Flaherty]
48 * Show a message to the user when the alarm list is empty (LP: #1364555)
49
47 -- Nekhelesh Ramananthan <krnekhelesh@gmail.com> Wed, 13 Aug 2014 15:46:12 +020050 -- Nekhelesh Ramananthan <krnekhelesh@gmail.com> Wed, 13 Aug 2014 15:46:12 +0200
4851
49ubuntu-clock-app (3.0-0ubuntu1) utopic; urgency=medium52ubuntu-clock-app (3.0-0ubuntu1) utopic; urgency=medium
5053
=== modified file 'po/com.ubuntu.clock.pot'
--- po/com.ubuntu.clock.pot 2014-09-08 22:22:09 +0000
+++ po/com.ubuntu.clock.pot 2014-09-12 19:29:13 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: \n"9"Project-Id-Version: \n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2014-09-09 00:21+0200\n"11"POT-Creation-Date: 2014-09-12 15:22-0400\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -33,33 +33,41 @@
33msgstr ""33msgstr ""
3434
35#: ../app/alarm/AlarmLabel.qml:30 ../app/alarm/AlarmLabel.qml:5235#: ../app/alarm/AlarmLabel.qml:30 ../app/alarm/AlarmLabel.qml:52
36#: ../app/alarm/EditAlarmPage.qml:30336#: ../app/alarm/EditAlarmPage.qml:308
37msgid "Label"37msgid "Label"
38msgstr ""38msgstr ""
3939
40#: ../app/alarm/AlarmList.qml:81 ../app/alarm/AlarmPage.qml:7840#: ../app/alarm/AlarmList.qml:81 ../app/alarm/AlarmPage.qml:80
41#: ../app/worldclock/UserWorldCityList.qml:10341#: ../app/worldclock/UserWorldCityList.qml:103
42msgid "Delete"42msgid "Delete"
43msgstr ""43msgstr ""
4444
45#: ../app/alarm/AlarmPage.qml:26 ../app/ubuntu-clock-app.qml:10345#: ../app/alarm/AlarmPage.qml:28 ../app/ubuntu-clock-app.qml:103
46msgid "Alarms"46msgid "Alarms"
47msgstr ""47msgstr ""
4848
49#: ../app/alarm/AlarmPage.qml:42 ../app/alarm/EditAlarmPage.qml:5549#: ../app/alarm/AlarmPage.qml:44 ../app/alarm/EditAlarmPage.qml:55
50#: ../app/alarm/EditAlarmPage.qml:17850#: ../app/alarm/EditAlarmPage.qml:183
51msgid "Alarm"51msgid "Alarm"
52msgstr ""52msgstr ""
5353
54#: ../app/alarm/AlarmPage.qml:5554#: ../app/alarm/AlarmPage.qml:57
55msgid "Cancel selection"55msgid "Cancel selection"
56msgstr ""56msgstr ""
5757
58#: ../app/alarm/AlarmPage.qml:64 ../app/alarm/AlarmRepeat.qml:3558#: ../app/alarm/AlarmPage.qml:66 ../app/alarm/AlarmRepeat.qml:35
59msgid "Select All"59msgid "Select All"
60msgstr ""60msgstr ""
6161
62#: ../app/alarm/AlarmRepeat.qml:31 ../app/alarm/EditAlarmPage.qml:29362#: ../app/alarm/AlarmPage.qml:112
63msgid "No saved alarms"
64msgstr ""
65
66#: ../app/alarm/AlarmPage.qml:113
67msgid "Tap the + icon to add an alarm"
68msgstr ""
69
70#: ../app/alarm/AlarmRepeat.qml:31 ../app/alarm/EditAlarmPage.qml:298
63msgid "Repeat"71msgid "Repeat"
64msgstr ""72msgstr ""
6573
@@ -97,7 +105,7 @@
97msgid "Change time and date"105msgid "Change time and date"
98msgstr ""106msgstr ""
99107
100#: ../app/alarm/AlarmSound.qml:27 ../app/alarm/EditAlarmPage.qml:316108#: ../app/alarm/AlarmSound.qml:27 ../app/alarm/EditAlarmPage.qml:321
101msgid "Sound"109msgid "Sound"
102msgstr ""110msgstr ""
103111
@@ -125,7 +133,7 @@
125msgid "Edit alarm"133msgid "Edit alarm"
126msgstr ""134msgstr ""
127135
128#: ../app/alarm/EditAlarmPage.qml:340136#: ../app/alarm/EditAlarmPage.qml:345
129msgid "Delete alarm"137msgid "Delete alarm"
130msgstr ""138msgstr ""
131139

Subscribers

People subscribed via source and target branches