Merge lp:~martin-borho/ubuntu-weather-app/reboot-real-weather-data into lp:ubuntu-weather-app/obsolete.trunk

Proposed by Martin Borho
Status: Superseded
Proposed branch: lp:~martin-borho/ubuntu-weather-app/reboot-real-weather-data
Merge into: lp:ubuntu-weather-app/obsolete.trunk
Diff against target: 2985 lines (+2795/-0) (has conflicts)
34 files modified
.bzrignore (+19/-0)
CMakeLists.txt (+108/-0)
COPYING (+674/-0)
README (+11/-0)
README.translations (+40/-0)
app/CMakeLists.txt (+17/-0)
app/components/CMakeLists.txt (+5/-0)
app/components/DayDelegate.qml (+109/-0)
app/components/HeaderRow.qml (+63/-0)
app/components/HomeGraphic.qml (+49/-0)
app/components/HomeTempInfo.qml (+73/-0)
app/data/CMakeLists.txt (+5/-0)
app/data/Storage.qml (+136/-0)
app/data/WeatherApi.js (+743/-0)
app/data/key.js (+1/-0)
app/ubuntu-weather-app.qml (+162/-0)
app/ui/CMakeLists.txt (+5/-0)
app/ui/HomePage.qml (+140/-0)
backend/CMakeLists.txt (+29/-0)
debian/changelog (+173/-0)
debian/compat (+1/-0)
debian/control (+40/-0)
debian/copyright (+54/-0)
debian/rules (+14/-0)
debian/source/format (+1/-0)
debian/ubuntu-weather-app-autopilot.install (+1/-0)
debian/ubuntu-weather-app.install (+1/-0)
manifest.json.in (+23/-0)
po/CMakeLists.txt (+33/-0)
po/com.ubuntu.weather.pot (+36/-0)
tests/CMakeLists.txt (+3/-0)
tests/autopilot/CMakeLists.txt (+8/-0)
ubuntu-weather-app.apparmor (+6/-0)
ubuntu-weather-app.desktop.in.in (+12/-0)
Conflict adding file .bzrignore.  Moved existing file to .bzrignore.moved.
Conflict adding file CMakeLists.txt.  Moved existing file to CMakeLists.txt.moved.
Conflict adding file COPYING.  Moved existing file to COPYING.moved.
Conflict adding file README.  Moved existing file to README.moved.
Conflict adding file README.translations.  Moved existing file to README.translations.moved.
Conflict adding file debian.  Moved existing file to debian.moved.
Conflict adding file po.  Moved existing file to po.moved.
Conflict adding file tests.  Moved existing file to tests.moved.
To merge this branch: bzr merge lp:~martin-borho/ubuntu-weather-app/reboot-real-weather-data
Reviewer Review Type Date Requested Status
Ubuntu Weather Developers Pending
Review via email: mp+249000@code.launchpad.net

This proposal has been superseded by a proposal from 2015-02-07.

Commit message

Filled static prototype components with real weather data.

Description of the change

Filled static prototype components with real weather data.

To post a comment you must log in.
7. By Martin Borho

Filled static prototype components with real weather data.

Approved by Victor Thompson, Ubuntu Phone Apps Jenkins Bot.

8. By Andrew Hayzen

* Add bottom edge page listing the locations.

Approved by Victor Thompson, Ubuntu Phone Apps Jenkins Bot.

9. By Andrew Hayzen

* Use Settings API, with migration of data - deletion of old data not enabled yet.

Approved by Victor Thompson, Ubuntu Phone Apps Jenkins Bot.

10. By Andrew Hayzen

* Basic implementation of settings for Units, DataProvider and RefreshInterval. Fixes: https://bugs.launchpad.net/bugs/1420609.

Approved by Victor Thompson, Ubuntu Phone Apps Jenkins Bot.

11. By Martin Borho

Put locations in a Listview and all in a Flickable

12. By Martin Borho

removed snapMode for LocatioonPanes due to error

13. By Martin Borho

minor comments changes

14. By Martin Borho

added current property to settings

15. By Martin Borho

removed highlightMoveDuration

16. By Martin Borho

currentIndex gets set from settings.current

17. By Martin Borho

formatting

18. By Martin Borho

pushing HomePage.qml directly to pagestack

Unmerged revisions

18. By Martin Borho

pushing HomePage.qml directly to pagestack

17. By Martin Borho

formatting

16. By Martin Borho

currentIndex gets set from settings.current

15. By Martin Borho

removed highlightMoveDuration

14. By Martin Borho

added current property to settings

13. By Martin Borho

minor comments changes

12. By Martin Borho

removed snapMode for LocatioonPanes due to error

11. By Martin Borho

Put locations in a Listview and all in a Flickable

10. By Andrew Hayzen

* Basic implementation of settings for Units, DataProvider and RefreshInterval. Fixes: https://bugs.launchpad.net/bugs/1420609.

Approved by Victor Thompson, Ubuntu Phone Apps Jenkins Bot.

9. By Andrew Hayzen

* Use Settings API, with migration of data - deletion of old data not enabled yet.

