Commit Graph
1642 Commits
Author SHA1 Message Date
Abdullahi Usman 0a02a1269b event-widget : Add/rework new event sort function
The overflow layout used to display "Other X events" text when
there is no enough space to accomodate more events.

But due to the way the events were sorted, some events are folded to
'Other events' popover even when the cell has enough space to accomodate
the event(s) or when it is not required to be folded.

We rework how the events will be sorted.  First, the events are sorted by their
start dates(starting with the closest).  But if two or more events have same start date
then they are sorted according to their lengths.  And still if they have same start
date and length then they are sorted according to their modified times(the closest first).

https://bugzilla.gnome.org/show_bug.cgi?id=778478
2017-06-23 04:17:26 -03:00
Carlo Lobrano 9033d987a3 quick-add-popover: improve event title in header
Currently when creating new events, in both week and month view,
the popover header shows just the date

e.g.
	"New Event on April 29"
	"New event from April 29 to May 2"

It could be better to show fancier headers with relative dates

e.g.
	"New Event Today",
	"New Event Tomorrow",
	"New Event next Monday",
	"New Event from Tomorrow to May 2"

With this patch I change the header title according to the above
logic

https://bugzilla.gnome.org/show_bug.cgi?id=747479
2017-06-23 03:59:01 -03:00
Milan Crha e07590d1cf window: remove refresh timeout on exit
https://bugzilla.gnome.org/show_bug.cgi?id=783441
2017-06-18 14:54:50 -03:00
Yash Singh 68c604b095 manager: set 'rid' to NULL when 'All events' chosen
Setting 'rid' to NULL in gcal_manager_update_event()
when 'All events' chosen allows us to modify
All and Future Instances of recurrent events correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-06-14 18:28:54 -03:00
Yash Singh be9da0cbda views: ask for recurrence when dropping recurrent events
While dragging and dropping a recurrent event, pop
up the recurrence-dialog to allow the user to choose
the set of events to which the changes should be
applied.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-06-14 16:18:11 -03:00
Yash Singh a7add6d6be utils: set recurrence-dialog transient for toplevel widget
Setting the recurrence-dialog transient for toplevel widget
allows us to take care of
ask_recurrence_modification_type() calls in the
various views.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-06-14 14:44:10 -03:00
Yash Singh 19f10697d5 utils: set recurrence-dialog modal to toplevel widget
Setting the recurrence-dialog modal to toplevel widget
allows us to take care of
ask_recurrence_modification_type() calls in the
various views.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-06-12 14:46:38 -03:00
Yash Singh e13bbcefe6 manager: pass NULL as 'rid' when 'All Events' chosen
If user chooses 'All Events' option while deleting
a recurrent event, pass NULL as the 'rid' argument to
e_cal_client_remove_object().

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-06-10 09:29:29 -03:00
Yash Singh 5a5dc6716a window: pop up recurrence-dialog right after edit-dialog
The recurrence-dialog opens only if the event to be modified
is a recurring event and only if the user doesn't cancel
the modification in the edit-dialog. If the user presses
'Cancel' in the recurrence-dialog after making modifications
in the edit-dialog, then no changes are applied.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-06-10 09:02:31 -03:00
Yash Singh a9430f54d0 utils: add ESource* argument to ask-recurrence-modification-type
Earlier the argument was ESource. Changed
the argument to ESource* for the function
to correctly fetch "client" data from the
source.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-06-10 08:49:48 -03:00
Georges Basile Stavracas Neto 3f9731bf89 manager: fix style 2017-06-10 08:30:27 -03:00
Yash Singh 6b31ac88c2 manager: pass correct rid & uid to remove-event
Passing the correct rid & uid to
e_cal_client_remove_object() ensures that
the deletion of recurrent events is
handled correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-06-09 22:33:46 -03:00
Yash Singh 7fd3e48427 manager: set client upon loading event
Add EClient support while loading an event.
This EClient then helps us check its
capability in window.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-06-09 22:33:46 -03:00
Yash Singh cbc9fe7be1 utils: add dialog to modify recurring events
Whenever a user chooses to modify an event which is
recurring, a new dialog will open automatically when
the user clicks 'Done' or 'Delete' in edit-dialog,
after making the desired changes. This new dialog
will ask the user to choose the set of events to
which the changes will be applied. The options
include 'This Event Only', 'Subsequent Events'
and 'All Events'. The function returns true and
the changes take place only if the user chooses any
option other than 'Cancel' or <Alt+F4>.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-06-09 22:33:46 -03:00
Rafal Luzynski 2263fc9478 date formats: Use g_date_time_format()
Don't hardcode month-day order, use g_date_time_format() and
mark the format string for translation and let translators choose
their preferred formats.

This patch also removes context from the existing "%B %d" date
format because it is unnecessary and this allows the format to be
reused by the patch.

https://bugzilla.gnome.org/show_bug.cgi?id=780629
2017-06-01 11:37:00 -03:00
Yash Singh 9ffa913ad4 manager: pass ECalObjModType to update and remove
Currently, GcalManager always assumes E_CAL_OBJ_MOD_THIS
when modifying or deleting events. Since we're landing
the groundwork for recurrence management, we can't assume
this anymore.

This patch, then, allows GcalManager:modify_event() and
:remove_event() receive the ECalObjModType instead of
assuming E_CAL_OBJ_MOD_THIS. However, this commit does
not add recurrence support yet, and every call to these
functions are still passing E_CAL_OBJ_MOD_THIS.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-05-27 11:36:05 -03:00
Milan Crha a53581ed53 window: connect search view when manager is set
https://bugzilla.gnome.org/show_bug.cgi?id=782475
2017-05-27 11:01:41 -03:00
Georges Basile Stavracas Neto d294ea46a5 week-header: fix drawing stray lines when managing events 2017-05-24 17:27:07 -03:00
Abdullahi Usman 9bbb12691a month-view: add margin to overflow layout
The overflow layout sit at the bottom of a cell to display "Other X events"
when there is no room to accomodate more.

The issue is that the overflow layout does not have margin property like
other views(layouts) in the cell, so instead it appears either too far from or
too close to the border depending on the text it accomodates.

We can fix this by setting the margin property.

https://bugzilla.gnome.com/show_bug.cgi?id=771581
2017-05-24 15:46:23 -03:00
Mohammed Sadiq 00b89b89cd gcal-event: fix several memory leaks
https://bugzilla.gnome.org/show_bug.cgi?id=782972
2017-05-24 15:08:31 -03:00
Georges Basile Stavracas Neto 1ef8fbcb34 edit-dialog: unconditionally update event dialog
When setting an event, we might modify the event in such a way that
the edit dialog can be broken if it doesn't update.

Fix that by unconditionally updating the event dialog when setting
an event.
2017-05-22 22:55:10 -03:00
Abdullahi Usman ad3e37606d month-view : adjust overflow layout and set it ellipsized at end.
The overflow layout used to display "Other X events" text when
there is no enough space to accomodate more events.

This used to get mixed-up/overlapped with the date label because the
overflow label uses whole cell width as width.

We can fix this by substracting date label width from overflow label
width to accomodate the date label.

https://bugzilla.gnome.com/show_bug.cgi?id=7771581

https://bugzilla.gnome.org/show_bug.cgi?id=771581
2017-05-22 22:05:07 -03:00
Abdullahi Usman 91408b355b month-view : add margin to overflow layout
The overflow layout sit at the bottom of a cell to display "Other X events"
when there is no room to accomodate more.

The issue is that the overflow layout does not have margin property like
other views(layouts) in the cell, so instead it appears either too far from or
too close to the border depending on the text it accomodates.

We can fix this by setting the margin property.

https://bugzilla.gnome.com/show_bug.cgi?id=7771581
2017-05-22 21:57:46 -03:00
Georges Basile Stavracas Neto a647033847 project: remove unused variables 2017-05-22 21:57:24 -03:00
Yash Singh 6dd234296e event: add recurrence property & has-recurrence function
Recurrence property of the event enables us to add recurrences
to it in the future. It is the first step in that direction.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-05-18 14:50:14 -03:00
Georges Basile Stavracas Neto 4e262f6d5d event: remove unused code 2017-05-17 14:47:03 -03:00
Georges Basile Stavracas Neto 05af332937 source-dialog: use DBus to spawn Control Center
In a Flatpak'd world, we cannot rely on the fact that
gnome-control-center binary will be installed at the
app's sandbox. But since it's a core app, we can rely
on the fact that it's available outside the sandbox.

To make it work, use DBus rather than raw spawn to
open control center.
2017-05-17 09:03:24 -03:00
Georges Basile Stavracas Neto dde6b5bf05 week-view: improve scroll timeout logic
Instead of keeping an active timeout source spamming the
console, just connect to the right signal and wait for the
week view to be visible again.
2017-05-16 17:48:25 -03:00
Georges Basile Stavracas Neto f25a7b0dd8 application: only override log handler with --debug 2017-05-16 15:01:11 -03:00
Georges Basile Stavracas Neto dc72ff4924 log: ignore GdkPixbuf messages 2017-05-16 14:57:21 -03:00
Georges Basile Stavracas Neto 4323990138 window: fix style 2017-05-16 14:57:17 -03:00
Georges Basile Stavracas Neto 09fe510937 views: use the new GcalClock to redraw
Instead of having each view manage it's own timeout (or
even worse, making GcalWindow manage it), use the newly
introduced GcalClock API to do that.
2017-05-16 14:57:15 -03:00
Georges Basile Stavracas Neto 15563607dd manager: create and keep an internal clock
This clock will be used in the future by other classes
to update stuff.
2017-05-16 14:57:13 -03:00
Georges Basile Stavracas Neto e7a05bdc4c clock: introduce GcalClock
GcalClock is an internal clock for GNOME Calendar that
sends a few utility signals, such as :day-changed and
:minute-changed.

It also watches for suspend/resume events to properly
send the signal right after the resume.
2017-05-16 14:57:11 -03:00
Mohammed Sadiq be731fcae7 event-widget: fix memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=782566
2017-05-15 17:28:25 -03:00
Mohammed Sadiq 4dde284170 week-header: fix memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=782561
2017-05-15 17:23:31 -03:00
Orkun Tezer a54e91a9b3 week-header: use g_date_time_add_days for dnd date calculation
Dnd at week header crashes with segmentation fault

The problem, calculation of dnd_date returns NULL when week_start is
in previous month.

Fix that by using g_date_time_add_days() function

https://bugzilla.gnome.org/show_bug.cgi?id=781955
2017-05-08 21:49:46 -03:00
Georges Basile Stavracas Neto f9454b6a8a event-widget: properly escape event description
When we escape first, then truncate, we might end up truncating at
the middle of a special character sequence, breaking the markup.

Fix that by escaping after truncating.
2017-05-08 21:26:21 -03:00
Mohammed Sadiq 178e6a269a week-view: fix signal emission on scrolled_window
This was causing segfault in week-view

https://bugzilla.gnome.org/show_bug.cgi?id=782269
2017-05-06 12:51:25 -03:00
Mohammed Sadiq 9ed375cd99 application: fix setting active-date logic
https://bugzilla.gnome.org/show_bug.cgi?id=782192
2017-05-06 12:25:16 -03:00
Kevin Lopez ec3ef0d0a3 search-view: hide if click is performed outside
Result drop down should disappear when any click is performed outside
that drop down.

https://bugzilla.gnome.org/show_bug.cgi?id=74796

https://bugzilla.gnome.org/show_bug.cgi?id=747962
2017-05-04 08:55:50 -03:00
Orkun Tezer a6e347d8f2 week-header: Move events at column after remove event from list
The Problem: When user remove 4rt fullday event, header only shows two
events and not shows 3rd fullday event

Because, we check and set visibility of event that user wants to remove
from calendar, before remove event from event list which causes 3rd
event unvisible.

Fix that with check and set visibility of event after remove event
from event list, then visibilties and overflow corretly calculated

https://bugzilla.gnome.org/show_bug.cgi?id=777423
2017-05-03 21:55:39 -03:00
Georges Basile Stavracas Neto 817325da05 month-view: simplify code 2017-04-29 12:57:06 -03:00
Georges Basile Stavracas Neto 7dc5eb5bf5 week-grid, week-header: properly initialize datetimes
Since we use autoptr on those, we may end up falling in to
the early return and mistakenly unreferencing the not
initialized new date.
2017-04-29 12:57:06 -03:00
Georges Basile Stavracas Neto 7d771830f1 edit-dialog: fix g_list_sort() usage 2017-04-24 10:03:28 -03:00
Evgeny Shulgin 7798f38ad9 window: use case-insensitive sorting in the calendar list
g_strcmp0() is used when comparing the display name of the ESource.
This is not a valid sort, because in this case we will get an order
like "a" < "z" < "B" < "Z", but it should be like "a", "B", "z", "Z".

We will use g_ascii_strcasecmp to fix it.

https://bugzilla.gnome.org/show_bug.cgi?id=781231
2017-04-24 09:54:17 -03:00
Evgeny Shulgin 6728ddd019 source-dialog: use case-insensitive sorting in the calendar list
g_strcmp0() is used when comparing the display name of the ESource.
This is not a valid sort, because in this case we will get an order
like "a" < "z" < "B" < "Z", but it should be like "a", "B", "z", "Z".

We will use g_ascii_strcasecmp() to fix it.

https://bugzilla.gnome.org/show_bug.cgi?id=781231
2017-04-24 09:54:17 -03:00
Evgeny Shulgin d76bf34640 edit-dialog: sort the list of calendars in alphabetical order
Since gcal_manager_get_sources() returns a GList of ESource received
from the hash table, they are not sorted alphabetically. Because of
this, edit-dialog shows the unsorted list.

I added a function for sorting this GList that is case-insensitive.

https://bugzilla.gnome.org/show_bug.cgi?id=781231
2017-04-24 09:54:17 -03:00
Isaque Galdino 997e958fb9 year-view: Uninitialised values
Valgrind was reporting some "Conditional jump or move depends on
uninitialised value(s)" and "Invalid read of size 4" when hovering
year-view.

It was found some uninitialised variables in the code and they were
initialised before being used.

https://bugzilla.gnome.org/show_bug.cgi?id=781430
2017-04-21 23:24:11 -03:00
Georges Basile Stavracas Neto 9d91c11b52 year-view: simplify code
By storing the coordinates array in a local pointer,
we avoid 9 super slow full memory lookups. That matters
when we're inside the drawing function, trying to keep
60fps.
2017-04-19 16:48:51 -03:00