Commit Graph
5909 Commits
Author SHA1 Message Date
Niklas Wimmer ec92fab118 tests/event: Validate schedule comparison
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/792>
2026-07-22 10:27:58 -04:00
Niklas Wimmer 81954048f9 core/event: Fix schedule comparison function
Fixes a few problems in the schedule comparison code:

- Same recurrence pointer short-circuits to TRUE: a pointer to the
  same recurrence is not a sufficient condition, because the dates
  could still be different (this is especially true if the recurrence
  is NULL for both events, but also holds if that is not the case).
  Also deleted the explicit check if only one of the recurrence
  pointers is NULL, because that is the first thing that is checked
  in `gcal_recurrence_is_equal()` anyway.
- Date comparisons only check if the date moved into a specific
  direction: the correct logic is to check if they are not the same,
  no matter in which direction the date moved.
- The time is not compared: for non all-day events, it is necessary
  to compare the time values too. The glib function that is now used
  for that also checks the date, so these checks can be collapsed
  into one.

For the second and third point it seems like some things got a bit
mixed up in
https://gitlab.gnome.org/GNOME/gnome-calendar/-/commit/2ee6dfc5e7bd5823bee5029a7ac3a32d3c247ba9:

- The `gcal_schedule_section_changed()` implementation already used the
  `g_date_time_equal()` function (which is now used again).
- It was `gcal_schedule_section_day_changed()` which only compared the
  dates using `gcal_date_time_compare_date()`, but this function was
  only used for edits to recurring events to determine whether to
  allow changing all instances. This commit now exposes a regression
  in this part of the code, which is tracked separately in
  https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/1613.

Fixes: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/1612>
See: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/783>
See: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/1613>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/792>
2026-07-22 10:27:57 -04:00
Niklas Wimmer a1b55b5ca9 tests/range-tree: Validate insertions and removals
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/798>
2026-07-22 14:13:36 +00:00
Niklas Wimmer b83a89a2e7 tests/range: Validate the compare function
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/798>
2026-07-22 14:13:36 +00:00
Niklas Wimmer ea2c637b35 core/range: Fix compare function
Fixes a regression from
https://gitlab.gnome.org/GNOME/gnome-calendar/-/commit/62345668748b571939c1c7b441e44664a05a0287

Essentially, `gcal_range_compare()` is just a faster subset of
`gcal_range_calculate_overlap()`. The commit that introduced this
regression accidentally flipped the sign of the compare function,
which made it no longer match with the implementation of overlap.

The function's implementation also did not match its doc comment,
returning any integer instead of only `-1`, `0` or `1`. Since the
behavior described in the doc comment is more commonly used for
comparison functions, the implementation was adjusted to match it.

To avoid any such failures in the future, the next commits will
add tests to validate.

Fixes: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/1615>
See: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/770>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/798>
2026-07-22 14:13:36 +00:00
Antonio Marin 173d8a1d67 Update Romanian translation 2026-07-22 14:10:26 +00:00
Niklas Wimmer 6ea211fbf9 flatpak: Remove intltool module
GNOME Calendar itself stopped depending on intltool in 3.25.3. After
intltool got removed from org.gnome.Sdk, it was added to our manifest
in 2019, because EDS still depended on it.

EDS stopped depending on intltool in 2021 (see linked MR).

Since this was the only module we used from the `shared-modules`
project, I also removed that git submodule.

See: <https://gitlab.gnome.org/GNOME/evolution-data-server/-/merge_requests/78>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/802>
2026-07-22 13:24:28 +00:00
Cheng-Chia Tseng b00107d024 Update Chinese (Taiwan) translation
Reviewed-by: Cheng-Chia Tseng <pswo10680@gmail.com>
Reviewed-by: Yi-Jyun Pan <pan93412@gmail.com>
2026-07-16 08:08:28 +00:00
Hari Rana 5f21144fbb views/month-view-row: Additive inverse in right-to-left languages
"Additive inverse" basically means transforming a positive number
into a negative equivalent, or vice-versa; for example, from 5 to -5.

