Commit Graph
5889 Commits
Author SHA1 Message Date
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
Hari Rana a0b8f4b23e event-editor/event-editor-dialog: Remove unused struct members
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/784>
2026-06-26 07:54:24 -04:00
Hari Rana 2ee6dfc5e7 core/event: Add utility functions for checking equality
This adds:
- `gcal_event_alarms_equal()`
- `gcal_event_schedule_equal()`
- `gcal_event_strings_equal()`

We aren't going to make use of it yet, but eventually these functions
will be used for the event editor dialog, as well as writing tests for.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/783>
2026-06-26 07:09:52 -04:00
Hari Rana 8aa3b7442b event-editor/summary-section: Remove automatic focus grabbing when setting event
This is no longer needed as it was replaced by the
`grab_focus()` override.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/782>
2026-06-25 07:39:38 -04:00
Hari Rana 35580dc40c event-editor/event-editor-dialog: Explicitly grab focus on summary section
As described in the previous commit, this approach is more
predictable because the focus is decided in the same place.

The focus grabbing behavior is set after notifying
the `GcalEventEditorDialog:event` property as otherwise it would
not select the entire text in some occasions.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/782>
2026-06-25 07:39:38 -04:00
Hari Rana 3271974b95 event-editor/summary-section: Override grab_focus()
This will allow for a cleaner and more predictable focus behavior,
as this will give the capability to the dialog to grab focus
on either the "Done" button or summary section depending on the
writability, as opposed to the current approach, where the
summary section assumes that it is already writable and grabs focus,
which then the dialog sets focus on the "Done" button.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/782>
2026-06-25 07:39:38 -04:00
Hari Rana 3c67de4076 event-editor/attendee-details-page: Use AdwPreferencesGroup API
AdwPreferencesGroup now has the `bind_model()` method, so it's
best to just use that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 14:10:35 -04:00
Hari Rana cda1362c59 event-editor/event-editor-section: Add AdwPreferencesGroup as prerequisite
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 14:10:35 -04:00
Hari Rana 240dc649ce event-editor/summary-section: Inherit AdwPreferencesGroup
This is a prerequisite to make GcalEventEditorSection require
inheriting AdwPreferencesGroup.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 14:10:35 -04:00
Hari Rana cbee9bbb60 event-editor/schedule-section: Inherit AdwPreferencesGroup
This is a prerequisite to make GcalEventEditorSection require
inheriting AdwPreferencesGroup.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 14:10:34 -04:00
Hari Rana 60c9989e4b event-editor/attendees-section: Inherit AdwPreferencesGroup
This is a prerequisite to make GcalEventEditorSection require
inheriting AdwPreferencesGroup.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 14:10:34 -04:00
Hari Rana c595d8a6e8 event-editor/reminders-section: Inherit AdwPreferencesGroup
This is a prerequisite to make GcalEventEditorSection require
inheriting AdwPreferencesGroup.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 14:10:34 -04:00
Hari Rana fbea369c0f event-editor/notes-section: Inherit AdwPreferencesGroup
The end goal is to make GcalEventEditorSection require inheriting
AdwPreferencesGroup. Given that most widgets utilizing
GcalEventEditorSection inherit another widget, we first want to
change and adapt the inheritance, and then bump the requirement
of the interface.

These changes will be made incrementally, starting
with GcalNotesSection.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 14:10:34 -04:00
Hari Rana 568227346b event-editor/event-editor-dialog: Port to AdwPreferencesPage
Our use case is already handled by the `AdwPreferencesPage:banner`
property, which allows us to port the dialog to AdwPreferencesPage.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 14:10:34 -04:00
Hari RanaandJamie Gravendeel 4f037132fe event-editor/schedule-section: Use separate-rows property in all-day section
`separate-rows` already does what we want, and using that property
allows us to nesting AdwPreferencesGroup into a GtkBox widget.

Co-authored-by: Jamie Gravendeel <me@jamie.garden>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 14:10:28 -04:00
Hari Rana 8bbaeb754b event-editor/schedule-section: Use AdwInlineViewSwitcher
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 13:02:50 -04:00
Hari Rana 701c6e3cb5 event-editor/event-editor-dialog: Install actions in widget class
This is a prerequisite in order to enable/disable actions using
`gtk_widget_action_set_enabled()`, is something we'll be making
use of in the future.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/779>
2026-06-23 12:55:12 -04:00
Hari Rana 3d768fa748 event-editor/attendee-row: Remove unused GtkBox
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/779>
2026-06-23 12:55:12 -04:00
Hari Rana eff6aeb6d6 event-editor/attendee-details-page: Chain up finalize()
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/779>
2026-06-23 12:55:12 -04:00
Hari Rana 50ee469d42 core/event: Add remove_alarm() prototype to header
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/780>
2026-06-23 12:48:03 -04:00
Hari Rana 5a171ea813 flatpak: Use runtime's GCR
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/778>
2026-06-22 21:37:26 +00:00