Commit Graph
2733 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto c6fab7675b application: Port to GTK4
Subclass AdwApplication.
2022-02-11 09:18:38 -03:00
Georges Basile Stavracas Neto 9b56010b12 event-editor/date-chooser: Port to GTK4 2022-02-11 09:18:38 -03:00
Georges Basile Stavracas Neto e138a35a6b event-editor/alarm-row: Port to GTK4
Subclass AdwActionRow.
2022-02-11 09:18:38 -03:00
Georges Basile Stavracas Neto 97456e3428 date-chooser-day: Port to GTK4
Subclass AdwBin. Remove unnecessary GtkWidget overrides.
2022-02-11 09:18:38 -03:00
Georges Basile Stavracas Neto 2809ed3abb Depend on GTK4 and libadwaita
This breaks the build. Next commits will port each widget to
GTK4.
2022-02-11 09:18:38 -03:00
Georges Basile Stavracas Neto 2b7e2cb574 build: Temporarily remove libedataserverui dep
Since we'll be switching to GTK4, we can't depend on this
library which links to GTK3. There's a GTK4 port underway,
we'll reenable when it lands
2022-02-11 09:18:38 -03:00
Georges Basile Stavracas Neto 7efd6facc9 Port to GWeather4
In preparation for the GTK4 port. This is just a cheap port,
I'll implement proper entry completion after porting to GTK4.
2022-02-11 09:18:38 -03:00
Michael Webster 02cd9b053e application: Fix tm -> GDateTime month conversion
The month argument for g_date_time_new() is 1-based,
while the tm struct is 0-based.

Follow-up to:
a0aa36b6d2

ref:
https://pubs.opengroup.org/onlinepubs/7908799/xsh/time.h.html
2021-12-15 14:22:00 +00:00
Alexander Mikhaylenko 83249b0d84 core: Remove follow-night-light
The system will do the scheduling instead.
2021-12-11 20:40:00 +05:00
Alexander Mikhaylenko 7144300a49 application: Support dark style preference
Depend on libhandy 1.5.0.
2021-12-11 17:25:49 +05:00
Michael Webster a0aa36b6d2 application: Fix tm -> GDateTime year conversion
g_date_time_new() expects an actual year, while the tm struct
only provides the number of years since 1900.

ref:
https://pubs.opengroup.org/onlinepubs/7908799/xsh/time.h.html
2021-12-10 14:20:13 -05:00
Georges Basile Stavracas Neto 2697dac460 import-dialog: Also import timezones
Some calendars provide custom timezones, and set events to
them. We need to account for that when importing calendars.

Original patch proposed by Milan Crha.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/444
2021-12-08 17:18:16 -03:00
Georges Basile Stavracas Neto 0751c2e93c event-editor/schedule-section: Show times in local timezone
Preserve the original timezone when editing, but always display
the start and end times in local timezone.
2021-12-07 13:32:16 -03:00
Georges Basile Stavracas Neto fc3ad22169 event-popover: Display times in local timezone
Convert the start and end datetimes to the local timezone
before displaying them.
2021-12-07 13:32:16 -03:00
Georges Basile Stavracas Neto 0811242180 event: Query client timezone on failure
If we can't find an appropriate timezone, query the ECalClient
for it and give it an extra chance of finding the right timezone.

Thanks to Milan Crha for proposing this fix.

Related: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/444
2021-12-07 12:39:15 -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
Adrien Plazas 977673ad02 event-editor-dialog: Better style sections
This gives them rounded corners and separators.
2021-10-15 16:31:00 +02:00
Adrien Plazas 660d3300b2 event-editor-dialog: Use HdyPreferencesGroup and HdyPreferencesPage
This helps simplifying the code a bit and standardizing it with the rest
of GNOME.
2021-10-15 16:30:54 +02:00
Adrien Plazas 598e9814fc event-editor-dialog: Make it resizable
This also sets a reasonable default height and stops giving the scrolled
window a max height. This will allows it to fit in phone screens.
2021-10-15 16:27:09 +02:00
Georges Basile Stavracas Neto f1ac400e5d Drop gnome-online-accounts dependency
We don't need it anymore.
2021-10-13 13:48:09 -03:00
Georges Basile Stavracas Neto 8f715c19b5 application: Move CSS providers to GcalWindow 2021-09-05 18:34:32 -03:00
Georges Basile Stavracas Neto 229b6f7add window: Silence a compilar warning 2021-09-05 18:07:27 -03:00
Georges Basile Stavracas Neto 52ef8ff6bf application: Only add CSS providers once
Instead of adding the color CSS provider over and over on
every activation, only add it once. Also make sure to start
the manager after doing that.
2021-08-19 14:26:06 -03:00
Georges Basile Stavracas Neto 7fd8babdda application: Activate on open
Otherwise, there might be no window available.
2021-08-16 19:48:09 -03:00
Georges Basile Stavracas Neto 7bf8d8851b application: Add weak ref to window 2021-08-16 19:47:54 -03:00
Georges Basile Stavracas Neto 440bb39498 window: Add weak pointer to import dialog
Otherwise we crash the second time it's opened.
2021-08-16 19:07:35 -03:00
Georges Basile Stavracas Neto e689f18b1e Add file importing dialog
Add a file importing dialog, and pass through files received from command
line.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/5
2021-08-16 18:26:21 -03:00
Georges Basile Stavracas Neto a080d8ec0f utils: Protect against NULL description 2021-08-16 15:27:19 -03:00
Georges Basile Stavracas Neto e90c67a57d manager: Ensure default calendar property is always set 2021-08-16 15:26:59 -03:00
Georges Basile Stavracas Neto aec1d8d5cd calendar-page: Add rounded corners to listbox 2021-08-06 17:37:40 -03:00
Georges Basile Stavracas Neto 8c71c60e8d calendar-management: Switch to HdyWindow
Make GcalCalendarManagementDialog an HdyWindow subclass,
and adapt the widgetry to work with the new parent class.