Instead of inverting conditions in right-to-left languages to
compare the X coordinate, a much simpler approach to this is to
normalize the X coordinate by applying additive inverse in
right-to-left languages.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/744>
2026-07-05 14:56:44 -04:00
Hari Rana 1f06a71ee0 views/month-cell: Set child visible instead of sensitive
When hovering over the bottom side of a month cell regardless of
the sensitivity state of the overflow button, it queries the
button's tooltip text. Using `gtk_widget_set_child_visible()`
fixes that issue.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/743>
2026-07-04 23:04:29 -04:00
Hari Rana cc6edfed79 views/month-cell: Replace overlay with box and empty bin
Since we don't make use of the overlay anymore, it's best to remove
it altogether.

This also changes the behavior of the widgets a bit: It adds an
empty AdwBin widget which expands vertically, allowing us to avoid
aligning the header and overflow button.

The pattern goes from reducible (where we deduct the overflow
height to retrieve the content) to additive (where we add the
overflow height to the content height), which requires us to
adapt GcalMonthViewRow with this new behavior.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/743>
2026-07-04 23:04:29 -04:00
Victoria Niedzielska 68376efe6b Update Polish translation
Co-authored-by: Victoria Niedzielska <victorian@gnome.org>
2026-07-03 16:10:23 +00:00
Martin 86cbf871ea Update Slovenian translation
Co-authored-by: Martin <miles@filmsi.net>
2026-06-30 16:48:22 +00:00
Antonio Marin f6a39c1326 Update Romanian translation
Co-authored-by: Antonio Marin <gnmer.6qxyg@slmail.me>
2026-06-30 08:15:56 +00:00
Georges Basile Stavracas Neto 3d0f7c0d9a Post-release version bump 2026-06-29 21:55:58 -03:00
Georges Basile Stavracas Neto 3a38f92f7a 51.alpha 2026-06-29 21:55:10 -03:00
Zelda Ahmed c1549d59fa gui/event-popover: Use en-dash instead of em-dash for date ranges
En-dashes "–" should be used instead of the longer em-dashes "—", since
the dash was used to represent a range of dates, which means the correct
dash to use is the en-dash

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/789>
2026-06-29 16:44:23 +01:00
Zelda Ahmed b29cf4e517 core/event: Use en-dash instead of em-dash
En-dashes "–" should be used instead of the longer em-dashes "—", since
the dash was used to represent a range of dates, which means the correct
dash to use is the en-dash

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/789>
2026-06-29 16:44:18 +01:00
Zeqian Sun 4a3815fa07 Update Chinese (China) translation
Co-authored-by: Zeqian Sun <jianshusdd@outlook.com>
2026-06-29 08:07:43 +00:00
Hari Rana f76eb428a7 event-editor/summary-section: Request for validation when editing summary row
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/499>
2026-06-26 10:06:24 -04:00
Hari Rana c0e41b8ca0 event-editor/event-editor-dialog: Add signal for requesting validation
This will be needed to make the Save button sensitive/insensitive.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/499>
2026-06-26 10:06:24 -04:00
Hari Rana 026f148dca event-editor/event-editor-dialog: Always grab focus to summary section
Now that the summary section is always focusable, even when the event is
non-writable, we can make it grab focus every time.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/499>
2026-06-26 10:06:23 -04:00
Hari Rana b051c30e1b event-editor/event-editor-dialog: Unset sensitiveness of widgets
Only GcalCalendarComboRow, GcalAttendeesSection, and GcalRemindersSection
remain unfocusable on read-only events.

In the case of GcalRemindersSection, we eventually want to allow setting
reminders regardless of the writable state of the event; however, since
dialog is centered around the assumption that a read-only event should
never be edited, which includes reminders, these changes will have to be
done in a separate merge request.

