Commit Graph
2229 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto efe60e10d1 notes-section: Remove scrolled window
The entire dialog is wrapped under a scrolled window, it
doesn't make much sense to have yet another one for the
notes. This is a relif of times when the edit dialog didn't
have a scrolled window.

Remove the scrolled window of the notes section.
2020-11-10 15:00:59 +00:00
Georges Basile Stavracas Neto 7a5580980b summary-section: Use expandable entries
Now the entry grows as much as possible to accomodate the
text.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/153
2020-11-10 15:00:59 +00:00
Georges Basile Stavracas Neto b4fedbbba5 Introduce GcalExpandableEntry
This is simply a copy-past of GNOME To Do's GtdExpandableEntry.
2020-11-10 15:00:59 +00:00
Georges Basile Stavracas Neto d41af9f8a0 summary-section: Set max-width-char on entries
We want them to grow a bit more, and not let the expansion
of the title label detemine the width. Allow the location
and title entries to expand, and set a maximum width char
to 30 on them.

See https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/554
2020-11-10 15:00:59 +00:00
Dan Levin 8b251d5a98 reminders-section: Introduce 15 minute reminder
10 minute reminder is too little advanced notice. 30 minutes is too
much. Say hello to 15 minute reminder.
2020-11-02 17:05:31 +01:00
Georges Basile Stavracas Neto a146b9050d project: Silence CI warnings 2020-10-31 16:55:06 -03:00
Georges Basile Stavracas Neto 06f0c4d011 schedule-section: Make date & time labels dim
They should have been dim labels since the beginning, this was an
oversight.
2020-10-31 16:15:54 -03:00
Georges Basile Stavracas Neto b481b40381 schedule-section: Mark date & time labels as action children
Otherwise they appear inside the expanded section, and not outside like
we wanted. This was a regression from the libhandy 1.0 port.
2020-10-31 16:15:54 -03:00
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
Michael Catanzaro 9ac1528e54 gcal-timeline: completed_calendars should be unsigned
In on_calendar_monitor_completed_cb() we have this assert:

g_assert (self->completed_calendars <= g_hash_table_size (self->calendars));

That is comparing a signed integer to unsigned. This is dangerous. We
could add casts to say that we really want to do it, but
completed_calendars should never be negative, so might as well use
unsigned.
2020-10-14 09:14:34 -05:00
Michael Catanzaro c2c89b667e gcal-timeline: never reset completed_calendars
Since 78cb11c64d, GcalCalendarMonitor now
notifies when a completed calendar transitions to incomplete, and
GcalTimeline decrements its completed_calendars counter. But we forgot
to remove the code that resets completed_calendars when previously
needed. That's not required anymore, because we can trust
GcalCalendarMonitor to do the right thing.

In my case, I have 5 calendars enabled and 6 total. When starting
gnome-calendar, all 5 are successively completed, and
completed_calendars increments from 0 -> 1 -> 2 -> 3 -> 4 -> 5. Then,
when transitioning month view from January 2020 to December 2019, we
call reset_completed_calendars() and completed_calenders gets clobbered
to 0. Then it decrements from 0 -> -1 -> -2 -> -3 -> -4 -> -5 as the
GcalCalendarMonitors notify that they are no longer completed. Well,
that is what would happen, if it didn't crash when decrementing to -1.
We assert -1 <= 6 (the total number of calendars) and crash because -1
gets promoted to a huge unsigned int, since we're comparing signed to
unsigned. (That crash would have been avoided if we used
-Wsign-compare, although that warning would not have caught the logic
problem.)

Anyway, since GcalMonitor now notifies when calendars are no longer
complete, it is safe to simply remove reset_completed_calendars().
GcalTimeline will still notify if it needs to change its own complete
property (in on_calendar_monitor_completed_cb).

Fixes #567
Fixes #636
Fixes #638
Fixes #647
Fixes #650
2020-10-14 09:13:12 -05: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
Yuri Edward 78cb11c64d calendar-monitor: Turn "completed" signal into a boolean property
And make GcalTimeline decrease the completed calendars counter when
any GcalCalendarMonitor goes from complete to incomplete.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/625
2020-08-17 15:59:33 -03:00
Georges Basile Stavracas Neto 158c65db4b event: Trivial cleanup
We can avoid a lookup by simply checking if the alarm id
isn't NULL.
2020-06-17 21:24:36 -03:00
Georges Basile Stavracas Neto 4b6a559924 manager: Assert that cloning was successful
Cloning an ECalComponent can fail, and we need to be able to
catch these failures.

Assert that cloning was successful before procceeding with
the move.
2020-06-17 21:24:36 -03: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 c1ec9e734b event: Commit component more often
GcalEvent was mising many points where committing the component
is required. Commit the component more often.

https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/620
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
Douglas Fuller a9e74b7966 week-header: Clone and modify new event when dropping
Update week-header to use the same clone strategy used by month-cell
2020-06-15 20:05:14 -04:00
Douglas Fuller 1ce21be23a week-header: trivial cleanup 2020-06-15 20:04:41 -04:00
Douglas Fuller 2cb26a4399 week-grid: Clone and modify new event when dropping
Update week-grid to use the same clone strategy used by month-cell

Fixes #607
2020-06-15 20:01:56 -04:00
Douglas Fuller c7161543b2 week-grid: trivial cleanup 2020-06-15 19:59:19 -04: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
Georges Basile Stavracas Neto 4b1e303448 year-view: Clone and modify new event when dropping
Pretty much the same rationale and implementation of the previous
commit.
2020-06-15 13:32:02 -03:00
Georges Basile Stavracas Neto ed7121c995 month-cell: Clone and modify new event when dropping
Instead of modifying the original event, create a new event
from it and modify this new event instead. After updating it
through gcal_manager_update_event(), GcalMonthView will remove
the old instance and add the new one anyway.
2020-06-15 13:26:51 -03:00
Georges Basile Stavracas Neto cab7d5907f month-cell: Instrument drop function
It's useful for debugging DnD.
2020-06-15 13:26:12 -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