Commit Graph
43 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto 004fdb0f3d utils: Shuffle and cleanup some paintable code
- It's only used in GcalShellSearchProvider so move it there.
- GdkTexture implements GIcon so no need to convert to a pixbuf.
2024-10-11 22:55:03 -03:00
Diego Iván M.E 9443520411 utils: Fix double free in gcal_create_writable_calendars_model
gtk_filter_list_model_new expected that the model passed to be
an owned reference, but we were passing an unowned one, causing
a double free after the function is called repeatedly. This
was particularly noticeable in the importer dialog.

Fixes #1282
2024-08-27 13:40:28 +00:00
Hari Rana 8ff3a843b3 utils: Add function to create writable-only calendars lists 2024-08-23 13:46:00 -03:00
Jean-François Fortin Tam 008b914f9e utils/source-discoverer: Set the User-Agent
This avoids some web servers or WAFs doing weird stuff with our requests
which would lead to situations where our web calendar source discovery
would face server errors, redirects, incorrect contents, etc.

Fixes #651

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/290
2024-08-07 12:32:00 -04:00
Georges Basile Stavracas Neto ae03627f0c utils: Port to AdwAlertDialog 2024-07-09 17:09:29 -03:00
Otávio Silva 9433db55a2 utils: Move get_service_name_from_url to utils
This function can be useful in contexts other than the creation of
the meeting row.
2024-07-09 16:14:47 -03: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
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
Daniel Garcia Moreno 68c921bf60 test: Add event_date_edit_tzid
This new test check that the tz data in the component is set correctly
after editing an event date end.

See https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/170
2023-11-09 20:59:59 +00:00
Georges Basile Stavracas Neto b26f33ea10 utils: Remove 24h utility function
The last user of this function is gone now.
2023-09-23 02:39:39 -03:00
Victoria Lacroix aec45594f9 gcal-utils: Combine GNOME Settings launchers
This refactor combines the functions
gcal_utils_launch_online_accounts_panel and
gcal_utils_launch_datetime_settings_panel into a single function that
takes a panel ID as an argument.
2023-07-15 23:04:51 +00:00
Victoria Lacroix 3526cadcca gcal-window: datetime settings shortcut
Shortcut is added so that time-related system settings can be easily
accessed. See #1023

The code is largely just a copy-paste of the code that opens the
"Online Accounts…" menu.

Fixes #1023
2023-07-15 23:04:51 +00:00
Christopher Davis 9a9cfb5468 gcal-utils: Use AdwMessageDialog
Use the new adaptive AdwMessageDialog widget
where we previously used GtkMessageDialog.
2023-06-17 18:49:19 -03: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 80dd2df7c3 utils: Remove obsolete comment 2022-11-21 08:45:09 -03:00
Georges Basile Stavracas Neto 6a5c0229b9 utils: Add boolean flag for showing MOD_ALL
This will be used by next commit to more finely control editing
of recurrent events.
2022-10-17 23:37:13 -03:00
nahuelwexd 1de480f102 util: use new GNOME Settings app id 2022-04-07 19:42:50 -03:00
Björn Daase ad7ff65a4d event-editor/schedule-section: Fix localization mix
The gcal_util_translate_time_string function is a plain copy of
gnome-shells shell_util_translate_time_string solving the same problem.

Fixes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/581
2022-02-12 17:43:49 +01:00
Georges Basile Stavracas Neto 69d320f49c event-editor/dialog: Improve calendar selection menu 2022-02-12 13:24:57 -03:00
Georges Basile Stavracas Neto 47a72f8156 event-editor-dialog: Port to new callback-based ask API 2022-02-12 13:08:50 -03:00
Georges Basile Stavracas Neto ee5acbd493 Reimplement event drag n' drop
Reintroduce the code using GTK4 tooling for in-process DnD.
This is looking much better!
2022-02-12 13:08:50 -03:00
Georges Basile Stavracas Neto fb504db31f util: Drop unused function 2022-02-12 13:08:50 -03:00
Georges Basile Stavracas Neto 1cbce60c4a month-view: Port to GTK4 2022-02-12 13:08:50 -03:00
Georges Basile Stavracas Neto b31b16da17 week-view: Port to GTK4 2022-02-12 13:08:50 -03:00
Georges Basile Stavracas Neto 0f7a0db138 event-editor/dialog: Port to GTK4 2022-02-11 09:18:38 -03:00
Georges Basile Stavracas Neto 2139f40e67 project: Adjust color rendering to use GdkPaintable 2022-02-11 09:18:38 -03:00
Georges Basile Stavracas Neto 41ba168250 calendar-management/calendars-page: Port to GTK4 2022-02-11 09:18:38 -03:00
Markus Hoffmann 7741443c03 utils: Fix Google Meet URL template
The Google Meet URL is extracted from the Calendar Event Notes by using a substring with a fixed length. This length is too short by 1 character.

