Commit Graph
610 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto 8b9af9241e views/week-header: Don't change all day state
I don't know what I had in mind when I wrote this, since 2017 self
did not bother adding a proper commit message, but 2023 me is pretty
convinced we never want to change the event length when dragging it
around.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/896
2023-03-16 12:27:09 +00:00
Georges Basile Stavracas Neto 0650c89ee2 views/week: Cleanup unused struct field
We don't use 'scroll_scale' anymore
2023-03-16 12:26:28 +00:00
Georges Basile Stavracas Neto e1616039d6 views/week: Special case discrete events
They behave slightly differently from smooth scroll events, and
they don't emit 'scroll-begin' nor 'scroll-end', so we have to
execute that the callbacks of these signals do inside the scroll
callback itself.
2023-03-16 12:26:28 +00:00
Georges Basile Stavracas Neto a55bf69dfb views/week: Don't swap callback arguments
No function changes
2023-03-16 12:26:28 +00:00
Georges Basile Stavracas Neto 189c809271 views/week: Store and restore zoom level
Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/916
2023-03-16 12:26:28 +00:00
Georges Basile Stavracas Neto a9e4a5ae12 views/week: Connect to 'scroll-begin'
The scroll-begin callback is being connected to the 'scroll' signal.
This is an obvious oversight.

Connect to the right signal.
2023-03-16 12:26:28 +00:00
Georges Basile Stavracas Neto 8d92808992 views/week: Operate on zoom levels
Instead of freely using heights and pixel sizes, operate on zoom
levels.
2023-03-16 12:26:28 +00:00
Georges Basile Stavracas Neto b93aa0dd23 calendar-button: Stop spinning when not synchronizing
GtkSpinner queues relayouts even when the stack is not displaying
it, and this causes excessive redrawing. This button design looks
obsolete and should eventually be reworked, but for now, let's
just stop spinning when the spinner is invisible.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/971
2023-03-16 12:25:15 +00:00
Georges Basile Stavracas Neto 9ea2ceef1a gui: Fix search from Shell overview 2023-03-05 11:53:50 -03:00
Georges Basile Stavracas Neto d6a216d0fa gui: Propagate context to GcalSearchButton
The people who introduced this code were not careful enough to
make sure the code they removed from GcalWindow was added back
in GcalToolbarEnd.

They also simply commented out some code instead of properly
reimplementing that.

I regret having trusted their code :(

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/880
2023-03-05 11:41:35 -03:00
Georges Basile Stavracas Neto 0e8332b07b calendar-management/new: Switch to a GtkDialog
The implementation of the credentials popover has relied on a hack,
and sadly this hack doesn't work anymore.

It's too late for a redesign, so for now, just put it into a dialog
and show it on top of the calendar management dialog.
2023-03-03 19:50:30 -03:00
Georges Basile Stavracas Neto 4f9d7de032 calendar-management/new: Dispose template 2023-03-03 19:50:30 -03:00
Felipe Kinoshita 2805b414f8 general: Use gtk_widget_set_visible
A lot of places were using gtk_widget_show/gtk_widget_hide, but those
methods are deprecated since Gtk 4.10.

Let's use gtk_widget_set_visible instead.
2023-03-03 19:14:09 -03:00
Georges Basile Stavracas Neto 69728fc814 views/agenda: Properly activate events
The code that activates event is just a sad FIXME in the file, and
the implementation is simple enough.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/897
2023-03-02 21:49:27 -03:00
Georges Basile Stavracas Neto e13eb17816 views/agenda: Cleanup unused Week View (!!!)
This is to show how much I suck at reviewing code. Look at this
massive gold nugget of garbage. Nobody on their serious mind would
have let that pass code review.

But I did. And now I deserve the punishment to deal with this.

Of course, the author didn't seem to have spared more than a fraction
of a second of their brain power to even consider what they were
doing here. But that's what code review is for - preventing garbage
like this from landing. And yet, here we are, removing an invisible
Week view from the sidebar.
2023-03-02 21:49:27 -03:00
Georges Basile Stavracas Neto bd9ff41a37 views/month-view: Use new signal helpers 2023-03-02 21:49:27 -03:00
Georges Basile Stavracas Neto bedf4e610d views/week-grid: Use new signal helpers 2023-03-02 21:49:27 -03:00
Georges Basile Stavracas Neto c80c06c86e views/week-view: Use new signal helpers 2023-03-02 21:49:27 -03:00
Georges Basile Stavracas Neto 1359465c62 views/week-header: Use new signal helpers 2023-03-02 21:49:27 -03:00
Georges Basile Stavracas Neto cdb80cfd3a views/view: Cosmetics 2023-03-02 21:49:27 -03:00
Georges Basile Stavracas Neto 5d5709122f views/view: Add private signal helpers
They'll be useful to stop hijacking view signals.
2023-03-02 21:49:27 -03:00
Georges Basile Stavracas Neto 5a028471e9 views/week-header: Cosmetics 2023-03-02 21:25:02 -03:00
Georges Basile Stavracas Neto a77f6e39e4 views/view: Store signal id
This will be used by next commits
2023-03-02 21:14:02 -03:00
Automeris naranja 88c696dbad window: Allow opening Main Menu by pressing F10 2023-02-13 13:25:32 -03:00
Georges Basile Stavracas Neto 40fa82deab event-editor/dialog: Check if calendars changed too
In addition to checking if any event fields changed, check if the
caledar changed too.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/924
2023-02-06 22:48:40 +00:00
Harshil Patel 5cd1823810 Added MS Teams parser.
Fixes GNOME/gnome-calendar#747
2023-01-06 07:15:43 +00:00
Yosef Or Boczko cb21ded772 gcal-agenda-view: Mark a string to be translatable
Signed-off-by: Yosef Or Boczko <yoseforb@gmail.com>
2023-01-05 11:44:39 +00:00
Sabri Ünal 066995d512 gui: Add a tooltip for "Main Menu" icon 2023-01-05 11:44:15 +00:00
Jean-François Fortin Tam aa333722af Set a better default size (height and width) for the event editor dialog
These are still hardcoded instead of measuring the available space,
but it's better than nothing in the meantime.

Decent WMs size the window correctly if width/height exceed the screen.

Also, allow the Notes field to expand vertically, to fill the space.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/602
2023-01-02 16:24:44 -05:00
Henrique F. Simões 481dcbe5b6 calendar-button: Add mnemonic to calendar label
Mnemonics are useful for navigating through the interface more easily,
besides improving the accessibility. Since the calendar button is an
important button for using the application, it is interesting to have
a mnemonic associated with its label.

Using the letter C for this label seems reasoable, since there is no
conflict with the labels simulteneously active in the application, and
it is easy to remember.
2022-11-20 19:54:52 +00:00
Henrique F. Simões e6b3e72e7c window: Add mnemonics to today, week and month labels
Users should be able to navigate through the interface ideally using
only the keyboard, as specified in the GNOME Human Interface Guidelines.
This however is currently possible in the window page with shortcuts
when it comes to switching among week and month views, and jumping to
today's date. It is also interesting to have access keys attached to
such labels, so that the user does not need to look for the keyboard
shortcuts.

Using the first letter for each of the labels as mnemonics suffices in
this case, since there is no conflict, none of them is a thin letter nor
has descenders, and they are easy to remember.
2022-11-20 19:54:52 +00:00
TheEvilSkeleton 0045c26ff6 about: Add support-url
This adds a support URL to the Calendar forums for easier access to ask questions.
2022-11-07 22:42:25 -05:00
Milan Crha 21e5396bf5 event-editor: Fix possible use-after-free of recurrence until date
The GcalDateSelector returns an internal instance, while the 'until' date/time
is meant to be an own instance, which is freed by the GcalRecurrence instance
in its free function. That means the 'until' date/time is supposed to be reffed
when being assigned into the GcalRecurrence structure.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/892
2022-10-31 12:25:11 +00:00
Georges Basile Stavracas Neto 502b381975 event-editor/dialog: Properly handle editing recurrent events
When a recurrent event is edited, we now are able to only offer the
MOD_ALL option when it actually will work. However, we're still left
with the problem that we end up applying the instance-specific data
onto the main event, through an old hack.

The views already aren't able to offer the MOD_ALL property, since
they all change the dates of events, but GcalEventEditorDialog can,
and it must handle that properly.

For now, do the simplest possible approach, which is: retrive the
template event and apply all properties that can be applied to it,
without letting the start and end days leak into it. We already only
allow passing MOD_ALL on situations where the dates aren't really
modified, so it should be safe.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/882
2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto 102346534a event-editor/dialog: Improve detection of MOD_ALL exclusion cases 2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto 679a392b71 event-editor/dialog: Don't hide dialog on cancelling operation
If the user clicks the "Cancel" button, it obviously means "cancel",
so let's cancel.
2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto cc696bc365 window: Properly hide start headerbar buttons
Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/859
2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto 23dedc0fc8 event-editor/schedule: Trivial autoptr cleanup 2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto 185490e272 event-editor/dialog: Don't ask mod type if event wasn't recurrent 2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto 966411843a event-editor/dialog: Don't show MOD_ALL if schedule changed
We get into seriously tricky situations if we try and change the
date & time of an event with recurrency, and pass MOD_ALL. That's
because it is ambioguous *where* the change must be applied.

Don't allow selecting MOD_ALL when the scheduling of the recurrent
event changes.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/882
2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto df5b9e7821 event-editor/dialog: Don't apply changes if nothing changed
This saves some cycles by not doing anything when nothing needs to
be done.
2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto 82d8ec31ca event-editor/sections: Add vfunc to check for changes
This will be useful for next commits where we will need to check
if the schedule section actually changed something.
2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto dbd2f0df58 event-editor/dialog: Don't apply changes to readonly events
In practice this never does anything relevant, because widgets are
insensitive, but it's better not to nonetheless.
2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto 5329c2297b views: Don't show MOD_ALL
The only field that views may change using DnD is the start date
field (and, consequently, the end date), and that's exactly what
we must not show the MOD_ALL option for.

Don't show it.

Related: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/882
2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto 6a5c0229b9 utils: Add boolean flag for showing MOD_ALL
This will be used by next commit to more finely control editing
of recurrent events.
2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto 1bb834e110 event-widget: Properly dispose template children 2022-10-17 23:37:13 -03:00
Ray Strode 184d77ef4d window: Fix crash in toast animation
Every once in a while when I'm deleting an event gnome-calendar crashes.

I dug in a bit, and it seems the reason is
adw_toast_overlay_add_toast takes ownership of the passed in reference.

This is a little idiosyncratic for something that's not GInitiallyUnowned,
but it appears to be the API nonetheless.

GCalWindow assumes it owns the reference.

This commit makes both users of the toast happy by adding a ref call.
2022-10-14 13:38:03 -04:00
Yosef Or Boczko 17bb795846 gcal-week-grid: Fix wrong x postion for events in RTL
Every event in RTL languages is drawn in the
wrong place. As a result the week view is totally unusable.

Fix this.

#817

Signed-off-by: Yosef Or Boczko <yoseforb@gmail.com>
2022-10-12 20:35:52 +03:00
Milan Crha 11a34a1d28 Misc: Fix GObject property types for GLabel::xalign/yalign properties
When running under valgrind, it claims that there's used uninitialized
memory, which is set as GObject property in the code. It's for
GtkLabel::xalign. The problem was that the value in the code is
an integer, but the property itself expects float type. This fixes
the place and where a floating point is already used it annotates
the value to be float, not a double.
2022-10-06 13:36:10 +02:00
Milan Crha 8138619419 gcal-window: Event deletion aborts unfinished previous delete attempt
Cannot use g_clear_pointer() here, because it unsets the pointer first and
only then calls the free function, which means the test on self->delete_event_toast
NULL-ness would be satisfied in the on_toast_dismissed_cb(), thus the previous
event delete attempt would be "cancelled" internally.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/858
2022-10-05 18:44:25 +02:00