Commit Graph
2813 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto d42a943e4d Merge branch 'gweather-api-fix' into 'master'
Adapt to the libgweather API changes

See merge request GNOME/gnome-calendar!15
2017-12-12 12:00:52 +00:00
Emmanuele Bassi a4d21a72c7 Adapt to the libgweather API changes
The deprecated GweatherForecastType enumeration was dropped from the
API, and gweather_info_new() lost the forecast type parameter.

This requires bumping up the minimum version of libgweather we require
to build Calendar. Ideally, we could do a version check and an ifdef
dance to keep Calendar building with the previous versions of
libgweather, but since we were requiring version 3.24 I don't think it's
worth it.
2017-12-12 03:04:28 +00:00
Georges Basile Stavracas Neto 8670c6fd8e source-dialog: cast to GtkWidget* before increasing refcount
So that we check for the right type.
2017-12-11 23:22:42 -02:00
Georges Basile Stavracas Neto 23a9de1108 weather-service: major reorganization and cleanup
To make it more like the actual code style of GNOME Calendar.

Hope Florian doesn't get (too) mad of me removing and modifying
so much on his code. I'm sorry dude, my OCD didn't allow me to
just flood the gate.
2017-12-11 23:10:55 -02:00
Florian Brosch eceb826e77 Whitespace changes 2017-12-11 22:13:16 -02:00
Florian Brosch d51d1ea2cd view: Move weather API to interface GcalView
This allows us to get rid of similar code.
2017-12-11 22:09:59 -02:00
Florian Brosch d13473d3bc year-view: Show weather reports.
This view is not ref-counted correctly. I use the same
workaround to avoid runtime errors as for month views.
2017-12-11 22:06:54 -02:00
Florian Brosch 67f3a2057e month-cell: Display temperatures 2017-12-11 22:06:52 -02:00
Florian Brosch e9e403ce7a month-view: Show weather reports.
This commit triggers two existing issues:
 1. window size calculation
    (this breaks month-cells)
 2. wrong reference counts in views
    (I use :destroy to avoid dangling pointers)