In order to get the right URL the substring needs to be 1 character longer. In order to match the Google Meet URL add an "x" in the given URL pattern.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/749
2021-10-28 13:59:13 +00:00
Georges Basile Stavracas Neto a080d8ec0f utils: Protect against NULL description 2021-08-16 15:27:19 -03:00
Georges Basile Stavracas Neto 01ee4a2b49 utils: Add Google extractor
Google events have an exotic section at the end of their event
descriptions, we can parse that to find some information like
the meeting URL.
2021-06-27 18:36:05 -03:00
Georges Basile Stavracas Neto a146b9050d project: Silence CI warnings 2020-10-31 16:55:06 -03:00
Michael Catanzaro 8e6a3b9f3f Fix crashes when e_cal_util_get_system_timezone() returns NULL
The return value is nullable, but gnome-calendar fails to check it.

Because the nullable return value is inconvenient for us, we can instead
add and use gcal_context_get_icaltimezone() to supplement the existing
gcal_context_get_timezone().

We'll also need a function to convert from GTimeZone to ICalTimezone,
gcal_timezone_to_icaltimezone().

Fixes #419
2019-09-19 16:01:44 -05:00
Georges Basile Stavracas Neto 5e4bbe446f utils: Pass GcalCalendar to ask_recurrence_modification_type()
The method ask_recurrence_modification_type() currently
receives an ESource, and tried to fetch the ECalClient
from the ESource by using g_object_get_data().

However, since we moved to GcalCalendar, we do not set
this data field in ESource.

Receive a GcalCalendar instead, and use the appropriate
function gcal_calendar_get_client() instead.
2019-09-14 21:38:53 -03:00
Georges Basile Stavracas Neto ff0644ad76 utils: Add auxiliary function to format display names
This will be used by the web source discoverer to format
any URLs that contain a file name in their path.
2019-07-13 16:04:31 -03:00
Michael Catanzaro 621d69e0bc utils: Use setlocale() in is_workday()
Trying to use environment variables to guess the locale was a good
attempt, but this is tricky because they have to be looked up in a
certain order: first LC_ALL, then fallback to LC_TIME, and finally LANG,
which was missed here. This caused a huge warning spam on the year view
when only LANG is set, and usually only LANG should be set since the
other environment variables are usually used for temporary overrides.
Instead, query the locale using setlocale().

Also, don't assert if the locale is shorter than expected (missing
territory code) since there is at least one valid locale that does not
have any territory codes (Esperanto) and since it's programmer error to
assert when the application processes unexpected input like this.

Fixes #424
2019-07-09 21:52:56 -03:00
Georges Basile Stavracas Neto 8743121f4d source-dialog: Move Online Accounts panel spawn to utils
So that it can be reused by other files.
2019-06-24 21:32:44 -03:00
Milan Crha a0cae4356a Port to libecal-2.0
Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/merge_requests/70
2019-05-17 21:58:55 +02:00
Georges Basile Stavracas Neto 1118c74881 event: Receive and operate on GcalCalendar
Instead of receiving an ESource, receive a GcalCalendar
and operate on it. Many places needed to be adjusted for
that.

Tests need to be rethinked.
2019-05-04 12:05:39 -03:00
Georges Basile Stavracas Neto 0acf0b60ba utils: Receive const GdkRGBA*
We do not modify their values, they're const in
practice already.
2019-05-04 12:05:39 -03:00
Georges Basile Stavracas Neto 6dda74432c utils: Remove more unused functions 2019-04-26 15:42:32 -03:00
Georges Basile Stavracas Neto c52bacfc3f utils: Move more API to gcal-date-time-utils.c 2019-04-26 13:57:05 -03:00
Georges Basile Stavracas Neto ab1c0b6ca4 utils: Rename gcal_clear_datetime to gcal_clear_date_time
To keep it consistent with the rest of the API.
2019-04-26 13:27:37 -03:00
Georges Basile Stavracas Neto 3bff2b8981 utils: Move to utils/ subdir
We will split this file into more, specialized, files
so it makes sense to not pollute the top source dir.
2019-04-25 20:59:08 -03:00