Use HdyHeaderBar everywhere.
2021-08-06 17:32:58 -03:00
Georges Basile Stavracas Neto 68160348dc Introduce GcalEventPopover
GcalEventPopover gives a preview of the event, and handy access
to the event description and information. It also allows easily
joining meetings if any one if available.

The list of supported meeting URLs is small now, but I hope
more people will contribute as we go.

It is also possible to edit the event through an edit button.
2021-06-27 18:45:12 -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 7079cf2a80 quick-add-popover: Properly localize string arrays
N_() only marks strings for translation, it is necessary to call gettext()
when using the strings.
2021-06-21 18:34:53 -03:00
Georges Basile Stavracas Neto bdce9b29ba quick-add-popover: Don't leak GDateTime
Not sure how this went through.
2021-06-21 18:34:52 -03:00
Georges Basile Stavracas Neto a7d40352b7 quick-add-popover: Mark string arrays const
As they really are.
2021-06-21 18:34:50 -03:00
Marco Trevisan (Treviño) fdb69db48a weather-service: Enable met.no provider
As per the switch to libgweather 40 with commits 216a8984 and a2a6d2e4
we already comply with met.no TOS [1] as we already provide explicitly
the application contact info and (implicitly, being a GApplication) the
application-id.

So we can enable the met.no weather provider, making the weather
forecast to work again.

[1] https://api.met.no/doc/TermsOfService

Fixes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/682
2021-05-31 20:02:36 +02:00
Sebastian Keller af7a17ef01 event: Fix multiday detection for all-day events
All-day events always use UTC, so when the multiday detection code was
converting them to the local timezone, they span an additional day if
the local timezone is not the same as UTC. This was leading to all-day
events always being considered multiday events.

Fix this by ignoring the timezone for all-day events, like all other
comparisons do. Also don't consider all-day events spanning 1 day to be
multiday since as per RFC 5545 the end date is non-inclusive and if
omitted to be start + 1 day.
2021-05-11 19:35:31 +00:00
Rajat Jain 19ee70f9ab window: Add missing keyboard shortcut
Add missing accelerator for <Alt>+Down as it was
mentioned in shortcuts dialog but not implemented.

Fixes #492

Signed-off-by: Rajat Jain <rajatjain.ix@gmail.com>
2021-05-11 19:11:31 +00:00
Sebastian Keller 44e2420645 range: Handle zero-length ranges when calculating overlap
Zero length ranges, such as for events without a DTEND could be
considered to overlap a range if they were at exactly the end of the
range. The end of a range however is the first date that is supposed to
not overlap, so a zero-length range on exactly this point should not be
considered overlapping.

This fixes cases where all-day events from the next month could show up
on the same day of the current month if they did not have a DTEND.

This also adds tests for all possible cases of such zero-length events
overlapping.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/701
2021-04-21 13:59:26 +00:00
Johannes Maibaum a2a6d2e4aa weather-service: Set contact_info to DOAP file URL
Currently, GNOME Calendar does not set up the contact_info needed in
libgweather 40 API. This leads to the following assertion, and no
weather forecast info being shown in Calendar:

`gweather_info_update: assertion 'info->contact_info != NULL' failed.`

To fix the assertion, set the URL to the DOAP file on the master branch.
GNOME Weather does the same, see:

https://gitlab.gnome.org/GNOME/gnome-weather/-/commit/6763f7dc9cb25eac4aa13e94e07ea932a42c8e4d

Part of #682
2021-04-13 01:07:37 +00:00
Johannes Maibaum 78d0df1404 window: Remove nested CLAMP() on switching views 2021-04-11 19:06:38 +02:00
Johannes Maibaum 4c51539168 window: Fix GcalWindow's change-view accelerators
Commit 2d5b1aa9d1 removed the
GCAL_WINDOW_VIEW_DAY variant of the GcalWindowView enum. Since then, the
change-view accelerators to switch to GCAL_WINDOW_VIEW_{WEEK,MONTH,YEAR}
were broken, as the accelerator setup was assuming
GCAL_WINDOW_VIEW_WEEK==1, which isn't true anymore with
GCAL_WINDOW_VIEW_DAY being gone.

This change fixes the enum values in the accelerator setup.
2021-04-11 19:06:05 +02:00
Sebastian Keller fb242dd109 time-zone-monitor: Use local timezone as fallback without dbus service
On systems without anything providing the org.freedesktop.timedate1
interface, the timezone returned by the monitor would always be NULL,
because it was never set. This can lead to crashes in places that expect
the monitor to always return a valid timezone. So in that case use the
local timezone from when the monitor got initialized.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/703
2021-04-11 00:27:08 +00:00
Sebastian Keller a0d24cd5d8 time-zone-monitor: Fix timezone leak on timezone changes
The old timezone was never being unref'ed before it got overwritten.
2021-04-11 00:27:08 +00:00
Georges Basile Stavracas Neto d1a0dbd8f5 event: Switch to g_time_zone_new_identifier()
And add the relevant NULL checks here.
2021-02-26 19:26:49 -03:00
Georges Basile Stavracas Neto 27c6d2c017 time-zone-monitor: Switch to g_time_zone_new_identifier()
We don't even need to check for NULL here because if the system timezone
is invalid, we're too screwed to have a fallback path anyway.
2021-02-26 19:26:49 -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
Christopher Davis 709cfb75fa gui: Use HdyViewSwitcher
For GNOME 40 apps should migrate to use HdyViewSwitcher.
For now, this does not mean full adaptivity.
2021-02-14 16:34:13 +00:00