Commit Graph
67 Commits
Author SHA1 Message Date
Jean-François Fortin Tam 588bec96b6 utils/source-discoverer: Fix HTTP errors interpretation
There can be many reasons why a request is not allowed or authorized.
403 and 405 HTTP error codes do not prompt the visitor for credentials.
Only 401 and 407 responses are credentials prompts.

Only raise a username and password request when facing a 401 or 407.

Fixes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/645
Fixes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/552
2024-08-16 18:47:57 -04:00
Jean-François Fortin Tam 577efdd967 utils/source-discoverer: Add a debug statement
This debug statement would happen before any interpretation of errors,
which is useful in troubleshooting issues related to interpretation.

Related: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/645
2024-08-16 18:47:57 -04: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
Daniel Garcia Moreno 6afb5cf3a5 view: Fix daylight saving issue in week view
This patch fixes an issue when creating new events in week view the week
after the daylight saving change.

The problem was in the calc of the selected date, that's done couting
the 30 minutes slots and adding that minutes to the week_start datetime.
When there's a daylight saving change, the real date to select should be
adjusted. This patch adds a new util function to make it easy to add
minutes ignoring the tz so we can make this calc directly with
gcal_date_time_add_floating_minutes.

This also includes a new test file with some checks for the new util
function and spring / autumn changes.

This new function could be used in other places to fix specific issues
that could be caused by the same logic error, calculate a selection or
event position based on GDateTime operations.

Fix https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/482
2023-11-09 13:17:20 +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
Georges Basile Stavracas Neto 0322bcf54c utils/source-discoverer: Test URI before discovery
This makes sure that we have a valid host set. This check is
copies from Soup's private SOUP_URI_IS_VALID() macro.

Add a test for this behavior.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/794
2023-03-05 11:24:49 -03:00
Georges Basile Stavracas Neto fd7baeb787 utils/source-discoverer: Pass error
An oversight of the GUri port.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/794
2023-03-03 19:50:30 -03:00
Georges Basile Stavracas Neto 2b947e83a6 utils/source-discoverer: Use caldav-stub and caldav
As per suggestion from Milan, use caldav-stub as the parent name,
and caldav as the backend name.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/539
2023-03-03 19:50:30 -03:00
Georges Basile Stavracas Neto 98f6ccdb88 utils/source-discoverer: Set security method
Set the security method of the discovered source into the newly
created source. This should preserve the TLS security method in
these sources.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/40
2023-03-03 19:50:30 -03:00
Georges Basile Stavracas Neto 02c2119c39 utils/source-discoverer: Use g_strcmp0
Cosmetical change.
2023-03-03 19:50:30 -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
Clément Saccoccio e2adc7de5e source-discoverer: when importing a web iCal, allow an incorrect content type if the header is good 2022-10-24 21:06:18 +02: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
Milan Crha d273b4304f gcal_set_date_time: Avoid possible use-after-free
When the `*dest` and `src` are the same, doing g_date_time_unref()
can free the instance before it's assigned back to the `*dest`.
2022-10-05 15:10:47 +00:00
Milan Crha 0bd11799dc Port to libsoup3 2022-06-22 08:51:30 -03:00
Reynir Björnsson 19b520fa2d source-discoverer: Fail if SoupUri creation fails 2022-06-15 14:10:02 +00: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 64fe7e543c utils/date-time-utils: Use g_time_zone_new_identifier()
g_time_zone_new() is deprecated in favor of it, so use it.
2021-02-26 19:26:49 -03:00
Georges Basile Stavracas Neto 9800fbec4b utils/date-time-utils: Trivial style cleanup 2021-02-26 19:26:49 -03:00
Michael Catanzaro 0733844690 Remove autocleanup for GWeatherLocation with new gweather 2021-01-12 15:08:50 -06:00
Georges Basile Stavracas Neto a146b9050d project: Silence CI warnings 2020-10-31 16:55:06 -03:00
Georges Basile Stavracas Neto eb954505e4 project: Split meson files in subdirs
It allows us to better control what each subdir does, etc. This is
only the first step; we want to also split GResources, etc.
2020-10-30 13:45:50 -03:00
Evangelos Ribeiro Tzaras 07f544b78d gcal-date-time-utils: Fix week start
In locales where the first weekday is a monday, the previous code
had a off by one error determining the week a sunday is in.
The problem ultimately arose because in the
`gcal_date_time_get_start_of_week()` function the variable
`n_days_after_week_start` would become negative (-1 in this case) making
the following `g_date_time_add_days (date, -n_days_after_week_start)`
add 1 day resulting in `start_of_week` being set to the start of the
following week.

The solution was to make sure `n_days_after_week_start` would be
positive by adding 7 to it. The variable is taken modulo 7 hence this
should not introduce any bugs.

Fixes #583
2020-06-15 20:43:55 +02:00
Michael Catanzaro a3e9af23dc source-discoverer: add support for webcal:// URIs
We can implement webcal:// by simply rewriting the URI to https://.
Amazing!

Fixes #564
2020-04-14 15:16:24 -05:00
Georges Basile Stavracas Neto 12fd607d56 utils: Make date comparison follow time comparison semantics
Right now, comparing dates with gcal_date_time_compare_date() gives
the exact opposite result of when comparing using g_date_time_compare().

As shown by this patch, this was a source of *many* bugs.
2020-04-14 19:08:06 +00:00
Georges Basile Stavracas Neto 1f6559de68 Remove ECalDataModel and ECalDataModelSubscriber
Drop the bomb!
2020-04-01 21:06:51 -03:00
Michael Catanzaro a439fd2b1d date-time-utils: fall back to UTC when timezone is unrecognized
For whatever reason, libical doesn't support the Etc/UTC timezone.
Currently we crash gnome-calendar whenever libical doesn't support the
current timezone (as returned by GTimeZone). Let's fall back to UTC
instead.

Fixes #485
2020-02-18 17:07:55 -06:00
Georges Basile Stavracas Neto 34eb3a2343 utils: Use GDate to compare dates 2019-12-02 16:41:56 -03:00