2017-12-11 21:54:55 -02:00
Florian Brosch 9ac45e840d weather, timer: Set log domains 2017-12-11 21:38:08 -02:00
Florian Brosch 0b332c311c weather: start the right timer. 2017-12-11 21:38:08 -02:00
Florian Brosch 759e6ef0b1 week-header: Rename WeatherInfoPos to WeatherInfoDay and drop positions. 2017-12-11 21:38:08 -02:00
Florian Brosch 2606d35ccb timer: Drop useless if in reset.
This condition is already part of our contract.
2017-12-11 21:38:08 -02:00
Florian Brosch c942b19c18 timer: Rename struct CallbackWrapper to CbWrapperData 2017-12-11 21:38:08 -02:00
Florian Brosch 1a98df6524 weather: Update on 00:00 2017-12-11 21:38:08 -02:00
Florian Brosch 24d9e0c390 weather: Change the way I calculate begin-of-day 2017-12-11 21:38:08 -02:00
Florian Brosch 660e1c6178 Avoid single line comments. 2017-12-11 21:38:08 -02:00
Florian Brosch c502102653 weather: Rename timer to duration timer.
In preparation for my next commit.
2017-12-11 21:38:08 -02:00
Florian Brosch 9ff8b9ddf0 weather: Use network status 2017-12-11 21:38:08 -02:00
Florian Brosch 91ec4990ab weather: Use shorter timeouts if local weather info is invalid 2017-12-11 21:38:06 -02:00
Florian Brosch 50e675da05 timer: Improve duration api
- rename duration setter
- add duration getter
2017-12-11 21:34:23 -02:00
Florian Brosch 5475df20c6 weather: Set check-interval-renew to 3h. 2017-12-11 21:34:22 -02:00
Florian Brosch 2a0a6064aa weather: Rename check-interval to check-interval-renew.
In preparation for check-interval-new.
2017-12-11 21:33:47 -02:00
Florian Brosch 83d6eaef9a weather: Introduce a proper timer for forecasts. 2017-12-11 21:32:01 -02:00
Florian Brosch 72dc615bfd weather: Drop gcal_weather_service_get_location_name() 2017-12-11 21:32:01 -02:00
Florian Brosch 9d4bf09ca7 weather: Use find_nearest_city instead of new_detached 2017-12-11 21:32:01 -02:00
Florian Brosch 12da918357 window: Improve weather setting sensitivity 2017-12-11 21:32:01 -02:00
Florian Brosch f4f0c3a38d window: Set style class "error" for invalid locations 2017-12-11 21:32:01 -02:00
Florian Brosch f0fa9eca70 week-header: Properly handle weather infos on date changes 2017-12-11 21:32:01 -02:00
Florian Brosch d1ee082142 weather: Re-use old weather predictions on errors 2017-12-11 21:32:00 -02:00
Florian Brosch eb3e4a4078 Synchronise weather on application.sync. 2017-12-11 21:29:33 -02:00
Florian Brosch 75fc1f41e6 weather: steal a data point from tomorrow in case there is none for "today".
This commit also improves night/day icon selection.
2017-12-11 21:29:33 -02:00
Florian Brosch 2cbdba9a95 weather: Display service attributions in AboutDialog.
Note that this injects strings we can't translate.
2017-12-11 21:29:33 -02:00
Florian Brosch a188c68653 week-header: Style temperatures 2017-12-11 21:29:33 -02:00
Florian Brosch 30297f084d weather: week: Add space between icon and temperature 2017-12-11 21:29:33 -02:00
Florian Brosch a58047257b weather: Use -night icons only for fold-results when it makes sense. 2017-12-11 21:29:33 -02:00
Florian Brosch b1b5cf2d73 weather: Change weather icon selection heuristic.
The original version used conditions as key. This does
not work out for all providers. They might return no
value while gweather derives icons from other fields.
2017-12-11 21:29:33 -02:00
Florian Brosch 1f3173823b weather: Integrate weather into our main windows. 2017-12-11 21:29:31 -02:00
Florian Brosch 950a2cda8f weather: Pin weather services to applications. 2017-12-11 21:25:16 -02:00
Florian Brosch 4ffbf68b23 week-header: Add initial weather support.
This is still work in progress. API is stable but presentation
is not. It also contains some LOCs for unfinished mouse-over and
click-events.
2017-12-11 21:23:20 -02:00
Florian Brosch d701f2c7a6 weather: Add optional reading point logging 2017-12-11 21:23:20 -02:00
Florian Brosch 3d292038b2 week-view: Fix outdated ownership comment.
A comment states GcalWeekView.manager is a week reference. It is
not. It probably should be.
2017-12-11 21:23:20 -02:00
Florian Brosch c5c832241e Weather: Change weather update signal. 2017-12-11 21:23:20 -02:00
Florian Brosch 0248cf918e weather: Rename WeatherInfo.weather_info to gweather_info
This should make next commit less confusing.
2017-12-11 21:23:19 -02:00
Florian Brosch 45d365ff42 weather: Improve weather folding 2017-12-11 21:23:19 -02:00
Florian Brosch 0c51e061e2 weather: Improve logging 2017-12-11 21:23:19 -02:00
Florian Brosch 30612fee5c weather: Add a TODO
We should switch to a async version of geocode_reverse_resolve.
2017-12-11 21:23:19 -02:00
Florian Brosch 8d85af0960 weather: Prepare global time zone support.
This patch allows to change time-zones for
weather reports.
2017-12-11 21:23:19 -02:00
Florian Brosch 13342ac82e weather: Properly extract and translate weather information.
Completes commit 98cc78d6de66fc3a79abd9148ba03e9b21f89fb1.
2017-12-11 21:23:19 -02:00
Florian Brosch d7c9e70c31 weather: Simplify and inline property param flags 2017-12-11 21:23:19 -02:00