Commit Graph
1174 Commits
Author SHA1 Message Date
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
Michael Catanzaro 26897f89a2 Revert "new-calendar-page: add support for webcal:// links"
This reverts commit 8520e1819c
2020-04-02 15:30:35 +00:00
Michael Catanzaro 8520e1819c new-calendar-page: add support for webcal:// links
Turns out, all we have to do is rewrite the URL to https://. I'm
surprised this works, but I don't see any problems with it. I tested
subscribing to webcal://www.gnome.org/start/unstable/schedule.ics.

See also: #481
2020-04-02 03:09:06 +00:00
Michael Catanzaro 7a3db413e9 new-calendar-page: properly track state of URL entry and Add button
Currently, when the user enters an invalid URL -- a URL that does not
pass SoupURI's URI format validation -- then we set the error style
class on the URL entry to turn the border of the entry red. For example,
if I try to enter "dog" then GNOME Calendar catches this and flags the
entry as red.

But there are some problems.

First of all, GNOME Calendar doesn't do anything to prevent users from
entering URLs that are syntatically valid but not usable as calendars.
The code knows whether the URL was successfully parsed as a calendar
file, it just doesn't do anything with this information. So there is no
red warning if I try to use https://example.com as a calendar, even
though the dialog knows that it didn't work.

Secondly, GNOME Calendar allows pressing the Add button even if the URL
entry contains invalid input, but only if the Calendar Name has been
entered. The dialog thinks: "if I have a name, but not a valid URL, then
the user wants to create a new, empty local calendar!" But this is not
right. If the user has typed anything in the URL entry, then the goal is
to import a new calendar, not to create a new one.

This commit changes set_url_entry_error() into update_url_entry_state(),
and gives it responsibility for updating the add button sensitivity and
URL entry pulsing in addition to the URL entry style class, solving both
of the above problems.

As a side effect, this also closes a race window where the Add button
remains sensitive for half a second after typing new text in the URL entry.
At this point, we don't yet know whether the URL is valid, because we
wait half a second before validating the URL, so we shouldn't allow the
user to activate the Add button during this race window.

Fixes #481
2020-04-02 03:09:06 +00:00
Michael Catanzaro bba6c60c32 new-calendar-page: improve URI validity check
This check passes if the URI is empty. Normally this callback only runs
when there is text in the URL entry, but there is a race window where
the user could delete it first. (Passing NULL to a SoupURI creates an
invalid non-NULL empty URI that can be filled in later.)
2020-04-02 03:09:06 +00:00
Georges Basile Stavracas Neto fa0173e174 window: Remove subscribers on destroy 2020-04-01 23:10:01 -03:00
Georges Basile Stavracas Neto 6586c8738c calendars-page: Add already connected calendars on startup
Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/479
2020-04-01 23:10:01 -03:00
Georges Basile Stavracas Neto f052cb6589 event-widget: Remove idle on destroy
Finalize may be too late for us, since a widget
may be destroyed long before it's finalized.

Remove the idle timer on destroy then.
2020-04-01 21:06:51 -03:00
Georges Basile Stavracas Neto 399b9d8d00 Simplify calendar views
We don't need a split subscription update step in GcalView
anymore, since subscribers communicate range directly to
the timeline now.
2020-04-01 21:06:51 -03:00
Kai A. Hiller 8f0a860966 gcal-calender-popover: Make sorting stable
When multiple calendars with the same name exist, their relative order in the
list is random and changes e.g. when toggling the checkmark next to them. The
result is glitchy behavior.

Now when two calendars have the same name we do a secondary sort by their ID,
resulting in a nice deterministic order.
2020-04-01 22:58:28 +00:00
Georges Basile Stavracas Neto 2be799d78d edit-dialog: Make the new alarm row have a label
With the introduction of the new event editor, Calendar
saw it receive sections of editable properties of the
events. One of these sections is the "Reminders" section,
that contains the reminders (also called alarms) of an
event.

However, this section's row to add a new alarm does not
match the proposed mockups for it. It currently has a
combo box that shows the popover with selectable reminder
times, instead of being a clickable row.

Make it a clickable listbox row, and show the alarms popover
when clicked.