Approved by Victor Thompson, Ubuntu Phone Apps Jenkins Bot.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.bzrignore'
2--- .bzrignore 1970-01-01 00:00:00 +0000
3+++ .bzrignore 2015-02-07 17:39:34 +0000
4@@ -0,0 +1,19 @@
5+*.user*
6+debian/files
7+debian/tmp
8+debian/ubuntu-weather-app*
9+debian/app-template/
10+debian/*.debhelper.log
11+debian/*.substvars
12+.build
13+Makefile
14+CMakeCache.txt
15+CMakeFiles/
16+*.cmake
17+*.gmo
18+*.mo
19+*.desktop
20+*.desktop.in
21+*.desktop.in.in.h
22+.excludes
23+ubuntu-weather-app.json
24
25=== renamed file '.bzrignore' => '.bzrignore.moved'
26=== added file 'CMakeLists.txt'
27--- CMakeLists.txt 1970-01-01 00:00:00 +0000
28+++ CMakeLists.txt 2015-02-07 17:39:34 +0000
29@@ -0,0 +1,108 @@
30+project(com.ubuntu.weather)
31+cmake_minimum_required(VERSION 2.8.9)
32+
33+find_program(INTLTOOL_MERGE intltool-merge)
34+if(NOT INTLTOOL_MERGE)
35+ message(FATAL_ERROR "Could not find intltool-merge, please install the intltool package")
36+endif()
37+find_program(INTLTOOL_EXTRACT intltool-extract)
38+if(NOT INTLTOOL_EXTRACT)
39+ message(FATAL_ERROR "Could not find intltool-extract, please install the intltool package")
40+endif()
41+
42+set (UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Relative path to the manifest file")
43+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-permissive -pedantic -Wall -Wextra")
44+
45+find_package(Qt5Core REQUIRED)
46+find_package(Qt5Qml REQUIRED)
47+find_package(Qt5Quick REQUIRED)
48+
49+# Automatically create moc files
50+set(CMAKE_AUTOMOC ON)
51+
52+option(INSTALL_TESTS "Install the tests on make install" on)
53+option(CLICK_MODE "Build as a click package" on)
54+
55+# Tests
56+enable_testing()
57+
58+# Standard install paths
59+include(GNUInstallDirs)
60+
61+set(APP_NAME weather)
62+set(APP_HARDCODE ubuntu-weather-app)
63+set(MAIN_QML ${APP_HARDCODE}.qml)
64+set(DESKTOP_FILE "${APP_HARDCODE}.desktop")
65+set(ICON weather-app@30.png)
66+set(AUTOPILOT_DIR ubuntu_weather_app)
67+
68+# Set install paths
69+if(CLICK_MODE)
70+ set(CMAKE_INSTALL_PREFIX "/")
71+ set(UBUNTU-WEATHER_APP_DIR "${CMAKE_INSTALL_DATADIR}/qml")
72+
73+ set(QT_IMPORTS_DIR "${CMAKE_INSTALL_LIBDIR}")
74+ set(EXEC "qmlscene $@ ${UBUNTU-WEATHER_APP_DIR}/${MAIN_QML}")
75+ set(MODULE_PATH ${QT_IMPORTS_DIR})
76+ if(NOT BZR_REVNO)
77+ execute_process(
78+ COMMAND bzr revno
79+ OUTPUT_VARIABLE BZR_REVNO
80+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
81+ OUTPUT_STRIP_TRAILING_WHITESPACE
82+ )
83+ endif(NOT BZR_REVNO)
84+ if(NOT BZR_SOURCE)
85+ set(BZR_SOURCE "lp:${APP_HARDCODE}/reboot")
86+ message("-- Setting BZR_SOURCE to ${BZR_SOURCE}")
87+ endif(NOT BZR_SOURCE)
88+else(CLICK_MODE)
89+ set(UBUNTU-WEATHER_APP_DIR "${CMAKE_INSTALL_DATADIR}/ubuntu-weather-app")
90+ execute_process(
91+ COMMAND qmake -query QT_INSTALL_QML
92+ OUTPUT_VARIABLE QT_IMPORTS_DIR
93+ OUTPUT_STRIP_TRAILING_WHITESPACE
94+ )
95+ set(MODULE_PATH ${QT_IMPORTS_DIR}/WeatherApp)
96+endif(CLICK_MODE)
97+
98+if(${CLICK_MODE})
99+ message("-- Configuring manifest.json")
100+
101+ execute_process(
102+ COMMAND dpkg-architecture -qDEB_HOST_ARCH
103+ OUTPUT_VARIABLE CLICK_ARCH
104+ OUTPUT_STRIP_TRAILING_WHITESPACE
105+ )
106+
107+ configure_file(${UBUNTU_MANIFEST_PATH} ${CMAKE_CURRENT_BINARY_DIR}/manifest.json)
108+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION ${CMAKE_INSTALL_PREFIX})
109+ install(FILES "${APP_HARDCODE}.apparmor" DESTINATION ${CMAKE_INSTALL_PREFIX})
110+else(CLICK_MODE)
111+ set(EXEC "qmlscene $@ -I ${MODULE_PATH} ${CMAKE_INSTALL_PREFIX}/${UBUNTU-WEATHER_APP_DIR}/${MAIN_QML}")
112+endif()
113+
114+
115+file(GLOB_RECURSE I18N_SRC_FILES
116+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po
117+ *.qml *.js)
118+list(APPEND I18N_SRC_FILES ${DESKTOP_FILE}.in.in.h)
119+list(SORT I18N_SRC_FILES)
120+
121+configure_file(${DESKTOP_FILE}.in.in ${DESKTOP_FILE}.in)
122+
123+add_custom_target(${DESKTOP_FILE} ALL
124+ COMMENT "Merging translations into ${DESKTOP_FILE}..."
125+ COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${DESKTOP_FILE}.in ${DESKTOP_FILE}
126+)
127+
128+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}
129+ DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
130+
131+add_subdirectory(app)
132+add_subdirectory(backend)
133+add_subdirectory(po)
134+add_subdirectory(tests)
135+
136+# TODO: Add custom target for autopilot and run.
137+
138
139=== renamed file 'CMakeLists.txt' => 'CMakeLists.txt.moved'
140=== added file 'COPYING'
141--- COPYING 1970-01-01 00:00:00 +0000
142+++ COPYING 2015-02-07 17:39:34 +0000
143@@ -0,0 +1,674 @@
144+ GNU GENERAL PUBLIC LICENSE
145+ Version 3, 29 June 2007
146+
147+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
148+ Everyone is permitted to copy and distribute verbatim copies
149+ of this license document, but changing it is not allowed.
150+
151+ Preamble
152+
153+ The GNU General Public License is a free, copyleft license for
154+software and other kinds of works.
155+
156+ The licenses for most software and other practical works are designed
157+to take away your freedom to share and change the works. By contrast,
158+the GNU General Public License is intended to guarantee your freedom to
159+share and change all versions of a program--to make sure it remains free
160+software for all its users. We, the Free Software Foundation, use the
161+GNU General Public License for most of our software; it applies also to
162+any other work released this way by its authors. You can apply it to
163+your programs, too.
164+
165+ When we speak of free software, we are referring to freedom, not
166+price. Our General Public Licenses are designed to make sure that you
167+have the freedom to distribute copies of free software (and charge for
168+them if you wish), that you receive source code or can get it if you
169+want it, that you can change the software or use pieces of it in new
170+free programs, and that you know you can do these things.
171+
172+ To protect your rights, we need to prevent others from denying you
173+these rights or asking you to surrender the rights. Therefore, you have
174+certain responsibilities if you distribute copies of the software, or if
175+you modify it: responsibilities to respect the freedom of others.
176+
177+ For example, if you distribute copies of such a program, whether
178+gratis or for a fee, you must pass on to the recipients the same
179+freedoms that you received. You must make sure that they, too, receive
180+or can get the source code. And you must show them these terms so they
181+know their rights.
182+
183+ Developers that use the GNU GPL protect your rights with two steps:
184+(1) assert copyright on the software, and (2) offer you this License
185+giving you legal permission to copy, distribute and/or modify it.
186+
187+ For the developers' and authors' protection, the GPL clearly explains
188+that there is no warranty for this free software. For both users' and
189+authors' sake, the GPL requires that modified versions be marked as
190+changed, so that their problems will not be attributed erroneously to
191+authors of previous versions.
192+
193+ Some devices are designed to deny users access to install or run
194+modified versions of the software inside them, although the manufacturer
195+can do so. This is fundamentally incompatible with the aim of
196+protecting users' freedom to change the software. The systematic
197+pattern of such abuse occurs in the area of products for individuals to
198+use, which is precisely where it is most unacceptable. Therefore, we
199+have designed this version of the GPL to prohibit the practice for those
200+products. If such problems arise substantially in other domains, we
201+stand ready to extend this provision to those domains in future versions
202+of the GPL, as needed to protect the freedom of users.
203+
204+ Finally, every program is threatened constantly by software patents.
205+States should not allow patents to restrict development and use of
206+software on general-purpose computers, but in those that do, we wish to
207+avoid the special danger that patents applied to a free program could
208+make it effectively proprietary. To prevent this, the GPL assures that
209+patents cannot be used to render the program non-free.
210+
211+ The precise terms and conditions for copying, distribution and
212+modification follow.
213+
214+ TERMS AND CONDITIONS
215+
216+ 0. Definitions.
217+
218+ "This License" refers to version 3 of the GNU General Public License.
219+
220+ "Copyright" also means copyright-like laws that apply to other kinds of
221+works, such as semiconductor masks.
222+
223+ "The Program" refers to any copyrightable work licensed under this
224+License. Each licensee is addressed as "you". "Licensees" and
225+"recipients" may be individuals or organizations.
226+
227+ To "modify" a work means to copy from or adapt all or part of the work
228+in a fashion requiring copyright permission, other than the making of an
229+exact copy. The resulting work is called a "modified version" of the
230+earlier work or a work "based on" the earlier work.
231+
232+ A "covered work" means either the unmodified Program or a work based
233+on the Program.
234+
235+ To "propagate" a work means to do anything with it that, without
236+permission, would make you directly or secondarily liable for
237+infringement under applicable copyright law, except executing it on a
238+computer or modifying a private copy. Propagation includes copying,
239+distribution (with or without modification), making available to the
240+public, and in some countries other activities as well.
241+
242+ To "convey" a work means any kind of propagation that enables other
243+parties to make or receive copies. Mere interaction with a user through
244+a computer network, with no transfer of a copy, is not conveying.
245+
246+ An interactive user interface displays "Appropriate Legal Notices"
247+to the extent that it includes a convenient and prominently visible
248+feature that (1) displays an appropriate copyright notice, and (2)
249+tells the user that there is no warranty for the work (except to the
250+extent that warranties are provided), that licensees may convey the
251+work under this License, and how to view a copy of this License. If
252+the interface presents a list of user commands or options, such as a
253+menu, a prominent item in the list meets this criterion.
254+
255+ 1. Source Code.
256+
257+ The "source code" for a work means the preferred form of the work
258+for making modifications to it. "Object code" means any non-source
259+form of a work.
260+
261+ A "Standard Interface" means an interface that either is an official
262+standard defined by a recognized standards body, or, in the case of
263+interfaces specified for a particular programming language, one that
264+is widely used among developers working in that language.
265+
266+ The "System Libraries" of an executable work include anything, other
267+than the work as a whole, that (a) is included in the normal form of
268+packaging a Major Component, but which is not part of that Major
269+Component, and (b) serves only to enable use of the work with that
270+Major Component, or to implement a Standard Interface for which an
271+implementation is available to the public in source code form. A
272+"Major Component", in this context, means a major essential component
273+(kernel, window system, and so on) of the specific operating system
274+(if any) on which the executable work runs, or a compiler used to
275+produce the work, or an object code interpreter used to run it.
276+
277+ The "Corresponding Source" for a work in object code form means all
278+the source code needed to generate, install, and (for an executable
279+work) run the object code and to modify the work, including scripts to
280+control those activities. However, it does not include the work's
281+System Libraries, or general-purpose tools or generally available free
282+programs which are used unmodified in performing those activities but
283+which are not part of the work. For example, Corresponding Source
284+includes interface definition files associated with source files for
285+the work, and the source code for shared libraries and dynamically
286+linked subprograms that the work is specifically designed to require,
287+such as by intimate data communication or control flow between those
288+subprograms and other parts of the work.
289+
290+ The Corresponding Source need not include anything that users
291+can regenerate automatically from other parts of the Corresponding
292+Source.
293+
294+ The Corresponding Source for a work in source code form is that
295+same work.
296+
297+ 2. Basic Permissions.
298+
299+ All rights granted under this License are granted for the term of
300+copyright on the Program, and are irrevocable provided the stated
301+conditions are met. This License explicitly affirms your unlimited
302+permission to run the unmodified Program. The output from running a
303+covered work is covered by this License only if the output, given its
304+content, constitutes a covered work. This License acknowledges your
305+rights of fair use or other equivalent, as provided by copyright law.
306+
307+ You may make, run and propagate covered works that you do not
308+convey, without conditions so long as your license otherwise remains
309+in force. You may convey covered works to others for the sole purpose
310+of having them make modifications exclusively for you, or provide you
311+with facilities for running those works, provided that you comply with
312+the terms of this License in conveying all material for which you do
313+not control copyright. Those thus making or running the covered works
314+for you must do so exclusively on your behalf, under your direction
315+and control, on terms that prohibit them from making any copies of
316+your copyrighted material outside their relationship with you.
317+
318+ Conveying under any other circumstances is permitted solely under
319+the conditions stated below. Sublicensing is not allowed; section 10
320+makes it unnecessary.
321+
322+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
323+
324+ No covered work shall be deemed part of an effective technological
325+measure under any applicable law fulfilling obligations under article
326+11 of the WIPO copyright treaty adopted on 20 December 1996, or
327+similar laws prohibiting or restricting circumvention of such
328+measures.
329+
330+ When you convey a covered work, you waive any legal power to forbid
331+circumvention of technological measures to the extent such circumvention
332+is effected by exercising rights under this License with respect to
333+the covered work, and you disclaim any intention to limit operation or
334+modification of the work as a means of enforcing, against the work's
335+users, your or third parties' legal rights to forbid circumvention of
336+technological measures.
337+
338+ 4. Conveying Verbatim Copies.
339+
340+ You may convey verbatim copies of the Program's source code as you
341+receive it, in any medium, provided that you conspicuously and
342+appropriately publish on each copy an appropriate copyright notice;
343+keep intact all notices stating that this License and any
344+non-permissive terms added in accord with section 7 apply to the code;
345+keep intact all notices of the absence of any warranty; and give all
346+recipients a copy of this License along with the Program.
347+
348+ You may charge any price or no price for each copy that you convey,
349+and you may offer support or warranty protection for a fee.
350+
351+ 5. Conveying Modified Source Versions.
352+
353+ You may convey a work based on the Program, or the modifications to
354+produce it from the Program, in the form of source code under the
355+terms of section 4, provided that you also meet all of these conditions:
356+
357+ a) The work must carry prominent notices stating that you modified
358+ it, and giving a relevant date.
359+
360+ b) The work must carry prominent notices stating that it is
361+ released under this License and any conditions added under section
362+ 7. This requirement modifies the requirement in section 4 to
363+ "keep intact all notices".
364+
365+ c) You must license the entire work, as a whole, under this
366+ License to anyone who comes into possession of a copy. This
367+ License will therefore apply, along with any applicable section 7
368+ additional terms, to the whole of the work, and all its parts,
369+ regardless of how they are packaged. This License gives no
370+ permission to license the work in any other way, but it does not
371+ invalidate such permission if you have separately received it.
372+
373+ d) If the work has interactive user interfaces, each must display
374+ Appropriate Legal Notices; however, if the Program has interactive
375+ interfaces that do not display Appropriate Legal Notices, your
376+ work need not make them do so.
377+
378+ A compilation of a covered work with other separate and independent
379+works, which are not by their nature extensions of the covered work,
380+and which are not combined with it such as to form a larger program,
381+in or on a volume of a storage or distribution medium, is called an
382+"aggregate" if the compilation and its resulting copyright are not
383+used to limit the access or legal rights of the compilation's users
384+beyond what the individual works permit. Inclusion of a covered work
385+in an aggregate does not cause this License to apply to the other
386+parts of the aggregate.
387+
388+ 6. Conveying Non-Source Forms.
389+
390+ You may convey a covered work in object code form under the terms
391+of sections 4 and 5, provided that you also convey the
392+machine-readable Corresponding Source under the terms of this License,
393+in one of these ways:
394+
395+ a) Convey the object code in, or embodied in, a physical product
396+ (including a physical distribution medium), accompanied by the
397+ Corresponding Source fixed on a durable physical medium
398+ customarily used for software interchange.
399+
400+ b) Convey the object code in, or embodied in, a physical product
401+ (including a physical distribution medium), accompanied by a
402+ written offer, valid for at least three years and valid for as
403+ long as you offer spare parts or customer support for that product
404+ model, to give anyone who possesses the object code either (1) a
405+ copy of the Corresponding Source for all the software in the
406+ product that is covered by this License, on a durable physical
407+ medium customarily used for software interchange, for a price no
408+ more than your reasonable cost of physically performing this
409+ conveying of source, or (2) access to copy the
410+ Corresponding Source from a network server at no charge.
411+
412+ c) Convey individual copies of the object code with a copy of the
413+ written offer to provide the Corresponding Source. This
414+ alternative is allowed only occasionally and noncommercially, and
415+ only if you received the object code with such an offer, in accord
416+ with subsection 6b.
417+
418+ d) Convey the object code by offering access from a designated
419+ place (gratis or for a charge), and offer equivalent access to the
420+ Corresponding Source in the same way through the same place at no
421+ further charge. You need not require recipients to copy the
422+ Corresponding Source along with the object code. If the place to
423+ copy the object code is a network server, the Corresponding Source
424+ may be on a different server (operated by you or a third party)
425+ that supports equivalent copying facilities, provided you maintain
426+ clear directions next to the object code saying where to find the
427+ Corresponding Source. Regardless of what server hosts the
428+ Corresponding Source, you remain obligated to ensure that it is
429+ available for as long as needed to satisfy these requirements.
430+
431+ e) Convey the object code using peer-to-peer transmission, provided
432+ you inform other peers where the object code and Corresponding
433+ Source of the work are being offered to the general public at no
434+ charge under subsection 6d.
435+
436+ A separable portion of the object code, whose source code is excluded
437+from the Corresponding Source as a System Library, need not be
438+included in conveying the object code work.
439+
440+ A "User Product" is either (1) a "consumer product", which means any
441+tangible personal property which is normally used for personal, family,
442+or household purposes, or (2) anything designed or sold for incorporation
443+into a dwelling. In determining whether a product is a consumer product,
444+doubtful cases shall be resolved in favor of coverage. For a particular
445+product received by a particular user, "normally used" refers to a
446+typical or common use of that class of product, regardless of the status
447+of the particular user or of the way in which the particular user
448+actually uses, or expects or is expected to use, the product. A product
449+is a consumer product regardless of whether the product has substantial
450+commercial, industrial or non-consumer uses, unless such uses represent
451+the only significant mode of use of the product.
452+
453+ "Installation Information" for a User Product means any methods,
454+procedures, authorization keys, or other information required to install
455+and execute modified versions of a covered work in that User Product from
456+a modified version of its Corresponding Source. The information must
457+suffice to ensure that the continued functioning of the modified object
458+code is in no case prevented or interfered with solely because
459+modification has been made.
460+
461+ If you convey an object code work under this section in, or with, or
462+specifically for use in, a User Product, and the conveying occurs as
463+part of a transaction in which the right of possession and use of the
464+User Product is transferred to the recipient in perpetuity or for a
465+fixed term (regardless of how the transaction is characterized), the
466+Corresponding Source conveyed under this section must be accompanied
467+by the Installation Information. But this requirement does not apply
468+if neither you nor any third party retains the ability to install
469+modified object code on the User Product (for example, the work has
470+been installed in ROM).
471+
472+ The requirement to provide Installation Information does not include a
473+requirement to continue to provide support service, warranty, or updates
474+for a work that has been modified or installed by the recipient, or for
475+the User Product in which it has been modified or installed. Access to a
476+network may be denied when the modification itself materially and
477+adversely affects the operation of the network or violates the rules and
478+protocols for communication across the network.
479+
480+ Corresponding Source conveyed, and Installation Information provided,
481+in accord with this section must be in a format that is publicly
482+documented (and with an implementation available to the public in
483+source code form), and must require no special password or key for
484+unpacking, reading or copying.
485+
486+ 7. Additional Terms.
487+
488+ "Additional permissions" are terms that supplement the terms of this
489+License by making exceptions from one or more of its conditions.
490+Additional permissions that are applicable to the entire Program shall
491+be treated as though they were included in this License, to the extent
492+that they are valid under applicable law. If additional permissions
493+apply only to part of the Program, that part may be used separately
494+under those permissions, but the entire Program remains governed by
495+this License without regard to the additional permissions.
496+
497+ When you convey a copy of a covered work, you may at your option
498+remove any additional permissions from that copy, or from any part of
499+it. (Additional permissions may be written to require their own
500+removal in certain cases when you modify the work.) You may place
501+additional permissions on material, added by you to a covered work,
502+for which you have or can give appropriate copyright permission.
503+
504+ Notwithstanding any other provision of this License, for material you
505+add to a covered work, you may (if authorized by the copyright holders of
506+that material) supplement the terms of this License with terms:
507+
508+ a) Disclaiming warranty or limiting liability differently from the
509+ terms of sections 15 and 16 of this License; or
510+
511+ b) Requiring preservation of specified reasonable legal notices or
512+ author attributions in that material or in the Appropriate Legal
513+ Notices displayed by works containing it; or
514+
515+ c) Prohibiting misrepresentation of the origin of that material, or
516+ requiring that modified versions of such material be marked in
517+ reasonable ways as different from the original version; or
518+
519+ d) Limiting the use for publicity purposes of names of licensors or
520+ authors of the material; or
521+
522+ e) Declining to grant rights under trademark law for use of some
523+ trade names, trademarks, or service marks; or
524+
525+ f) Requiring indemnification of licensors and authors of that
526+ material by anyone who conveys the material (or modified versions of
527+ it) with contractual assumptions of liability to the recipient, for
528+ any liability that these contractual assumptions directly impose on
529+ those licensors and authors.
530+
531+ All other non-permissive additional terms are considered "further
532+restrictions" within the meaning of section 10. If the Program as you
533+received it, or any part of it, contains a notice stating that it is
534+governed by this License along with a term that is a further
535+restriction, you may remove that term. If a license document contains
536+a further restriction but permits relicensing or conveying under this
537+License, you may add to a covered work material governed by the terms
538+of that license document, provided that the further restriction does
539+not survive such relicensing or conveying.
540+
541+ If you add terms to a covered work in accord with this section, you
542+must place, in the relevant source files, a statement of the
543+additional terms that apply to those files, or a notice indicating
544+where to find the applicable terms.
545+
546+ Additional terms, permissive or non-permissive, may be stated in the
547+form of a separately written license, or stated as exceptions;
548+the above requirements apply either way.
549+
550+ 8. Termination.
551+
552+ You may not propagate or modify a covered work except as expressly
553+provided under this License. Any attempt otherwise to propagate or
554+modify it is void, and will automatically terminate your rights under
555+this License (including any patent licenses granted under the third
556+paragraph of section 11).
557+
558+ However, if you cease all violation of this License, then your
559+license from a particular copyright holder is reinstated (a)
560+provisionally, unless and until the copyright holder explicitly and
561+finally terminates your license, and (b) permanently, if the copyright
562+holder fails to notify you of the violation by some reasonable means
563+prior to 60 days after the cessation.
564+
565+ Moreover, your license from a particular copyright holder is
566+reinstated permanently if the copyright holder notifies you of the
567+violation by some reasonable means, this is the first time you have
568+received notice of violation of this License (for any work) from that
569+copyright holder, and you cure the violation prior to 30 days after
570+your receipt of the notice.
571+
572+ Termination of your rights under this section does not terminate the
573+licenses of parties who have received copies or rights from you under
574+this License. If your rights have been terminated and not permanently
575+reinstated, you do not qualify to receive new licenses for the same
576+material under section 10.
577+
578+ 9. Acceptance Not Required for Having Copies.
579+
580+ You are not required to accept this License in order to receive or
581+run a copy of the Program. Ancillary propagation of a covered work
582+occurring solely as a consequence of using peer-to-peer transmission
583+to receive a copy likewise does not require acceptance. However,
584+nothing other than this License grants you permission to propagate or
585+modify any covered work. These actions infringe copyright if you do
586+not accept this License. Therefore, by modifying or propagating a
587+covered work, you indicate your acceptance of this License to do so.
588+
589+ 10. Automatic Licensing of Downstream Recipients.
590+
591+ Each time you convey a covered work, the recipient automatically
592+receives a license from the original licensors, to run, modify and
593+propagate that work, subject to this License. You are not responsible
594+for enforcing compliance by third parties with this License.
595+
596+ An "entity transaction" is a transaction transferring control of an
597+organization, or substantially all assets of one, or subdividing an
598+organization, or merging organizations. If propagation of a covered
599+work results from an entity transaction, each party to that
600+transaction who receives a copy of the work also receives whatever
601+licenses to the work the party's predecessor in interest had or could
602+give under the previous paragraph, plus a right to possession of the
603+Corresponding Source of the work from the predecessor in interest, if
604+the predecessor has it or can get it with reasonable efforts.
605+
606+ You may not impose any further restrictions on the exercise of the
607+rights granted or affirmed under this License. For example, you may
608+not impose a license fee, royalty, or other charge for exercise of
609+rights granted under this License, and you may not initiate litigation
610+(including a cross-claim or counterclaim in a lawsuit) alleging that
611+any patent claim is infringed by making, using, selling, offering for
612+sale, or importing the Program or any portion of it.
613+
614+ 11. Patents.
615+
616+ A "contributor" is a copyright holder who authorizes use under this
617+License of the Program or a work on which the Program is based. The
618+work thus licensed is called the contributor's "contributor version".
619+
620+ A contributor's "essential patent claims" are all patent claims
621+owned or controlled by the contributor, whether already acquired or
622+hereafter acquired, that would be infringed by some manner, permitted
623+by this License, of making, using, or selling its contributor version,
624+but do not include claims that would be infringed only as a
625+consequence of further modification of the contributor version. For
626+purposes of this definition, "control" includes the right to grant
627+patent sublicenses in a manner consistent with the requirements of
628+this License.
629+
630+ Each contributor grants you a non-exclusive, worldwide, royalty-free
631+patent license under the contributor's essential patent claims, to
632+make, use, sell, offer for sale, import and otherwise run, modify and
633+propagate the contents of its contributor version.
634+
635+ In the following three paragraphs, a "patent license" is any express
636+agreement or commitment, however denominated, not to enforce a patent
637+(such as an express permission to practice a patent or covenant not to
638+sue for patent infringement). To "grant" such a patent license to a
639+party means to make such an agreement or commitment not to enforce a
640+patent against the party.
641+
642+ If you convey a covered work, knowingly relying on a patent license,
643+and the Corresponding Source of the work is not available for anyone
644+to copy, free of charge and under the terms of this License, through a
645+publicly available network server or other readily accessible means,
646+then you must either (1) cause the Corresponding Source to be so
647+available, or (2) arrange to deprive yourself of the benefit of the
648+patent license for this particular work, or (3) arrange, in a manner
649+consistent with the requirements of this License, to extend the patent
650+license to downstream recipients. "Knowingly relying" means you have
651+actual knowledge that, but for the patent license, your conveying the
652+covered work in a country, or your recipient's use of the covered work
653+in a country, would infringe one or more identifiable patents in that
654+country that you have reason to believe are valid.
655+
656+ If, pursuant to or in connection with a single transaction or
657+arrangement, you convey, or propagate by procuring conveyance of, a
658+covered work, and grant a patent license to some of the parties
659+receiving the covered work authorizing them to use, propagate, modify
660+or convey a specific copy of the covered work, then the patent license
661+you grant is automatically extended to all recipients of the covered
662+work and works based on it.
663+
664+ A patent license is "discriminatory" if it does not include within
665+the scope of its coverage, prohibits the exercise of, or is
666+conditioned on the non-exercise of one or more of the rights that are
667+specifically granted under this License. You may not convey a covered
668+work if you are a party to an arrangement with a third party that is
669+in the business of distributing software, under which you make payment
670+to the third party based on the extent of your activity of conveying
671+the work, and under which the third party grants, to any of the
672+parties who would receive the covered work from you, a discriminatory
673+patent license (a) in connection with copies of the covered work
674+conveyed by you (or copies made from those copies), or (b) primarily
675+for and in connection with specific products or compilations that
676+contain the covered work, unless you entered into that arrangement,
677+or that patent license was granted, prior to 28 March 2007.
678+
679+ Nothing in this License shall be construed as excluding or limiting
680+any implied license or other defenses to infringement that may
681+otherwise be available to you under applicable patent law.
682+
683+ 12. No Surrender of Others' Freedom.
684+
685+ If conditions are imposed on you (whether by court order, agreement or
686+otherwise) that contradict the conditions of this License, they do not
687+excuse you from the conditions of this License. If you cannot convey a
688+covered work so as to satisfy simultaneously your obligations under this
689+License and any other pertinent obligations, then as a consequence you may
690+not convey it at all. For example, if you agree to terms that obligate you
691+to collect a royalty for further conveying from those to whom you convey
692+the Program, the only way you could satisfy both those terms and this
693+License would be to refrain entirely from conveying the Program.
694+
695+ 13. Use with the GNU Affero General Public License.
696+
697+ Notwithstanding any other provision of this License, you have
698+permission to link or combine any covered work with a work licensed
699+under version 3 of the GNU Affero General Public License into a single
700+combined work, and to convey the resulting work. The terms of this
701+License will continue to apply to the part which is the covered work,
702+but the special requirements of the GNU Affero General Public License,
703+section 13, concerning interaction through a network will apply to the
704+combination as such.
705+
706+ 14. Revised Versions of this License.
707+
708+ The Free Software Foundation may publish revised and/or new versions of
709+the GNU General Public License from time to time. Such new versions will
710+be similar in spirit to the present version, but may differ in detail to
711+address new problems or concerns.
712+
713+ Each version is given a distinguishing version number. If the
714+Program specifies that a certain numbered version of the GNU General
715+Public License "or any later version" applies to it, you have the
716+option of following the terms and conditions either of that numbered
717+version or of any later version published by the Free Software
718+Foundation. If the Program does not specify a version number of the
719+GNU General Public License, you may choose any version ever published
720+by the Free Software Foundation.
721+
722+ If the Program specifies that a proxy can decide which future
723+versions of the GNU General Public License can be used, that proxy's
724+public statement of acceptance of a version permanently authorizes you
725+to choose that version for the Program.
726+
727+ Later license versions may give you additional or different
728+permissions. However, no additional obligations are imposed on any
729+author or copyright holder as a result of your choosing to follow a
730+later version.
731+
732+ 15. Disclaimer of Warranty.
733+
734+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
735+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
736+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
737+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
738+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
739+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
740+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
741+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
742+
743+ 16. Limitation of Liability.
744+
745+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
746+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
747+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
748+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
749+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
750+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
751+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
752+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
753+SUCH DAMAGES.
754+
755+ 17. Interpretation of Sections 15 and 16.
756+
757+ If the disclaimer of warranty and limitation of liability provided
758+above cannot be given local legal effect according to their terms,
759+reviewing courts shall apply local law that most closely approximates
760+an absolute waiver of all civil liability in connection with the
761+Program, unless a warranty or assumption of liability accompanies a
762+copy of the Program in return for a fee.
763+
764+ END OF TERMS AND CONDITIONS
765+
766+ How to Apply These Terms to Your New Programs
767+
768+ If you develop a new program, and you want it to be of the greatest
769+possible use to the public, the best way to achieve this is to make it
770+free software which everyone can redistribute and change under these terms.
771+
772+ To do so, attach the following notices to the program. It is safest
773+to attach them to the start of each source file to most effectively
774+state the exclusion of warranty; and each file should have at least
775+the "copyright" line and a pointer to where the full notice is found.
776+
777+ <one line to give the program's name and a brief idea of what it does.>
778+ Copyright (C) <year> <name of author>
779+
780+ This program is free software: you can redistribute it and/or modify
781+ it under the terms of the GNU General Public License as published by
782+ the Free Software Foundation, either version 3 of the License, or
783+ (at your option) any later version.
784+
785+ This program is distributed in the hope that it will be useful,
786+ but WITHOUT ANY WARRANTY; without even the implied warranty of
787+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
788+ GNU General Public License for more details.
789+
790+ You should have received a copy of the GNU General Public License
791+ along with this program. If not, see <http://www.gnu.org/licenses/>.
792+
793+Also add information on how to contact you by electronic and paper mail.
794+
795+ If the program does terminal interaction, make it output a short
796+notice like this when it starts in an interactive mode:
797+
798+ <program> Copyright (C) <year> <name of author>
799+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
800+ This is free software, and you are welcome to redistribute it
801+ under certain conditions; type `show c' for details.
802+
803+The hypothetical commands `show w' and `show c' should show the appropriate
804+parts of the General Public License. Of course, your program's commands
805+might be different; for a GUI interface, you would use an "about box".
806+
807+ You should also get your employer (if you work as a programmer) or school,
808+if any, to sign a "copyright disclaimer" for the program, if necessary.
809+For more information on this, and how to apply and follow the GNU GPL, see
810+<http://www.gnu.org/licenses/>.
811+
812+ The GNU General Public License does not permit incorporating your program
813+into proprietary programs. If your program is a subroutine library, you
814+may consider it more useful to permit linking proprietary applications with
815+the library. If this is what you want to do, use the GNU Lesser General
816+Public License instead of this License. But first, please read
817+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
818
819=== renamed file 'COPYING' => 'COPYING.moved'
820=== added file 'README'
821--- README 1970-01-01 00:00:00 +0000
822+++ README 2015-02-07 17:39:34 +0000
823@@ -0,0 +1,11 @@
824+Weather app for Ubuntu devices
825+
826+To contribute:
827+ https://wiki.ubuntu.com/Touch/CoreApps/Weather
828+ https://wiki.ubuntu.com/Touch/CoreApps/DevelopmentGuide
829+
830+The following essential packages are required to develop this app:
831+- ubuntu-sdk (see http://developer.ubuntu.com/start)
832+- intltool - run the `sudo apt-get install intltool` command for installation
833+
834+See the debian/control file for an up-to-date list of dependencies
835
836=== renamed file 'README' => 'README.moved'
837=== added file 'README.translations'
838--- README.translations 1970-01-01 00:00:00 +0000
839+++ README.translations 2015-02-07 17:39:34 +0000
840@@ -0,0 +1,40 @@
841+# Updating translations
842+
843+Translations for the Weather app happen in [Launchpad Translations][] and
844+are automatically committed daily on the trunk branch in the po/ folder.
845+
846+They are then built and installed as part of the package build, so that
847+developers don't really need to worry about them.
848+
849+However, there is one task that needs to be taken care of: exposing new
850+translatable messages to translators. So whenever you add new translatable
851+messages in the code, make sure to follow these steps:
852+
853+ 1. Run click-buddy retaining the build directory:
854+ `click-buddy --dir . --no-clean`
855+ 2. Copy the .pot file from the <build dir> mentioned in the output to your
856+ original source:
857+ `cp <build dir>/po/*.pot po/`
858+ 3. Commit the generated .pot file:
859+ `bzr commit -m"Updated translation template"`
860+ 4. Push the branch and send a merge proposal as usual
861+
862+And that's it, once the branch lands Launchpad should take care of all the rest!
863+
864+# Behind the scenes
865+
866+Behind the scenes, whenever the po/*.pot file (also known as translations template)
867+is committed to trunk Launchpad reads it and updates the translatable strings
868+exposed in the web UI. This will enable translators to work on the new strings.
869+The translations template contains all translatable strings that have been
870+extracted from the source code files.
871+
872+Launchpad will then store translations in its database and will commit them daily
873+in the form of textual po/*.po files to trunk. The PO files are also usually
874+referred to as the translations files. You'll find a translation file for each
875+language the app has got at least a translated message available for.
876+
877+Translations for core apps follow the standard [gettext format].
878+
879+ [Launchpad Translations]: https://translations.launchpad.net/ubuntu-weather-app
880+ [gettext format]: https://www.gnu.org/software/gettext/
881
882=== renamed file 'README.translations' => 'README.translations.moved'
883=== added directory 'app'
884=== added file 'app/CMakeLists.txt'
885--- app/CMakeLists.txt 1970-01-01 00:00:00 +0000
886+++ app/CMakeLists.txt 2015-02-07 17:39:34 +0000
887@@ -0,0 +1,17 @@
888+if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
889+ file(GLOB QML_JS_FILES *.qml *.js)
890+ add_custom_target(ubuntu-weather-app_QMlFiles ALL SOURCES ${QML_JS_FILES})
891+endif(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
892+
893+
894+if(CLICK_MODE)
895+ set(ICON ${ICON})
896+ install(FILES ${ICON} DESTINATION ${CMAKE_INSTALL_PREFIX})
897+endif(CLICK_MODE)
898+
899+install(FILES ${MAIN_QML} DESTINATION ${UBUNTU-WEATHER_APP_DIR})
900+
901+add_subdirectory(components)
902+add_subdirectory(data)
903+add_subdirectory(ui)
904+
905
906=== added directory 'app/components'
907=== added file 'app/components/CMakeLists.txt'
908--- app/components/CMakeLists.txt 1970-01-01 00:00:00 +0000
909+++ app/components/CMakeLists.txt 2015-02-07 17:39:34 +0000
910@@ -0,0 +1,5 @@
911+file(GLOB COMPONENTS_QML_JS_FILES *.qml *.js)
912+
913+add_custom_target(ubuntu-weather-app_components_QMlFiles ALL SOURCES ${COMPONENTS_QML_JS_FILES})
914+
915+install(FILES ${COMPONENTS_QML_JS_FILES} DESTINATION ${UBUNTU-WEATHER_APP_DIR}/components)
916
917=== added file 'app/components/DayDelegate.qml'
918--- app/components/DayDelegate.qml 1970-01-01 00:00:00 +0000
919+++ app/components/DayDelegate.qml 2015-02-07 17:39:34 +0000
920@@ -0,0 +1,109 @@
921+/*
922+ * Copyright (C) 2015 Canonical Ltd
923+ *
924+ * This file is part of Ubuntu Weather App
925+ *
926+ * Ubuntu Weather App is free software: you can redistribute it and/or modify
927+ * it under the terms of the GNU General Public License version 3 as
928+ * published by the Free Software Foundation.
929+ *
930+ * Ubuntu Weather App is distributed in the hope that it will be useful,
931+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
932+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
933+ * GNU General Public License for more details.
934+ *
935+ * You should have received a copy of the GNU General Public License
936+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
937+ */
938+
939+import QtQuick 2.3
940+import Ubuntu.Components 1.1
941+import Ubuntu.Components.ListItems 0.1 as ListItem
942+
943+ListItem.Standard {
944+ height: units.gu(8)
945+
946+ // TODO: will expand when clicked to reveal more info
947+
948+ property alias day: dayLabel.text
949+ property alias image: weatherImage.source
950+ property alias high: highLabel.text
951+ property alias low: lowLabel.text
952+
953+ // Standard divider is not full width so add a ThinDivider to the bottom
954+ showDivider: false
955+
956+ ListItem.ThinDivider {
957+ anchors {
958+ bottom: parent.bottom
959+ }
960+ }
961+
962+ Label {
963+ id: dayLabel
964+ anchors {
965+ left: parent.left
966+ right: weatherImage.left
967+ rightMargin: units.gu(1)
968+ verticalCenter: parent.verticalCenter
969+ }
970+ elide: Text.ElideRight
971+ font.weight: Font.Light
972+ fontSize: "medium"
973+ }
974+
975+ Image {
976+ id: weatherImage
977+ anchors {
978+ horizontalCenter: parent.horizontalCenter
979+ verticalCenter: parent.verticalCenter
980+ }
981+ height: units.gu(3)
982+ width: units.gu(3)
983+
984+ Rectangle {
985+ anchors {
986+ fill: parent
987+ }
988+ color: "#F00"
989+
990+ Label {
991+ anchors {
992+ centerIn: parent
993+ }
994+ text: "img"
995+ }
996+ }
997+ }
998+
999+ Label {
1000+ id: lowLabel
1001+ anchors {
1002+ left: weatherImage.right
1003+ right: highLabel.left
1004+ rightMargin: units.gu(1)
1005+ verticalCenter: parent.verticalCenter
1006+ }
1007+ elide: Text.ElideRight
1008+ font.pixelSize: units.gu(2)
1009+ font.weight: Font.Light
1010+ fontSize: "medium"
1011+ height: units.gu(2)
1012+ horizontalAlignment: Text.AlignRight
1013+ verticalAlignment: Text.AlignTop // AlignTop appears to align bottom?
1014+ }
1015+
1016+ Label {
1017+ id: highLabel
1018+ anchors {
1019+ bottom: lowLabel.bottom
1020+ right: parent.right
1021+ }
1022+ color: UbuntuColors.orange
1023+ elide: Text.ElideRight
1024+ font.pixelSize: units.gu(3)
1025+ font.weight: Font.Normal
1026+ height: units.gu(3)
1027+ verticalAlignment: Text.AlignTop // AlignTop appears to align bottom?
1028+ }
1029+}
1030
1031=== added file 'app/components/HeaderRow.qml'
1032--- app/components/HeaderRow.qml 1970-01-01 00:00:00 +0000
1033+++ app/components/HeaderRow.qml 2015-02-07 17:39:34 +0000
1034@@ -0,0 +1,63 @@
1035+/*
1036+ * Copyright (C) 2015 Canonical Ltd
1037+ *
1038+ * This file is part of Ubuntu Weather App
1039+ *
1040+ * Ubuntu Weather App is free software: you can redistribute it and/or modify
1041+ * it under the terms of the GNU General Public License version 3 as
1042+ * published by the Free Software Foundation.
1043+ *
1044+ * Ubuntu Weather App is distributed in the hope that it will be useful,
1045+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1046+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1047+ * GNU General Public License for more details.
1048+ *
1049+ * You should have received a copy of the GNU General Public License
1050+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1051+ */
1052+
1053+import QtQuick 2.3
1054+import Ubuntu.Components 1.1
1055+
1056+
1057+Row {
1058+ spacing: units.gu(2)
1059+ width: parent.width
1060+
1061+ property alias locationName: locationNameLabel.text
1062+
1063+ Label {
1064+ id: locationNameLabel
1065+ color: UbuntuColors.darkGrey
1066+ elide: Text.ElideRight
1067+ font.weight: Font.Normal
1068+ fontSize: "large"
1069+ height: settingsButton.height
1070+ width: parent.width - settingsButton.width - parent.spacing
1071+ verticalAlignment: Text.AlignVCenter
1072+ }
1073+
1074+ AbstractButton {
1075+ id: settingsButton
1076+ height: width
1077+ width: units.gu(4)
1078+
1079+ Rectangle {
1080+ anchors {
1081+ fill: parent
1082+ }
1083+ color: Theme.palette.selected.background
1084+ visible: parent.pressed
1085+ }
1086+
1087+ Icon {
1088+ anchors {
1089+ centerIn: parent
1090+ }
1091+ color: UbuntuColors.darkGrey
1092+ name: "settings"
1093+ height: width
1094+ width: units.gu(2.5)
1095+ }
1096+ }
1097+}
1098
1099=== added file 'app/components/HomeGraphic.qml'
1100--- app/components/HomeGraphic.qml 1970-01-01 00:00:00 +0000
1101+++ app/components/HomeGraphic.qml 2015-02-07 17:39:34 +0000
1102@@ -0,0 +1,49 @@
1103+/*
1104+ * Copyright (C) 2015 Canonical Ltd
1105+ *
1106+ * This file is part of Ubuntu Weather App
1107+ *
1108+ * Ubuntu Weather App is free software: you can redistribute it and/or modify
1109+ * it under the terms of the GNU General Public License version 3 as
1110+ * published by the Free Software Foundation.
1111+ *
1112+ * Ubuntu Weather App is distributed in the hope that it will be useful,
1113+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1114+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1115+ * GNU General Public License for more details.
1116+ *
1117+ * You should have received a copy of the GNU General Public License
1118+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1119+ */
1120+
1121+import QtQuick 2.3
1122+import Ubuntu.Components 1.1
1123+
1124+Item {
1125+ height: units.gu(32)
1126+ width: parent.width
1127+
1128+ property alias icon: iconLabel.text
1129+
1130+ // TODO: will be on 'rails' (horizontal listview?) to reveal hourly forecast
1131+ Image {
1132+ anchors {
1133+ fill: parent
1134+ }
1135+
1136+ Rectangle {
1137+ anchors {
1138+ fill: parent
1139+ }
1140+ color: "#F00"
1141+
1142+ Label {
1143+ id: iconLabel
1144+ anchors {
1145+ centerIn: parent
1146+ }
1147+ }
1148+ }
1149+ }
1150+}
1151+
1152
1153=== added file 'app/components/HomeTempInfo.qml'
1154--- app/components/HomeTempInfo.qml 1970-01-01 00:00:00 +0000
1155+++ app/components/HomeTempInfo.qml 2015-02-07 17:39:34 +0000
1156@@ -0,0 +1,73 @@
1157+/*
1158+ * Copyright (C) 2015 Canonical Ltd
1159+ *
1160+ * This file is part of Ubuntu Weather App
1161+ *
1162+ * Ubuntu Weather App is free software: you can redistribute it and/or modify
1163+ * it under the terms of the GNU General Public License version 3 as
1164+ * published by the Free Software Foundation.
1165+ *
1166+ * Ubuntu Weather App is distributed in the hope that it will be useful,
1167+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1168+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1169+ * GNU General Public License for more details.
1170+ *
1171+ * You should have received a copy of the GNU General Public License
1172+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1173+ */
1174+
1175+import QtQuick 2.3
1176+import Ubuntu.Components 1.1
1177+
1178+
1179+Column {
1180+ anchors {
1181+ left: parent.left
1182+ right: parent.right
1183+ }
1184+ spacing: units.gu(1)
1185+
1186+ property alias description: descriptionLabel.text
1187+ property alias high: highLabel.text
1188+ property alias low: lowLabel.text
1189+ property alias now: nowLabel.text
1190+
1191+ Label {
1192+ font.weight: Font.Light
1193+ fontSize: "small"
1194+ text: i18n.tr("Today")
1195+ }
1196+
1197+ Label {
1198+ id: descriptionLabel
1199+ font.weight: Font.Normal
1200+ fontSize: "large"
1201+ }
1202+
1203+ Row {
1204+ spacing: units.gu(2)
1205+
1206+ Label {
1207+ id: nowLabel
1208+ color: UbuntuColors.orange
1209+ font.pixelSize: units.gu(8)
1210+ font.weight: Font.Light
1211+ height: units.gu(8)
1212+ verticalAlignment: Text.AlignBottom // AlignBottom seems to put it at the top?
1213+ }
1214+
1215+ Column {
1216+ Label {
1217+ id: lowLabel
1218+ font.weight: Font.Light
1219+ fontSize: "medium"
1220+ }
1221+
1222+ Label {
1223+ id: highLabel
1224+ font.weight: Font.Light
1225+ fontSize: "medium"
1226+ }
1227+ }
1228+ }
1229+}
1230
1231=== added directory 'app/data'
1232=== added file 'app/data/CMakeLists.txt'
1233--- app/data/CMakeLists.txt 1970-01-01 00:00:00 +0000
1234+++ app/data/CMakeLists.txt 2015-02-07 17:39:34 +0000
1235@@ -0,0 +1,5 @@
1236+file(GLOB DATA_QML_JS_FILES *.qml *.js)
1237+
1238+add_custom_target(ubuntu-weather-app_data_QMlFiles ALL SOURCES ${DATA_QML_JS_FILES})
1239+
1240+install(FILES ${DATA_QML_JS_FILES} DESTINATION ${UBUNTU-WEATHER_APP_DIR}/data)
1241
1242=== added file 'app/data/Storage.qml'
1243--- app/data/Storage.qml 1970-01-01 00:00:00 +0000
1244+++ app/data/Storage.qml 2015-02-07 17:39:34 +0000
1245@@ -0,0 +1,136 @@
1246+/*
1247+ * Copyright (C) 2013, 2014, 2015 Canonical Ltd
1248+ *
1249+ * This program is free software: you can redistribute it and/or modify
1250+ * it under the terms of the GNU General Public License version 3 as
1251+ * published by the Free Software Foundation.
1252+ *
1253+ * This program is distributed in the hope that it will be useful,
1254+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1255+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1256+ * GNU General Public License for more details.
1257+ *
1258+ * You should have received a copy of the GNU General Public License
1259+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1260+ *
1261+ * Authored by: Martin Borho <martin@borho.net>
1262+ */
1263+import QtQuick.LocalStorage 2.0
1264+import QtQuick 2.3
1265+
1266+Item {
1267+ property var db: null
1268+
1269+ function openDB() {
1270+ if(db !== null) return;
1271+
1272+ db = LocalStorage.openDatabaseSync("com.ubuntu.weather", "", "Default Ubuntu weather app", 100000);
1273+
1274+ if (db.version === "") {
1275+ db.changeVersion("", "0.1",
1276+ function(tx) {
1277+ tx.executeSql('CREATE TABLE IF NOT EXISTS Locations(id INTEGER PRIMARY KEY AUTOINCREMENT, data TEXT, date TEXT)');
1278+ console.log('Database created');
1279+ });
1280+ // reopen database with new version number
1281+ db = LocalStorage.openDatabaseSync("com.ubuntu.weather", "", "Default Ubuntu weather app", 100000);
1282+ }
1283+
1284+ if(db.version === "0.1") {
1285+ db.changeVersion("0.1", "0.2",
1286+ function(tx) {
1287+ tx.executeSql('CREATE TABLE IF NOT EXISTS settings(key TEXT UNIQUE, value TEXT)');
1288+ console.log('Settings table added, Database upgraded to v0.2');
1289+ });
1290+ // reopen database with new version number
1291+ db = LocalStorage.openDatabaseSync("com.ubuntu.weather", "", "Default Ubuntu weather app", 100000);
1292+ }
1293+
1294+ if(db.version === "0.2") {
1295+ db.changeVersion("0.2", "0.3",
1296+ function(tx) {
1297+ tx.executeSql('DELETE FROM Locations WHERE 1');
1298+ console.log('Removed old locations, Database upgraded to v0.3');
1299+ });
1300+ }
1301+ }
1302+
1303+ function saveSetting(key, value) {
1304+ openDB();
1305+ db.transaction( function(tx){
1306+ tx.executeSql('INSERT OR REPLACE INTO settings VALUES(?, ?)', [key, value]);
1307+ });
1308+ }
1309+
1310+ function getSettings(callback) {
1311+ openDB();
1312+ var settings = {};
1313+ db.readTransaction(
1314+ function(tx){
1315+ var rs = tx.executeSql('SELECT key, value FROM Settings');
1316+ for(var i = 0; i < rs.rows.length; i++) {
1317+ var row = rs.rows.item(i);
1318+ settings[row.key] = row.value;
1319+ }
1320+ callback(settings);
1321+ }
1322+ );
1323+ }
1324+
1325+ function clearSetting(name) {
1326+ openDB();
1327+ db.transaction(function(tx){
1328+ tx.executeSql('DELETE FROM Settings WHERE key = ?', [name]);
1329+ });
1330+ }
1331+
1332+ function insertLocation(data) {
1333+ openDB();
1334+ var res;
1335+ db.transaction( function(tx){
1336+ var r = tx.executeSql('INSERT INTO Locations(data, date) VALUES(?, ?)', [JSON.stringify(data), new Date().getTime()]);
1337+ res = r.insertId;
1338+ });
1339+ return res;
1340+ }
1341+
1342+ function updateLocation(dbId, data) {
1343+ openDB();
1344+ db.transaction( function(tx){
1345+ var r = tx.executeSql('UPDATE Locations SET data = ?, date=? WHERE id = ?', [JSON.stringify(data), new Date().getTime(), dbId])
1346+ });
1347+ }
1348+
1349+ function getLocations(callback) {
1350+ openDB();
1351+ db.readTransaction(
1352+ function(tx){
1353+ var locations = [];
1354+ var rs = tx.executeSql('SELECT * FROM Locations');
1355+ for(var i = 0; i < rs.rows.length; i++) {
1356+ var row = rs.rows.item(i),
1357+ locData = JSON.parse(row.data);
1358+ locData["updated"] = parseInt(row.date, 10);
1359+ locData["db"] = {id: row.id, updated: new Date(parseInt(row.date, 10))};
1360+ locations.push(locData);
1361+ }
1362+ callback(locations);
1363+ }
1364+ );
1365+ }
1366+
1367+ function clearLocation(location_id) {
1368+ openDB();
1369+ db.transaction(function(tx){
1370+ tx.executeSql('DELETE FROM Locations WHERE id = ?', [location_id]);
1371+ });
1372+ }
1373+
1374+ function clearDB() { // for dev purposes
1375+ openDB();
1376+ db.transaction(function(tx){
1377+ tx.executeSql('DELETE FROM Locations WHERE 1');
1378+ tx.executeSql('DELETE FROM Settings WHERE 1');
1379+ });
1380+ }
1381+}
1382
1383=== added file 'app/data/WeatherApi.js'
1384--- app/data/WeatherApi.js 1970-01-01 00:00:00 +0000
1385+++ app/data/WeatherApi.js 2015-02-07 17:39:34 +0000
1386@@ -0,0 +1,743 @@
1387+.pragma library
1388+/*
1389+ * Copyright (C) 2013 Canonical Ltd
1390+ *
1391+ * This program is free software: you can redistribute it and/or modify
1392+ * it under the terms of the GNU General Public License version 3 as
1393+ * published by the Free Software Foundation.
1394+ *
1395+ * This program is distributed in the hope that it will be useful,
1396+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1397+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1398+ * GNU General Public License for more details.
1399+ *
1400+ * You should have received a copy of the GNU General Public License
1401+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1402+ *
1403+ * Authored by: Raúl Yeguas <neokore@gmail.com>
1404+ * Martin Borho <martin@borho.net>
1405+ * Andrew Starr-Bochicchio <a.starr.b@gmail.com>
1406+ */
1407+
1408+/**
1409+* Version of the response data format.
1410+* Increase this number to force a refresh.
1411+*/
1412+var RESPONSE_DATA_VERSION = 20140315;
1413+
1414+/**
1415+* Helper functions
1416+*/
1417+function debug(obj) {
1418+ print(JSON.stringify(obj))
1419+}
1420+//
1421+function calcFahrenheit(celsius) {
1422+ return celsius * 1.8 + 32;
1423+}
1424+//
1425+function calcMph(ms) {
1426+ return ms*2.24;
1427+}
1428+//
1429+function calcInch(mm) {
1430+ return mm/25.4;
1431+}
1432+//
1433+function calcKmh(ms) {
1434+ return ms*3.6;
1435+}
1436+//
1437+function convertKmhToMph(kmh) {
1438+ return kmh*0.621;
1439+}
1440+//
1441+function calcWindDir(degrees) {
1442+ var direction = "?";
1443+ if(degrees >=0 && degrees <= 30){
1444+ direction = "N";
1445+ } else if(degrees >30 && degrees <= 60){
1446+ direction = "NE";
1447+ } else if(degrees >60 && degrees <= 120){
1448+ direction = "E";
1449+ } else if(degrees >120 && degrees <= 150){
1450+ direction = "SE";
1451+ } else if(degrees >150 && degrees <= 210){
1452+ direction = "S";
1453+ } else if(degrees >210 && degrees <= 240){
1454+ direction = "SW";
1455+ } else if(degrees >240 && degrees <= 300){
1456+ direction = "W";
1457+ } else if(degrees >300 && degrees <= 330){
1458+ direction = "NW";
1459+ } else if(degrees >330 && degrees <= 360){
1460+ direction = "N";
1461+ }
1462+ return direction;
1463+}
1464+
1465+//
1466+function getLocationTime(tstamp) {
1467+ var locTime = new Date(tstamp);
1468+ return {
1469+ year: locTime.getUTCFullYear(),
1470+ month: locTime.getUTCMonth(),
1471+ date: locTime.getUTCDate(),
1472+ hours: locTime.getUTCHours(),
1473+ minutes: locTime.getUTCMinutes()
1474+ }
1475+}
1476+// Serialize a JavaScript object to URL parameters
1477+// E.g. {param1: value1, param2: value2} to "param1=value&param2=value"
1478+// TODO: it'd be nice to make it work with either passing a single object
1479+// or several at once
1480+function parameterize(obj) {
1481+ var str = [];
1482+ for(var param in obj) {
1483+ str.push(encodeURIComponent(param) + "=" + encodeURIComponent(obj[param]));
1484+ }
1485+ return str.join("&");
1486+}
1487+
1488+var GeoipApi = (function() {
1489+ var _baseUrl = "http://geoip.ubuntu.com/lookup";
1490+ return {
1491+ getLatLong: function(params, apiCaller, onSuccess, onError) {
1492+ var request = { type: "geolookup",url: _baseUrl},
1493+ resultHandler = (function(request, xmlDoc) {
1494+ var coords = {},
1495+ childNodes = xmlDoc.childNodes;
1496+ for(var i=0;i<childNodes.length;i++) {
1497+ if(childNodes[i].nodeName === "Latitude") {
1498+ coords.lat = childNodes[i].firstChild.nodeValue;
1499+ } else if(childNodes[i].nodeName === "Longitude") {
1500+ coords.lon = childNodes[i].firstChild.nodeValue;
1501+ }
1502+ }
1503+ onSuccess(coords);
1504+ }),
1505+ retryHandler = (function(err) {
1506+ console.log("geolookup retry of "+err.request.url);
1507+ apiCaller(request, resultHandler, onError);
1508+ });
1509+ apiCaller(request, resultHandler, retryHandler);
1510+ }
1511+ }
1512+})();
1513+
1514+var GeonamesApi = (function() {
1515+ /**
1516+ provides neccessary methods for requesting and preparing data from Geonames.org
1517+ */
1518+ var _baseUrl = "http://api.geonames.org/";
1519+ var _username = "uweatherdev"
1520+ var _addParams = "&maxRows=25&featureClass=P"
1521+ //
1522+ function _buildSearchResult(request, data) {
1523+ var searchResult = { locations: [], request: request };
1524+ if(data.geonames) {
1525+ data.geonames.forEach(function(r) {
1526+ searchResult.locations.push({
1527+ name: r.name,
1528+ coord: {lat: r.lat, lon: r.lng},
1529+ country: r.countryCode,
1530+ countryName: r.countryName,
1531+ timezone: r.timezone,
1532+ adminName1: r.adminName1,
1533+ adminName2: r.adminName2,
1534+ adminName3: r.adminName3,
1535+ population: r.population,
1536+ services: {
1537+ "geonames": r.geonameId
1538+ }
1539+ });
1540+ })
1541+ }
1542+ return searchResult;
1543+ }
1544+ //
1545+ return {
1546+ //
1547+ search: function(mode, params, apiCaller, onSuccess, onError) {
1548+ var request,
1549+ retryHandler = (function(err) {
1550+ console.log("search retry of "+err.request.url);
1551+ apiCaller(request, searchResponseHandler, onError);
1552+ }),
1553+ searchResponseHandler = function(request, data) {
1554+ onSuccess(_buildSearchResult(request, data));
1555+ };
1556+ if(mode === "point") {
1557+ request = { type: "search",
1558+ url: _baseUrl+ "findNearbyPlaceNameJSON?style=full&username="+encodeURIComponent(_username)
1559+ +"&lat="+encodeURIComponent(params.coords.lat)+"&lng="+encodeURIComponent(params.coords.lon)
1560+ +_addParams}
1561+ } else {
1562+ request = { type: "search",
1563+ url: _baseUrl+ "searchJSON?style=full&username="+encodeURIComponent(_username)
1564+ +"&name_startsWith="+encodeURIComponent(params.name)+_addParams}
1565+ }
1566+ apiCaller(request, searchResponseHandler, retryHandler);
1567+ }
1568+ }
1569+
1570+})();
1571+
1572+var OpenWeatherMapApi = (function() {
1573+ /**
1574+ provides neccessary methods for requesting and preparing data from OpenWeatherMap.org
1575+ */
1576+ var _baseUrl = "http://api.openweathermap.org/data/2.5/";
1577+ //
1578+ var _serviceName = "openweathermap";
1579+ //
1580+ var _icon_map = {
1581+ "01d": "sun",
1582+ "01n": "moon",
1583+ "02d": "cloud_sun",
1584+ "02n": "cloud_moon",
1585+ "03d": "cloud_sun",
1586+ "03n": "cloud_moon",
1587+ "04d": "cloud",
1588+ "04n": "cloud",
1589+ "09d": "rain",
1590+ "09n": "rain",
1591+ "10d": "rain",
1592+ "10n": "rain",
1593+ "11d": "thunder",
1594+ "11n": "thunder",
1595+ "13d": "snow_shower",
1596+ "13n": "snow_shower",
1597+ "50d": "fog",
1598+ "50n": "fog"
1599+ }
1600+ //
1601+ function _buildDataPoint(date, data) {
1602+ var result = {
1603+ timestamp: data.dt,
1604+ date: date,
1605+ metric: {
1606+ temp:data.main.temp,
1607+ windSpeed: calcKmh(data.wind.speed),
1608+ rain: data.main.rain || ((data.rain) ? data.rain["3h"] : false ) || 0,
1609+ snow: data.main.snow || ((data.snow) ? data.snow["3h"] : false ) || 0
1610+ },
1611+ imperial: {
1612+ temp: calcFahrenheit(data.main.temp),
1613+ windSpeed: calcMph(data.wind.speed),
1614+ rain: calcInch(data.main.rain || ((data.rain) ? data.rain["3h"] : false ) || 0),
1615+ snow: calcInch(data.main.snow || ((data.snow) ? data.snow["3h"] : false ) ||0)
1616+ },
1617+ humidity: data.main.humidity,
1618+ pressure: data.main.pressure,
1619+ windDeg: data.wind.deg,
1620+ windDir: calcWindDir(data.wind.deg),
1621+ icon: _icon_map[data.weather[0].icon],
1622+ condition: data.weather[0]
1623+ };
1624+ if(data.id !== undefined) {
1625+ result["service"] = _serviceName;
1626+ result["service_id"] = data.id;
1627+ }
1628+ return result;
1629+ }
1630+ //
1631+ function _buildDayFormat(date, data) {
1632+ var result = {
1633+ date: date,
1634+ timestamp: data.dt,
1635+ metric: {
1636+ tempMin: data.temp.min,
1637+ tempMax: data.temp.max,
1638+ windSpeed: calcKmh(data.speed),
1639+ rain: data.rain || 0,
1640+ snow: data.snow || 0
1641+ },
1642+ imperial: {
1643+ tempMin: calcFahrenheit(data.temp.min),
1644+ tempMax: calcFahrenheit(data.temp.max),
1645+ windSpeed: calcMph(data.speed),
1646+ rain: calcInch(data.rain || 0),
1647+ snow: calcInch(data.snow || 0)
1648+ },
1649+ pressure: data.pressure,
1650+ humidity: data.humidity,
1651+ icon: _icon_map[data.weather[0].icon],
1652+ condition: data.weather[0],
1653+ windDeg: data.deg,
1654+ windDir: calcWindDir(data.deg),
1655+ hourly: []
1656+ }
1657+ return result;
1658+ }
1659+ //
1660+ function formatResult(data, location) {
1661+ var tmpResult = {},
1662+ result = [],
1663+ day=null,
1664+ offset=(location.timezone && location.timezone.gmtOffset) ? location.timezone.gmtOffset*60*60*1000: 0,
1665+ localNow = getLocationTime(new Date().getTime()+offset),
1666+ todayDate;
1667+ print("["+location.name+"] "+JSON.stringify(localNow))
1668+ // add openweathermap id for faster responses
1669+ if(location.services && !location.services[_serviceName] && data["current"].id) {
1670+ location.services[_serviceName] = data["current"].id
1671+ }
1672+ //
1673+ data["daily"]["list"].forEach(function(dayData) {
1674+ var date = getLocationTime(((dayData.dt*1000)-1000)+offset), // minus 1 sec to handle +/-12 TZ
1675+ day = date.year+"-"+date.month+"-"+date.date;
1676+ if(!todayDate) {
1677+ if(localNow.year+"-"+localNow.month+"-"+localNow.date > day) {
1678+ // skip "yesterday"
1679+ return;
1680+ }
1681+ todayDate = date;
1682+ }
1683+ tmpResult[day] = _buildDayFormat(date, dayData);
1684+ })
1685+ //
1686+ var today = todayDate.year+"-"+todayDate.month+"-"+todayDate.date
1687+ tmpResult[today]["current"] = _buildDataPoint(todayDate, data["current"]);
1688+ if(data["forecast"] !== undefined) {
1689+ data["forecast"]["list"].forEach(function(hourData) {
1690+ var dateData = getLocationTime((hourData.dt*1000)+offset),
1691+ day = dateData.year+"-"+dateData.month+"-"+dateData.date;
1692+ if(tmpResult[day]) {
1693+ tmpResult[day]["hourly"].push(_buildDataPoint(dateData, hourData));
1694+ }
1695+ })
1696+ }
1697+ //
1698+ for(var d in tmpResult) {
1699+ result.push(tmpResult[d]);
1700+ }
1701+ return result;
1702+ }
1703+ //
1704+ function _getUrls(params) {
1705+ var urls = {
1706+ current: "",
1707+ daily: "",
1708+ forecast: ""
1709+ },
1710+ latLongParams = "&lat="+encodeURIComponent(params.location.coord.lat)
1711+ + "&lon="+encodeURIComponent(params.location.coord.lon);
1712+ if(params.location.services && params.location.services[_serviceName]) {
1713+ urls.current = _baseUrl + "weather?units="+params.units+"&id="+params.location.services[_serviceName];
1714+ urls.daily = _baseUrl + "forecast/daily?id="+params.location.services[_serviceName]+"&cnt=10&units="+params.units
1715+ urls.forecast = _baseUrl + "forecast?id="+params.location.services[_serviceName]+"&units="+params.units
1716+
1717+ } else if (params.location.coord) {
1718+ urls.current = _baseUrl + "weather?units="+params.units+latLongParams;
1719+ urls.daily = _baseUrl+"forecast/daily?cnt=10&units="+params.units+latLongParams;
1720+ urls.forecast = _baseUrl+"forecast?units="+params.units+latLongParams;
1721+ }
1722+ return urls;
1723+ }
1724+ //
1725+ return {
1726+ //
1727+ getData: function(params, apiCaller, onSuccess, onError) {
1728+ var urls = _getUrls(params),
1729+ handlerMap = {
1730+ current: { type: "current",url: urls.current},
1731+ daily: { type: "daily",url: urls.daily},
1732+ forecast: { type: "forecast", url: urls.forecast}},
1733+ response = {
1734+ location: params.location,
1735+ db: (params.db) ? params.db : null,
1736+ format: RESPONSE_DATA_VERSION
1737+ },
1738+ respData = {},
1739+ addDataToResponse = (function(request, data) {
1740+ var formattedResult;
1741+ respData[request.type] = data;
1742+ if(respData["current"] !== undefined
1743+ && respData["forecast"] !== undefined
1744+ && respData["daily"] !== undefined) {
1745+ response["data"] = formatResult(respData, params.location)
1746+ onSuccess(response);
1747+ }
1748+ }),
1749+ onErrorHandler = (function(err) {
1750+ onError(err);
1751+ }),
1752+ retryHandler = (function(err) {
1753+ console.log("retry of "+err.request.url);
1754+ var retryFunc = handlerMap[err.request.type];
1755+ apiCaller(retryFunc, addDataToResponse, onErrorHandler);
1756+ });
1757+ //
1758+ apiCaller(handlerMap.current, addDataToResponse, retryHandler);
1759+ apiCaller(handlerMap.forecast, addDataToResponse, retryHandler);
1760+ apiCaller(handlerMap.daily, addDataToResponse, retryHandler);
1761+ }
1762+ }
1763+
1764+})();
1765+
1766+var WeatherChannelApi = (function() {
1767+ /**
1768+ provides neccessary methods for requesting and preparing data from OpenWeatherMap.org
1769+ */
1770+ var _baseUrl = "http://wxdata.weather.com/wxdata/";
1771+ //
1772+ var _serviceName = "weatherchannel";
1773+ //
1774+ // see http://s.imwx.com/v.20131006.223722/img/wxicon/72/([0-9]+).png
1775+ var _iconMap = {
1776+ "0": "thunder", // ??
1777+ "1": "thunder", // ??
1778+ "2": "thunder", // ??
1779+ "3": "thunder", // ??
1780+ "4": "thunder", //T-Storms
1781+ "5": "snow_rain", //Rain / Snow
1782+ "6": "snow_rain", // ??
1783+ "7": "snow_rain", //Wintry Mix
1784+ "8": "scattered", //Freezing Drizzle
1785+ "9": "scattered", //Drizzle
1786+ "10": "rain", // ??
1787+ "11": "rain", //Showers
1788+ "12": "rain", //Rain
1789+ "13": "snow_shower", // ??
1790+ "14": "snow_shower", //Snow shower/Light snow
1791+ "15": "snow_shower", //
1792+ "16": "snow_shower", //Snow
1793+ "17": "thunder", // Hail??
1794+ "18": "snow_rain", // Rain / Snow ??
1795+ "19": "fog", //Fog ??
1796+ "20": "fog", //Fog
1797+ "21": "fog", //Haze
1798+ "22": "fog", // ??
1799+ "23": "fog", // Wind ??
1800+ "24": "overcast", //Partly Cloudy / Wind
1801+ "25": "overcast", // ??
1802+ "26": "overcast",//Cloudy
1803+ "27": "cloud_moon",//Mostly Cloudy
1804+ "28": "cloud_sun", //Mostly Cloudy
1805+ "29": "cloud_moon", //Partly Cloudy
1806+ "30": "cloud_sun", //Partly Cloudy
1807+ "31": "moon", //Clear
1808+ "32": "sun", //Sunny
1809+ "33": "cloud_moon", //Mostly Clear
1810+ "34": "cloud_sun", //Mostly Sunny
1811+ "35": "snow_rain", // ??
1812+ "36": "sun", //Sunny
1813+ "37": "thunder", //Isolated T-Storms
1814+ "38": "thunder", //Scattered T-Storms
1815+ "39": "scattered", //Scattered Showers
1816+ "40": "rain", // ??
1817+ "41": "snow", //Scattered Snow Showers
1818+ "42": "snow_shower", // ??
1819+ "43": "snow_shower", // ??
1820+ "44": "fog", // ??
1821+ "45": "scattered", // ??
1822+ "46": "snow_shower", //Snow Showers Early
1823+ "47": "thunder" //Isolated T-Storms
1824+ };
1825+ //
1826+ function _buildDataPoint(date, dataObj) {
1827+ var data = dataObj["Observation"] || dataObj,
1828+ result = {
1829+ timestamp: data.date || data.dateTime,
1830+ date: date,
1831+ metric: {
1832+ temp: data.temp,
1833+ tempFeels: data.feelsLike,
1834+ windSpeed: data.wSpeed
1835+ },
1836+ imperial: {
1837+ temp: calcFahrenheit(data.temp),
1838+ tempFeels: calcFahrenheit(data.feelsLike),
1839+ windSpeed: convertKmhToMph(data.wSpeed)
1840+ },
1841+ precipType: (data.precip_type !== undefined) ? data.precip_type : null,
1842+ propPrecip: (data.pop !== undefined) ? data.pop : null,
1843+ humidity: data.humid,
1844+ pressure: data.pressure,
1845+ windDeg: data.wDir,
1846+ windDir: data.wDirText,
1847+ icon: _iconMap[(data.wxIcon||data.icon)],
1848+ condition: data.text || data.wDesc,
1849+ uv: data.uv
1850+ };
1851+ if(_iconMap[data.wxIcon||data.icon] === undefined) {
1852+ print("ICON MISSING POINT: "+(data.wxIcon||data.icon)+" "+result.condition)
1853+ }
1854+ return result;
1855+ }
1856+ //
1857+ function _buildDayFormat(date, data, now) {
1858+ var partData = (now > data.validDate || data.day === undefined) ? data.night : data.day,
1859+ result = {
1860+ date: date,
1861+ timestamp: data.validDate,
1862+ metric: {
1863+ tempMin: data.minTemp,
1864+ tempMax: data.maxTemp,
1865+ windSpeed: partData.wSpeed
1866+ },
1867+ imperial: {
1868+ tempMin: calcFahrenheit(data.minTemp),
1869+ tempMax: calcFahrenheit(data.maxTemp || data.minTemp),
1870+ windSpeed: convertKmhToMph(partData.wSpeed)
1871+ },
1872+ precipType: partData.precip_type,
1873+ propPrecip: partData.pop,
1874+ pressure: null,
1875+ humidity: partData.humid,
1876+ icon: _iconMap[partData.icon],
1877+ condition: partData.phrase,
1878+ windDeg: partData.wDir,
1879+ windDir: partData.wDirText,
1880+ uv: partData.uv,
1881+ hourly: []
1882+ }
1883+ if(_iconMap[partData.icon] === undefined) {
1884+ print("ICON MISSING DAY: "+partData.icon+" "+result.condition)
1885+ }
1886+ return result;
1887+ }
1888+ //
1889+ function formatResult(combinedData, location) {
1890+ var tmpResult = {}, result = [],
1891+ day=null, todayDate,
1892+ offset=(location.timezone && location.timezone.gmtOffset) ? location.timezone.gmtOffset*60*60*1000: 0,
1893+ now = new Date().getTime(),
1894+ nowMs = parseInt(now/1000),
1895+ localNow = getLocationTime(now+offset),
1896+ data = {
1897+ "location": combinedData[0]["Location"],
1898+ "daily": combinedData[0]["DailyForecasts"],
1899+ "forecast": combinedData[0]["HourlyForecasts"],
1900+ "current": combinedData[0]["StandardObservation"],
1901+ };
1902+ print("["+location.name+"] "+JSON.stringify(localNow));
1903+ // add openweathermap id for faster responses
1904+ if(location.services && !location.services[_serviceName] && data["location"].key) {
1905+ location.services[_serviceName] = data["location"].key
1906+ }
1907+ // only 5 days of forecast for TWC
1908+ for(var x=0;x<5;x++) {
1909+ var dayData = data["daily"][x],
1910+ date = getLocationTime(((dayData.validDate*1000)-1000)+offset); // minus 1 sec to handle +/-12 TZ
1911+ day = date.year+"-"+date.month+"-"+date.date;
1912+ if(!todayDate) {
1913+ if(localNow.year+"-"+localNow.month+"-"+localNow.date > day) {
1914+ // skip "yesterday"
1915+ continue;
1916+ }
1917+ todayDate = date;
1918+ }
1919+ tmpResult[day] = _buildDayFormat(date, dayData, nowMs);
1920+ }
1921+ //
1922+ if(data["current"]) {
1923+ var today = todayDate.year+"-"+todayDate.month+"-"+todayDate.date
1924+ tmpResult[today]["current"] = _buildDataPoint(todayDate, data["current"]);
1925+ }
1926+ if(data["forecast"] !== undefined) {
1927+ data["forecast"].forEach(function(hourData) {
1928+ var dateData = getLocationTime((hourData.dateTime*1000)+offset),
1929+ day = dateData.year+"-"+dateData.month+"-"+dateData.date;
1930+ if(tmpResult[day]) {
1931+ tmpResult[day]["hourly"].push(_buildDataPoint(dateData, hourData));
1932+ }
1933+ })
1934+ }
1935+ //
1936+ for(var d in tmpResult) {
1937+ result.push(tmpResult[d]);
1938+ }
1939+ return result;
1940+ }
1941+ //
1942+ function _getUrl(params) {
1943+ var url, serviceId,
1944+ baseParams = {
1945+ key: params.api_key,
1946+ units: (params.units === "metric") ? "m" : "e",
1947+ locale: Qt.locale().name,
1948+ hours: "48",
1949+ },
1950+ commands = {
1951+ "mobileaggregation": "mobile/mobagg/",
1952+ };
1953+ if(params.location.services && params.location.services[_serviceName]) {
1954+ serviceId = encodeURIComponent(params.location.services[_serviceName]);
1955+ url = _baseUrl+commands["mobileaggregation"]+serviceId+".js?"+parameterize(baseParams);
1956+ } else if (params.location.coord) {
1957+ var coord = {lat: params.location.coord.lat, lng: params.location.coord.lon};
1958+ url = _baseUrl+commands["mobileaggregation"]+"get.js?"+parameterize(baseParams)+"&"+
1959+ parameterize(coord);
1960+ }
1961+ return url;
1962+ }
1963+ //
1964+ return {
1965+ getData: function(params, apiCaller, onSuccess, onError) {
1966+ var url = _getUrl(params),
1967+ handlerMap = {
1968+ all: { type: "all", url: url}
1969+ },
1970+ response = {
1971+ location: params.location,
1972+ db: (params.db) ? params.db : null,
1973+ format: RESPONSE_DATA_VERSION
1974+ },
1975+ addDataToResponse = (function(request, data) {
1976+ var formattedResult;
1977+ response["data"] = formatResult(data, params.location);
1978+ onSuccess(response);
1979+ }),
1980+ onErrorHandler = (function(err) {
1981+ onError(err);
1982+ });
1983+ apiCaller(handlerMap.all, addDataToResponse, onErrorHandler);
1984+ }
1985+ }
1986+})();
1987+
1988+var WeatherApi = (function(_services) {
1989+ /**
1990+ proxy for requesting weather apis, the passed _services are providing the respective api endpoints
1991+ and formatters to build a uniform response object
1992+ */
1993+ function _getService(name) {
1994+ if(_services[name] !== undefined) {
1995+ return _services[name];
1996+ }
1997+ return _services["weatherchannel"];
1998+ }
1999+ //
2000+ function _sendRequest(request, onSuccess, onError) {
2001+ var xmlHttp = new XMLHttpRequest();
2002+ if (xmlHttp) {
2003+ console.log("Sent request URL: " + request.url);
2004+ xmlHttp.open('GET', request.url, true);
2005+ xmlHttp.onreadystatechange = function () {
2006+ try {
2007+ if (xmlHttp.readyState == 4) {
2008+ if(xmlHttp.status === 200) {
2009+ if(xmlHttp.responseXML) {
2010+ onSuccess(request, xmlHttp.responseXML.documentElement);
2011+ } else {
2012+ var json = JSON.parse(xmlHttp.responseText);
2013+ onSuccess(request,json);
2014+ }
2015+ } else {
2016+ onError({
2017+ msg: "wrong response http code, got "+xmlHttp.status,
2018+ request: request
2019+ });
2020+ }
2021+ }
2022+ } catch (e) {
2023+ print("Exception: "+e)
2024+ onError({msg: "wrong response data format", request: request});
2025+ }
2026+ };
2027+ xmlHttp.send(null);
2028+ }
2029+ }
2030+ //
2031+ return {
2032+ //
2033+ geoLookup: function(params, onSuccess, onError) {
2034+ var service = _getService('geoip'),
2035+ geoNameService = _getService('geonames'),
2036+ lookupHandler = function(data) {
2037+ print("Geolookup: "+JSON.stringify(data))
2038+ geoNameService.search("point", {coords:data}, _sendRequest, onSuccess, onError);
2039+ };
2040+ service.getLatLong(params, _sendRequest, lookupHandler, onError)
2041+ },
2042+ //
2043+ search: function(mode, params, onSuccess, onError) {
2044+ var service = _getService('geonames');
2045+ service.search(mode, params, _sendRequest, onSuccess, onError);
2046+ },
2047+ //
2048+ getLocationData: function(params, onSuccess, onError) {
2049+ var service = _getService(params.service);
2050+ service.getData(params, _sendRequest, onSuccess, onError);
2051+ },
2052+ }
2053+})({
2054+ "openweathermap": OpenWeatherMapApi,
2055+ "weatherchannel": WeatherChannelApi,
2056+ "geonames": GeonamesApi,
2057+ "geoip": GeoipApi
2058+});
2059+
2060+var sendRequest = function(message, responseCallback) {
2061+ // handles the response data
2062+ var finished = function(result) {
2063+ // print result to get data for test json files
2064+ // print(JSON.stringify(result));
2065+ //WorkerScript.sendMessage({
2066+ responseCallback({
2067+ action: message.action,
2068+ result: result
2069+ })
2070+ }
2071+ // handles errors
2072+ var onError = function(err) {
2073+ console.log(JSON.stringify(err, null, true));
2074+ //WorkerScript.sendMessage({ 'error': err})
2075+ responseCallback({ 'error': err})
2076+ }
2077+ // keep order of locations, sort results
2078+ var sortDataResults = function(locA, locB) {
2079+ return locA.db.id - locB.db.id;
2080+ }
2081+ // perform the api calls
2082+ if(message.action === "searchByName") {
2083+ WeatherApi.search("name", message.params, finished, onError);
2084+ } else if(message.action === "searchByPoint") {
2085+ WeatherApi.search("point", message.params, finished, onError);
2086+ } else if(message.action === "getGeoIp") {
2087+ WeatherApi.geoLookup(message.params, finished, onError);
2088+ } else if(message.action === "updateData") {
2089+ var locLength = message.params.locations.length,
2090+ locUpdated = 0,
2091+ result = [],
2092+ now = new Date().getTime();
2093+ if(locLength > 0) {
2094+ message.params.locations.forEach(function(loc) {
2095+ var updatedHnd = function (newData, cached) {
2096+ locUpdated += 1;
2097+ if(cached === true) {
2098+ newData["save"] = false;
2099+ } else {
2100+ newData["save"] = true;
2101+ newData["updated"] = new Date().getTime();
2102+ }
2103+ result.push(newData);
2104+ if(locUpdated === locLength) {
2105+ result.sort(sortDataResults);
2106+ finished(result);
2107+ }
2108+ },
2109+ params = {
2110+ location:loc.location,
2111+ db: loc.db,
2112+ units: 'metric',
2113+ service: message.params.service,
2114+ api_key: message.params.api_key
2115+ },
2116+ secsFromLastFetch = (now-loc.updated)/1000;
2117+ if( message.params.force===true || loc.format !== RESPONSE_DATA_VERSION || secsFromLastFetch > 1800){
2118+ // data older than 30min, location is new or data format is deprecated
2119+ WeatherApi.getLocationData(params, updatedHnd, onError);
2120+ } else {
2121+ console.log("["+loc.location.name+"] returning cached data, time from last fetch: "+secsFromLastFetch)
2122+ updatedHnd(loc, true);
2123+ }
2124+ })
2125+ } else {
2126+ finished(result);
2127+ }
2128+ }
2129+}
2130
2131=== added file 'app/data/key.js'
2132--- app/data/key.js 1970-01-01 00:00:00 +0000
2133+++ app/data/key.js 2015-02-07 17:39:34 +0000
2134@@ -0,0 +1,1 @@
2135+var twcKey = "";
2136
2137=== added file 'app/ubuntu-weather-app.qml'
2138--- app/ubuntu-weather-app.qml 1970-01-01 00:00:00 +0000
2139+++ app/ubuntu-weather-app.qml 2015-02-07 17:39:34 +0000
2140@@ -0,0 +1,162 @@
2141+/*
2142+ * Copyright (C) 2015 Canonical Ltd
2143+ *
2144+ * This file is part of Ubuntu Weather App
2145+ *
2146+ * Ubuntu Weather App is free software: you can redistribute it and/or modify
2147+ * it under the terms of the GNU General Public License version 3 as
2148+ * published by the Free Software Foundation.
2149+ *
2150+ * Ubuntu Weather App is distributed in the hope that it will be useful,
2151+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2152+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2153+ * GNU General Public License for more details.
2154+ *
2155+ * You should have received a copy of the GNU General Public License
2156+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2157+ */
2158+
2159+import QtQuick 2.3
2160+import Ubuntu.Components 1.1
2161+import "components"
2162+import "data" as Data
2163+import "data/WeatherApi.js" as WeatherApi
2164+import "data/key.js" as Key
2165+import "ui"
2166+
2167+MainView {
2168+ id: weatherApp
2169+
2170+ objectName: "weather"
2171+
2172+ applicationName: "com.ubuntu.weather"
2173+
2174+ automaticOrientation: false
2175+
2176+ width: units.gu(40)
2177+ height: units.gu(70)
2178+
2179+ backgroundColor: "#F5F5F5"
2180+
2181+ useDeprecatedToolbar: false
2182+ anchorToKeyboard: true
2183+
2184+ /*
2185+ List of locations and their data, accessible through index
2186+ */
2187+ property var locationsList: []
2188+
2189+ /*
2190+ Index of Location before a refresh, to go back after
2191+ */
2192+ property int indexAtRefresh: -1
2193+
2194+ /*
2195+ Set default values for settings here
2196+ */
2197+ property var settings: {
2198+ "units": Qt.locale().measurementSystem === Locale.MetricSystem ? "metric" : "imperial",
2199+ "wind_units": Qt.locale().measurementSystem === Locale.MetricSystem ? "kmh" : "mph",
2200+ "precip_units": Qt.locale().measurementSystem === Locale.MetricSystem ? "mm" : "in",
2201+ "service": "weatherchannel"
2202+ }
2203+
2204+ /*
2205+ Scale symbols and labels.
2206+ */
2207+ property string tempScale
2208+ property string speedScale
2209+ property string precipScale
2210+ property string tempUnits
2211+ property string windUnits
2212+ property string precipUnits
2213+
2214+ /*
2215+ After reading the settings from storage and updating the default
2216+ settings with the user selected ones, (re)load pages!
2217+ */
2218+ Component.onCompleted: {
2219+ storage.getSettings(function(storedSettings) {
2220+ for(var settingName in storedSettings) {
2221+ settings[settingName] = storedSettings[settingName];
2222+ }
2223+ setScalesAndLabels();
2224+ refreshData();
2225+ })
2226+ }
2227+
2228+ function setScalesAndLabels() {
2229+ // set scales
2230+ tempScale = String("°") + ((settings["units"] === "imperial") ? "F" : "C")
2231+ speedScale = ((settings["wind_units"] === "mph") ? "mph" : "km/h")
2232+ precipScale = ((settings["precip_units"] === "in") ? "in" : "mm")
2233+ tempUnits = ((settings["units"] === 'imperial') ? 'imperial' : 'metric')
2234+ windUnits = ((settings["wind_units"] === 'mph') ? 'imperial' : 'metric')
2235+ precipUnits = ((settings["precip_units"] === 'in') ? 'imperial' : 'metric')
2236+ }
2237+
2238+ /*
2239+ Handle response data from data backend. Checks if a location
2240+ was updated and has to be stored again.
2241+ */
2242+ function responseDataHandler(messageObject) {
2243+ if(!messageObject.error) {
2244+ if(messageObject.action === "updateData") {
2245+ messageObject.result.forEach(function(loc) {
2246+ // replace location data in cache with refreshed values
2247+ if(loc["save"] === true) {
2248+ storage.updateLocation(loc.db.id, loc);
2249+ }
2250+ });
2251+ //print(JSON.stringify(messageObject.result));
2252+ fillPages(messageObject.result);
2253+ }
2254+ } else {
2255+ console.log(messageObject.error.msg+" / "+messageObject.error.request.url)
2256+ // TODO error handling
2257+ }
2258+ }
2259+
2260+ /* Fill the location pages with their data. */
2261+ function fillPages(locations) {
2262+ locationsList = locations;
2263+ // refactor this when Location are in a ListView!
2264+ homePage.renderData();
2265+ }
2266+
2267+ /*
2268+ Refresh data, either directly from storage or by checking against
2269+ API instead.
2270+ */
2271+ function refreshData(from_storage, force_refresh) {
2272+ if(from_storage === true && force_refresh !== true) {
2273+ storage.getLocations(fillPages);
2274+ } else {
2275+ storage.getLocations(function(locations) {
2276+ WeatherApi.sendRequest({
2277+ action: "updateData",
2278+ params: {
2279+ locations:locations,
2280+ force:force_refresh,
2281+ service:settings["service"],
2282+ api_key: Key.twcKey
2283+ }
2284+ }, responseDataHandler)
2285+ });
2286+ }
2287+ }
2288+
2289+ Data.Storage {
2290+ id: storage
2291+ }
2292+
2293+ PageStack {
2294+ id: mainPageStack
2295+
2296+ HomePage {
2297+ id: homePage
2298+ }
2299+
2300+ Component.onCompleted: mainPageStack.push(homePage)
2301+ }
2302+}
2303
2304=== added directory 'app/ui'
2305=== added file 'app/ui/CMakeLists.txt'
2306--- app/ui/CMakeLists.txt 1970-01-01 00:00:00 +0000
2307+++ app/ui/CMakeLists.txt 2015-02-07 17:39:34 +0000
2308@@ -0,0 +1,5 @@
2309+file(GLOB UI_QML_JS_FILES *.qml *.js)
2310+
2311+add_custom_target(ubuntu-weather-app_ui_QMlFiles ALL SOURCES ${UI_QML_JS_FILES})
2312+
2313+install(FILES ${UI_QML_JS_FILES} DESTINATION ${UBUNTU-WEATHER_APP_DIR}/ui)
2314
2315=== added file 'app/ui/HomePage.qml'
2316--- app/ui/HomePage.qml 1970-01-01 00:00:00 +0000
2317+++ app/ui/HomePage.qml 2015-02-07 17:39:34 +0000
2318@@ -0,0 +1,140 @@
2319+/*
2320+ * Copyright (C) 2015 Canonical Ltd
2321+ *
2322+ * This file is part of Ubuntu Weather App
2323+ *
2324+ * Ubuntu Weather App is free software: you can redistribute it and/or modify
2325+ * it under the terms of the GNU General Public License version 3 as
2326+ * published by the Free Software Foundation.
2327+ *
2328+ * Ubuntu Weather App is distributed in the hope that it will be useful,
2329+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2330+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2331+ * GNU General Public License for more details.
2332+ *
2333+ * You should have received a copy of the GNU General Public License
2334+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2335+ */
2336+
2337+import QtQuick 2.3
2338+import Ubuntu.Components 1.1
2339+import Ubuntu.Components.ListItems 0.1 as ListItem
2340+import "../components"
2341+
2342+
2343+Page {
2344+ // Set to null otherwise the header is shown (but blank) over the top of the listview
2345+ id: locationPage
2346+ flickable: null
2347+
2348+ /*
2349+ Data properties
2350+ */
2351+ property string name;
2352+ property string conditionText
2353+ property int currentTemp
2354+ property string todayMaxTemp
2355+ property string todayMinTemp
2356+ property string iconName
2357+
2358+ // TODO map iconnames to source image names
2359+ property var iconMap: {
2360+ "moon": "moon.svg"
2361+ // etc pp
2362+ }
2363+
2364+ /*
2365+ Format date object by given format.
2366+ */
2367+ function formatTimestamp(dateData, format) {
2368+ var date = new Date(dateData.year, dateData.month, dateData.date, dateData.hours, dateData.minutes)
2369+ return Qt.formatDate(date, i18n.tr(format))
2370+ }
2371+
2372+ /*
2373+ Extracts values from the location weather data and puts them into the appropriate components
2374+ to display them.
2375+
2376+ Attention: Data access happens through "weatherApp.locationList[]" by index, since complex
2377+ data in models will lead to type problems.
2378+ */
2379+ function renderData() {
2380+ var index = Math.floor(Math.random()*weatherApp.locationsList.length), // TODO get this value from ListView.currentIndex later!
2381+ data = weatherApp.locationsList[index],
2382+ current = data.data[0].current,
2383+ forecasts = data.data,
2384+ forecastsLength = forecasts.length,
2385+ today = forecasts[0],
2386+ tempUnits = weatherApp.tempUnits,
2387+ tempScale = weatherApp.tempScale;
2388+
2389+ // set general location data
2390+ name = data.location.adminName1;
2391+
2392+ // set current temps and condition
2393+ iconName = (current.icon) ? current.icon : ""
2394+ conditionText = (current.condition.main) ? current.condition.main : current.condition; // difference TWC/OWM
2395+ todayMaxTemp = (today[tempUnits].tempMax) ? Math.round(today[tempUnits].tempMax).toString() + tempScale: "";
2396+ todayMinTemp = Math.round(today[tempUnits].tempMin.toString()) + tempScale;
2397+ currentTemp = Math.round(current[tempUnits].temp);
2398+
2399+ // reset days list
2400+ mainPageWeekdayListView.model.clear()
2401+
2402+ // set daily forecasts
2403+ if(forecastsLength > 0) {
2404+ for(var x=1;x<forecastsLength;x++) {
2405+ // print(JSON.stringify(forecasts[x][units]))
2406+ var dayData = {
2407+ day: formatTimestamp(forecasts[x].date, 'dddd'),
2408+ low: Math.round(forecasts[x][tempUnits].tempMin).toString() + tempScale,
2409+ high: (forecasts[x][tempUnits].tempMax !== undefined) ? Math.round(forecasts[x][tempUnits].tempMax).toString() + tempScale : "",
2410+ image: (forecasts[x].icon !== undefined && iconMap[forecasts[x].icon] !== undefined) ? iconMap[forecasts[x].icon] + tempScale : ""
2411+ }
2412+ mainPageWeekdayListView.model.append(dayData);
2413+ }
2414+ }
2415+ }
2416+
2417+ ListView {
2418+ id: mainPageWeekdayListView
2419+ anchors {
2420+ fill: parent
2421+ margins: units.gu(2)
2422+ }
2423+
2424+ header: Column {
2425+ anchors {
2426+ left: parent.left
2427+ right: parent.right
2428+ }
2429+ spacing: units.gu(1)
2430+
2431+ HeaderRow {
2432+ locationName: locationPage.name
2433+ }
2434+
2435+ HomeGraphic {
2436+ icon: locationPage.iconName
2437+ }
2438+
2439+ HomeTempInfo {
2440+ description: locationPage.conditionText
2441+ high: locationPage.todayMaxTemp
2442+ low: locationPage.todayMinTemp
2443+ now: locationPage.currentTemp
2444+ }
2445+
2446+ ListItem.ThinDivider {
2447+
2448+ }
2449+ }
2450+ model: ListModel {}
2451+
2452+ delegate: DayDelegate {
2453+ day: model.day
2454+ high: model.high
2455+ low: model.low
2456+ }
2457+ }
2458+}
2459
2460=== added file 'app/weather-app@30.png'
2461Binary files app/weather-app@30.png 1970-01-01 00:00:00 +0000 and app/weather-app@30.png 2015-02-07 17:39:34 +0000 differ
2462=== added directory 'backend'
2463=== added file 'backend/CMakeLists.txt'
2464--- backend/CMakeLists.txt 1970-01-01 00:00:00 +0000
2465+++ backend/CMakeLists.txt 2015-02-07 17:39:34 +0000
2466@@ -0,0 +1,29 @@
2467+project(backend)
2468+
2469+include_directories(
2470+ ${CMAKE_CURRENT_SOURCE_DIR}
2471+)
2472+
2473+#set(
2474+# timeZone_SRCS
2475+# TimeZone/timezone.cpp
2476+# TimeZone/timezone_plugin.cpp
2477+#)
2478+
2479+#add_library(TimeZoneBackend MODULE
2480+# ${timeZone_SRCS}
2481+#)
2482+#set_target_properties(TimeZoneBackend PROPERTIES
2483+# LIBRARY_OUTPUT_DIRECTORY TimeZone)
2484+
2485+#qt5_use_modules(TimeZoneBackend Gui Qml Quick)
2486+
2487+# Copy qmldir file to build dir for running in QtCreator
2488+#add_custom_target(TimeZoneBackend-qmldir ALL
2489+# COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/TimeZone/qmldir ${CMAKE_CURRENT_BINARY_DIR}/TimeZone
2490+# DEPENDS ${QML_JS_FILES}
2491+#)
2492+
2493+# Install plugin file
2494+#install(TARGETS TimeZoneBackend DESTINATION ${QT_IMPORTS_DIR}/qt5/qml/UbuntuWeather/TimeZone/)
2495+#install(FILES TimeZone/qmldir DESTINATION ${QT_IMPORTS_DIR}/qt5/qml/UbuntuWeather/TimeZone/)
2496
2497=== added directory 'debian'
2498=== renamed directory 'debian' => 'debian.moved'
2499=== added file 'debian/changelog'
2500--- debian/changelog 1970-01-01 00:00:00 +0000
2501+++ debian/changelog 2015-02-07 17:39:34 +0000
2502@@ -0,0 +1,173 @@
2503+ubuntu-weather-app (2.1) UNRELEASED; urgency=medium
2504+
2505+ *
2506+
2507+ -- Daniel Holbach <daniel.holbach@ubuntu.com> Wed, 04 Feb 2015 11:25:02 +0100
2508+
2509+ubuntu-weather-app (2.0) utopic; urgency=low
2510+
2511+ [ Andrew Hayzen ]
2512+ * Initial version of reboot
2513+
2514+ -- Andrew Hayzen <ahayzen@gmail.com> Mon, 02 Feb 2014 15:10:00 +0000
2515+
2516+ubuntu-weather-app (1.8.3ubuntu1) utopic; urgency=low
2517+
2518+ [ Dan Chapman ]
2519+ * Add timezone c++ extension plugin
2520+
2521+ -- Dan Chapman <dpniel@ubuntu.com> Thu, 25 Sep 2014 10:46:29 +0100
2522+
2523+ubuntu-weather-app (1.8.3) raring; urgency=low
2524+
2525+ [ Martin Borho ]
2526+ * updated icons for rain and snow
2527+ * bug fixes and optimizations
2528+
2529+ [ Alan Pope ]
2530+ * Update click framework and apparmor profile version (LP: #1315318)
2531+
2532+ -- Alan Pope <popey@ubuntu.com> Fri, 02 May 2014 13:51:57 +0100
2533+
2534+ubuntu-weather-app (1.8.1ubuntu1) UNRELEASED; urgency=low
2535+
2536+ * added missing icon
2537+
2538+ -- Martin Borho <martin@borho.net> Sun, 23 Mar 2014 13:06:17 +0000
2539+
2540+ubuntu-weather-app (1.8ubuntu1) UNRELEASED; urgency=low
2541+
2542+ [Leo Arias]
2543+ * Port to autopilot 1.4.
2544+ * Set the objectNames for the settings options.
2545+
2546+ [Nicholas Skaggs]
2547+ * Fixed test_del_add_bug test, simplify tests, re-enable disabled tests.
2548+ * Redo create blank db, ensure it's being used across all tests.
2549+ * Add cmake build.
2550+ * Set revno to match store.
2551+ * Updated tests to use more emulator standards.
2552+ * Tweaked activity indicator handling.
2553+
2554+ [Dennis O'Flaherty]
2555+ * Load weather for the selected city when clicking the OWM logo instead of loading for London.
2556+
2557+ [Raul Yeguas]
2558+ * Added an modified logo for OpenWeatherMap (have mercy on me, christina-li and michal) and an action to open its website on click.
2559+ * Added animations for daily and houly forecast scroll.
2560+ * Improved animation speed by reducing image size.
2561+ * Removes SideStage hint, fixes related to the sizes of the current weather data display on tablets.
2562+
2563+ [Victor Thompson]
2564+ * Added unit of measure for main temperature value.
2565+ * Fixed conversion of wind speed data for TWC data.
2566+ * Prevent predictive text in search bar.
2567+
2568+ [Arash Badie Modiri]
2569+ * Changed a translation string into something a little bit more general.
2570+
2571+ [Martin Borho]
2572+ * Optimized and added haptic effect to hourly scrolling .
2573+ * Added The Weather Channel as default weather data provider.
2574+ * Added keyboard shortcuts.
2575+ * Initial tablet design of the Weather app.
2576+ * Refactored all width:parent.width and height:parent.height through corresponding anchors
2577+ * Fixed edit dialog to fill window on N7 2013 landscape
2578+ * Fixed weather AP tests to not assume tablet mode
2579+ * Fixed content sticking to the top, when height was changed in phone mode
2580+ * Fixed StateNotFoundError failures in image 206
2581+ * Removed WorkerScriptfor API calls
2582+ * New icon names used in API clients
2583+ * Using the current condition icon for the current day
2584+
2585+ [David Planella]
2586+ * Fixed the rule to generate a .pot template after the migration to cmake.
2587+ * Minor improvements on the weather API: added parameterize(), added locale parameters to TWC calls
2588+ * Fixes empty TWC URL if locale is not supported.
2589+ * Adds documentation for the The Weather Channel API.
2590+ * Makes the provider footer to be full width in order for it to make it look good on a Nexus 7.
2591+ * Fixes the shorter length header on the N7 using anchors instead of widths.
2592+
2593+ [Alan Pope]
2594+ * New icon.
2595+
2596+ -- Martin Borho <martin@borho.net> Fri, 21 Mar 2014 11:26:17 +0000
2597+
2598+ubuntu-weather-app (1.0ubuntu1) UNRELEASED; urgency=medium
2599+
2600+ * New icon
2601+
2602+ -- Alan Pope <alan.pope@canonical.com> Tue, 18 Feb 2014 21:26:17 +0000
2603+
2604+ubuntu-weather-app (1.0) saucy; urgency=low
2605+
2606+ [Andrew Starr-Bochicchio]
2607+ * Use the system locale to determine both the default units and the display of time.
2608+ * Add predictive search for locations. (LP: #1218910)
2609+ * Increase visibility of ActivityIndicator (LP: #1218904)
2610+
2611+ [David Planella]
2612+ * Updated translatable strings, a couple of small fixes to ease translations
2613+
2614+ [Dennis O'Flaherty]
2615+ * Fixes for precipitation values.
2616+
2617+ [Martin Borho]
2618+ * Removing a location add adding a new one fails. (LP: #1230297)
2619+ * Added location lookup via geoip and geonames.org with test (LP: #1187312, #1188726)
2620+ * Added fixes for new removable ListItem and the changed LocalStorage path. (LP: #1234544)
2621+ * Added setting for precipitation unit, mm or in.
2622+ * Location search now via geonames.org. (LP: #1230153)
2623+ * Updated predefined cities list.
2624+ * Added component for notifications.
2625+ * Added bottom margin to scrolling area in tabs and moved warm colors up the gradient color scheme.
2626+ * Visual improvements and fixes to LocationManagerSheet and AddLocationSheet. (LP: #1198541, #1221734)
2627+ * Added updated label, removed years from date labels. (LP: #1219200, #1221149, #1221162)
2628+ * Improved scrolling, added slow/fast scrolling for day/hour scrolling distinction. (LP:# 1221169)
2629+ * Added option in settings to change the wind speed unit. (LP: #1214934, #1190784)
2630+ * Dynamic gradient backgrounds according to the visual design.
2631+ * Added missing localstorage dependency.
2632+
2633+ [Nicholas Skaags]
2634+ * Add support for testing via click packages.
2635+
2636+ [Raúl Yeguas]
2637+ * Updated colors in GradientsMap.js. (LP: #1226746)
2638+ * Returns the last element to primary information screen and skip animation. (LP: #1227150)
2639+ * improved CurrentTemp text size
2640+ * UbuntuAnimations should be used (LP: #1218805)
2641+ * Replaced ValueSelector with new OptionSelector in Settings.
2642+ * Implemented a new scrolling.
2643+ * Added pressure data and modified the transition animation.
2644+ * Font color should be always white, with drop shadow.
2645+
2646+ [Sergio Schvezov]
2647+ * changing applicationName to com.ubuntu.weather to write in the unconfined areas
2648+ * cleaning up python code
2649+ * add the click data into the package and added apparmor rules (LP: #121839)
2650+
2651+ -- Martin Borho <martin@borho.net> Tue, 8 Oct 2013 22:42:00 +0200
2652+
2653+ubuntu-weather-app (0.3) raring; urgency=low
2654+
2655+ * LocationManager-Sheet added
2656+ * Settings-Sheet added
2657+ * Autopilot tests
2658+ * Data-provider calls now in WorkerScript
2659+ * ActivityIndicators while loading
2660+ * Suru theme added
2661+ * Displaying more weather data for every location
2662+
2663+ -- Martin Borho <martin@borho.net> Tue, 13 Aug 2013 21:33:33 +0200
2664+
2665+ubuntu-weather-app (0.2) raring; urgency=low
2666+
2667+ * Added support for packaging and installing translations
2668+
2669+ -- David Planella <david.planella@ubuntu.com> Tue, 28 May 2013 14:21:33 +0200
2670+
2671+ubuntu-weather-app (0.1) raring; urgency=low
2672+
2673+ * Initial release
2674+
2675+ -- Michael Hall <mhall119@ubuntu.com> Mon, 11 Feb 2013 16:04:00 -0500
2676
2677=== added file 'debian/compat'
2678--- debian/compat 1970-01-01 00:00:00 +0000
2679+++ debian/compat 2015-02-07 17:39:34 +0000
2680@@ -0,0 +1,1 @@
2681+9
2682
2683=== added file 'debian/control'
2684--- debian/control 1970-01-01 00:00:00 +0000
2685+++ debian/control 2015-02-07 17:39:34 +0000
2686@@ -0,0 +1,40 @@
2687+Source: ubuntu-weather-app
2688+Priority: extra
2689+Maintainer: Ubuntu App Cats <ubuntu-touch-coreapps@lists.launchpad.net>
2690+Build-Depends: cmake,
2691+ debhelper (>= 9),
2692+ gettext,
2693+ intltool,
2694+ python3 | python-all | python3-dev | python3-all-dev,
2695+ python3-minimal,
2696+ qtbase5-dev,
2697+ qtbase5-dev-tools,
2698+ qtdeclarative5-dev,
2699+ qtdeclarative5-dev-tools,
2700+ qtdeclarative5-ubuntu-ui-toolkit-plugin,
2701+Standards-Version: 3.9.6
2702+Section: misc
2703+Homepage: https://launchpad.net/ubuntu-weather-app
2704+Vcs-Bzr: https://code.launchpad.net/~ubuntu-weather-dev/ubuntu-weather-app/trunk
2705+
2706+Package: ubuntu-weather-app
2707+Architecture: all
2708+Depends: qmlscene,
2709+ qtdeclarative5-localstorage-plugin,
2710+ qtdeclarative5-qtquick2-plugin,
2711+ qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu,
2712+ suru-icon-theme | ubuntu-mobile-icons,
2713+ ${misc:Depends}
2714+Description: Weather application
2715+ Core Weather application
2716+
2717+Package: ubuntu-weather-app-autopilot
2718+Architecture: all
2719+Depends: libautopilot-qt (>= 1.4),
2720+ libqt5test5,
2721+ libqt5widgets5,
2722+ ubuntu-ui-toolkit-autopilot,
2723+ ubuntu-weather-app (>= ${source:Version}),
2724+ ${misc:Depends}
2725+Description: Test package for the weather app
2726+ Autopilot tests for the weather app package
2727
2728=== added file 'debian/copyright'
2729--- debian/copyright 1970-01-01 00:00:00 +0000
2730+++ debian/copyright 2015-02-07 17:39:34 +0000
2731@@ -0,0 +1,54 @@
2732+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2733+Upstream-Name: ubuntu-weather-app
2734+Source: https://launchpad.net/ubuntu-weather-app
2735+
2736+Files: *
2737+Copyright: 2013 Canonical Ltd.
2738+ 2013 Jakub <jakub@motyczko.pl>
2739+ 2013 Martin Borho <martin@borho.net>
2740+ 2013 Nekhelesh Ramananthan <krnekhelesh@gmail.com>
2741+ 2013 Omer Akram <om26er@ubuntu.com>
2742+ 2013 Raúl Yeguas <neokore@gmail.com>
2743+ 2013 Riccardo Padovani <rpadovani@ubuntu-it.org>
2744+ 2013 Zonov Roman <roman2861@yandex.ru>
2745+ 2015 Andrew Hayzen <ahayzen@gmail.com>
2746+ 2015 Victor Thompson <victor.thompson@gmail.com>
2747+License: GPL-3
2748+
2749+Files: debian/*
2750+Copyright: 2013 Canonical Ltd.
2751+License: LGPL-3
2752+
2753+License: GPL-3
2754+ This package is free software; you can redistribute it and/or
2755+ modify it under the terms of the GNU General Public
2756+ License as published by the Free Software Foundation; either
2757+ version 3 of the License.
2758+ .
2759+ This package is distributed in the hope that it will be useful,
2760+ but WITHOUT ANY WARRANTY; without even the implied warranty of
2761+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2762+ General Public License for more details.
2763+ .
2764+ You should have received a copy of the GNU General Public License
2765+ along with this program. If not, see <http://www.gnu.org/licenses/>.
2766+ .
2767+ On Debian systems, the complete text of the GNU General
2768+ Public License can be found in "/usr/share/common-licenses/GPL-3".
2769+
2770+License: LGPL-3
2771+ This package is free software; you can redistribute it and/or
2772+ modify it under the terms of the GNU Lesser General Public
2773+ License as published by the Free Software Foundation; either
2774+ version 3 of the License.
2775+ .
2776+ This package is distributed in the hope that it will be useful,
2777+ but WITHOUT ANY WARRANTY; without even the implied warranty of
2778+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2779+ Lesser General Public License for more details.
2780+ .
2781+ You should have received a copy of the GNU General Public License
2782+ along with this program. If not, see <http://www.gnu.org/licenses/>.
2783+ .
2784+ On Debian systems, the complete text of the GNU Lesser General
2785+ Public License can be found in "/usr/share/common-licenses/LGPL-3".
2786
2787=== added file 'debian/rules'
2788--- debian/rules 1970-01-01 00:00:00 +0000
2789+++ debian/rules 2015-02-07 17:39:34 +0000
2790@@ -0,0 +1,14 @@
2791+#!/usr/bin/make -f
2792+# -*- makefile -*-
2793+
2794+# Uncomment this to turn on verbose mode.
2795+#export DH_VERBOSE=1
2796+
2797+%:
2798+ dh $@
2799+
2800+override_dh_auto_configure:
2801+ dh_auto_configure -- -DCLICK_MODE=OFF
2802+
2803+override_dh_install:
2804+ dh_install --list-missing
2805
2806=== added directory 'debian/source'
2807=== added file 'debian/source/format'
2808--- debian/source/format 1970-01-01 00:00:00 +0000
2809+++ debian/source/format 2015-02-07 17:39:34 +0000
2810@@ -0,0 +1,1 @@
2811+1.0
2812
2813=== added file 'debian/ubuntu-weather-app-autopilot.install'
2814--- debian/ubuntu-weather-app-autopilot.install 1970-01-01 00:00:00 +0000
2815+++ debian/ubuntu-weather-app-autopilot.install 2015-02-07 17:39:34 +0000
2816@@ -0,0 +1,1 @@
2817+usr/lib
2818
2819=== added file 'debian/ubuntu-weather-app.install'
2820--- debian/ubuntu-weather-app.install 1970-01-01 00:00:00 +0000
2821+++ debian/ubuntu-weather-app.install 2015-02-07 17:39:34 +0000
2822@@ -0,0 +1,1 @@
2823+usr/share
2824
2825=== added file 'manifest.json.in'
2826--- manifest.json.in 1970-01-01 00:00:00 +0000
2827+++ manifest.json.in 2015-02-07 17:39:34 +0000
2828@@ -0,0 +1,23 @@
2829+{
2830+ "architecture": "@CLICK_ARCH@",
2831+ "description": "A weather forecast application for Ubuntu with support for multiple online weather data sources",
2832+ "framework": "ubuntu-sdk-14.10",
2833+ "hooks": {
2834+ "weather": {
2835+ "apparmor": "ubuntu-weather-app.apparmor",
2836+ "desktop": "@CMAKE_INSTALL_DATADIR@/applications/ubuntu-weather-app.desktop"
2837+ }
2838+ },
2839+ "icon": "@ICON@",
2840+ "maintainer": "Ubuntu App Cats <ubuntu-touch-coreapps@lists.launchpad.net>",
2841+ "name": "@PROJECT_NAME@",
2842+ "title": "Weather",
2843+ "version": "3.0.@BZR_REVNO@",
2844+ "x-source": {
2845+ "vcs-bzr": "@BZR_SOURCE@",
2846+ "vcs-bzr-revno": "@BZR_REVNO@"
2847+ },
2848+ "x-test": {
2849+ "autopilot": "@AUTOPILOT_DIR@"
2850+ }
2851+}
2852
2853=== added directory 'po'
2854=== renamed directory 'po' => 'po.moved'
2855=== added file 'po/CMakeLists.txt'
2856--- po/CMakeLists.txt 1970-01-01 00:00:00 +0000
2857+++ po/CMakeLists.txt 2015-02-07 17:39:34 +0000
2858@@ -0,0 +1,33 @@
2859+include(FindGettext)
2860+find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext)
2861+
2862+set(DOMAIN ${PROJECT_NAME})
2863+set(POT_FILE ${DOMAIN}.pot)
2864+file(GLOB PO_FILES *.po)
2865+
2866+# Creates the .pot file containing the translations template
2867+add_custom_target(${POT_FILE} ALL
2868+ COMMENT "Generating translation template"
2869+ COMMAND ${INTLTOOL_EXTRACT} --update --type=gettext/ini
2870+ --srcdir=${CMAKE_SOURCE_DIR} ${DESKTOP_FILE}.in.in
2871+ COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
2872+ -D ${CMAKE_CURRENT_SOURCE_DIR}
2873+ -D ${CMAKE_CURRENT_BINARY_DIR}
2874+ --from-code=UTF-8
2875+ --c++ --qt --add-comments=TRANSLATORS
2876+ --keyword=tr --keyword=tr:1,2 --keyword=N_
2877+ --package-name='${APP_HARDCODE}'
2878+ --copyright-holder='Canonical Ltd.'
2879+ ${I18N_SRC_FILES}
2880+ COMMAND ${CMAKE_COMMAND} -E copy ${POT_FILE} ${CMAKE_CURRENT_SOURCE_DIR})
2881+
2882+# Builds the binary translations catalog for each language
2883+# it finds source translations (*.po) for
2884+foreach(PO_FILE ${PO_FILES})
2885+ get_filename_component(LANG ${PO_FILE} NAME_WE)
2886+ gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE})
2887+ set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/${LANG}/LC_MESSAGES)
2888+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo
2889+ DESTINATION ${INSTALL_DIR}
2890+ RENAME ${DOMAIN}.mo)
2891+endforeach(PO_FILE)
2892
2893=== added file 'po/com.ubuntu.weather.pot'
2894--- po/com.ubuntu.weather.pot 1970-01-01 00:00:00 +0000
2895+++ po/com.ubuntu.weather.pot 2015-02-07 17:39:34 +0000
2896@@ -0,0 +1,36 @@
2897+# SOME DESCRIPTIVE TITLE.
2898+# Copyright (C) YEAR Canonical Ltd.
2899+# This file is distributed under the same license as the PACKAGE package.
2900+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
2901+#
2902+#, fuzzy
2903+msgid ""
2904+msgstr ""
2905+"Project-Id-Version: ubuntu-weather-app\n"
2906+"Report-Msgid-Bugs-To: \n"
2907+"POT-Creation-Date: 2015-02-07 18:30+0100\n"
2908+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
2909+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
2910+"Language-Team: LANGUAGE <LL@li.org>\n"
2911+"Language: \n"
2912+"MIME-Version: 1.0\n"
2913+"Content-Type: text/plain; charset=CHARSET\n"
2914+"Content-Transfer-Encoding: 8bit\n"
2915+
2916+#: ../app/components/HomeTempInfo.qml:38
2917+msgid "Today"
2918+msgstr ""
2919+
2920+#: ubuntu-weather-app.desktop.in.in.h:1
2921+msgid "Weather"
2922+msgstr ""
2923+
2924+#: ubuntu-weather-app.desktop.in.in.h:2
2925+msgid ""
2926+"A weather forecast application for Ubuntu with support for multiple online "
2927+"weather data sources"
2928+msgstr ""
2929+
2930+#: ubuntu-weather-app.desktop.in.in.h:3
2931+msgid "weather;forecast;twc;openweathermap;the weather channel;"
2932+msgstr ""
2933
2934=== added directory 'tests'
2935=== renamed directory 'tests' => 'tests.moved'
2936=== added file 'tests/CMakeLists.txt'
2937--- tests/CMakeLists.txt 1970-01-01 00:00:00 +0000
2938+++ tests/CMakeLists.txt 2015-02-07 17:39:34 +0000
2939@@ -0,0 +1,3 @@
2940+if(NOT CLICK_MODE)
2941+ add_subdirectory(autopilot)
2942+endif(NOT CLICK_MODE)
2943
2944=== added directory 'tests/autopilot'
2945=== added file 'tests/autopilot/CMakeLists.txt'
2946--- tests/autopilot/CMakeLists.txt 1970-01-01 00:00:00 +0000
2947+++ tests/autopilot/CMakeLists.txt 2015-02-07 17:39:34 +0000
2948@@ -0,0 +1,8 @@
2949+if(INSTALL_TESTS)
2950+execute_process(COMMAND python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
2951+ OUTPUT_VARIABLE PYTHON_PACKAGE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
2952+
2953+install(DIRECTORY ${AUTOPILOT_DIR}
2954+ DESTINATION ${PYTHON_PACKAGE_DIR}
2955+ )
2956+endif(INSTALL_TESTS)
2957
2958=== added directory 'tests/autopilot/ubuntu_weather_app'
2959=== added file 'ubuntu-weather-app.apparmor'
2960--- ubuntu-weather-app.apparmor 1970-01-01 00:00:00 +0000
2961+++ ubuntu-weather-app.apparmor 2015-02-07 17:39:34 +0000
2962@@ -0,0 +1,6 @@
2963+{
2964+ "policy_groups": [
2965+ "networking"
2966+ ],
2967+ "policy_version": 1.2
2968+}
2969
2970=== added file 'ubuntu-weather-app.desktop.in.in'
2971--- ubuntu-weather-app.desktop.in.in 1970-01-01 00:00:00 +0000
2972+++ ubuntu-weather-app.desktop.in.in 2015-02-07 17:39:34 +0000
2973@@ -0,0 +1,12 @@
2974+[Desktop Entry]
2975+Version=1.0
2976+Type=Application
2977+Terminal=false
2978+Exec=@EXEC@
2979+Icon=@ICON@
2980+_Name=Weather
2981+_Comment=A weather forecast application for Ubuntu with support for multiple online weather data sources
2982+_Keywords=weather;forecast;twc;openweathermap;the weather channel;
2983+X-Ubuntu-Touch=true
2984+X-Ubuntu-Default-Department-ID=accessories
2985+X-Ubuntu-Splash-Color=#F5F5F5

Subscribers

People subscribed via source and target branches