Commit Graph
281 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto 0c510d6709 month-view: Ignore events outside current range
The month view looks specially awful when switching between
dates, since it doesn't implicitly filter the ranges it's
displaying.

Ignore events outside the current month range, since they'll
be removed anyway by the timeline.
2020-04-16 16:16:49 -03:00
Georges Basile Stavracas Neto 12fd607d56 utils: Make date comparison follow time comparison semantics
Right now, comparing dates with gcal_date_time_compare_date() gives
the exact opposite result of when comparing using g_date_time_compare().

As shown by this patch, this was a source of *many* bugs.
2020-04-14 19:08:06 +00:00
Georges Basile Stavracas Neto 3efbc2436c range-tree: Use GcalRange 2020-04-14 19:08:05 +00:00
Georges Basile Stavracas Neto 923e3b7b71 project: Move range tree to core/ 2020-04-14 19:08:05 +00:00
Georges Basile Stavracas Neto e4debb9912 views: Free GDateTimes with g_date_time_unref() 2020-04-01 23:10:01 -03:00
Georges Basile Stavracas Neto 19fc8138ba week-header: Use g_date_time_compare()
It is incorrect to use the date-only comparison here. Use the appropriate
GDateTime API and fix a truckload of issues.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/546
2020-04-01 21:06:51 -03:00
Georges Basile Stavracas Neto b703f5746d week-header: Rename a variable
"event_start" and "event_end" clearly communicate they're the
start and end datetimes of the event. I'm dumb, so I need the
code to tell me what's it about easily.
2020-04-01 21:06:51 -03:00
Georges Basile Stavracas Neto c77e4ecfb5 year-view: Small code cleanup
Merge update_date() with gcal_year_view_set_date(), and
tidy up the code style a bit.
2020-04-01 21:06:51 -03:00
Georges Basile Stavracas Neto 1f6559de68 Remove ECalDataModel and ECalDataModelSubscriber
Drop the bomb!
2020-04-01 21:06:51 -03:00
Georges Basile Stavracas Neto 399b9d8d00 Simplify calendar views
We don't need a split subscription update step in GcalView
anymore, since subscribers communicate range directly to
the timeline now.
2020-04-01 21:06:51 -03:00
Georges Basile Stavracas Neto 06fbe2c2b9 month-view: Properly notify the "context" property
After adding the EXPLICIT_NOTIFY flag, we needed to make
GcalMonthView notify about it manually, otherwise the
context wouldn't propagate to GcalMonthPopover. We never
did that.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/553
2020-04-01 21:06:51 -03:00
Georges Basile Stavracas Neto 9cb29b6dc5 manager: Update event gathering API 2020-04-01 21:06:51 -03:00
Georges Basile Stavracas Neto 7cfc264c6d views: Remove ECalDataModel code 2020-04-01 21:06:51 -03:00
Georges Basile Stavracas Neto 9787f02e5b views: Implement GcalTimelineSubscriber 2020-04-01 21:06:51 -03:00
Georges Basile Stavracas Neto 92f331cd9f range-tree: Add API to remove data
It'll be useful to remove entries without knowing their
range.
2020-04-01 21:06:50 -03:00
Georges Basile Stavracas Neto ec0c17f6fb range-tree: Support destroy function 2020-04-01 21:06:50 -03:00
Georges Basile Stavracas Neto ae2a6b9d21 range-tree: Switch to use GDateTime
Using raw integers forces us to select a pre-defined
start and end ranges for the timeline. Since we want
to reuse this data structure on GcalTimeline, make it
a bit more useful.
2020-04-01 21:06:50 -03:00
Niels De Graef 4d05ffb9d3 Don't forget to chain up to parent finalize
This can give a small memory leak and can prevent the necessary closing
of resources.
2019-12-02 19:53:59 +00:00
Georges Basile Stavracas Neto b772349c3f Move UI files to src/
Keep it in sync with what To Do and Settings do.
2019-12-02 16:41:56 -03:00
Georges Basile Stavracas Neto cafd17627c year-view: Trivial code cleanup 2019-10-09 12:37:01 -03:00
Georges Basile Stavracas Neto 357ec18a0a Fix GcalContext management
GObject automatically notifies when passing
properties as part of g_object_new(). This
happens after the instance is created, thus
after constructed().

By passing G_PARAM_EXPLICIT_NOTIFY, we avoid
this behavior. However, we are still notifying
PROP_CONTEXT in GcalWindow. Removing this other
notify fixes the crashes related to GcalContext.

https://gitlab.gnome.org/GNOME/gnome-calendar/issues/417
2019-10-04 20:54:05 -03:00
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