Commit Graph
88 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto b4029b0c23 edit-dialog: Rename to GcalEventEditorDialog 2020-10-31 13:30:56 -03:00
Georges Basile Stavracas Neto c73dc191db project: Move GcalEditDialog and friends to src/gui/event-editor/ 2020-10-30 15:13:35 -03:00
Georges Basile Stavracas Neto e67ebcfc50 project: Move all UI-related files to src/gui/
So we can have a nice separation.
2020-10-30 14:44:33 -03:00
Georges Basile Stavracas Neto 92863f578f project: Split GResource files in subdirs 2020-10-30 14:17:40 -03:00
Georges Basile Stavracas Neto 87ce5e6d49 project: Move css-code.h to src/gui/
It is only used there.
2020-10-30 13:47:38 -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 ac46671334 window: Switch to HdyHeaderBar
Change the headerbar to HdyHeaderBar
2020-09-16 15:24:46 +00:00
Evangelos Ribeiro Tzaras 402ad34f42 window: Inherit from HdyApplicationWindow
This commit makes the toplevel GcalWindow inherit from
HdyApplicationWindow instead of GtkApplicationWindow.
2020-09-16 15:24:46 +00:00
Evangelos Ribeiro Tzaras 8be361b6ce project: Switch to libhandy-1
This commit updates the dependencies for libhandy to the tagged 1.0
release and changes the code to accomodate the changes from
libhandy-0 to libhandy-1.

Notable changes:
edit-dialog: HdyDialog has been dropped in [1]
alarm-row: action child type in HdyActionRow has been removed.

[1] https://gitlab.gnome.org/GNOME/libhandy/-/merge_requests/434
2020-09-16 15:24:46 +00:00
Evangelos Ribeiro Tzaras 2d5b1aa9d1 project: Cleanup code for unused views
Got rid of the unused views in the GcalWindowView enum
and associated code in gcal-window.
2020-09-16 15:24:46 +00:00
Georges Basile Stavracas Neto 1bb00b8989 edit-dialog: Commit sequence after poking at component
GcalEditDialog code pre-dates GcalEvent and apply changes directly
to the underlying ECalComponent. However, it doesn't commit the
sequence after doing so, which opens the door for doom.

Commit the component sequence after changing the recurrence data.
2020-06-17 21:24:36 -03:00
Georges Basile Stavracas Neto 53bc8d15a7 edit-dialog: Fake a cancel response when moving
When moving an event to another calendar, the GcalEvent instance
that is being held by GcalEditDialog is not valid one. On the other
hand, moving an event shouldn't trigger an update either.

For now, simply fake a GTK_RESPONSE_CANCEL. In the future, it'll
be better to move most of the GcalWindow code to GcalEventDialog
itself.
2020-06-17 21:24:36 -03:00
Georges Basile Stavracas Neto d5ed8626ca edit-dialog: Factor out update code to a separate function
To simplify readability of the response function, move some of
its code to an auxiliary function.
2020-06-17 21:24:36 -03:00
Georges Basile Stavracas Neto 8243e0b8ed edit-dialog: Edit cloned event
Edit a cloned event instead of the actual event, so that it
can preserve the original event's integrity. This allows for
a major edit dialog cleanup in the future.
2020-06-15 13:19:38 -03: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
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