https://gitlab.gnome.org/GNOME/gnome-calendar/issues/502
2019-12-06 16:37:12 -03:00
Georges Basile Stavracas Neto 866cdabe9c edit-dialog: Move the all day switch to the top of the list
As nitpicked by Sam.
2019-12-02 16:41:56 -03:00
Georges Basile Stavracas Neto 87c1ffb9d5 Reimplement alarm support
This is a complete reimplementation of alarms in Calendar.

Rejoice.
2019-12-02 16:41:56 -03:00
Georges Basile Stavracas Neto e871486766 edit-dialog: Split recurrency widgets in different rows 2019-12-02 16:41:56 -03:00
Georges Basile Stavracas Neto 23e1544a25 edit-dialog: Simplify notes widgetry
Remove an intemediary GtkBox that is now not necessary anymore.
2019-12-02 16:41:56 -03:00
Georges Basile Stavracas Neto 4a1c5b9cc6 edit-dialog: Split Reminders to its own section 2019-12-02 16:41:56 -03:00
Georges Basile Stavracas Neto ce47cfea86 time-selector: Make it a GtkBox directly 2019-12-02 16:41:56 -03:00
Georges Basile Stavracas Neto 3896aac734 edit-dialog: Make date & time rows expandable
Add a human-readable label and move the widgets to the expandable
section.
2019-12-02 16:41:56 -03:00
Georges Basile Stavracas Neto 948447d8bf edit-dialog: Turn the All Day check a switch 2019-12-02 16:41:56 -03:00
Georges Basile Stavracas Neto d14175895a date-selector: Reduce width 2019-12-02 16:41:56 -03:00
Georges Basile Stavracas Neto d5529f1782 edit-dialog: Move widgets to lisbox rows 2019-12-02 16:41:56 -03:00
Georges Basile Stavracas Neto bb310421c1 edit-dialog: Make it a HdyDialog subclass 2019-12-02 16:41:56 -03:00
Georges Basile Stavracas Neto b772349c3f Move UI files to src/
Keep it in sync with what To Do and Settings do.
2019-12-02 16:41:56 -03:00
Michael Catanzaro e053c0cae8 quick-add-popover: Use more g_signal_connect_object
We need to disconnect from the GcalManager when the GcalQuickAddPopover
is destroyed, or crashes happen.
2019-10-07 10:37:50 -05:00
Georges Basile Stavracas Neto 357ec18a0a Fix GcalContext management
GObject automatically notifies when passing
properties as part of g_object_new(). This
happens after the instance is created, thus
after constructed().

By passing G_PARAM_EXPLICIT_NOTIFY, we avoid
this behavior. However, we are still notifying
PROP_CONTEXT in GcalWindow. Removing this other
notify fixes the crashes related to GcalContext.

https://gitlab.gnome.org/GNOME/gnome-calendar/issues/417
2019-10-04 20:54:05 -03:00
Georges Basile Stavracas Neto 44092da60b edit-dialog: Use GtkCalendar internally
Instead of tracking the ESource, which is an extra
complication on top of this messy code.
2019-10-04 00:58:41 -03:00
Georges Basile Stavracas Neto 970cc1fca5 application: Remove -d as short form of --debug
Both --debug and --date had their short form -d, causing
problems. Let's make -d stand for --date, since --debug
is more of a development tool.

https://gitlab.gnome.org/GNOME/gnome-calendar/issues/456
2019-10-03 20:19:40 -03:00
Nick Gasson b034bd4bf0 Update GcalMultiChoice label when format callback changes
Currently the label text is only updated when set_value is called and
the new value is different to the current value. So if a format callback
is configured after the GcalMultiChoice is created, this won't be
applied until the value is changed to something other than the default.

The problem in issue #100 is that the default value for "month" is
0=>January. gcal_date_chooser_init sets the format callback and then
calls gcal_multi_choice_set_value with value==0 which won't update the
label.

Fix by having gcal_multi_choice_set_format_callback update the label
text with the result of applying the format callback to the current
value.

Fixes #100
2019-10-01 17:44:04 +00:00
Christopher Davis 0aa9e42016 flatpak: Add development styling to window
Adds .devel style class to the main window for development
builds of Calendar.

Related to https://gitlab.gnome.org/GNOME/gnome-calendar/issues/285
2019-09-30 12:04:08 -03:00
Christopher Davis 0d6b2327e0 flatpak: Allow dual installation of app bundles
Part of https://gitlab.gnome.org/GNOME/Initiatives/issues/1.
Allows for the installation of development bundles alongside
stable versions.

Related to https://gitlab.gnome.org/GNOME/gnome-calendar/issues/285
2019-09-30 12:04:08 -03:00
Michael Catanzaro cb14c3f46c Fix double free in gcal_quick_add_popover_set_property
This already uses an autoptr.

Fixes #455
2019-09-21 16:06:48 +00: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
Michael Catanzaro 18ae67cb59 Use more g_signal_connect_object()
Most of these are probably paranoid, not bugs. I haven't done an
exhaustive review to see what really needs it: that would be
time-consuming and require significant familiarity with the Calendar
codebase. This was just a quick check. Anyway, I vote for paranoid
when it comes to using g_signal_connect() regardless. It's dangerous,
and there's no reason to ever leave a signal connected after the user
data object has been destroyed.

Fixes #423
2019-09-14 23:28:42 +00:00
Georges Basile Stavracas Neto 22596db1d1 window: Readd <Ctrl>n shortcut
https://gitlab.gnome.org/GNOME/gnome-calendar/issues/383
2019-09-13 18:49:05 -03:00
Georges Basile Stavracas Neto 9aec1c097d new-calendar-page: Properly cleanup sources
We can't control a widget's property at destruction time.
Cleanup the sources directly.
2019-07-13 20:07:30 -03:00
Georges Basile Stavracas Neto f0060b7699 new-calendar-page: Use the new discoverer
The new discoverer is a vast improvement over the code
that use used to have here. Right now, we fail to use
Soup to detect the URL, and that's been reported multiple
times already.

Use the new web discoverer code, and adjust the UI to
match the new code. Namely, use a GtkPopover to show
the credentials widget.

Fixes #380
2019-07-13 16:04:31 -03:00
Michael Catanzaro 34c062a7fa Fix crash in update_default_calendar_row()
It's wrong to call set_row() with NULL row.

Fixes #422
2019-07-10 01:01:42 +00:00
Georges Basile Stavracas Neto 33fc75ca01 calendar-management-page: Pass GcalCalendar 2019-06-25 14:16:47 -03:00
Georges Basile Stavracas Neto 47bed7bc77 new-calendar-page: Restore opening Online Accounts panel from label 2019-06-25 12:51:14 -03:00
Georges Basile Stavracas Neto 0f28e3fa53 new-calendar-page: Implement new designs
This looks soooooo much better =)

https://gitlab.gnome.org/GNOME/gnome-calendar/issues/388
2019-06-24 21:33:00 -03:00
Georges Basile Stavracas Neto 7da3197186 calendars-page: Remove previously deleted calendar if any
It is possible to delete a calendar, and immediately delete another.
When that happens, both should be deleted.
2019-06-24 21:33:00 -03:00
Georges Basile Stavracas Neto 39ebc5457a calendars-page: Fix callback parameters 2019-06-24 21:33:00 -03:00
Georges Basile Stavracas Neto e53a7532f2 calendars-page: Use the passed calendar for deletion 2019-06-24 21:33:00 -03:00
Georges Basile Stavracas Neto 10e10f6605 edit-calendar-page: Silence warning 2019-06-24 21:32:59 -03:00
Georges Basile Stavracas Neto 170347b016 calendar-management-dialog: Trivial style cleanup 2019-06-24 21:32:59 -03:00
Georges Basile Stavracas Neto efa29b19d5 calendars-page: Use switch to toggle visibility 2019-06-24 21:32:59 -03:00
Georges Basile Stavracas Neto c092445363 calendar-management: Shuffle code around and cleanup 2019-06-24 21:32:59 -03:00
Georges Basile Stavracas Neto f7df717e1b edit-calendar-page: Add back button
And remove the remaining code (and a few extras) from the
calendar management dialog.
2019-06-24 21:32:59 -03:00
Georges Basile Stavracas Neto 5e9f7bf01e new-calendar-page: Add "Cancel" and "Add" header buttons 2019-06-24 21:32:58 -03:00
Georges Basile Stavracas Neto 804479ebcc calendar-management-page: Add helper to retrieve titlebar 2019-06-24 21:32:58 -03:00