Merge lp:~vthompson/ubuntu-weather-app/msg-when-no-keys into lp:ubuntu-weather-app

Proposed by Victor Thompson
Status: Merged
Approved by: Andrew Hayzen
Approved revision: 166
Merged at revision: 166
Proposed branch: lp:~vthompson/ubuntu-weather-app/msg-when-no-keys
Merge into: lp:ubuntu-weather-app
Diff against target: 149 lines (+91/-2)
4 files modified
app/components/NoAPIKeyErrorStateComponent.qml (+62/-0)
app/ui/HomePage.qml (+12/-1)
debian/changelog (+6/-0)
po/com.ubuntu.weather.pot (+11/-1)
To merge this branch: bzr merge lp:~vthompson/ubuntu-weather-app/msg-when-no-keys
Reviewer Review Type Date Requested Status
Andrew Hayzen Approve
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
Jenkins Bot continuous-integration Approve
Review via email: mp+277080@code.launchpad.net

Commit message

* Create an error state when there are no keys found.

Description of the change

* Create an error state when there are no keys found.

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
166. By Victor Thompson

Update to add key file.

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Looks good!

review: Approve
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Sweet! LGTM :-)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'app/components/NoAPIKeyErrorStateComponent.qml'
2--- app/components/NoAPIKeyErrorStateComponent.qml 1970-01-01 00:00:00 +0000
3+++ app/components/NoAPIKeyErrorStateComponent.qml 2015-11-10 02:13:16 +0000
4@@ -0,0 +1,62 @@
5+/*
6+ * Copyright (C) 2015 Canonical Ltd
7+ *
8+ * This file is part of Ubuntu Weather App
9+ *
10+ * Ubuntu Weather App is free software: you can redistribute it and/or modify
11+ * it under the terms of the GNU General Public License version 3 as
12+ * published by the Free Software Foundation.
13+ *
14+ * Ubuntu Weather App is distributed in the hope that it will be useful,
15+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+ * GNU General Public License for more details.
18+ *
19+ * You should have received a copy of the GNU General Public License
20+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21+ */
22+
23+import QtQuick 2.4
24+import Ubuntu.Components 1.2
25+import "../components"
26+
27+
28+Rectangle {
29+ color: "white"
30+ anchors.fill: parent
31+
32+ SettingsButton {
33+ anchors {
34+ right: parent.right
35+ top: parent.top
36+ }
37+ }
38+
39+ Column {
40+ anchors {
41+ centerIn: parent
42+ }
43+ spacing: units.gu(4)
44+ width: parent.width - units.gu(4)
45+
46+ Label {
47+ id: networkErrorStateLabel
48+ anchors {
49+ horizontalCenter: parent.horizontalCenter
50+ }
51+ fontSize: "x-large"
52+ text: i18n.tr("No API Keys Found")
53+ width: parent.width
54+ wrapMode: Text.WordWrap
55+ }
56+
57+ Label {
58+ anchors {
59+ horizontalCenter: parent.horizontalCenter
60+ }
61+ text: i18n.tr("If you are a developer, please see the README file for instructions on how to obtain your own Open Weather Map API key.")
62+ width: parent.width
63+ wrapMode: Text.WordWrap
64+ }
65+ }
66+}
67
68=== modified file 'app/ui/HomePage.qml'
69--- app/ui/HomePage.qml 2015-09-05 00:03:33 +0000
70+++ app/ui/HomePage.qml 2015-11-10 02:13:16 +0000
71@@ -19,6 +19,7 @@
72 import QtQuick 2.4
73 import Ubuntu.Components 1.2
74 import "../components"
75+import "../data/keys.js" as Keys
76
77
78 PageWithBottomEdge {
79@@ -166,7 +167,7 @@
80 }
81
82 Loader {
83- active: networkError && mainPageStack.depth === 1
84+ active: networkError && mainPageStack.depth === 1 && (Keys.twcKey || Keys.owmKey)
85 anchors {
86 fill: parent
87 }
88@@ -174,4 +175,14 @@
89 source: "../components/NetworkErrorStateComponent.qml"
90 visible: status === Loader.Ready && active
91 }
92+
93+ Loader {
94+ active: mainPageStack.depth === 1 && !Keys.twcKey && !Keys.owmKey
95+ anchors {
96+ fill: parent
97+ }
98+ asynchronous: true
99+ source: "../components/NoAPIKeyErrorStateComponent.qml"
100+ visible: status === Loader.Ready && active
101+ }
102 }
103
104=== modified file 'debian/changelog'
105--- debian/changelog 2015-10-25 20:14:14 +0000
106+++ debian/changelog 2015-11-10 02:13:16 +0000
107@@ -6,6 +6,12 @@
108 [ Bartosz Kosiorek ]
109 * Change message text according to Ubuntu UX comment (LP: #1493466)
110
111+ [ Alan Pope ]
112+ * Describe how to get a key in the README. Mention this in the keys.js.
113+
114+ [ Victor Thompson ]
115+ * Create an error state when there are no keys found.
116+
117 -- Andrew Hayzen <ahayzen@gmail.com> Sat, 24 Oct 2015 20:22:31 +0100
118
119 ubuntu-weather-app (3.0ubuntu1) vivid; urgency=medium
120
121=== modified file 'po/com.ubuntu.weather.pot'
122--- po/com.ubuntu.weather.pot 2015-10-25 20:12:50 +0000
123+++ po/com.ubuntu.weather.pot 2015-11-10 02:13:16 +0000
124@@ -8,7 +8,7 @@
125 msgstr ""
126 "Project-Id-Version: ubuntu-weather-app\n"
127 "Report-Msgid-Bugs-To: \n"
128-"POT-Creation-Date: 2015-10-25 21:12+0100\n"
129+"POT-Creation-Date: 2015-11-09 19:59-0600\n"
130 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
131 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
132 "Language-Team: LANGUAGE <LL@li.org>\n"
133@@ -94,6 +94,16 @@
134 msgid "Retry"
135 msgstr ""
136
137+#: ../app/components/NoAPIKeyErrorStateComponent.qml:48
138+msgid "No API Keys Found"
139+msgstr ""
140+
141+#: ../app/components/NoAPIKeyErrorStateComponent.qml:57
142+msgid ""
143+"If you are a developer, please see the README file for instructions on how "
144+"to obtain your own Open Weather Map API key."
145+msgstr ""
146+
147 #: ../app/ui/AddLocationPage.qml:29
148 msgid "Select a city"
149 msgstr ""

Subscribers

People subscribed via source and target branches

to all changes: