Commit Graph
102 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto b725d25b86 schedule-section: Remove useless labels
They're placeholders, and always overriden. Remove them.
2020-10-31 16:15:54 -03:00
Georges Basile Stavracas Neto 968ae16e08 window: Use leaf type for GcalEventEditorDialog
We're casting either way, to at least let's cast to something
that requires fewer characters.
2020-10-31 16:15:54 -03:00
Georges Basile Stavracas Neto 4c24103bae event-editor-dialog: Make 'event' property read-only
It is not meant to be set externally.
2020-10-31 16:15:54 -03:00
Georges Basile Stavracas Neto b0cdca78b1 event-editor-dialog: Unify set_event and set_event_is_new
The split is annoying, and a relic of time.
2020-10-31 16:15:54 -03:00
Georges Basile Stavracas Neto 7e10c6d451 event-editor-dialog: Stop using response type
Using dialog responses to communicate intent to GcalWindow was always
a hack, and as the code is cleaned, it's getting increasingly annoying.

Replace this with a proper 'remove-event' signal ('delete-event' would
conflict with the equally named GTK signal), remove the custom response
types, and cleanup the code.
2020-10-31 16:15:54 -03:00
Georges Basile Stavracas Neto 1480d7ac70 event-editor-dialog: Code cleanup
Use g_autofoo when possible; avoid allocating new strings when fetching
from GVariant; sort and reorder fields.
2020-10-31 16:15:54 -03:00
Georges Basile Stavracas Neto c098dc7aa7 event-editor-dialog: Store sections in an array
It allows us to simplify some boring copy-pasted code.
2020-10-31 16:15:54 -03:00
Georges Basile Stavracas Neto 3a9f9009a4 event-editor-dialog: Remove dead code
These weren't being used anywhere.
2020-10-31 16:15:54 -03:00
Georges Basile Stavracas Neto 0f1dc88030 event-editor-dialog: Move notes to GcalNotesSection 2020-10-31 16:15:49 -03:00
Georges Basile Stavracas Neto 73cbe1f39c event-editor-dialog: Move summary to GcalSummarySection 2020-10-31 13:30:56 -03:00
Georges Basile Stavracas Neto 46aee00f65 event-editor-dialog: More schedule to GcalScheduleSection 2020-10-31 13:30:56 -03:00
Georges Basile Stavracas Neto 997f6bb671 event-editor-dialog: Move reminders to GcalRemindersSection
Move all widgetry, logic, and setup to GcalReminderSection.
2020-10-31 13:30:56 -03:00
Georges Basile Stavracas Neto a839a0d860 Introduce GcalEventEditorSection
This is the interface to represent sections of the event editor
dialog.
2020-10-31 13:30:56 -03:00
Georges Basile Stavracas Neto f9c466a1be event-editor-dialog: Notify context when setting property
The 'context' property is set a explicit notify property, meaning we have
to manually notify it when setting it.
2020-10-31 13:30:56 -03:00
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