Closes: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/737>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/499>
2026-06-26 10:06:23 -04:00
Hari Rana cbf5d8e10b event-editor/schedule-section: Update editability of widgets
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/499>
2026-06-26 10:06:23 -04:00
Hari Rana b70763075b event-editor/notes-section: Update editability of text view
Related: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/737>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/499>
2026-06-26 10:06:19 -04:00
Hari Rana a83198b954 event-editor/summary-section: Update editability of widgets
Related: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/737>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/499>
2026-06-26 10:06:02 -04:00
Hari Rana f5ce577b36 event-editor/date-time-chooser: Add "editable" property
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/499>
2026-06-26 09:48:54 -04:00
Hari Rana 59a5f5f7b5 event-editor/date-chooser-row: Make menu button insensitive when row is uneditable
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/499>
2026-06-26 09:48:54 -04:00
Hari Rana 3219b98b1b event-editor/schedule-section: Set visible child name based on schedule type
This fixes a bug introduced by
https://gitlab.gnome.org/GNOME/gnome-calendar/-/commit/8bbaeb754b6b5b81e92173508ef20888d7c421a8
which forgot to update the page depending on the schedule type.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/499>
2026-06-26 09:48:54 -04:00
Hari Rana ec5489b263 event-editor/event-editor-section: Remove GtkWidget overrides
Now that all GcalEventEditorSection subclasses override `event_set()`,
we can safely remove these overrides.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:23:09 -04:00
Hari Rana 40337612e8 event-editor/event-editor-dialog: Set GcalEventEditorSection:dialog property to all sections
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:23:09 -04:00
Hari Rana 9b4c5606ac event-editor/summary-section: Subclass GcalEventEditorSection
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:23:09 -04:00
Hari Rana 11ac931d55 event-editor/schedule-section: Subclass GcalEventEditorSection
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:23:09 -04:00
Hari Rana f8c4fb786f event-editor/reminders-section: Subclass GcalEventEditorSection
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:23:09 -04:00
Hari Rana 082e829651 event-editor/notes-section: Subclass GcalEventEditorSection
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:23:09 -04:00
Hari Rana 61a3b9f869 event-editor/attendees-section: Subclass GcalEventEditorSection
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:23:08 -04:00
Hari Rana 66e7d9b6d7 event-editor/event-editor-section: Turn it into an abstract class
Currently, GcalEventEditorSection is an interface that doesn't
really do much apart from requiring a property and providing
virtual methods.

This proposed approach turns it into an abstract class, derived
from AdwPreferencesGroup, which gives access to virtual methods
as well as public methods. It comes with the same benefits of
an interface, while sharing a lot of code that were duplicated
in the previous commits.

As a stopgap measure, it overrides several GtkWidget virtual
methods to smoothly transition without causing the commits
to break. These overrides will get removed in a later commit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:23:08 -04:00
Hari Rana da9b28cf93 event-editor/attendees-section: Remove GcalEventEditorSection implementation
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:23:08 -04:00
Hari Rana 5dc7e4d639 event-editor/schedule-section: Remove GcalEventEditorSection implementation
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:23:08 -04:00
Hari Rana d1c5a085bd event-editor/reminders-section: Remove GcalEventEditorSection implementation
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:23:08 -04:00
Hari Rana 63191bea9e event-editor/notes-section: Remove GcalEventEditorSection implementation
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:23:08 -04:00
Hari Rana 09e5bd5859 event-editor/summary-section: Remove GcalEventEditorSection implementation
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:23:07 -04:00
Hari Rana d62c2386b8 event-editor/event-editor-dialog: Compare original event with edited event
This also takes the opportunity to rework the save process.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:22:32 -04:00
Hari Rana 854d991134 event-editor/attendees-section: Allow applying event when mapped
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:14:03 -04:00
Hari Rana a2bcde8ccb event-editor/schedule-section: Write to event directly
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:14:03 -04:00
Hari Rana 842f9939cf event-editor/reminders-section: Write to event directly
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:14:03 -04:00
Hari Rana af8a619eac event-editor/notes-section: Write to event directly
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:14:03 -04:00
Hari Rana 6e4062a9d6 event-editor/summary-section: Write to event directly
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:14:03 -04:00
Hari Rana b0d5cdbcb8 event-editor/event-editor-dialog: Store duplicate event instance
This is a preliminary step for moving the comparison and
application logic of each section into the dialog.

Essentially, the dialog will pass the duplicate event to each
section, and these sections will modify the event. If the user
presses "Save", the dialog will compare the edited event to
the original event, and apply if they are different.

This also adds the `get_event()` method which will be used
in the future.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:13:24 -04:00
Hari Rana 6cd8d631f5 event-editor/event-editor-dialog: Rename set_event() to present_event()
This allows us to avoid using `adw_dialog_present()` every time
`set_event()` is being invoked.

All the files using `set_event()` are updated accordingly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:08:39 -04:00