Merge lp:~ahayzen/ubuntu-weather-app/fix-1583169-add-updated-at-text into lp:ubuntu-weather-app

Proposed by Andrew Hayzen on 2016-08-17
Status: Merged
Approved by: Andrew Hayzen on 2017-04-12
Approved revision: 253
Merged at revision: 266
Proposed branch: lp:~ahayzen/ubuntu-weather-app/fix-1583169-add-updated-at-text
Merge into: lp:ubuntu-weather-app
Diff against target: 172 lines (+78/-6)
5 files modified
app/components/HomeTempInfo.qml (+34/-1)
app/ui/LocationPane.qml (+6/-0)
debian/changelog (+9/-1)
manifest.json.in (+1/-1)
po/com.ubuntu.weather.pot (+28/-3)
To merge this branch: bzr merge lp:~ahayzen/ubuntu-weather-app/fix-1583169-add-updated-at-text
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Approve on 2017-04-12
Michael Sheldon (community) Approve on 2017-04-12
Andrew Hayzen Abstain on 2017-04-12
Review via email: mp+303188@code.launchpad.net

Commit message

* Add support for showing updated X minutes ago

Description of the change

* Add support for showing updated X minutes ago

To post a comment you must log in.
Andrew Hayzen (ahayzen) wrote :

We are going to get design to review this first.

review: Needs Information
review: Approve (continuous-integration)
251. By Andrew Hayzen on 2017-04-12

* Pull of trunk

review: Approve (continuous-integration)
Andrew Hayzen (ahayzen) wrote :

Testing:
- Open the weather for a location
- Wait for a long period of time check that the "updated recently" changes to "updated N minutes ago"
- Refresh (pull from top) the location to refresh
- It should now change back to "updated recently"

review: Abstain
252. By Andrew Hayzen on 2017-04-12

* Update changelog date/times

253. By Andrew Hayzen on 2017-04-12

* Add space

Michael Sheldon (michael-sheldon) wrote :

Looks good!

