agenda-view sort_func uses gcal_date_time_compare_date, which is
insufficient for this case.
we want to compare events date(s) down to the last minute, so that we
can be able to sort them in chronological order.
we use the g_date_time_compare function.
Fixes: #936
Co-authored-by: Georges Basile Stavracas Neto
<georges.stavracas@gmail.com>
Files that aren't in the UTF-8 encoding were breaking the import dialog.
This tries to guess the encoding of the file before processing it, based
on the Byte Order Mark (BOM), and converts it to UTF-8.
Fixes#1243
When the user deletes a calendar in the calendar management dialog, a
popover allows them to undo the deletion. The calendar is fully deleted
only when the toast is dismissed or when the toast reaches its timeout.
When the user closes the calendar management dialog without dismissing
the toast and before the end of the timeout, the calendar can still be
manipulated for a short period of time.
To fix this, I removed the calendar-management-dialog from the UI of the
window, and made the window create and destroy the dialog on demand.
This forces the toast overlay to dismiss all toasts.
Using a tooltip to inform when the calendar is read-only won't
work in touch devices.
This change also improves a11y, as Orca now reads this message,
something that wasn't happening before.
When dragging and dropping events in week view during the week of
daylight savings time switch, events were off by one hour. This fixes this
behavior by using the util function gcal_date_time_add_floating_minutes.
Fixes#1198
When importing .ics files as events,
you can assign the resulting events to any writable calendar,
even those hidden from the view.
However, it is good to have a hint of such calendars being invisible.
That way, users can have predictable expectations.
Fixes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1184
Reading the `get_source_parent_name_color` call after `color_paintable`,
one gets the impression they are somehow related, but they are not.
Furthermore, this unfortunate location complicates my upcoming changes.
Let's relocate that code next to the context where it is actually used.
This improves clarity and maintainability.
By !474, we now use a GListModel to store the calendars.
Nonetheless, we still use the GListStore API, which no longer
works.
This commit introduces a simple linear search for the default calendar
In practice, the name and color widgets are currently meant to be used
when creating a local calendar, not when subscribing online, especially
as a single online calendar link can bundle multiple calendars.
This makes the scope of those widgets clearer,
and also makes the dialog more balanced.
Related: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/566
Replace the manually positioned & styled group label by a property
This simplifies the XML code, makes the style match the rest of the UI,
and prevents libadwaita from sometimes moving such labels to the bottom.
Now that the "Open" button has been removed,
it is now a feature to "Connect" rather than "Import",
so update the section title to reflect that.
Also give a hint as to what protocols are supported.
A file imported as a "new calendar" would make it dependent on the file.
This feature was confusing everybody and is downright dangerous.
This does not prevent anyone from creating normal calendars,
and importing events from .ics files into them.
Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/390
Currently, the progress bar is pulsed as soon as the user starts
typing, giving the impression that a process is on going. But,
in reality, validation is performed 500 ms.
After this changes the progress bar is pulsed only when validation
is on-going. The timeout has been increased to 750ms too.
Use the widget to display calendars and distinguish whether
they are visible or not. Currently, it does not distinguish
read-only calendars, but once !494 is merged, it should not
be a problem.
This widget displays the calendar and shows whether it is
visible or not. The widget displays the color of the calendar
at the left of the label and the visibility state at the right.
When updating the color of the calendar, the corresponding colored dot
in the "Calendars" popover does not change. This is due to the fact that
GListModel doesn't notify when one child changes internally. Any widget
depicting a calendar should watch for changes on the data.
To fix this, I used the same code as in GcalEventEditorDialog, which
creates a binding between the calendar's color and the paintable inside
the image.
Since the GtkListBox is bound to the calendars GListModel, and since the
GListModel is already sorted, there is no longer a need for sorting the
rows by name.
Ports the import dialog out of AdwPreferencesPage to
modify some properties of the ScrolledWindow so the dialog
does the sizing as expected
This avoids scrolling when the natural height of the contents
fits within the window
When enabling or disabling a calendar through the GcalCalendarButton
popover, the user loses the ability to click right after. This bug was
caused by the update mechanism, triggered by the calendar-changed signal,
which would delete then create a brand new GtkWidget for the row.
To fix this, I replaced the manual signal-based create, update and
remove mechanisms with a binding between the GtkListBox and the calendar
GListModel.
A new widget to perform drag and drop operations, for example,
dropping ICS files to the GcalWindow. It allows to overlay
a child for visual feedback when a DnD operation is done.
either in the main window or in the import dialog,
depending on whether none could be imported, or just some
of them.
It is based on Loupe's DragOverlay widget.
Closes#1257