Commit Graph
128 Commits
Author SHA1 Message Date
Automeris naranja 061c027520 event-editor-dialog: Use an AdwBanner when a calendar is read-only
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.
2024-10-22 11:29:53 +00:00
Hari Rana 26d34930b6 event-editor: Only list writable calendars 2024-08-23 13:46:00 -03:00
Diego Iván 0af5ffc334 event-editor-dialog: Use GcalCalendarRow to display calendars
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.
2024-08-11 23:35:42 +00:00
Diego Iván 1d418ce1ba event-editor: Introduce GcalCalendarRow
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.
2024-08-11 23:35:42 +00:00
Abdullahi Usman 1e3acba3cb date-chooser: fix some events randomly disappearing
because days starts at 01:01:01 (HH:MM::SS), some events at the start
or end of day may be push into another day or back into previous day.
day should starts at 00:00:00 and previous day should stop at 23:59:59.

fixes:
https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1255
2024-07-21 23:03:43 +01:00
Dimitrios Christidis 5dbf0c24bd event-editor: Introduce reminder at event start time 2024-07-09 19:54:03 +00:00
Abdullahi Usman d8e2fd6d81 reminders-section: make alarm sound changes persistent
When the alarm sound changes, the change is not updated because
gcal-manager does not see the changes.

We now update the components and make more comparisons so that
it can be seen by gcal-manager
2024-07-09 19:47:13 +00:00
Abdullahi Usman 420a126ddb reminders-section: fix reminder alarm toggle button states
Alarm toggle state are in three stages because we do not update both
icon and active when pressed.

we now update the icons to match their states.
2024-07-09 19:47:13 +00:00
Jean-François Fortin Tam b547db1170 event-editor: Demystify the read-only padlock icon
Non-technical users may not realize why they can not edit some events
from read-only subscribed remote calendars.

A symbolic padlock icon does not suffice to make this obvious.
This tooltip makes the UI self-documenting, and improves accessibility.
2024-05-01 15:01:39 +00:00
Alice Mikhaylenko 6a27049c93 event-editor-dialog: Port Delete Event button to AdwButtonRow 2024-05-01 13:47:16 +00:00
Alice Mikhaylenko a74e7179c1 reminders-section: Port Add Reminder row to AdwButtonRow 2024-05-01 13:47:16 +00:00
Jean-François Fortin Tam 704c0815a1 event-editor: Focus "Done" for read-only events
In commit 1494f7407, we focus the summary entry when opening the dialog.
However, this prevents the Escape keyboard shortcut from working
when opening a read-only event after having opened a writable event.

Set focus onto the "Done" button when showing a read-only event,
as it's the only widget that can be activated/clicked in this situation.

This makes the "Escape", "Spacebar" and "Enter" keyboard shortcuts work.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1180
2024-04-26 12:54:59 +00:00
Georges Basile Stavracas Neto cbe89a9daa gui/event-editor: Rework calendars menu
Use a GtkListBox and bind from the model. Create rows from the model
items, and bind properties as needed.

The action target is set only when the calendar is writable because
setting an invalid action+target pair makes the row insensitive.

Remove the ancient menu icon hack.
2024-03-01 00:39:42 -03:00
Georges Basile Stavracas Neto 4795999092 Revert "event-editor: Revert "New Event" string back to "Unnamed Event""
This reverts commit 18da9c9f3b.
2024-02-25 14:32:07 -03:00
Georges Basile Stavracas Neto 18da9c9f3b event-editor: Revert "New Event" string back to "Unnamed Event" 2024-02-25 13:18:06 -03:00
Hari Rana ddb54c8c1c event-editor: Improve event name validation handling
- Fix a bug where clicking the "Add Event" button created an empty title in the event editor dialog.
- Add "error" class when the user writes an invalid event name.
- Add new function to validate event name.

Because the sections are split into files, the event editor will need a signal to check that each section is correct, and each section will have to emit the signal. This will need to be done in a future commit.
2024-02-25 08:55:17 -05:00
Hari Rana 1494f7407f summary-section: Grab focus on summary entry when opening dialog
Due to an unintentional behavior change from AdwWindow to AdwDialog, the entry row must be focused after the dialog is displayed.
2024-02-24 22:53:54 +00:00
Jean-François Fortin Tam 1ae6fbb637 event-editor: Fix widgets groups sensitivity sync
A side-effect of changing the default "writable" state in commit 06b3c38
is that we must ensure that all the widget groups are synced with it.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1178
2024-02-23 17:13:01 -05:00
Jean-François Fortin Tam 06b3c38db8 event-editor: Fix the "Save" / "Done" button label
The "Done" button was apparently meant for read-only events,
while the "Save" action was for everything else.
It didn't work correctly because of a mismatch between code and UI XML.

