Instead of the manager. This adds multiple lines retrieving
the manager from the context, but throughout the course of
this rework, they will probably be simplified.
This is mostly a nice touch of integration for when
using the Night Light feature. It can be disabled by
switching the 'follow-night-light' dconf key to false,
but no user interface widgetry was added.
The "New Event" menu item is confusing and misleading, since
it is contextless item that has a context-aware action. The
result varies depending on which view you are, but this is in
no way communicated.
So just remove that, and all the GcalWindow API that is not
used anymore altogether.
When navigating through the dates of GcalDateChooser, if we
select a day (e.g. 31) that is not contained inside the next
or previous month, Calendar crashes.
Fix that by ensuring that the selected day is always contained
in the new month.
https://gitlab.gnome.org/GNOME/gnome-calendar/issues/284
Changing the time of an event with a different
timezone was automatically changing the timezone
to the local one.
This patch checks whether a timezone is already
set and uses that.
Fixes#273
When an event is timed, and we move past its end
date and time, the event does not react to that
and continues with the opacity of a regular event.
Fix that by reacting to minute changes.
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.
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
GcalManager:remove_event() is an asynchronous function
that, by the time the callback is executed, unreferences
the event that is being removed. This implies that, when
the function was called, a reference was taken -- we don't
want the event to be finalized during the operation, after
all.
The problem is that the reference was never taken.
Fix that by properly owning a reference to the event when
removing it, and dropping it when the removal is finished.
Issue: #268
Checking if an event is multiday is currently broken
because g_date_time_difference() returns raw time spans,
and that value means "there is 24h of difference between
these dates", when what we're looking for is "how many
days are between these two dates".
To fix that, use the GDate API instead of GDateTime.
The unit test that checks GCalManager test fails due to missing
schemas.
This patch allows schemas to be compiled in the build tree and also
sets the environment variables so tests can found them and run
properly.
Additional code and testing from Mohammed Sadiq <sadiq@sadiqpk.org>
We can receive the source-changed signal on read-only sources,
and these sources have no row associated. Trying to remove the
non-existing row would yield a warning.