Commit Graph
260 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto 5e4bbe446f utils: Pass GcalCalendar to ask_recurrence_modification_type()
The method ask_recurrence_modification_type() currently
receives an ESource, and tried to fetch the ECalClient
from the ESource by using g_object_get_data().

However, since we moved to GcalCalendar, we do not set
this data field in ESource.

Receive a GcalCalendar instead, and use the appropriate
function gcal_calendar_get_client() instead.
2019-09-14 21:38:53 -03:00
Michael Catanzaro 18ae67cb59 Use more g_signal_connect_object()
Most of these are probably paranoid, not bugs. I haven't done an
exhaustive review to see what really needs it: that would be
time-consuming and require significant familiarity with the Calendar
codebase. This was just a quick check. Anyway, I vote for paranoid
when it comes to using g_signal_connect() regardless. It's dangerous,
and there's no reason to ever leave a signal connected after the user
data object has been destroyed.

Fixes #423
2019-09-14 23:28:42 +00:00
Georges Basile Stavracas Neto 666679f123 year-view: Remove stray message 2019-08-25 17:57:48 +03:00
Georges Basile Stavracas Neto 00e883ca63 year-view: Optimize sidebar update
Use the cached events to fill the sidebar, instead of
querying e-d-s every time we need an update.
2019-07-13 20:44:27 -03:00
Georges Basile Stavracas Neto 8a98c697c4 week-header: Trivial style cleanup 2019-07-09 21:24:58 -03:00
Michael Catanzaro 3ed9669c6e week-header: Remove internal weather service
self->weather_service was only partially removed in 01fdf79e6a,
leading to a guaranteed crash when the weather is updated because
self->weather_service is now always NULL.

Fixes #397
2019-07-09 21:14:23 -03:00
Georges Basile Stavracas Neto 0b4119367a month-view: Use last cell to calculate multday event end
Instead of assuming all cells have the same width, use the last
cell to figure out the width of the event with the traditional:

    event width = end.x2 - start.x1
    event width = (end.x1 + end.width) - start.x1

https://gitlab.gnome.org/GNOME/gnome-calendar/issues/413
2019-06-26 11:04:39 -03:00
Milan Crha a0cae4356a Port to libecal-2.0
Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/merge_requests/70
2019-05-17 21:58:55 +02:00
Georges Basile Stavracas Neto 0baeaa160a window: Delegate changing dates to GcalView
The view knows its time range, and knows what the
next or previous dates should be. So instead of
calculating the next date manually, ask the views
for that.
2019-05-09 17:42:59 -03:00
Georges Basile Stavracas Neto da31180cba view: Let views handle subscription range
Instead of GcalWindow handling the ranges themselves,
delegate this responsibility to the views.
2019-05-09 17:42:58 -03:00
Georges Basile Stavracas Neto 1118c74881 event: Receive and operate on GcalCalendar
Instead of receiving an ESource, receive a GcalCalendar
and operate on it. Many places needed to be adjusted for
that.

Tests need to be rethinked.
2019-05-04 12:05:39 -03:00
Georges Basile Stavracas Neto f67009bbba week-header: Use GDateTime to fetch weekday names 2019-04-26 16:00:33 -03:00
Georges Basile Stavracas Neto 06e07fe4d6 year-view: Cleanup header 2019-04-26 15:25:05 -03:00
Georges Basile Stavracas Neto c88cf19e86 week-header: Simplify set_date() 2019-04-26 15:20:47 -03:00
Georges Basile Stavracas Neto c64849a29a week-header: Compare week number 2019-04-26 15:17:20 -03:00
Georges Basile Stavracas Neto 360a50acf2 year-view: Fix sidebar events
Various fallouts from moving to GDateTime
2019-04-26 14:09:39 -03:00
Georges Basile Stavracas Neto c52bacfc3f utils: Move more API to gcal-date-time-utils.c 2019-04-26 13:57:05 -03:00
Georges Basile Stavracas Neto ab1c0b6ca4 utils: Rename gcal_clear_datetime to gcal_clear_date_time
To keep it consistent with the rest of the API.
2019-04-26 13:27:37 -03:00
Georges Basile Stavracas Neto 073fc961c1 view: Turn 'active-date' into a GDateTime property
Drop the bomb!
2019-04-26 13:04:37 -03:00
Georges Basile Stavracas Neto 21e748ac36 month-view: Don't get weather info before having a date 2019-04-25 16:35:37 -03:00
Georges Basile Stavracas Neto c5b5023508 application: Move time format to GcalContext
It finally found its place under the sun.
2019-04-25 16:30:57 -03:00
Georges Basile Stavracas Neto 01fdf79e6a Use weather service from GcalContext
All those properties were a waste compared to storing it
into the context.
2019-04-25 16:30:56 -03:00
Georges Basile Stavracas Neto 1297ad695b application: Remove gcal_application_get_clock()
That moved to GcalContext, and now that all pieces who
used it have access to the context, we can just use it.
2019-04-25 16:30:55 -03:00
Georges Basile Stavracas Neto 54506973fc event-widget: Receive a context 2019-04-25 16:30:55 -03:00
Georges Basile Stavracas Neto c175599550 view: Replace the manager property by the context 2019-04-25 16:30:55 -03:00
Georges Basile Stavracas Neto a799678f68 event: rewrite timezone support
Now with something that hopefully works.

https://gitlab.gnome.org/GNOME/gnome-calendar/issues/43
https://gitlab.gnome.org/GNOME/gnome-calendar/issues/302
2018-09-14 20:16:54 -03:00
Georges Basile Stavracas Neto cfa8794313 manager: Move GcalClock to GcalApplication
GcalManager is basically an object that is shared
among classes that need to modify calendars, while
GcalClock is just a wall clock implementation.

Move it to GcalApplication, so that objects without
access to GcalManager can still access the clock.
2018-05-04 21:37:53 -03:00
Georges Basile Stavracas Neto df7216f2f5 month-popover: don't be so small
This commit limits the month popover at least
250px wide. To make it actually usable.
2018-05-01 20:29:57 -03:00
Georges Basile Stavracas Neto 1da2151bb9 month-popover: popdown when adding new event 2018-05-01 20:29:36 -03:00
Georges Basile Stavracas Neto d272bbe3c8 week-view: use the correct inclusive end date
Event dates are, by definition, inclusive on their
start dates, but exclusives on their end dates. That
means that end dates don't actually contain the date
they represent.

Week grid code, however, was considering that end date
as inclusive, and the layout code was miscalculated
because of that.

Fix that by using an inclusive end date when calculating
the event span. Since Calendar does not support subsecond
precision, we do that by subtracting one second from the
exclusive end date.

Issue: #279
2018-05-01 18:50:27 -03:00
Georges Basile Stavracas Neto 93b22f2c43 month-view: reorganize code 2018-05-01 11:06:47 -03:00
Andrea Azzarone 9d0b44d4e3 view: Auto disconnect weather-changed signal handler
Use g_signal_connect_object in order to auto disconnect the weather-changed
signal handler when the view object is finalized.

https://gitlab.gnome.org/GNOME/gnome-calendar/issues/271
2018-04-11 17:45:02 +02:00
Georges Basile Stavracas Neto 8892c31379 week-view: Remove embarrassing debug message 2018-01-28 12:50:04 -02:00
Georges Basile Stavracas Neto 194407ecfb views: Instrument and fix reference leaks 2018-01-28 12:08:04 -02:00
Georges Basile Stavracas Neto 037567209c view: Remove first weekday helpers when unecessary
Not all views need to know the first weekday, and those
who need, it can be stored internally.
2018-01-28 10:20:19 -02:00
Georges Basile Stavracas Neto b936759e5c project: Make time format a first-class citizen
The current code deals with 12/24h clock formats almost like
a workaround of the issue. This commit adds proper support to
different clock formats.
2018-01-28 02:30:55 -02:00
Georges Basile Stavracas Neto 1dcf0d1f24 project: Unify headers 2018-01-27 22:35:20 -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 a8d6bfea0b month-popover: Properly mark static function as static 2018-01-27 14:30:31 -02: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
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
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