Fixes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1142
2024-02-23 16:19:40 +00:00
Monster 3733d11380 general: Correct strings to comply with GNOME HIG 2024-02-14 14:55:36 +00:00
Georges Basile Stavracas Neto 26c71e18f6 event-editor: Use adw_dialog_close() to hide 2024-01-27 12:53:10 -03:00
Georges Basile Stavracas Neto df8526f471 event-editor: Cleanup some code
Remove the constructed() override, we can do that in init().
2024-01-27 12:40:23 -03:00
Georges Basile Stavracas Neto b52b27eace event-editor: Turn into an AdwDialog 2024-01-27 12:38:35 -03:00
Hari Rana 315d47350f summary-section: Use AdwEntryRow class 2023-12-17 22:33:34 +00:00
Hari Rana 57cb3a7650 alarm-row: Remove GtkBox
Uses valign in all buttons, instead of using GtkBox
2023-12-14 00:11:56 +00:00
Georges Basile Stavracas Neto 1043917ecf event-editor/time-selector: Don't change dropdown on callback
The 'update_time' function shouldn't try to update the dropdown,
as it is actually invoked by the dropdown itself. This causes a
cyclic loop with signal emission.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1133
2023-12-13 19:41:41 -03:00
Georges Basile Stavracas Neto 3b9bf55dd5 event-editor/time-selector: Properly diff times
Helps: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1133
2023-12-13 19:41:41 -03:00
Felipe Kinoshita fc48929233 gcal-time-selector: Use GtkDropDown
GtkComboBoxText is deprecated, let's port it to the recommended Widget.
2023-11-25 11:51:10 -03:00
Georges Basile Stavracas Neto a944aafa00 gui/date-chooser: Use translated weekday abbreviations
It matches what GNOME Shell does, and makes the app more localizable.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1122
2023-11-17 13:47:48 -03:00
Daniel García Moreno adb56d9c29 event-editor: Do not apply section that doesn't changed
Fix https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1028
2023-11-12 21:29:07 +01:00
Georges Basile Stavracas Neto 82a6fa364e event-editor/date-selector: Use portal for week dates
Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1022
2023-11-07 18:55:05 +00:00
Georges Basile Stavracas Neto da84b727b3 core/subscriber: Pass old event on update
Now that we keep precise control over GcalEvent instances, and
can use simple pointer comparisons everywhere, GcalMonthView
implemented its update function as a simple remove + add pair.

The problem is that we're not passing the old event instance,
so removals never actually happen, since the new instance is
not yet available to subscribers.

Pass old event in additio to the new one, and use it where it
makes sense.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1073
2023-08-18 10:41:41 -03:00
Hari Rana d80536c83b summary-section: Remove find-location button 2023-08-15 18:28:58 -04:00
Hari Rana 3c5a1cf870 notes-section: Disable Tab 2023-08-03 11:26:19 +00:00
Georges Basile Stavracas Neto a7f0af6e8a event-editor: Shuffle some code
Declaring the entries struct inline saves us a few
lines of code.
2023-08-02 11:03:50 -03:00
Hari Rana 21bfed06e9 schedule-section: Show date when selecting the same day next week 2023-08-02 12:38:53 +00:00
Hari Rana be337bfe70 event-editor-dialog: Various keyboard improvements
- Add Esc as shortcut to close window
- Add mnemonics for Cancel and Done buttons
2023-07-23 14:14:33 +00:00
Christopher Davis ec54dc0ba7 event-editor-dialog: Port to AdwToolbarView
All windows in an app should be using AdwToolbarView.
2023-06-18 22:44:40 -04:00
Christopher Davis 0c2b8261c2 event-editor-dialog: Use AdwWindow instead of GtkDialog
GtkDialog is being deprecated. Instead of using it,
we want to subclass AdwWindow. As part of this change
the content and headerbar are put together in one box.
2023-06-18 22:44:40 -04:00
Titouan Real cf1d70e6c7 Add condition to reset 2023-05-31 12:25:36 +00:00
Cyber Phantom e2e7305971 gcal-schedule-section: Port "Repeat" to AdwComboRow
GtkComboBox is going to be deprecated in GTK 4.10.
This commit updates the "Repeat" rows in new schedule window to use AdwComboRow.
2023-04-22 10:14:22 +00:00
Felipe Kinoshita 2805b414f8 general: Use gtk_widget_set_visible
A lot of places were using gtk_widget_show/gtk_widget_hide, but those
methods are deprecated since Gtk 4.10.

Let's use gtk_widget_set_visible instead.
2023-03-03 19:14:09 -03:00
Georges Basile Stavracas Neto 40fa82deab event-editor/dialog: Check if calendars changed too
In addition to checking if any event fields changed, check if the
caledar changed too.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/924
2023-02-06 22:48:40 +00:00
Jean-François Fortin Tam aa333722af Set a better default size (height and width) for the event editor dialog
These are still hardcoded instead of measuring the available space,
but it's better than nothing in the meantime.

Decent WMs size the window correctly if width/height exceed the screen.

Also, allow the Notes field to expand vertically, to fill the space.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/602
2023-01-02 16:24:44 -05:00
Milan Crha 21e5396bf5 event-editor: Fix possible use-after-free of recurrence until date
The GcalDateSelector returns an internal instance, while the 'until' date/time
is meant to be an own instance, which is freed by the GcalRecurrence instance
in its free function. That means the 'until' date/time is supposed to be reffed
when being assigned into the GcalRecurrence structure.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/892
2022-10-31 12:25:11 +00:00
Georges Basile Stavracas Neto 502b381975 event-editor/dialog: Properly handle editing recurrent events
When a recurrent event is edited, we now are able to only offer the
MOD_ALL option when it actually will work. However, we're still left
with the problem that we end up applying the instance-specific data
onto the main event, through an old hack.

The views already aren't able to offer the MOD_ALL property, since
they all change the dates of events, but GcalEventEditorDialog can,
and it must handle that properly.

For now, do the simplest possible approach, which is: retrive the
template event and apply all properties that can be applied to it,
without letting the start and end days leak into it. We already only
allow passing MOD_ALL on situations where the dates aren't really
modified, so it should be safe.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/882
2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto 102346534a event-editor/dialog: Improve detection of MOD_ALL exclusion cases 2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto 679a392b71 event-editor/dialog: Don't hide dialog on cancelling operation
If the user clicks the "Cancel" button, it obviously means "cancel",
so let's cancel.
2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto 23dedc0fc8 event-editor/schedule: Trivial autoptr cleanup 2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto 185490e272 event-editor/dialog: Don't ask mod type if event wasn't recurrent 2022-10-17 23:37:13 -03:00