Commit Graph
1559 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto 82aa5fadb0 week-header: correctly check for updatable events
When comparing events' dates against week dates, we must
be careful to compare UTC with UTC. Otherwise, some events
will be left, specially at the first and last days.
2017-03-17 21:09:33 -03:00
Georges Basile Stavracas Neto f1b59d64d2 week-header: fix dnd at first column 2017-03-17 16:38:59 -03:00
Georges Basile Stavracas Neto 8b718ee0a0 week-view, week-header: instrument more functions 2017-03-17 16:38:28 -03:00
Georges Basile Stavracas Neto fa7f579592 window: correctly check today for week view 2017-03-17 16:11:42 -03:00
Georges Basile Stavracas Neto 002271ebb1 views: get rid of current date
We can easily track the current date with GDateTime API,
so we don't actually need the current date field.
2017-03-17 15:49:12 -03:00
Georges Basile Stavracas Neto 1dadd34409 week-view: instrument possibly crasher function 2017-03-17 15:06:02 -03:00
Georges Basile Stavracas Neto be137fca02 manager: unify completion flags
Instead of having a completion flag for GOA and calendars,
unify both of them and simplify some code.
2017-03-17 12:46:40 -03:00
Georges Basile Stavracas Neto 339b49e7d5 views: cleanup code 2017-03-17 11:13:19 -03:00
Georges Basile Stavracas Neto 0d44471546 window: cleanup code 2017-03-17 10:51:37 -03:00
Georges Basile Stavracas Neto d1a24d8adb application: cleanup code 2017-03-17 10:35:56 -03:00
Georges Basile Stavracas Neto 0b07d7d27d manager: improve code
This is a big cleanup commit where I tried my best to
make GcalManager code more structured and readable. This
included both cosmetic and functional changes.
2017-03-17 10:14:25 -03:00
Georges Basile Stavracas Neto cf6cdfd2aa project: use cairo_surface_t when possible
We can avoid an entire roundtrip from surface > pixbuf > surface
if we simply pass the surface to GtkImage. We also save quite
a bunch of debug lines.
2017-03-17 10:14:25 -03:00
Georges Basile Stavracas Neto 478db350e3 project: intrument functions
Add the newly added macros to provide useful tracing
information.
2017-03-17 10:14:25 -03:00
Georges Basile Stavracas Neto 7b05abea90 debug: add debug macros 2017-03-17 10:14:25 -03:00
Georges Basile Stavracas Neto d5825bbd35 project: override log domains
This way, we can have more useful debug spils.
2017-03-17 10:14:25 -03:00
Georges Basile Stavracas Neto 5d980de797 log: add initial logging capabilities 2017-03-17 10:14:25 -03:00
Kevin Lopez c3bffd5eeb search-view: no show search view if field is empty
When the search field is empty is not needed show the result drop down.

https://bugzilla.gnome.org/show_bug.cgi?id=747962
2017-03-16 21:32:04 -03:00
Joyjit Choudhury 35b2f90cab week-view: set correct week number
In this commit, the correct week number is set in week-view.

The problem is, the week number of week-view is being set according to
the first day of the week (if the first and last day of the week
are in the same year), or the first and last day of the week
(if the first and last day are in different years).

To fix this, the week number is being set according to the middle day
of the week (according to ISO 8601 standards), resulting in correct
week numbers.

https://bugzilla.gnome.org/show_bug.cgi?id=779331
2017-03-16 20:31:37 -03:00
Georges Basile Stavracas Neto 0266202d40 week-header: continue fixing event positions 2017-03-15 09:50:51 -03:00
Georges Basile Stavracas Neto 669869cf3f week-header: fix calc of events' start and end positions
Another shot in this issue. Again.

https://bugzilla.gnome.org/show_bug.cgi?id=780051
2017-03-15 17:45:49 +05:30
Georges Basile Stavracas Neto d4ef9b22ca week-grid: consider daylight when calculating event position
There are some weird cases around the globe where the timezone
changes in the middle of the day. In GMT-8:00, for example, the
DST changes at 2:00 am. This makes the timezone of thestart of
the week different from the event's timezone, and somehow the
GLib API doesn't take that into account when calculating the
diff between two dates.

Fix that by also considering different timezones when calculating
the event start and end positions.

https://bugzilla.gnome.org/show_bug.cgi?id=780079
2017-03-15 04:52:33 -07:00
Georges Basile Stavracas Neto 0b0dee101a quick-add-popover: only focus entry if popover is visible
Otherwise, we end up with a warning and many keybindings won't
work anymore.
2017-03-14 21:51:37 -03:00
Georges Basile Stavracas Neto 39d871d2ef week-grid: disconsider reported min-width for events
Sometimes, we'll need to ignore the reported minimum sizes
to be able to set the width of events to an acceptable
size. This is the case of the week grid.

https://bugzilla.gnome.org/show_bug.cgi?id=780052
2017-03-14 20:50:53 -03:00
Georges Basile Stavracas Neto f608f8fd9d week-header: don't account first weekday twice
The auxiliary functions to calculate the week start
already takes the first weekday into account. We,
however, were considering it again when calculating
the event position.

Fix that by only considering it once, through the
get_start_of_week() function.

https://bugzilla.gnome.org/show_bug.cgi?id=780051
2017-03-14 20:27:32 -03:00
Georges Basile Stavracas Neto 0dcf86b7c2 week-header: improve drag and drop
The rudimentary drag n' drop support should also deal
with the following corner cases:

           All Day
Multiday |   TRUE   |   FALSE    |
         |----------|------------|
    TRUE |   utc    | no changes |
   FALSE |   utc    |    utc     |

https://bugzilla.gnome.org/show_bug.cgi?id=777424
2017-03-14 20:19:28 -03:00
Georges Basile Stavracas Neto c33d820387 week-grid: use a proper function to queue redraw
Same as 97698ad1c9 for the Week grid.
2017-03-14 20:17:46 -03:00
Georges Basile Stavracas Neto 180621cd91 week-view: also check for realized
Be more strict about the checks, and avoid crashes.
2017-03-14 15:53:09 -03:00
Georges Basile Stavracas Neto 8102912541 window: set the correct date range for week view
Previous commits broke the week view's date range (more
than it was already broken). This patch fixes that by
using the correct method to get the week start.

https://bugzilla.gnome.org/show_bug.cgi?id=779967
2017-03-15 00:02:17 +05:30
Yash Singh 6f87ada70d window: set edit dialog's event to NULL after saving
Earlier the app used to crash when a new event was added using the
'Edit Details' buttion/dialog. This was happening because edit dialog's
event was set to NULL before the event was being stored in the calendar
through the 'edit_dialog' and hence the app was crashing.

This patch fixes the above-mentioned issue by saving the event before
setting the edit dialog's event to NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=779733
2017-03-12 12:42:02 -03:00
Georges Basile Stavracas Neto 97698ad1c9 week-header: use a proper function to queue redraw
We were using gtk_widget_queue_draw() as a callback to
a GTimeoutSource, which expects a boolean return type.
This is clearly wrong, and has the chance to cause
a segmentation fault.

Fix that by passing a function with the apropriate signature.

https://bugzilla.gnome.org/show_bug.cgi?id=779823
2017-03-10 08:00:39 -03:00
Georges Basile Stavracas Neto 36cabc0aff Revert "edit-dialog: fix date span backward"
This reverts commit 1228f05a90.
2017-03-06 22:19:34 -03:00
Andrei Ceapa 1228f05a90 edit-dialog: fix date span backward
The problem is that the end date might change to one before the
start date when modifying the start time.

Treat some cases taking into consideration the start date and start
time related to the fact that an event is spanning all day or not.
Separate the handling of the start date and start time.

https://bugzilla.gnome.org/show_bug.cgi?id=772100
2017-03-06 21:56:11 -03:00
Georges Basile Stavracas Neto e406f93239 event-widget: escape event summary
Now that we may set event markups, we have
to be careful to escape the event summary
and make sure that we always pass a valid
markup.
2017-03-06 21:56:11 -03:00
Valentin Negoescu 7aa4cefa8e source-dialog: update calendar image color
After editing the color of a calendar its image is not
updated as well. Fix this by updating the image when the
edit is finished.

https://bugzilla.gnome.org/show_bug.cgi?id=773869
2017-03-05 20:51:26 -03:00
Georges Basile Stavracas Neto eb10c84811 window: fix warning 2017-03-05 20:36:41 -03:00
Georges Basile Stavracas Neto 31aa709487 week-header: fix placement of events
When the first weekday wasn't monday, we were
miscalculating the initial and final positions
of the widgets.

Fix that by properly calculating the initial and
final positions.
2017-03-05 20:32:33 -03:00
Georges Basile Stavracas Neto 0d27d36218 window: correctly subscribe the week view
The week view was being subscribed to the wrong dates,
because the window was miscalculating the start of week
on sundays.

Fix that by properly calculating the start of week offset.
2017-03-05 20:31:34 -03:00
Georges Basile Stavracas Neto 1d8993d450 window: use gcal_clear_datetime
We have our own macro to make the code a little bit
more pleasant to read, let's just use it.
2017-03-05 20:30:08 -03:00
George Willian Condomitti 1ee760ac5c search-view: start searching after 3 characters and 500ms
Add timeout and minimum string length (3 characters) before triggering
searching routine.

App freezes and lags for a few seconds once one starts typing due to
the huge amount of matched events.

Search will be triggered only if passed time since last inserted
charactere is at least 500ms and three characteres have been entered.
If length is already >= 3 but user keeps typing in a quick fashion
(i.e. faster than 500ms per charactere) pre-scheduled search routine
(timeout from the last inserted char) is cancelled and a new one
is created.

https://bugzilla.gnome.org/show_bug.cgi?id=775549
2017-03-03 21:14:52 -03:00
Joyjit Choudhury 06cdeb61ed week-view: set the first weekday for week-header & week-grid
In this commit, the first weekday is set for week-header & week-grid.

The issue is, the first weekday is being set only for week-view,
resulting in incorrect display of weekdays in the week-header.

To fix this, the first weekday for week-header & week-grid is set
along with that of week-view.

https://bugzilla.gnome.org/show_bug.cgi?id=779346
2017-03-02 07:20:31 -03:00
Isaque Galdino 0bf0c9e7cf multi-choice: Fix endless timeout
There are two mapped events for each back/forward buttons in this
widget: button-press and button-release.

When you reach the limits like January and December, button-release is
lost, and you don't get it anymore. That caused button_timeout function
to not be disable anymore, so it's kept in loop forever.

This code fix checks in button_timeout function if any of the back/
forward buttons are still mapped. If not, it prevents from calling
button_timout, stopping the loop.

https://bugzilla.gnome.org/show_bug.cgi?id=776459
2017-02-27 08:46:52 -03:00
Georges Basile Stavracas Neto e69c9aa09c week-header: fix untranslated strings 2017-02-27 08:46:52 -03:00
Georges Basile Stavracas Neto aa9b83a92e window: reset edit dialog's event on response
Currently, we keep the to-be-edited event of the Edit
dialog when it sends any response. However, this can
cause issues since we can edit the event, press Esc and
see that the event didn't change but Edit dialog keeps
the changes.

Fix that by always resetting the edited event to NULL
after a response.

https://bugzilla.gnome.org/show_bug.cgi?id=778644
2017-02-20 08:29:59 -03:00
Georges Basile Stavracas Neto ce52cdd9ce week-header: fix double dnd highlight 2017-02-14 18:00:05 -02:00
Georges Basile Stavracas Neto 7cf41f8f45 month-view: fix warning on closing overflow popover 2017-02-14 18:00:05 -02:00
Mohammed Sadiq 1449233382 application: cleanup finalize method
Calendar now segfaults due to faling function
gtk_style_context_remove_provider_for_screen in application finalize method.

As application finalize method is called only when the application closes,
there isn't any hard requirement to cleanup every trailings. Operating
System shall take care of that.

So removing the failing functions so as to not segfault on exit anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=773871
2017-02-09 11:20:49 -02:00
Georges Basile Stavracas Neto 006ee30495 Revert "application: don't remove providers from screen when finalizing"
This reverts commit 0ce04c0eeb.
2017-02-09 11:20:28 -02:00
Georges Basile Stavracas Neto 0ce04c0eeb application: don't remove providers from screen when finalizing
When finalizing the application, it is possible that the main window
had already been destroyed and the Gtk+ CSS machinery to stop working.
We currently try to remove the CSS providers from screen when finalizing,
which (i) has no effect, and (ii) causes a segfault.

Fix that by simply destroying the CSS providers, and not trying to
remove them on finalize.

https://bugzilla.gnome.org/show_bug.cgi?id=773871
2017-02-09 11:09:40 -02:00
Yash Singh 6ce45743c6 gcal-window: Declare 'view' as type guint32
Earlier 'view' was declared as a 'guint' but was used as 'gint'.
This patch changes the declaration of 'view' to gint32.

https://bugzilla.gnome.org/show_bug.cgi?id=778299
2017-02-09 10:36:05 -02:00
Georges Basile Stavracas Neto 8f34049793 views: sync header labels' style
The Week view exposed a bug where we had different
CSS selectors for the exact same label. This made
them look inconsistent, with different colors and
paddings.

Fix that by ensuring they all use the same style
class. The Year view drawing code needed to be
reworked a little.

https://bugzilla.gnome.org/show_bug.cgi?id=778391
2017-02-09 10:28:28 -02:00