Commit Graph
1682 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto de780276f9 manager: user the new code style 2017-09-07 02:23:56 -03:00
Georges Basile Stavracas Neto 00b9c1c7a7 project: style improvements in meson files 2017-09-07 02:15:37 -03:00
Georges Basile Stavracas Neto 941f3ee77d event: cache events
This speeds up Calendar a little bit, and more importantly,
allows me to sleep well at night now.
2017-09-07 02:09:53 -03:00
Georges Basile Stavracas Neto 2f52962f01 utils: remove debug spew 2017-09-07 01:52:21 -03:00
Georges Basile Stavracas Neto 53a8278953 views: correctly hide events according to the mod type
When deleting events with recurrence, we want to hide the event
widgets according to the modification type. So that selecting
e.g. subsequent in the modification type dialog hides the event,
and the subsequent ones, truly reflecting the operation that will
happen.

Currently, however, the views don't do that, and only hide the
event that was asked to be deleted.

Fix that by passing the object modification type, and adapting the
views to take that into account.
2017-09-07 00:02:40 -03:00
Georges Basile Stavracas Neto 1a496eea17 subscriber-view: update comments 2017-09-07 00:02:40 -03:00
Georges Basile Stavracas Neto 3b6b536663 recurrence: add GcalRecurrenceModType
Instead of reusing the ECalObjModType and mixing the
prefixes all around, do this small cleanup and add a
gcal-prefixed enum.
2017-09-07 00:02:40 -03:00
Georges Basile Stavracas Neto edce0ab076 recurrence: use refcount instead of copy/free 2017-09-06 22:15:13 -03:00
Georges Basile Stavracas Neto 0cb6f20aea view: update style 2017-09-06 21:53:17 -03:00
Georges Basile Stavracas Neto 6004123ba2 edit-dialog: fix time widgets sensitive when all day 2017-08-24 07:16:15 +09:00
Georges Basile Stavracas Neto 3eec69c559 edit-dialog: update style
Calendar matured its code style over time and
edit dialog kept the old style.
2017-08-24 07:07:36 +09:00
newtodisworld@yandex.com e5024de887 edit-dialog: fix date span calculation
https://bugzilla.gnome.org/show_bug.cgi?id=772100
2017-08-24 06:53:32 +09:00
Georges Basile Stavracas Neto 316aeb9c67 quick-add-popover: properly place translator comment 2017-08-22 21:21:19 -03:00
Carlo Lobrano 66fa49b166 year-view: Mark working days according to locale
Currently, on the year view, Saturday and Sunday are marked
as non working days by default, despite the Locale settings and the
fact that in some Countries Sunday and/or Saturday are workdays.

This patch introduces a new function "is_workday" to check
whether a day is a working day according to the territory part of
Locale.

https://bugzilla.gnome.org/show_bug.cgi?id=746927
2017-08-22 21:10:07 -03:00
Abdullahi Usman e56bbc78a8 edit-dialog : correct time row visibility
The revealer widget in edit dialog's event time interval row uses to hide the
time selector widgets when the event is checked as all-day and also reveal the
widgets when not checked as all-day.

Sometimes edit dialog may turn on the visibility of the time selector
widgets when the revealer's animation already starts, causing a flickering of the widgets.

We remove the revealer widget and leave edit dialog to toggle the
visibility of time selector widgets when needed.

https://bugzilla.gnome.org/show_bug.cgi?id=771572
2017-08-22 21:01:20 -03:00
Abdullahi Usman d9a775e2fe month-view : correct overflow label position on rtl
The overflow layout displays "Other n events" when there are too much event
that a cell can accomodate.

But on rtl languages, due to the layering out of the cell, the position of the
overflow is not renderend on the mirrored date.

We fix that by mirroring the positon of the day on which the events occur so
that the events can appear on the right day.

https://bugzilla.gnome.org/show_bug.cgi?id=777427
2017-08-22 20:57:01 -03:00
Georges Basile Stavracas Neto 13d6f85d1f quick-add-popover: put day placeholder in the translatable string
As fairly pointed out, we should never split sentences [1].

[1] https://wiki.gnome.org/TranslationProject/DevGuidelines/Never%20split%20sentences

https://bugzilla.gnome.org/show_bug.cgi?id=786022
2017-08-22 20:51:16 -03:00
Abdullahi Usman df08daad68 month-view: improve dates calculation for RTL languages.
Month view used to calculate the event's start date and end date from
the physical layout of the month and compare it with the event's
original start date and end date to see if there is a change and then
update as necessary by either slanted start or end, when either is/are
not equal to the one in the original start and end dates.

However, the way in which the start date and end date in RTL language are
calculated must be different since the layering of the days in the weeks
are opposite.  Month view uses precalculated days number to mirror the
last week, which already chop off the days_delay number from cell_idx value.
In RTL, this cause issues such that the days are calculated wrongly and a
slanted start or end is visible.  Because the date is not the same as the
original events date, month view thinks that the view needs an update and
so tries to update the view wrongly.

We can fix this by using the cell_idx value to calculate the days and then
substracting the days_delay value after that.

https://bugzilla.gnome.org/show_bug.cgi?id=777426
2017-08-18 23:53:04 -03:00
Iñigo Martínez 1b04e6f4f5 project: Minor meson improvements.
This patch makes some minor improvements to the meson build system.
The changes are as follows:

* Avoid conditional statements when setting config.h values.
* Ordered calendar dependencies.
* Reused variables derived from options.
* Removed unnecessary new line in the output at the configuration's
  end.
* Use set10 function avoiding the trinary operator.
* Removed dependencies on the libgcal dependency, as they are not
  needed.

https://bugzilla.gnome.org/show_bug.cgi?id=786481
2017-08-18 23:06:29 -03:00
Georges Basile Stavracas Neto 282fb5fc33 month-view: don't draw dnd highlight on empty cells
https://bugzilla.gnome.org/show_bug.cgi?id=786102
2017-08-14 23:42:49 -03:00
Iñigo Martínez a1d25d2d7e project: Remove autotools
https://bugzilla.gnome.org/show_bug.cgi?id=782843
2017-08-10 07:49:16 -03:00
Iñigo Martínez 4c115249a7 project: Port to meson build system
https://bugzilla.gnome.org/show_bug.cgi?id=782843
2017-08-10 07:19:28 -03:00
Alex Benishek 311195857f Move from GPL 2 to GPL 3
Right now the project contains a mix of GPL 2 and GPL 3 code.
This commit moves all of the perviously GPL 2 code to GPL 3

https://bugzilla.gnome.org/show_bug.cgi?id=752649
2017-08-10 07:16:36 -03:00
Philip Withnall 30fc0b5bc5 src: Drop unused variables
Fixes a compiler warning.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=785670
2017-08-10 07:14:39 -03:00
Yash Singh 1ad72b61a3 edit-dialog: make number of occurrences accept only numeric input
Set the numeric property of number of occurrences spin button
to TRUE so that it only accepts numeric input.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-08-10 07:12:10 -03:00
Yash Singh b7de0f3e1f edit-dialog: set proper limits for number of occurrences
Set the lower value as 1 and upper value as G_MAXDOUBLE
to make sure that any negative number, or a number greater
than G_MAXDOUBLE is not accepted.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-08-10 07:12:10 -03:00
Georges Basile Stavracas Neto d11ed85a7f month-view: grey out invalid days
It should be very clear that days outside the current
month are actually not valid. The current drawing
algorithm does not differentiate that, thought, and
draws everything at the same color.

Fix that by greying out the days outside the current
month.

https://bugzilla.gnome.org/show_bug.cgi?id=763771
2017-07-30 16:03:39 +01:00
Yash Singh 9a4b7087d7 edit-dialog: hide/show repeat_limits_box
Instead of hiding the individual children of the
repeat_limits_box, hiding the repeat_limits_box
solves alignment issues, where an undesired gap
was visible below the repeat_combo upon opening
the edit-dialog for the first time.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-07-24 11:44:37 -03:00
Yash Singh 81ce012ed7 edit-dialog: remove unused spin_button_set_value
The number_of_occurrences was forcefully set to 0,
due to spin_button_set_value being placed incorrectly.
When a recurring event with limit_type as
GCAL_RECURRENCE_COUNT, having some 'x' number of
recurrences was opened in the edit-dialog, it showed
'0' as number_of_occurrences in place of 'x', which
is incorrect.

This patch removes this unnecessary line of code
and leads to correct assignment of number_of_occurrences.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-07-24 11:44:37 -03:00
Yash Singh a22bec6de3 edit-dialog: set correct value for repeat_combo
repeat_combo was assigned a value after repeat_duration
combo was assigned a value, which changed the value of the
repeat_duration combo due to the repeat_option_changed
function.

This patch fixes this issue by assigning the value to
repeat_combo prior to repeat_duration_combo.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-07-24 11:44:37 -03:00
Yash Singh 22fca75548 edit-dialog: show/hide Repeat widgets correctly
Currently, the repeat widgets - repeat_duration stack
and combobox are visible even when 'No Repeat' is
selected in repeat combobox.

This patch ensures that the repeat widgets are hidden
when 'No Repeat' is selected. When not selected,
repeat_duration_combo becomes visible which itself takes
care of the visibilty of the stack.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-07-24 11:44:37 -03:00
Yash Singh 6db25eacd6 edit-dialog: remove unnecessary condition check
An unnecessary condition check for assigning recurrence-changed
property of edit-dialog was causing a segmentation fault.

This patch removes this condition check and assigns the
recurrence-changed property correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-07-24 11:44:10 -03:00
Yash Singh 16bce2425e window: pop up recurrence-dialog only when required
Earlier, the recurrence-dialog would pop up even when user only
wanted to change the recurrence-property of an already recurring
event. This is incorrect behavior.

This patch fixes this issue by making sure that recurrence-dialog
doesn't pop up when the new recurrence-property chosen by the
user is different from what the event already has. In this case,
the user only wants to change the recurence-property of the event
and there's no use of the recurrence-dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-07-13 13:32:55 -03:00
Yash Singh 067e8ae765 edit-dialog: add 'Repeat' options for simple recurrences
Currently, creating recurring events is not supported
in gnome-calendar.

This patch adds a Repeat combobox with a list of
simple recurrences such as:

 * Monday - Friday events
 * Daily events
 * Weekly events
 * Monthly events
 * Yearly events

and also a list of recurrence-duration-types such as:

 * If an event should repeat forever
 * A date until which the event should repeat
 * Number of times an event should repeat

It enables the user to create simple recurring events and
even modify the recurrence-property of an already
recurring event.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-07-13 13:32:53 -03:00
Yash Singh 2c75e72582 event: add recurrence property
Earlier, an event had no recurrence property. Hence, the event's
recurrence pattern etc. could not be analysed, and as a result
could not be changed by the user. gnome-calendar just displayed
all the recurrences of a recurring event but had no 'readable'
knowledge regarding the characteristics of those recurrences.

This patch adds the recurrence property, which is basically
a GcalRecurrence structure linked to the event.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-07-13 13:32:52 -03:00
Yash Singh 59fcd01192 recurrence: add a function to check equality of recurrences
The gcal_recurrence_is_equal function checks if two recurrences are
equal or not. When a user is trying to modify the recurrence-rules
of an already recurring event, this function tells us if the
recurrence-dialog should pop up or not.

This patch also removes some unused code.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-07-13 13:32:49 -03:00
Georges Basile Stavracas Neto 72a3bb4168 quick-add-popover, event-widget: add translator comments
https://bugzilla.gnome.org/show_bug.cgi?id=784645
2017-07-10 22:57:00 -03:00
Abdullahi Usman 1360fe01e8 week-grid : seperate week's events overlaps.
The week view can display mutilple events that can partly or fully span
same time ranges.

But week view fails to make correct assumption about the width of events when
two or more events span some time ranges in which these events also span some
time ranges with other events, and whereby the number of these other events
that they span time ranges with does not coincide with the number of the events
that the other event also span.  Week view ended up calculating cells that
appears horizontally jointed up.  Also int16_compare() does not dereference the
pointer from g_ptr_array_sort() correctly and that makes it sort events
incorrectly and hence making events appears vertically jointed up.

If an event have other events in which they span some time, we calcuate its width
by taking into consideration of all the events that the other event may span
time with.  The event that has the higher number of time spans is considered.
We also save and retrieve our positions using UINT_TO_POINTER and POINTER_TO_UINT()
respectively, and then dereference the pointer from g_ptr_array_sort() correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=777416
2017-07-10 22:44:43 -03:00
Yash Singh 7ab4036335 recurrence: fix GDateTime to icaltime conversion
The month and year values extracted from until-date
of recurrences were accidentally interchanged.

This patch fixes that issue by making the correct assignment.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-07-10 22:37:26 -03:00
Yash Singh 27bb337f54 recurrence: Add recurrence struct to parse recurrence-rules
Currently, gnome-calendar has no component to deal
with recurrence-rules of events. This missing component
is however required to create and modify recurring events.

This patch adds the required GcalRecurrence component
which parses the recurrence-rules with details like:

 * Frequency of the recurring event
 * Duration of the recurrences:
	** If they repeat until a particular date
	** If they repeat a fixed number of times
	** If they repeat forever

and then stores these details in a suitable format
in the GcalRecurrence structure. The gcal-recurrence
functions simplify the task of handling and editing
recurrences. This structure is the first step towards
creating a new 'recurrence' property of an event.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-07-04 10:32:48 -03:00
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