Merge lp:~nik90/ubuntu-clock-app/implement-location-finding into lp:ubuntu-clock-app
- implement-location-finding
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Nekhelesh Ramananthan | ||||
Approved revision: | 88 | ||||
Merged at revision: | 165 | ||||
Proposed branch: | lp:~nik90/ubuntu-clock-app/implement-location-finding | ||||
Merge into: | lp:ubuntu-clock-app | ||||
Diff against target: |
770 lines (+451/-32) 14 files modified
CMakeLists.txt (+2/-2) app/clock/ClockPage.qml (+126/-4) app/ubuntu-clock-app.qml (+8/-0) backend/CMakeLists.txt (+23/-0) backend/modules/GeoLocation/backend.cpp (+34/-0) backend/modules/GeoLocation/backend.h (+35/-0) backend/modules/GeoLocation/geolocation.cpp (+100/-0) backend/modules/GeoLocation/geolocation.h (+78/-0) backend/modules/GeoLocation/qmldir (+2/-0) debian/changelog (+1/-0) debian/control (+2/-0) po/com.ubuntu.clock.pot (+29/-25) tests/unit/MockClockApp.qml (+9/-0) ubuntu-clock-app.json (+2/-1) |
||||
To merge this branch: | bzr merge lp:~nik90/ubuntu-clock-app/implement-location-finding | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Riccardo Padovani | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Nekhelesh Ramananthan | Needs Fixing | ||
Review via email:
|
Commit message
Adds user location finding to the clock app.
Description of the change
Adds user location finding to the clock app.
==== Testing ====
This MP requires extensive testing for different scenarios that I have listed below. Please comment below if any of the scenarios don't work as expected. I will be adding these scenarios to the manual test suite to ensure we don't regress with a new clock release.
### Prerequisites
I tested this on Mako RTM Stable Image #5. I expect it to work reliably with #5 and higher. Please execute the following commands before *each* case for a fresh clean testing environment.
- Clean up the ubuntu location service and clock app files (for a fresh start) by,
"stop ubuntu-
"rm -r .local/
"rm -r .local/
"start ubuntu-
### Case 1: User opens clock app for the first time (previous location unknown and location service enabled)
- Once you open the clock app, you should be prompted the first time for allowing clock app to access GPS. Press "Allow" here. That's the sign it is working.
- The clock app should show "Retrieving Location". After GPS coordinates are obtained (should take few seconds at most), it should show your city or country.
- Restart the clock app. It should show you the last saved city immediately and not "Retrieving location" again.
### Case 2: User opens clock app for the first time (previous location unknown and location services denied)
- Once you open the clock app, in the location service trust store prompt, press "Deny"!.
- The clock app should now show "Location Service Error" to indicate that it cannot access the location service.
- Restart the clock app and it should still read "Location Service Error".
### Case 3: User opens clock app as usual (not first-time)
- Open the clock app and it should prompt as usual for access to GPS. Press "Allow". The user location should then be shown within a few seconds.
- Close clock app
- Run "sudo stop ubuntu-
- Reopen clock app. It should show previous saved location and *not* "Location Service Error!".
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:66
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
#blocked on bug 1359866
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:68
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:69
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:73
http://
Executed test runs:
FAILURE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:80
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 81. By Nekhelesh Ramananthan
-
Added some comments
- 82. By Nekhelesh Ramananthan
-
Added more comments and cleaned lat and long calculation
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:82
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
As bug 1359866 is now fixed, is this unblocked?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nekhelesh Ramananthan (nik90) wrote : | # |
#unblocked This was part of the 3 MPs that I requested you to test since they are ready code wise.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nekhelesh Ramananthan (nik90) wrote : | # |
#blocked I believe this MP requires silo-001 [1] (ubuntu-rtm) to land in rtm stable otherwise I wouldn't be able to release a new clock app. Unfortunately the person (thomas voss) who requested silo-001 is on vacation.
I did request QA to go ahead and test the silo considering that it is already in utopic, however I was told that due to a regression in the past, QA doesn't test silos which haven't been tested by the lander first.
I will keep updating this MP as I get more details.
dbus-cpp 4.0.0+14.
location-service 2.1+14.
[1] https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
I gather this is still un-testable due to the location stuff not being complete and landed?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nekhelesh Ramananthan (nik90) wrote : | # |
> I gather this is still un-testable due to the location stuff not being
> complete and landed?
Yes, from what I know, the HERE location service is not reliably started on phone reboots, and also the HERE location fixes differ between RTM and Utopic images leading to different testing results. As such, I first would like the HERE service to be available on the different channels reliably before proceeding to fix this MP.
I say wait 1-2 weeks for HERE service to be reliable, after which I am going to postpone this to post-rtm since I am not comfortable landing a big MP this late in the development cycle.
- 83. By Nekhelesh Ramananthan
-
Merged trunk
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nekhelesh Ramananthan (nik90) wrote : | # |
I tested this on RTM Stable #5 Mako and it worked for all the use cases mentioned above in the MP description. I am a bit nervous about pushing this feature this late in the cycle. I would like some additional people like popey, davmor, and any others that come to mind to test this before we merge to trunk.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:83
http://
Executed test runs:
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nekhelesh Ramananthan (nik90) wrote : | # |
#unblocked
- 84. By Nekhelesh Ramananthan
-
Fixed qml tests
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:84
http://
Executed test runs:
FAILURE: http://
Click here to trigger a rebuild:
http://
- 85. By Nekhelesh Ramananthan
-
Added missing dependency which caused qml test to fail
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:85
http://
Executed test runs:
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 86. By Nekhelesh Ramananthan
-
Added comments
- 87. By Nekhelesh Ramananthan
-
Updated pot file
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:87
http://
Executed test runs:
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Mihir Soni (mihirsoni) wrote : | # |
I have tested this and it works fine on the first glance,
I'll test more and will update here.
- 88. By Nekhelesh Ramananthan
-
Renamed backend location plugin to geolocation
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:88
http://
Executed test runs:
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Riccardo Padovani (rpadovani) wrote : | # |
On rtm #6 the app doesn't start, it is stucked on the splash screen, both with gps activated or deasctivated.
Also, it doesn't create a log, so unfortunately I cannot understand what's wrong. I created the click package twice, so I don't think is my failure.
Anyway, I left a inline comment about a doubt on the code.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Riccardo Padovani (rpadovani) wrote : | # |
If I launch it from QTC (instead of creating a clic package) works.
Tests work as expected, but if I launch the app with position deactivate from the indicator it says "Location Service Error" as expected, but when I turn on position service from indicator the app doesn't try to update location, but stays stucked on "Location Service Error"
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nekhelesh Ramananthan (nik90) wrote : | # |
> If I launch it from QTC (instead of creating a click package) works.
>
> Tests work as expected, but if I launch the app with position deactivate from
> the indicator it says "Location Service Error" as expected, but when I turn on
> position service from indicator the app doesn't try to update location, but
> stays stucked on "Location Service Error"
Yeah that's because the clock app you will need to restart the app to update the location. Currently the location is updated only on 2 conditions,
1. On application startup
2. If the clock app is brought to the foreground 30 mins later
It does not continuously keep searching for the user location since that would be bad for the battery. So in your situation where you disabled the position service and then renabled it, the clock app does not get a signal that you turned it on. So you will need to restart the clock app.
A better way of fixing your situation would be to add a refresh button which the user can press to search for the location, but we are way past UI freezes to get this done.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nekhelesh Ramananthan (nik90) wrote : | # |
63 + Stop querying for the user location if it is found to be
64 + the same as the one stored in the app setting database
65 + */
66 + if (userLongitude === userLocationDoc
67 + userLatitude === userLocationDoc
>Riccardo Padovani (rpadovani) wrote 1 hour ago:
>I don't understand that if. Why you use OR and not an AND? If a user takes a plane in Rome, and >lands in Barcellona, the lat is the same, so the position isn'update?
No no that's not what this if loop is for. It is basically there to ensure that no invalid long or lat is supplied the clock app. Normally when the application is started up, the lat and long returned is usually garbage values. So this if loop checks the validity of the coordinates.
So if *either* lat or long is invalid, then it returns. Only if both of them are valid, does it continue to search for the user's location.
Hope this answers your question.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Riccardo Padovani (rpadovani) wrote : | # |
Yap, thanks Nik, now is definitely better :-)
Great work!
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2014-09-27 10:36:56 +0000 | |||
3 | +++ CMakeLists.txt 2014-11-04 15:58:17 +0000 | |||
4 | @@ -111,9 +111,9 @@ | |||
5 | 111 | 111 | ||
6 | 112 | add_custom_target("autopilot" chmod +x ${CMAKE_SOURCE_DIR}/tests/autopilot/run | 112 | add_custom_target("autopilot" chmod +x ${CMAKE_SOURCE_DIR}/tests/autopilot/run |
7 | 113 | COMMAND ${CMAKE_SOURCE_DIR}/tests/autopilot/run | 113 | COMMAND ${CMAKE_SOURCE_DIR}/tests/autopilot/run |
9 | 114 | DEPENDS timezone timezone-qmldir alarmsettings alarmsettings-qmldir datetime datetime-qmldir | 114 | DEPENDS timezone timezone-qmldir alarmsettings alarmsettings-qmldir datetime datetime-qmldir geolocation geolocation-qmldir |
10 | 115 | WORKING_DIRECTORY ./app) | 115 | WORKING_DIRECTORY ./app) |
11 | 116 | 116 | ||
12 | 117 | add_custom_target("run" /usr/bin/qmlscene -I ${CMAKE_BINARY_DIR}/backend ${CMAKE_SOURCE_DIR}/app/ubuntu-clock-app.qml | 117 | add_custom_target("run" /usr/bin/qmlscene -I ${CMAKE_BINARY_DIR}/backend ${CMAKE_SOURCE_DIR}/app/ubuntu-clock-app.qml |
14 | 118 | DEPENDS timezone timezone-qmldir alarmsettings alarmsettings-qmldir datetime datetime-qmldir | 118 | DEPENDS timezone timezone-qmldir alarmsettings alarmsettings-qmldir datetime datetime-qmldir geolocation geolocation-qmldir |
15 | 119 | WORKING_DIRECTORY ./app) | 119 | WORKING_DIRECTORY ./app) |
16 | 120 | 120 | ||
17 | === modified file 'app/clock/ClockPage.qml' | |||
18 | --- app/clock/ClockPage.qml 2014-10-10 19:58:49 +0000 | |||
19 | +++ app/clock/ClockPage.qml 2014-11-04 15:58:17 +0000 | |||
20 | @@ -17,7 +17,10 @@ | |||
21 | 17 | */ | 17 | */ |
22 | 18 | 18 | ||
23 | 19 | import QtQuick 2.3 | 19 | import QtQuick 2.3 |
24 | 20 | import U1db 1.0 as U1db | ||
25 | 21 | import QtPositioning 5.2 | ||
26 | 20 | import Ubuntu.Components 1.1 | 22 | import Ubuntu.Components 1.1 |
27 | 23 | import GeoLocation 1.0 | ||
28 | 21 | import "../alarm" | 24 | import "../alarm" |
29 | 22 | import "../components" | 25 | import "../components" |
30 | 23 | import "../upstreamcomponents" | 26 | import "../upstreamcomponents" |
31 | @@ -47,6 +50,110 @@ | |||
32 | 47 | id: alarmUtils | 50 | id: alarmUtils |
33 | 48 | } | 51 | } |
34 | 49 | 52 | ||
35 | 53 | PositionSource { | ||
36 | 54 | id: geoposition | ||
37 | 55 | |||
38 | 56 | // Property to store the time of the last GPS location update | ||
39 | 57 | property var lastUpdate | ||
40 | 58 | |||
41 | 59 | readonly property real userLongitude: position.coordinate.longitude | ||
42 | 60 | |||
43 | 61 | readonly property real userLatitude: position.coordinate.latitude | ||
44 | 62 | |||
45 | 63 | active: true | ||
46 | 64 | updateInterval: 1000 | ||
47 | 65 | |||
48 | 66 | onSourceErrorChanged: { | ||
49 | 67 | // Stop querying user location if location service is not available | ||
50 | 68 | if (sourceError !== PositionSource.NoError) { | ||
51 | 69 | console.log("[Source Error]: Location Service Error") | ||
52 | 70 | geoposition.stop() | ||
53 | 71 | } | ||
54 | 72 | } | ||
55 | 73 | |||
56 | 74 | onPositionChanged: { | ||
57 | 75 | // Do not accept an invalid user location | ||
58 | 76 | if(!position.longitudeValid || !position.latitudeValid) { | ||
59 | 77 | return | ||
60 | 78 | } | ||
61 | 79 | |||
62 | 80 | /* | ||
63 | 81 | Stop querying for the user location if it is found to be | ||
64 | 82 | the same as the one stored in the app setting database | ||
65 | 83 | */ | ||
66 | 84 | if (userLongitude === userLocationDocument.contents.long || | ||
67 | 85 | userLatitude === userLocationDocument.contents.lat) { | ||
68 | 86 | if (geoposition.active) { | ||
69 | 87 | console.log("[LOG]: Stopping geolocation update service") | ||
70 | 88 | geoposition.stop() | ||
71 | 89 | } | ||
72 | 90 | return | ||
73 | 91 | } | ||
74 | 92 | |||
75 | 93 | else { | ||
76 | 94 | // Retrieve user location online after receiving the user's lat and lng. | ||
77 | 95 | userLocation.setSource(position.coordinate.latitude, position.coordinate.longitude) | ||
78 | 96 | } | ||
79 | 97 | } | ||
80 | 98 | } | ||
81 | 99 | |||
82 | 100 | Connections { | ||
83 | 101 | target: clockApp | ||
84 | 102 | onApplicationStateChanged: { | ||
85 | 103 | /* | ||
86 | 104 | If Clock App is brought from background after more than 30 mins, | ||
87 | 105 | query the user location to ensure it is up to date. | ||
88 | 106 | */ | ||
89 | 107 | if(applicationState | ||
90 | 108 | && Math.abs(clock.analogTime - geoposition.lastUpdate) > 1800000) { | ||
91 | 109 | if(!geoposition.active) | ||
92 | 110 | geoposition.start() | ||
93 | 111 | } | ||
94 | 112 | |||
95 | 113 | else if (!applicationState) { | ||
96 | 114 | geoposition.lastUpdate = clock.analogTime | ||
97 | 115 | } | ||
98 | 116 | } | ||
99 | 117 | } | ||
100 | 118 | |||
101 | 119 | GeoLocation { | ||
102 | 120 | id: userLocation | ||
103 | 121 | |||
104 | 122 | function setSource(lat, lng) { | ||
105 | 123 | var url = String("%1%2%3%4%5") | ||
106 | 124 | .arg("http://api.geonames.org/findNearbyPlaceNameJSON?lat=") | ||
107 | 125 | .arg(lat) | ||
108 | 126 | .arg("&lng=") | ||
109 | 127 | .arg(lng) | ||
110 | 128 | .arg("&username=krnekhelesh&style=full") | ||
111 | 129 | |||
112 | 130 | console.log("[LOG]: Searching online for user location at " + url) | ||
113 | 131 | |||
114 | 132 | userLocation.source = url; | ||
115 | 133 | } | ||
116 | 134 | |||
117 | 135 | onLocationChanged: { | ||
118 | 136 | var locationData = JSON.parse | ||
119 | 137 | (JSON.stringify(userLocationDocument.contents)) | ||
120 | 138 | |||
121 | 139 | locationData.lat = geoposition.userLatitude | ||
122 | 140 | locationData.long = geoposition.userLongitude | ||
123 | 141 | locationData.location = userLocation.location | ||
124 | 142 | |||
125 | 143 | userLocationDocument.contents = locationData | ||
126 | 144 | |||
127 | 145 | /* | ||
128 | 146 | Stop querying the user coordinates once the user location has been | ||
129 | 147 | determined and saved to disk | ||
130 | 148 | */ | ||
131 | 149 | if(geoposition.active) { | ||
132 | 150 | console.log("[LOG]: Stopping geolocation update service") | ||
133 | 151 | geoposition.stop() | ||
134 | 152 | } | ||
135 | 153 | |||
136 | 154 | } | ||
137 | 155 | } | ||
138 | 156 | |||
139 | 50 | Flickable { | 157 | Flickable { |
140 | 51 | id: _flickable | 158 | id: _flickable |
141 | 52 | 159 | ||
142 | @@ -100,6 +207,10 @@ | |||
143 | 100 | id: clock | 207 | id: clock |
144 | 101 | objectName: "clock" | 208 | objectName: "clock" |
145 | 102 | 209 | ||
146 | 210 | Component.onCompleted: { | ||
147 | 211 | geoposition.lastUpdate = analogTime | ||
148 | 212 | } | ||
149 | 213 | |||
150 | 103 | analogTime: clockTime | 214 | analogTime: clockTime |
151 | 104 | 215 | ||
152 | 105 | anchors { | 216 | anchors { |
153 | @@ -130,9 +241,6 @@ | |||
154 | 130 | opacity: settingsIcon.opacity | 241 | opacity: settingsIcon.opacity |
155 | 131 | spacing: units.gu(1) | 242 | spacing: units.gu(1) |
156 | 132 | 243 | ||
157 | 133 | // TODO: Remove this once user location finding is implemented | ||
158 | 134 | visible: false | ||
159 | 135 | |||
160 | 136 | anchors { | 244 | anchors { |
161 | 137 | top: date.bottom | 245 | top: date.bottom |
162 | 138 | topMargin: units.gu(1) | 246 | topMargin: units.gu(1) |
163 | @@ -149,10 +257,24 @@ | |||
164 | 149 | Label { | 257 | Label { |
165 | 150 | id: location | 258 | id: location |
166 | 151 | objectName: "location" | 259 | objectName: "location" |
168 | 152 | text: i18n.tr("Location") | 260 | |
169 | 153 | fontSize: "medium" | 261 | fontSize: "medium" |
170 | 154 | anchors.verticalCenter: locationIcon.verticalCenter | 262 | anchors.verticalCenter: locationIcon.verticalCenter |
171 | 155 | color: UbuntuColors.midAubergine | 263 | color: UbuntuColors.midAubergine |
172 | 264 | |||
173 | 265 | text: { | ||
174 | 266 | if (userLocationDocument.contents.location === "Null") { | ||
175 | 267 | if(geoposition.sourceError !== PositionSource.NoError) { | ||
176 | 268 | return i18n.tr("Location Service Error!") | ||
177 | 269 | } else { | ||
178 | 270 | return i18n.tr("Retrieving location...") | ||
179 | 271 | } | ||
180 | 272 | } | ||
181 | 273 | |||
182 | 274 | else { | ||
183 | 275 | return userLocationDocument.contents.location | ||
184 | 276 | } | ||
185 | 277 | } | ||
186 | 156 | } | 278 | } |
187 | 157 | } | 279 | } |
188 | 158 | 280 | ||
189 | 159 | 281 | ||
190 | === modified file 'app/ubuntu-clock-app.qml' | |||
191 | --- app/ubuntu-clock-app.qml 2014-10-11 17:53:39 +0000 | |||
192 | +++ app/ubuntu-clock-app.qml 2014-11-04 15:58:17 +0000 | |||
193 | @@ -71,6 +71,14 @@ | |||
194 | 71 | defaults: { "digitalMode": false } | 71 | defaults: { "digitalMode": false } |
195 | 72 | } | 72 | } |
196 | 73 | 73 | ||
197 | 74 | U1db.Document { | ||
198 | 75 | id: userLocationDocument | ||
199 | 76 | create: true | ||
200 | 77 | database: clockDB | ||
201 | 78 | docId: "userLocationDocument" | ||
202 | 79 | defaults: { "lat": "NaN", "long": "Nan", "location": "Null" } | ||
203 | 80 | } | ||
204 | 81 | |||
205 | 74 | DateTime { | 82 | DateTime { |
206 | 75 | id: localTimeSource | 83 | id: localTimeSource |
207 | 76 | updateInterval: 1000 | 84 | updateInterval: 1000 |
208 | 77 | 85 | ||
209 | === modified file 'backend/CMakeLists.txt' | |||
210 | --- backend/CMakeLists.txt 2014-09-12 05:05:03 +0000 | |||
211 | +++ backend/CMakeLists.txt 2014-11-04 15:58:17 +0000 | |||
212 | @@ -25,6 +25,12 @@ | |||
213 | 25 | modules/Alarm/Settings/alarmsettings.cpp | 25 | modules/Alarm/Settings/alarmsettings.cpp |
214 | 26 | ) | 26 | ) |
215 | 27 | 27 | ||
216 | 28 | set( | ||
217 | 29 | geolocation_SRCS | ||
218 | 30 | modules/GeoLocation/backend.cpp | ||
219 | 31 | modules/GeoLocation/geolocation.cpp | ||
220 | 32 | ) | ||
221 | 33 | |||
222 | 28 | add_library(timezone MODULE | 34 | add_library(timezone MODULE |
223 | 29 | ${timezone_SRCS} | 35 | ${timezone_SRCS} |
224 | 30 | ) | 36 | ) |
225 | @@ -37,6 +43,10 @@ | |||
226 | 37 | ${alarmsettings_SRCS} | 43 | ${alarmsettings_SRCS} |
227 | 38 | ) | 44 | ) |
228 | 39 | 45 | ||
229 | 46 | add_library(geolocation MODULE | ||
230 | 47 | ${geolocation_SRCS} | ||
231 | 48 | ) | ||
232 | 49 | |||
233 | 40 | set_target_properties(timezone PROPERTIES | 50 | set_target_properties(timezone PROPERTIES |
234 | 41 | LIBRARY_OUTPUT_DIRECTORY Timezone | 51 | LIBRARY_OUTPUT_DIRECTORY Timezone |
235 | 42 | ) | 52 | ) |
236 | @@ -49,9 +59,14 @@ | |||
237 | 49 | LIBRARY_OUTPUT_DIRECTORY Alarm/Settings | 59 | LIBRARY_OUTPUT_DIRECTORY Alarm/Settings |
238 | 50 | ) | 60 | ) |
239 | 51 | 61 | ||
240 | 62 | set_target_properties(geolocation PROPERTIES | ||
241 | 63 | LIBRARY_OUTPUT_DIRECTORY GeoLocation | ||
242 | 64 | ) | ||
243 | 65 | |||
244 | 52 | qt5_use_modules(datetime Gui Qml Quick) | 66 | qt5_use_modules(datetime Gui Qml Quick) |
245 | 53 | qt5_use_modules(timezone Gui Qml Quick) | 67 | qt5_use_modules(timezone Gui Qml Quick) |
246 | 54 | qt5_use_modules(alarmsettings Gui Qml Quick DBus) | 68 | qt5_use_modules(alarmsettings Gui Qml Quick DBus) |
247 | 69 | qt5_use_modules(geolocation Gui Qml Quick) | ||
248 | 55 | 70 | ||
249 | 56 | # Copy qmldir file to build dir for running in QtCreator | 71 | # Copy qmldir file to build dir for running in QtCreator |
250 | 57 | add_custom_target(timezone-qmldir ALL | 72 | add_custom_target(timezone-qmldir ALL |
251 | @@ -69,6 +84,11 @@ | |||
252 | 69 | DEPENDS ${QMLFILES} | 84 | DEPENDS ${QMLFILES} |
253 | 70 | ) | 85 | ) |
254 | 71 | 86 | ||
255 | 87 | add_custom_target(geolocation-qmldir ALL | ||
256 | 88 | COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/modules/GeoLocation/qmldir ${CMAKE_CURRENT_BINARY_DIR}/GeoLocation | ||
257 | 89 | DEPENDS ${QMLFILES} | ||
258 | 90 | ) | ||
259 | 91 | |||
260 | 72 | # Install plugin file | 92 | # Install plugin file |
261 | 73 | install(TARGETS timezone DESTINATION ${MODULE_PATH}/Timezone/) | 93 | install(TARGETS timezone DESTINATION ${MODULE_PATH}/Timezone/) |
262 | 74 | install(FILES modules/Timezone/qmldir DESTINATION ${MODULE_PATH}/Timezone/) | 94 | install(FILES modules/Timezone/qmldir DESTINATION ${MODULE_PATH}/Timezone/) |
263 | @@ -78,3 +98,6 @@ | |||
264 | 78 | 98 | ||
265 | 79 | install(TARGETS alarmsettings DESTINATION ${MODULE_PATH}/Alarm/Settings/) | 99 | install(TARGETS alarmsettings DESTINATION ${MODULE_PATH}/Alarm/Settings/) |
266 | 80 | install(FILES modules/Alarm/Settings/qmldir DESTINATION ${MODULE_PATH}/Alarm/Settings/) | 100 | install(FILES modules/Alarm/Settings/qmldir DESTINATION ${MODULE_PATH}/Alarm/Settings/) |
267 | 101 | |||
268 | 102 | install(TARGETS geolocation DESTINATION ${MODULE_PATH}/GeoLocation/) | ||
269 | 103 | install(FILES modules/GeoLocation/qmldir DESTINATION ${MODULE_PATH}/GeoLocation/) | ||
270 | 81 | 104 | ||
271 | === added directory 'backend/modules/GeoLocation' | |||
272 | === added file 'backend/modules/GeoLocation/backend.cpp' | |||
273 | --- backend/modules/GeoLocation/backend.cpp 1970-01-01 00:00:00 +0000 | |||
274 | +++ backend/modules/GeoLocation/backend.cpp 2014-11-04 15:58:17 +0000 | |||
275 | @@ -0,0 +1,34 @@ | |||
276 | 1 | /* | ||
277 | 2 | * Copyright (C) 2014 Canonical Ltd | ||
278 | 3 | * | ||
279 | 4 | * This file is part of Ubuntu Clock App | ||
280 | 5 | * | ||
281 | 6 | * Ubuntu Clock App is free software: you can redistribute it and/or modify | ||
282 | 7 | * it under the terms of the GNU General Public License version 3 as | ||
283 | 8 | * published by the Free Software Foundation. | ||
284 | 9 | * | ||
285 | 10 | * Ubuntu Clock App is distributed in the hope that it will be useful, | ||
286 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
287 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
288 | 13 | * GNU General Public License for more details. | ||
289 | 14 | * | ||
290 | 15 | * You should have received a copy of the GNU General Public License | ||
291 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
292 | 17 | */ | ||
293 | 18 | |||
294 | 19 | #include <QtQml> | ||
295 | 20 | #include <QtQml/QQmlContext> | ||
296 | 21 | #include "backend.h" | ||
297 | 22 | #include "geolocation.h" | ||
298 | 23 | |||
299 | 24 | void BackendPlugin::registerTypes(const char *uri) | ||
300 | 25 | { | ||
301 | 26 | Q_ASSERT(uri == QLatin1String("GeoLocation")); | ||
302 | 27 | |||
303 | 28 | qmlRegisterType<GeoLocation>(uri, 1, 0, "GeoLocation"); | ||
304 | 29 | } | ||
305 | 30 | |||
306 | 31 | void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri) | ||
307 | 32 | { | ||
308 | 33 | QQmlExtensionPlugin::initializeEngine(engine, uri); | ||
309 | 34 | } | ||
310 | 0 | 35 | ||
311 | === added file 'backend/modules/GeoLocation/backend.h' | |||
312 | --- backend/modules/GeoLocation/backend.h 1970-01-01 00:00:00 +0000 | |||
313 | +++ backend/modules/GeoLocation/backend.h 2014-11-04 15:58:17 +0000 | |||
314 | @@ -0,0 +1,35 @@ | |||
315 | 1 | /* | ||
316 | 2 | * Copyright (C) 2014 Canonical Ltd | ||
317 | 3 | * | ||
318 | 4 | * This file is part of Ubuntu Clock App | ||
319 | 5 | * | ||
320 | 6 | * Ubuntu Clock App is free software: you can redistribute it and/or modify | ||
321 | 7 | * it under the terms of the GNU General Public License version 3 as | ||
322 | 8 | * published by the Free Software Foundation. | ||
323 | 9 | * | ||
324 | 10 | * Ubuntu Clock App is distributed in the hope that it will be useful, | ||
325 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
326 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
327 | 13 | * GNU General Public License for more details. | ||
328 | 14 | * | ||
329 | 15 | * You should have received a copy of the GNU General Public License | ||
330 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
331 | 17 | */ | ||
332 | 18 | |||
333 | 19 | #ifndef BACKEND_PLUGIN_H | ||
334 | 20 | #define BACKEND_PLUGIN_H | ||
335 | 21 | |||
336 | 22 | #include <QtQml/QQmlEngine> | ||
337 | 23 | #include <QtQml/QQmlExtensionPlugin> | ||
338 | 24 | |||
339 | 25 | class BackendPlugin : public QQmlExtensionPlugin | ||
340 | 26 | { | ||
341 | 27 | Q_OBJECT | ||
342 | 28 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") | ||
343 | 29 | |||
344 | 30 | public: | ||
345 | 31 | void registerTypes(const char *uri); | ||
346 | 32 | void initializeEngine(QQmlEngine *engine, const char *uri); | ||
347 | 33 | }; | ||
348 | 34 | #endif // BACKEND_PLUGIN_H | ||
349 | 35 | |||
350 | 0 | 36 | ||
351 | === added file 'backend/modules/GeoLocation/geolocation.cpp' | |||
352 | --- backend/modules/GeoLocation/geolocation.cpp 1970-01-01 00:00:00 +0000 | |||
353 | +++ backend/modules/GeoLocation/geolocation.cpp 2014-11-04 15:58:17 +0000 | |||
354 | @@ -0,0 +1,100 @@ | |||
355 | 1 | /* | ||
356 | 2 | * Copyright (C) 2014 Canonical Ltd | ||
357 | 3 | * | ||
358 | 4 | * This file is part of Ubuntu Clock App | ||
359 | 5 | * | ||
360 | 6 | * Ubuntu Clock App is free software: you can redistribute it and/or modify | ||
361 | 7 | * it under the terms of the GNU General Public License version 3 as | ||
362 | 8 | * published by the Free Software Foundation. | ||
363 | 9 | * | ||
364 | 10 | * Ubuntu Clock App is distributed in the hope that it will be useful, | ||
365 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
366 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
367 | 13 | * GNU General Public License for more details. | ||
368 | 14 | * | ||
369 | 15 | * You should have received a copy of the GNU General Public License | ||
370 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
371 | 17 | */ | ||
372 | 18 | |||
373 | 19 | #include <QDebug> | ||
374 | 20 | #include <QNetworkReply> | ||
375 | 21 | #include <QNetworkRequest> | ||
376 | 22 | #include <QJsonDocument> | ||
377 | 23 | |||
378 | 24 | #include "geolocation.h" | ||
379 | 25 | |||
380 | 26 | GeoLocation::GeoLocation(QObject *parent): | ||
381 | 27 | QObject(parent) | ||
382 | 28 | { | ||
383 | 29 | m_nam = new QNetworkAccessManager(this); | ||
384 | 30 | connect(m_nam, | ||
385 | 31 | SIGNAL(finished(QNetworkReply*)), | ||
386 | 32 | this, | ||
387 | 33 | SLOT(networkReplyFinished(QNetworkReply*))); | ||
388 | 34 | } | ||
389 | 35 | |||
390 | 36 | QUrl GeoLocation::source() const | ||
391 | 37 | { | ||
392 | 38 | return m_source; | ||
393 | 39 | } | ||
394 | 40 | |||
395 | 41 | QString GeoLocation::location() const | ||
396 | 42 | { | ||
397 | 43 | return m_location; | ||
398 | 44 | } | ||
399 | 45 | |||
400 | 46 | void GeoLocation::setSource(const QUrl &source) | ||
401 | 47 | { | ||
402 | 48 | if (m_source == source) { | ||
403 | 49 | // Don't set the source again if it is the same source being set again | ||
404 | 50 | return; | ||
405 | 51 | } | ||
406 | 52 | |||
407 | 53 | // Update the source and emit the changed signal to let QML know | ||
408 | 54 | m_source = source; | ||
409 | 55 | emit sourceChanged(); | ||
410 | 56 | |||
411 | 57 | retrieveLocationFromJson(); | ||
412 | 58 | } | ||
413 | 59 | |||
414 | 60 | void GeoLocation::retrieveLocationFromJson() | ||
415 | 61 | { | ||
416 | 62 | // Define the request | ||
417 | 63 | QNetworkRequest request(m_source); | ||
418 | 64 | |||
419 | 65 | // Make the request to retrieve the data | ||
420 | 66 | m_nam->get(request); | ||
421 | 67 | } | ||
422 | 68 | |||
423 | 69 | void GeoLocation::networkReplyFinished(QNetworkReply *reply) | ||
424 | 70 | { | ||
425 | 71 | if(reply->error() != QNetworkReply::NoError) { | ||
426 | 72 | qDebug() << "[LOG] Network error: " << reply->errorString(); | ||
427 | 73 | return; | ||
428 | 74 | } | ||
429 | 75 | |||
430 | 76 | QByteArray data = reply->readAll(); | ||
431 | 77 | |||
432 | 78 | QJsonDocument jsonDoc = QJsonDocument::fromJson(data); | ||
433 | 79 | |||
434 | 80 | QVariant cityData = jsonDoc.toVariant(); | ||
435 | 81 | |||
436 | 82 | foreach (const QVariant &entry, cityData.toMap().value("geonames").toList()) | ||
437 | 83 | { | ||
438 | 84 | auto data = entry.toMap(); | ||
439 | 85 | auto adminName2 = data.value("adminName2").toString(); | ||
440 | 86 | auto adminName1 = data.value("adminName1").toString(); | ||
441 | 87 | |||
442 | 88 | if (!adminName2.isEmpty()) { | ||
443 | 89 | m_location = adminName2; | ||
444 | 90 | emit locationChanged(); | ||
445 | 91 | } | ||
446 | 92 | |||
447 | 93 | else if (!adminName1.isEmpty()) { | ||
448 | 94 | m_location = adminName1; | ||
449 | 95 | emit locationChanged(); | ||
450 | 96 | } | ||
451 | 97 | } | ||
452 | 98 | |||
453 | 99 | reply->deleteLater(); | ||
454 | 100 | } | ||
455 | 0 | 101 | ||
456 | === added file 'backend/modules/GeoLocation/geolocation.h' | |||
457 | --- backend/modules/GeoLocation/geolocation.h 1970-01-01 00:00:00 +0000 | |||
458 | +++ backend/modules/GeoLocation/geolocation.h 2014-11-04 15:58:17 +0000 | |||
459 | @@ -0,0 +1,78 @@ | |||
460 | 1 | /* | ||
461 | 2 | * Copyright (C) 2014 Canonical Ltd | ||
462 | 3 | * | ||
463 | 4 | * This file is part of Ubuntu Clock App | ||
464 | 5 | * | ||
465 | 6 | * Ubuntu Clock App is free software: you can redistribute it and/or modify | ||
466 | 7 | * it under the terms of the GNU General Public License version 3 as | ||
467 | 8 | * published by the Free Software Foundation. | ||
468 | 9 | * | ||
469 | 10 | * Ubuntu Clock App is distributed in the hope that it will be useful, | ||
470 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
471 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
472 | 13 | * GNU General Public License for more details. | ||
473 | 14 | * | ||
474 | 15 | * You should have received a copy of the GNU General Public License | ||
475 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
476 | 17 | */ | ||
477 | 18 | |||
478 | 19 | #ifndef LOCATION_H | ||
479 | 20 | #define LOCATION_H | ||
480 | 21 | |||
481 | 22 | #include <QObject> | ||
482 | 23 | #include <QUrl> | ||
483 | 24 | #include <QNetworkAccessManager> | ||
484 | 25 | |||
485 | 26 | class GeoLocation : public QObject | ||
486 | 27 | { | ||
487 | 28 | Q_OBJECT | ||
488 | 29 | |||
489 | 30 | // Property to set the user's longitude and latitude | ||
490 | 31 | Q_PROPERTY(QUrl source | ||
491 | 32 | READ source | ||
492 | 33 | WRITE setSource | ||
493 | 34 | NOTIFY sourceChanged) | ||
494 | 35 | |||
495 | 36 | // Property to return the user's location (cityname or countryname) | ||
496 | 37 | Q_PROPERTY(QString location | ||
497 | 38 | READ location | ||
498 | 39 | NOTIFY locationChanged) | ||
499 | 40 | |||
500 | 41 | public: | ||
501 | 42 | GeoLocation(QObject *parent = 0); | ||
502 | 43 | |||
503 | 44 | // Function to read the json document source | ||
504 | 45 | QUrl source() const; | ||
505 | 46 | |||
506 | 47 | // Function to set the source | ||
507 | 48 | void setSource(const QUrl &source); | ||
508 | 49 | |||
509 | 50 | // Function to read the user's location | ||
510 | 51 | QString location() const; | ||
511 | 52 | |||
512 | 53 | signals: | ||
513 | 54 | // Signal to notify the source has been changed | ||
514 | 55 | void sourceChanged(); | ||
515 | 56 | |||
516 | 57 | // Signal to notify the location has been changed | ||
517 | 58 | void locationChanged(); | ||
518 | 59 | |||
519 | 60 | private slots: | ||
520 | 61 | // Function to process the json document when a reply is received | ||
521 | 62 | void networkReplyFinished(QNetworkReply *reply); | ||
522 | 63 | |||
523 | 64 | private: | ||
524 | 65 | // Private copy of the source received from QML | ||
525 | 66 | QUrl m_source; | ||
526 | 67 | |||
527 | 68 | // Network access manager to request data from the online source | ||
528 | 69 | QNetworkAccessManager *m_nam; | ||
529 | 70 | |||
530 | 71 | // Private copy of the user location | ||
531 | 72 | QString m_location; | ||
532 | 73 | |||
533 | 74 | // Function to initiate the location retrieval process | ||
534 | 75 | void retrieveLocationFromJson(); | ||
535 | 76 | }; | ||
536 | 77 | |||
537 | 78 | #endif // LOCATION_H | ||
538 | 0 | 79 | ||
539 | === added file 'backend/modules/GeoLocation/qmldir' | |||
540 | --- backend/modules/GeoLocation/qmldir 1970-01-01 00:00:00 +0000 | |||
541 | +++ backend/modules/GeoLocation/qmldir 2014-11-04 15:58:17 +0000 | |||
542 | @@ -0,0 +1,2 @@ | |||
543 | 1 | module GeoLocation | ||
544 | 2 | plugin geolocation | ||
545 | 0 | 3 | ||
546 | === modified file 'debian/changelog' | |||
547 | --- debian/changelog 2014-10-25 13:32:07 +0000 | |||
548 | +++ debian/changelog 2014-11-04 15:58:17 +0000 | |||
549 | @@ -55,6 +55,7 @@ | |||
550 | 55 | * Updated QtQuick library imports to v2.3 | 55 | * Updated QtQuick library imports to v2.3 |
551 | 56 | * Switched bzr branch to lp:ubuntu-clock-app | 56 | * Switched bzr branch to lp:ubuntu-clock-app |
552 | 57 | * Updated pot file name | 57 | * Updated pot file name |
553 | 58 | * Added support for user location retrieval using GPS (LP: #1323198) | ||
554 | 58 | * Added header shortcut to select/deselect all alarm repeat options (LP: #1362089) | 59 | * Added header shortcut to select/deselect all alarm repeat options (LP: #1362089) |
555 | 59 | * Added visual tweaks (80% opacity for disabled alarms) and show time to | 60 | * Added visual tweaks (80% opacity for disabled alarms) and show time to |
556 | 60 | next alarm when enabling an alarm. | 61 | next alarm when enabling an alarm. |
557 | 61 | 62 | ||
558 | === modified file 'debian/control' | |||
559 | --- debian/control 2014-09-26 10:56:42 +0000 | |||
560 | +++ debian/control 2014-11-04 15:58:17 +0000 | |||
561 | @@ -12,6 +12,7 @@ | |||
562 | 12 | qml-module-qttest, | 12 | qml-module-qttest, |
563 | 13 | qtdeclarative5-u1db1.0, | 13 | qtdeclarative5-u1db1.0, |
564 | 14 | qtdeclarative5-qtmultimedia-plugin, | 14 | qtdeclarative5-qtmultimedia-plugin, |
565 | 15 | qtdeclarative5-qtpositioning-plugin, | ||
566 | 15 | qt5-default, | 16 | qt5-default, |
567 | 16 | qtbase5-dev, | 17 | qtbase5-dev, |
568 | 17 | qtdeclarative5-dev, | 18 | qtdeclarative5-dev, |
569 | @@ -32,6 +33,7 @@ | |||
570 | 32 | qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu, | 33 | qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu, |
571 | 33 | qtdeclarative5-xmllistmodel-plugin, | 34 | qtdeclarative5-xmllistmodel-plugin, |
572 | 34 | qtdeclarative5-qtmultimedia-plugin, | 35 | qtdeclarative5-qtmultimedia-plugin, |
573 | 36 | qtdeclarative5-qtpositioning-plugin, | ||
574 | 35 | ubuntu-touch-sounds, | 37 | ubuntu-touch-sounds, |
575 | 36 | suru-icon-theme | ubuntu-mobile-icons, | 38 | suru-icon-theme | ubuntu-mobile-icons, |
576 | 37 | ${misc:Depends}, | 39 | ${misc:Depends}, |
577 | 38 | 40 | ||
578 | === modified file 'po/com.ubuntu.clock.pot' | |||
579 | --- po/com.ubuntu.clock.pot 2014-10-15 09:53:08 +0000 | |||
580 | +++ po/com.ubuntu.clock.pot 2014-11-04 15:58:17 +0000 | |||
581 | @@ -8,7 +8,7 @@ | |||
582 | 8 | msgstr "" | 8 | msgstr "" |
583 | 9 | "Project-Id-Version: \n" | 9 | "Project-Id-Version: \n" |
584 | 10 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
586 | 11 | "POT-Creation-Date: 2014-10-15 11:52+0200\n" | 11 | "POT-Creation-Date: 2014-11-04 16:55+0100\n" |
587 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
588 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
589 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
590 | @@ -18,11 +18,11 @@ | |||
591 | 18 | "Content-Transfer-Encoding: 8bit\n" | 18 | "Content-Transfer-Encoding: 8bit\n" |
592 | 19 | 19 | ||
593 | 20 | #: ../app/alarm/AlarmLabel.qml:30 ../app/alarm/AlarmLabel.qml:56 | 20 | #: ../app/alarm/AlarmLabel.qml:30 ../app/alarm/AlarmLabel.qml:56 |
595 | 21 | #: ../app/alarm/EditAlarmPage.qml:303 | 21 | #: ../app/alarm/EditAlarmPage.qml:302 |
596 | 22 | msgid "Label" | 22 | msgid "Label" |
597 | 23 | msgstr "" | 23 | msgstr "" |
598 | 24 | 24 | ||
600 | 25 | #: ../app/alarm/AlarmList.qml:78 ../app/alarm/AlarmPage.qml:108 | 25 | #: ../app/alarm/AlarmList.qml:78 ../app/alarm/AlarmPage.qml:117 |
601 | 26 | #: ../app/worldclock/UserWorldCityList.qml:101 | 26 | #: ../app/worldclock/UserWorldCityList.qml:101 |
602 | 27 | msgid "Delete" | 27 | msgid "Delete" |
603 | 28 | msgstr "" | 28 | msgstr "" |
604 | @@ -36,27 +36,27 @@ | |||
605 | 36 | msgid "Alarm" | 36 | msgid "Alarm" |
606 | 37 | msgstr "" | 37 | msgstr "" |
607 | 38 | 38 | ||
609 | 39 | #: ../app/alarm/AlarmPage.qml:58 ../app/worldclock/WorldCityList.qml:79 | 39 | #: ../app/alarm/AlarmPage.qml:58 ../app/worldclock/WorldCityList.qml:80 |
610 | 40 | msgid "Back" | 40 | msgid "Back" |
611 | 41 | msgstr "" | 41 | msgstr "" |
612 | 42 | 42 | ||
614 | 43 | #: ../app/alarm/AlarmPage.qml:78 | 43 | #: ../app/alarm/AlarmPage.qml:87 |
615 | 44 | msgid "Select None" | 44 | msgid "Select None" |
616 | 45 | msgstr "" | 45 | msgstr "" |
617 | 46 | 46 | ||
619 | 47 | #: ../app/alarm/AlarmPage.qml:80 ../app/alarm/AlarmRepeat.qml:35 | 47 | #: ../app/alarm/AlarmPage.qml:89 ../app/alarm/AlarmRepeat.qml:35 |
620 | 48 | msgid "Select All" | 48 | msgid "Select All" |
621 | 49 | msgstr "" | 49 | msgstr "" |
622 | 50 | 50 | ||
624 | 51 | #: ../app/alarm/AlarmPage.qml:138 | 51 | #: ../app/alarm/AlarmPage.qml:149 |
625 | 52 | msgid "No saved alarms" | 52 | msgid "No saved alarms" |
626 | 53 | msgstr "" | 53 | msgstr "" |
627 | 54 | 54 | ||
629 | 55 | #: ../app/alarm/AlarmPage.qml:139 | 55 | #: ../app/alarm/AlarmPage.qml:150 |
630 | 56 | msgid "Tap the + icon to add an alarm" | 56 | msgid "Tap the + icon to add an alarm" |
631 | 57 | msgstr "" | 57 | msgstr "" |
632 | 58 | 58 | ||
634 | 59 | #: ../app/alarm/AlarmRepeat.qml:31 ../app/alarm/EditAlarmPage.qml:293 | 59 | #: ../app/alarm/AlarmRepeat.qml:31 ../app/alarm/EditAlarmPage.qml:292 |
635 | 60 | msgid "Repeat" | 60 | msgid "Repeat" |
636 | 61 | msgstr "" | 61 | msgstr "" |
637 | 62 | 62 | ||
638 | @@ -68,33 +68,33 @@ | |||
639 | 68 | #: ../app/alarm/AlarmSettingsPage.qml:55 ../app/alarm/AlarmSettingsPage.qml:56 | 68 | #: ../app/alarm/AlarmSettingsPage.qml:55 ../app/alarm/AlarmSettingsPage.qml:56 |
640 | 69 | #: ../app/alarm/AlarmSettingsPage.qml:65 ../app/alarm/AlarmSettingsPage.qml:66 | 69 | #: ../app/alarm/AlarmSettingsPage.qml:65 ../app/alarm/AlarmSettingsPage.qml:66 |
641 | 70 | #: ../app/alarm/AlarmSettingsPage.qml:67 ../app/alarm/AlarmSettingsPage.qml:68 | 70 | #: ../app/alarm/AlarmSettingsPage.qml:67 ../app/alarm/AlarmSettingsPage.qml:68 |
644 | 71 | #: ../app/alarm/AlarmSettingsPage.qml:139 | 71 | #: ../app/alarm/AlarmSettingsPage.qml:146 |
645 | 72 | #: ../app/alarm/AlarmSettingsPage.qml:206 | 72 | #: ../app/alarm/AlarmSettingsPage.qml:215 |
646 | 73 | #, qt-format | 73 | #, qt-format |
647 | 74 | msgid "%1 minutes" | 74 | msgid "%1 minutes" |
648 | 75 | msgstr "" | 75 | msgstr "" |
649 | 76 | 76 | ||
651 | 77 | #: ../app/alarm/AlarmSettingsPage.qml:93 | 77 | #: ../app/alarm/AlarmSettingsPage.qml:92 |
652 | 78 | msgid "Alarm volume" | 78 | msgid "Alarm volume" |
653 | 79 | msgstr "" | 79 | msgstr "" |
654 | 80 | 80 | ||
656 | 81 | #: ../app/alarm/AlarmSettingsPage.qml:138 | 81 | #: ../app/alarm/AlarmSettingsPage.qml:145 |
657 | 82 | msgid "Silence after" | 82 | msgid "Silence after" |
658 | 83 | msgstr "" | 83 | msgstr "" |
659 | 84 | 84 | ||
661 | 85 | #: ../app/alarm/AlarmSettingsPage.qml:205 | 85 | #: ../app/alarm/AlarmSettingsPage.qml:214 |
662 | 86 | msgid "Snooze for" | 86 | msgid "Snooze for" |
663 | 87 | msgstr "" | 87 | msgstr "" |
664 | 88 | 88 | ||
666 | 89 | #: ../app/alarm/AlarmSettingsPage.qml:249 | 89 | #: ../app/alarm/AlarmSettingsPage.qml:259 |
667 | 90 | msgid "Vibration" | 90 | msgid "Vibration" |
668 | 91 | msgstr "" | 91 | msgstr "" |
669 | 92 | 92 | ||
671 | 93 | #: ../app/alarm/AlarmSettingsPage.qml:278 | 93 | #: ../app/alarm/AlarmSettingsPage.qml:293 |
672 | 94 | msgid "Change time and date" | 94 | msgid "Change time and date" |
673 | 95 | msgstr "" | 95 | msgstr "" |
674 | 96 | 96 | ||
676 | 97 | #: ../app/alarm/AlarmSound.qml:28 ../app/alarm/EditAlarmPage.qml:316 | 97 | #: ../app/alarm/AlarmSound.qml:28 ../app/alarm/EditAlarmPage.qml:315 |
677 | 98 | msgid "Sound" | 98 | msgid "Sound" |
678 | 99 | msgstr "" | 99 | msgstr "" |
679 | 100 | 100 | ||
680 | @@ -150,12 +150,16 @@ | |||
681 | 150 | msgid "Edit alarm" | 150 | msgid "Edit alarm" |
682 | 151 | msgstr "" | 151 | msgstr "" |
683 | 152 | 152 | ||
685 | 153 | #: ../app/alarm/EditAlarmPage.qml:337 | 153 | #: ../app/alarm/EditAlarmPage.qml:336 |
686 | 154 | msgid "Delete alarm" | 154 | msgid "Delete alarm" |
687 | 155 | msgstr "" | 155 | msgstr "" |
688 | 156 | 156 | ||
691 | 157 | #: ../app/clock/ClockPage.qml:152 | 157 | #: ../app/clock/ClockPage.qml:268 |
692 | 158 | msgid "Location" | 158 | msgid "Location Service Error!" |
693 | 159 | msgstr "" | ||
694 | 160 | |||
695 | 161 | #: ../app/clock/ClockPage.qml:270 | ||
696 | 162 | msgid "Retrieving location..." | ||
697 | 159 | msgstr "" | 163 | msgstr "" |
698 | 160 | 164 | ||
699 | 161 | #: ../app/worldclock/AddWorldCityButton.qml:30 | 165 | #: ../app/worldclock/AddWorldCityButton.qml:30 |
700 | @@ -207,23 +211,23 @@ | |||
701 | 207 | msgid "Select a city" | 211 | msgid "Select a city" |
702 | 208 | msgstr "" | 212 | msgstr "" |
703 | 209 | 213 | ||
705 | 210 | #: ../app/worldclock/WorldCityList.qml:94 | 214 | #: ../app/worldclock/WorldCityList.qml:109 |
706 | 211 | msgid "Search..." | 215 | msgid "Search..." |
707 | 212 | msgstr "" | 216 | msgstr "" |
708 | 213 | 217 | ||
710 | 214 | #: ../app/worldclock/WorldCityList.qml:205 | 218 | #: ../app/worldclock/WorldCityList.qml:214 |
711 | 215 | msgid "Searching for a city" | 219 | msgid "Searching for a city" |
712 | 216 | msgstr "" | 220 | msgstr "" |
713 | 217 | 221 | ||
715 | 218 | #: ../app/worldclock/WorldCityList.qml:210 | 222 | #: ../app/worldclock/WorldCityList.qml:219 |
716 | 219 | msgid "No City Found" | 223 | msgid "No City Found" |
717 | 220 | msgstr "" | 224 | msgstr "" |
718 | 221 | 225 | ||
720 | 222 | #: ../app/worldclock/WorldCityList.qml:216 | 226 | #: ../app/worldclock/WorldCityList.qml:225 |
721 | 223 | msgid "Unable to connect." | 227 | msgid "Unable to connect." |
722 | 224 | msgstr "" | 228 | msgstr "" |
723 | 225 | 229 | ||
725 | 226 | #: ../app/worldclock/WorldCityList.qml:217 | 230 | #: ../app/worldclock/WorldCityList.qml:226 |
726 | 227 | msgid "Please check your network connection and try again" | 231 | msgid "Please check your network connection and try again" |
727 | 228 | msgstr "" | 232 | msgstr "" |
728 | 229 | 233 | ||
729 | 230 | 234 | ||
730 | === modified file 'tests/unit/MockClockApp.qml' | |||
731 | --- tests/unit/MockClockApp.qml 2014-10-13 19:57:35 +0000 | |||
732 | +++ tests/unit/MockClockApp.qml 2014-11-04 15:58:17 +0000 | |||
733 | @@ -21,6 +21,7 @@ | |||
734 | 21 | import U1db 1.0 as U1db | 21 | import U1db 1.0 as U1db |
735 | 22 | import Ubuntu.Components 1.1 | 22 | import Ubuntu.Components 1.1 |
736 | 23 | import "../../app/clock" | 23 | import "../../app/clock" |
737 | 24 | import "../../app/components" | ||
738 | 24 | 25 | ||
739 | 25 | /* | 26 | /* |
740 | 26 | This file is meant to create a fake but fully fleshed clock app with its | 27 | This file is meant to create a fake but fully fleshed clock app with its |
741 | @@ -52,6 +53,14 @@ | |||
742 | 52 | defaults: { "digitalMode": false } | 53 | defaults: { "digitalMode": false } |
743 | 53 | } | 54 | } |
744 | 54 | 55 | ||
745 | 56 | U1db.Document { | ||
746 | 57 | id: userLocationDocument | ||
747 | 58 | create: true | ||
748 | 59 | database: clockDB | ||
749 | 60 | docId: "userLocationDocument" | ||
750 | 61 | defaults: { "lat": "NaN", "long": "Nan", "location": "Null" } | ||
751 | 62 | } | ||
752 | 63 | |||
753 | 55 | DateTime { | 64 | DateTime { |
754 | 56 | id: localTimeSource | 65 | id: localTimeSource |
755 | 57 | updateInterval: 1000 | 66 | updateInterval: 1000 |
756 | 58 | 67 | ||
757 | === modified file 'ubuntu-clock-app.json' | |||
758 | --- ubuntu-clock-app.json 2014-08-18 21:37:23 +0000 | |||
759 | +++ ubuntu-clock-app.json 2014-11-04 15:58:17 +0000 | |||
760 | @@ -2,7 +2,8 @@ | |||
761 | 2 | "policy_groups": [ | 2 | "policy_groups": [ |
762 | 3 | "audio", | 3 | "audio", |
763 | 4 | "calendar", | 4 | "calendar", |
765 | 5 | "networking" | 5 | "networking", |
766 | 6 | "location" | ||
767 | 6 | ], | 7 | ], |
768 | 7 | "policy_version": 1.2 | 8 | "policy_version": 1.2 |
769 | 8 | } | 9 | } |
770 | 9 | \ No newline at end of file | 10 | \ No newline at end of file |
FAILED: Continuous integration, rev:65 91.189. 93.70:8080/ job/ubuntu- clock-dev- ubuntu- clock-app- utopic- 3.0-ci/ 246/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic- python3/ 97 91.189. 93.70:8080/ job/generic- mediumtests- utopic- python3/ 97/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/ubuntu- clock-dev- ubuntu- clock-app- utopic- 3.0-utopic- amd64-ci/ 246
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- clock-dev- ubuntu- clock-app- utopic- 3.0-ci/ 246/rebuild
http://