Commit Graph
1961 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto 1dcf0d1f24 project: Unify headers 2018-01-27 22:35:20 -02:00
Georges Basile Stavracas Neto ac4f8feb15 weather-service: More small refactorings
Now it appears to be fully funcitonal again!
2018-01-27 22:26:30 -02:00
Georges Basile Stavracas Neto 718266f349 window: Bind manager to GcalWeatherSettings
A missing entry point from the previous refactorings
2018-01-27 22:25:57 -02:00
Georges Basile Stavracas Neto 50ec8fd30b window: Notify properties by pspec
It avoids lookups on the class properties.
2018-01-27 22:25:32 -02:00
Georges Basile Stavracas Neto 6dc3d9ee39 weather-settings: Improve start/stop logic 2018-01-27 21:56:58 -02:00
Georges Basile Stavracas Neto 5dddff9939 weather-service: Fix debug location
This is tricking us into thinking the code is being
executed when in fact it's falling into the early return.
2018-01-27 21:56:14 -02:00
Georges Basile Stavracas Neto 5a651b01f8 window: Rework property initialization
There is a clear chain of properties that must be respected
in order to make Calendar initialize properly:

 1. GcalManager, since it provider access to the settings
 2. The initial date
 3. GcalWeatherService, that depends on settings and the initial date
2018-01-27 21:46:15 -02:00
Georges Basile Stavracas Neto 5a0844c127 application: Remove conditional include
We always generate the config file nowadays.
2018-01-27 21:26:33 -02:00
Georges Basile Stavracas Neto 737181c655 application: Use g_auto* to simplify code 2018-01-27 21:11:08 -02:00
Georges Basile Stavracas Neto 499db7bfd4 weather: Rework weather management
This commit brings a few changes that I was too lazy to
split in different commits:

 * Remove a few useless arguments in the GcalWeatherService API
 * Move the weather management code from GcalWindow to GcalWeatherSettings
 * A few style changes
2018-01-27 20:36:29 -02:00
Georges Basile Stavracas Neto ab20672aeb weather: Move to a subdirectory 2018-01-27 15:24:32 -02:00
Georges Basile Stavracas Neto a8d6bfea0b month-popover: Properly mark static function as static 2018-01-27 14:30:31 -02:00
Georges Basile Stavracas Neto 702c089c17 weather-service: Simplify code 2018-01-27 14:30:02 -02:00
Georges Basile Stavracas Neto 5a6fabddc8 window: Rework property creation 2018-01-27 14:28:55 -02:00
Georges Basile Stavracas Neto f0a2a43438 Merge branch 'master' into 'master'
week-view: display "12 PM" correctly

See merge request GNOME/gnome-calendar!22
2018-01-10 16:08:08 +00:00
Adam Dingle 67efbd0f6c week-view: display "12 PM" correctly
https://gitlab.gnome.org/GNOME/gnome-calendar/issues/235
2018-01-10 10:10:46 +01:00
Akbar Hashmi 4048296314 application: Add --quit commandline argument
Overview: Clicking the close button in gnome-calendar doesn't always close all the instances of the application. The window is closed, but an instance of gnome-calendar is still running as a gapplication-service, which was probably run by gnome-shell search provider.

The two changes made were as follows:

1) added the argument quit to GOptionEntry
2) added the definition of quit to gcal_application_command_line
2017-12-19 07:41:40 +05:30
Georges Basile Stavracas Neto b8f51e1d3d window: a load more weather changes 2017-12-17 11:35:19 -02:00
Georges Basile Stavracas Neto 61b9ba85a2 month-view: cleanup includes 2017-12-16 23:52:06 -02:00
Georges Basile Stavracas Neto 9f1885d807 weather-service: use GPtrArray for public API
Using GLists and GSLists is a bad practice. These data
structures are too much inneficient and GPtrArray has
the advantage of having a free function pointer, so we
can hide the underlying free function from the consumers
of this API.

This also gets rid of another allocation cycle in Month
view.
2017-12-16 23:12:06 -02:00
Georges Basile Stavracas Neto dcf4ff0bda views: more weather service cleanups
Did I ever say how happy I'll be when people start
actually following my code style when densing code
to my projects?
2017-12-16 22:36:39 -02:00
Georges Basile Stavracas Neto d283316382 views: simplify reference leak workaround
Oh so many unecessary casts =(
2017-12-16 21:49:22 -02:00
Georges Basile Stavracas Neto 5c1bf907fa views: move :event-activated signal to GcalView
We don't really need to copy this signal to every GcalView
implementation. It's just wasting code.
2017-12-16 21:44:09 -02:00
Georges Basile Stavracas Neto c306bbc1ef month-view: properly cleanup weather data from cells 2017-12-16 21:34:31 -02:00
Georges Basile Stavracas Neto b70f3fa0b6 month-view: fix another allocation cycle 2017-12-12 11:06:46 -02:00
Georges Basile Stavracas Neto d2dea218ae view: pass the correct property value
It should be a pointer to a GcalWeatherService, not a pointer
to a pointer to a GcalWeatherService.
2017-12-12 11:06:07 -02: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