review: Approve
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'app/components/HomeTempInfo.qml'
--- app/components/HomeTempInfo.qml 2015-11-02 21:28:34 +0000
+++ app/components/HomeTempInfo.qml 2017-04-12 10:28:17 +0000
@@ -89,6 +89,11 @@
8989
90 property alias now: nowLabel.text90 property alias now: nowLabel.text
9191
92 // Don't store as int as reaches max int
93 property var updatedAt
94
95 onUpdatedAtChanged: diffTimer.restart()
96
92 Column {97 Column {
93 id: labelColumn98 id: labelColumn
94 anchors {99 anchors {
@@ -100,7 +105,35 @@
100 Label {105 Label {
101 font.weight: Font.Light106 font.weight: Font.Light
102 fontSize: "small"107 fontSize: "small"
103 text: i18n.tr("Today")108 text: i18n.tr("Today") + " - " + updatedAtText + " "
109
110 readonly property string updatedAtText: {
111 if (diffDays > 0) {
112 i18n.tr("updated %1 day ago", "updated %1 days ago", diffDays).arg(diffDays)
113 } else if (diffHours > 0) {
114 i18n.tr("updated %1 hour ago", "updated %1 hours ago", diffHours).arg(diffHours)
115 } else if (diffMinutes > 0) {
116 i18n.tr("updated %1 minute ago", "updated %1 minutes ago", diffMinutes).arg(diffMinutes)
117 } else {
118 i18n.tr("updated recently")
119 }
120 }
121
122 property var diff
123 property int diffMinutes: Math.floor(diff / 60)
124 property int diffHours: Math.floor(diffMinutes / 60)
125 property int diffDays: Math.floor(diffHours / 24)
126
127 // Check the time every 15 seconds
128 Timer {
129 id: diffTimer
130 interval: 15000
131 repeat: true
132 running: parent.visible
133 triggeredOnStart: true
134
135 onTriggered: parent.diff = ((new Date().getTime() - updatedAt) / 1000)
136 }
104 }137 }
105138
106 Label {139 Label {
107140
=== modified file 'app/ui/LocationPane.qml'
--- app/ui/LocationPane.qml 2016-08-25 07:47:46 +0000
+++ app/ui/LocationPane.qml 2017-04-12 10:28:17 +0000
@@ -45,6 +45,8 @@
45 property var todayData45 property var todayData
46 property bool graphicVisible : false46 property bool graphicVisible : false
4747
48 property var lastFetch // don't store as int as reaches max int
49
48 delegate: DayDelegate {50 delegate: DayDelegate {
49 day: model.day51 day: model.day
50 high: model.high52 high: model.high
@@ -99,6 +101,7 @@
99 id: homeTempInfo101 id: homeTempInfo
100 modelData: todayData102 modelData: todayData
101 now: mainPageWeekdayListView.currentTemp103 now: mainPageWeekdayListView.currentTemp
104 updatedAt: mainPageWeekdayListView.lastFetch
102 }105 }
103106
104 // TODO: Migrate this to using the new SDK list item when possible.107 // TODO: Migrate this to using the new SDK list item when possible.
@@ -231,6 +234,9 @@
231 hourlyForecastsData = hourlyForecasts;234 hourlyForecastsData = hourlyForecasts;
232 hourlyTempUnits = tempUnits;235 hourlyTempUnits = tempUnits;
233 }236 }
237
238 // Set last updated time
239 mainPageWeekdayListView.lastFetch = data.updated;
234 }240 }
235241
236 Component.onCompleted: renderData(index)242 Component.onCompleted: renderData(index)
237243
=== modified file 'debian/changelog'
--- debian/changelog 2016-08-25 07:47:46 +0000
+++ debian/changelog 2017-04-12 10:28:17 +0000
@@ -1,4 +1,12 @@
1ubuntu-weather-app (3.4ubuntu1) UNRELEASED; urgency=medium1ubuntu-weather-app (3.5ubuntu1) UNRELEASED; urgency=medium
2
3 [ Andrew Hayzen ]
4 * Release 3.4 and bump version to 3.5
5 * Add support for showing updated X minutes ago (LP: #1583169)
6
7 -- Andrew Hayzen <ahayzen@gmail.com> Wed, 17 Aug 2016 21:10:10 +0100
8
9ubuntu-weather-app (3.4ubuntu1) xenial; urgency=medium
210
3 [ Andrew Hayzen ]11 [ Andrew Hayzen ]
4 * Set useragent in geocode so that osm can uniquely identify our requests12 * Set useragent in geocode so that osm can uniquely identify our requests
513
=== modified file 'manifest.json.in'
--- manifest.json.in 2016-08-25 07:47:46 +0000
+++ manifest.json.in 2017-04-12 10:28:17 +0000
@@ -13,7 +13,7 @@
13 "maintainer": "Ubuntu App Cats <ubuntu-touch-coreapps@lists.launchpad.net>",13 "maintainer": "Ubuntu App Cats <ubuntu-touch-coreapps@lists.launchpad.net>",
14 "name": "@PROJECT_NAME@",14 "name": "@PROJECT_NAME@",
15 "title": "Weather",15 "title": "Weather",
16 "version": "3.4.@BZR_REVNO@",16 "version": "3.5.@BZR_REVNO@",
17 "x-source": {17 "x-source": {
18 "vcs-bzr": "@BZR_SOURCE@",18 "vcs-bzr": "@BZR_SOURCE@",
19 "vcs-bzr-revno": "@BZR_REVNO@"19 "vcs-bzr-revno": "@BZR_REVNO@"
2020
=== modified file 'po/com.ubuntu.weather.pot'
--- po/com.ubuntu.weather.pot 2016-10-08 08:44:17 +0000
+++ po/com.ubuntu.weather.pot 2017-04-12 10:28:17 +0000
@@ -1,6 +1,6 @@
1# SOME DESCRIPTIVE TITLE.1# SOME DESCRIPTIVE TITLE.
2# Copyright (C) YEAR Canonical Ltd.2# Copyright (C) YEAR Canonical Ltd.
3# This file is distributed under the same license as the PACKAGE package.3# This file is distributed under the same license as the ubuntu-weather-app package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.4# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5#5#
6#, fuzzy6#, fuzzy
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: ubuntu-weather-app\n"9"Project-Id-Version: ubuntu-weather-app\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2016-10-08 01:18-0700\n"11"POT-Creation-Date: 2017-04-12 10:54+0100\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"
@@ -58,10 +58,35 @@
58msgid "Manually add a location by swiping up from the bottom of the display"58msgid "Manually add a location by swiping up from the bottom of the display"
59msgstr ""59msgstr ""
6060
61#: ../app/components/HomeTempInfo.qml:10361#: ../app/components/HomeTempInfo.qml:108
62msgid "Today"62msgid "Today"
63msgstr ""63msgstr ""
6464
65#: ../app/components/HomeTempInfo.qml:112
66#, qt-format
67msgid "updated %1 day ago"
68msgid_plural "updated %1 days ago"
69msgstr[0] ""
70msgstr[1] ""
71
72#: ../app/components/HomeTempInfo.qml:114
73#, qt-format
74msgid "updated %1 hour ago"
75msgid_plural "updated %1 hours ago"
76msgstr[0] ""
77msgstr[1] ""
78
79#: ../app/components/HomeTempInfo.qml:116
80#, qt-format
81msgid "updated %1 minute ago"
82msgid_plural "updated %1 minutes ago"
83msgstr[0] ""
84msgstr[1] ""
85
86#: ../app/components/HomeTempInfo.qml:118
87msgid "updated recently"
88msgstr ""
89
65#: ../app/components/ListItemActions/Remove.qml:2690#: ../app/components/ListItemActions/Remove.qml:26
66msgid "Remove"91msgid "Remove"
67msgstr ""92msgstr ""

Subscribers

People subscribed via source and target branches

to all changes: