Commit Graph
1532 Commits
Author SHA1 Message Date
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
Mohammed Sadiq 1e471b1b0c quick-add-popover: focus entry after calendar selection
Pressing 'Enter' key shall always save the event.
So focusing on 'Add' button after selecting calendar is redundant.

Instead, focus on the entry, so that the user can add more text without
manually focusing.

https://bugzilla.gnome.org/show_bug.cgi?id=778373
2017-02-09 09:48:45 -02:00
Georges Basile Stavracas Neto d63e007a7a week-grid, week-view: improve hour sidebar rendering
The hour strings are too soft and can barely be read. Fix
that by setting a stronger color.

https://bugzilla.gnome.org/show_bug.cgi?id=777420
2017-02-09 09:21:28 -02:00
Georges Basile Stavracas Neto 6c2653809b week-grid: simplify drawing function
This patch simplifies the drawing function by removing
the unused layout and font descriptions.

https://bugzilla.gnome.org/show_bug.cgi?id=777420
2017-02-09 09:21:28 -02:00
Georges Basile Stavracas Neto cdc5bde96a week-grid: make sure events span at least 1 minute
When adding an event with the same start and end dates and
times, the event effectively spans 0 minutes, leading a division
by zero and causing varius UI glitches.

Fix that by making sure events span at least 1 minute.

https://bugzilla.gnome.org/show_bug.cgi?id=777414
2017-02-01 15:06:56 -02:00
Georges Basile Stavracas Neto e119d27718 week-grid: enforce a minimum width
https://bugzilla.gnome.org/show_bug.cgi?id=777414
2017-02-01 15:06:56 -02:00
Piotr Drąg 0b1dd67d2d Fix translator comments
They need to be exactly one line above a string to show up in .po files.
2017-01-26 04:58:52 +01:00
Georges Basile Stavracas Neto e4555ea292 search-view: various fixes 2017-01-24 09:22:57 -02:00
Georges Basile Stavracas Neto 53f9158f25 search-view: only decrease search counter when something is removed
Because we were blindlessly decreasing the search hit counter without
considering that we could've not removed anything, the search hit
counter is going nuts.

Fix that by properly checking if something was removed, and only decrease
the search hit counter when that happens.
2017-01-24 08:59:00 -02:00
Piotr Drąg c5d92c22d5 Use Unicode en dash in a translatable string
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772263
2017-01-17 15:21:52 +01:00
Georges Basile Stavracas Neto e74cfc0e22 project: move views to views/ folder 2017-01-17 11:28:48 -02:00
Georges Basile Stavracas Neto 7a21e1e5ac week-header: implement drag n' drop 2017-01-17 11:24:22 -02:00
Georges Basile Stavracas Neto 4974e03216 event-widget: properly draw dnd icon
Instead of using a pixbuf and relying on the underlying GdkWindow,
simply perform a custom draw() over a manually created cairo context
and avoid nasty crashes.
2017-01-17 11:24:22 -02:00
Georges Basile Stavracas Neto 530aaa24c4 week-grid: implement drag n' drop 2017-01-17 11:24:22 -02:00
Georges Basile Stavracas Neto 096327e046 week-view: set the header's and grid's manager as well 2017-01-17 10:50:32 -02:00
Georges Basile Stavracas Neto 529acca239 week-grid: fix index sorting
This was causing conflicts on event overlapping calculation.
2017-01-09 18:25:55 -02:00
Georges Basile Stavracas Neto 30cb8a5020 week-header: improve rendering of selection 2016-12-15 17:32:27 -02:00
Georges Basile Stavracas Neto f013d7442e week-header: fix event margins 2016-12-15 17:09:45 -02:00
Georges Basile Stavracas Neto 9da0704e37 week-grid: set child widgets' orientation to vertical 2016-12-15 17:03:26 -02:00
Georges Basile Stavracas Neto 4074bee50e event-widget: implement GtkOrientable
So that we can control how much information, and how this
information is displayed, depending on the widget orientation.
2016-12-15 17:02:51 -02:00
Georges Basile Stavracas Neto 69ad53352d week-grid: remove unused vars 2016-12-15 17:01:20 -02:00
Georges Basile Stavracas Neto 33f1e4cd31 week-header: minor improvements on date selection 2016-12-14 17:18:48 -02:00
Georges Basile Stavracas Neto 84c411e505 week-grid: fix inversed selection on RTL languages 2016-12-14 17:11:37 -02:00
Georges Basile Stavracas Neto ffaf7153d7 week-header: implement event creation 2016-12-14 17:00:11 -02:00
Georges Basile Stavracas Neto 55d9232b0c quick-add-popover: fix creation of timed events
On week view, we want to create events that span 1 day, but with
different hours. The current code of Quick Add popover, however,
doesn't support that, as the only test case up to now was month
and year views - both not making use of timed events.

Fix that by adding the necessary comparisons, adapting the strings
and allowing events with the same date but different times.
2016-12-13 20:19:28 -02:00
Georges Basile Stavracas Neto ab3b80f3b9 event-widget: factor out clock format function
This function will be used by other pieces of code later. We also gain
a tiny performance improvement, as only one GSetting is ever created.
2016-12-13 20:17:28 -02:00
Georges Basile Stavracas Neto 9a07dad0e9 week-grid: minor fixups 2016-12-13 16:29:24 -02:00
Georges Basile Stavracas Neto e8906c9e04 week-view: smoothly scroll the grid when moving to today 2016-12-13 16:29:07 -02:00