Commit Graph
295 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto af6f2141ab window: use g_clear_pointer instead of g_date_time_unref
This would handle the case where the datetime is NULL for us.
2016-02-28 14:13:19 -03:00
Georges Basile Stavracas Neto 079750561a window: remove queued event on finalize
When the user removes an event, we first hide it and,
after a timeout, we remove it. The problem is that if
the user closes the window before the timeout is fired,
the event never gets deleted.

Fix that by deleting the event on finalize if there's
any event queued.

https://bugzilla.gnome.org/show_bug.cgi?id=762284
2016-02-18 15:36:56 -02:00
Georges Basile Stavracas Neto d5cd6c7fc9 window: don't block mainloop when showing dialogs
By using gtk_dialog_run(), we enter in a recursive mainloop
which blocks the parent's one. Because of that, we see weird
things like the quick add popover not still floating around.
2016-02-18 15:28:17 -02:00
Georges Basile Stavracas Neto b1184978b1 window: use GDateTimes to pass the range
Another case where we can improve the code by porting
to GLib's api.
2016-02-18 03:31:35 +01:00
Georges Basile Stavracas Neto 710ee5fc8f window: fix start & end ranges
When we apply a timezone, the ranges change. Therefore, we
should set the timezone to the date itself and then get the
range.
2016-02-17 19:00:07 +01:00
Georges Basile Stavracas Neto 9ff5e05f9c app: automatically load resources from base path
We don't have to load most of the menus we're currently loading
by using the very handy automatic resource loading.

This patch fixup so the app loads resources automagically.
2016-02-16 18:12:18 -02:00
Georges Basile Stavracas Neto bfe18b00df window: fix new event action 2016-02-16 17:53:16 -02:00
Georges Basile Stavracas Neto 9ba89e1db6 window: update calendar colors from popover
When we change the calendar color, everything that represents
this calendar must be updated to match the changes. The calendar
popover, however, wasn't aware of these changes and did not match
updates of calendars.

Fix that by destryoing and readding the row for the given calendar
when it changes.

https://bugzilla.gnome.org/show_bug.cgi?id=762069
2016-02-16 15:09:11 -02:00
Georges Basile Stavracas Neto 7c0e3776e1 window: use GcalQuickAddPopover internally
Saves a lot of code from the window file, and makes
things better. Yay!
2016-02-16 13:37:54 -02:00
Georges Basile Stavracas Neto 3c0c3646f4 utils: use GDateTime to build component
As part of our epic journey to GDateTime, and to
prepare ground for the future work, use GDateTime
as arguments for building the ECalComponent.
2016-02-16 11:54:35 -02:00
Georges Basile Stavracas Neto a5658e3993 window: remove source when finalizing
Sometimes we crash the window right after closing it
because we set a timeout for save_geometry() before
destroying it, and the timeout is called after the
window is destroyed.
2016-02-14 12:17:37 -02:00
Georges Basile Stavracas Neto 2775012346 manager: use GcalEvent on it's API
To make things consistend and clear, use the
GcalEvent class to handle events.
2016-02-14 12:17:37 -02:00
Georges Basile Stavracas Neto c65fe989fe window: use a GcalEvent to delete events
Instead of using the GcalEventData struct, use the
deleted event. It holds a reference until the event
gets destroyed.

With this commit, we can safely drop GcalEventData
structure, since it's not used anymore.
2016-02-14 12:17:37 -02:00
Georges Basile Stavracas Neto e31e6eeac0 edit-dialog: use GcalEvent internally
Instead of using the ESource + ECalComponent combination,
use the new GcalEvent class, which wraps up and simplifies
most of the code.

This commit adds a GcalEditDialog::event property, and
adapts the dialog (and everything dependant on it's code)
to use the GcalEvent class.
2016-02-14 12:17:37 -02:00
Georges Basile Stavracas Neto 0ec0ea8121 event-widget: use GcalEvent internally
This saves a lot of code, and is much saner to maintain.
2016-02-14 12:17:37 -02:00
Georges Basile Stavracas Neto 771d227520 window: turn into a final class 2016-01-19 20:27:21 -02:00
Georges Basile Stavracas Neto abd6fa8b2d window: properly case ::manager property getter
It's a readwrite property, thus it must have an
case PROP_MANAGER set in get_property.
2015-12-31 00:37:36 -02:00
Georges Basile Stavracas Neto 961bf5dc88 window: setup edit dialog from UI file
This commit sets up the edit dialog from the window's ui
resource file, in a series of commits that tries to move
all C code to the UI definitions.

Also, GcalManager is a full GObject class, not a simple
pointer. As such, update the property spec to be of type
object, not pointer.
2015-12-30 17:37:12 -02:00
Georges Basile Stavracas Neto b1540e3f41 window: code cleanup
Remove the unneeded code to manage search bar visibility,
since it is correctly hidden now. Also, clean up some UI
code.
2015-07-15 20:57:12 -03:00
Georges Basile Stavracas Neto 0c1df74735 month-view: add keyboard navigation
This big patch implements keyboard navigation for
Month view and the main window. Also, refactor
some of it's drawing code.
2015-07-15 20:40:55 -03:00
Georges Basile Stavracas Neto 1f666ba405 window: move forward/backward according to locale 2015-06-04 15:44:48 -03:00
Erick Pérez Castellanos d5cc7efcd0 build: fix merge leftovers 2015-05-25 12:43:49 -04:00
Georges Basile Stavracas Neto 87c02b520a source-dialog: hide itself on response event 2015-05-25 12:36:55 -04:00
Georges Basile Stavracas Neto c1b14e48d4 window: comment misleading destruction of calendar row 2015-05-25 12:36:55 -04:00
Erick Pérez Castellanos b04720135f window: sources are unique
There's no need to loop through the rest of the list once the ESource has been
found
2015-05-25 12:36:53 -04:00
Erick Pérez Castellanos 44480da71a window: I rather have these lines
I prefer a clean separation between declarations and code
2015-05-25 12:36:53 -04:00
Georges Basile Stavracas Neto 2b4e46a4b6 manager: notify when sources are enabled/disabled
Add the new signal for GcalManager::source-enabled that
notifies connected widgets about the source change. With
that, we can keep checkboxes syncronizes.
2015-05-25 12:35:58 -04:00
Georges Basile Stavracas Neto c3d34ae149 window: add a nice style to the calendar listbox 2015-05-25 12:35:58 -04:00
Georges Basile Stavracas Neto 3905622420 window: don't set the manager twice 2015-05-25 12:35:57 -04:00
Georges Basile Stavracas Neto 5862f1671f window: add source dialog to builder file again 2015-05-25 12:35:57 -04:00
Georges Basile Stavracas Neto 0142b0494e window: instance source dialog on init 2015-05-25 12:35:56 -04:00
Georges Basile Stavracas Neto 72eb5dd20b source-dialog: make remove action local to the dialog
Instead of delegating it to GcalWindow, take
the responsability to manage the source removal
logic.

This commit expose a problem we were trying to
avoid: make our widgets sensitive to source
modifications.
2015-05-25 12:35:33 -04:00
Georges Basile Stavracas Neto f70702a885 window: correctly set the source and mode
Cannot change to edit mode without actually
give the source to edit.
2015-05-25 12:35:31 -04:00
Georges Basile Stavracas Neto 102b5431fd source-dialog: better name the modes
Since we're not creating a calendar
as the default state, rename the mode
to NORMAL as it better describes the
dialog state.
2015-05-25 12:35:30 -04:00
Georges Basile Stavracas Neto e7af463290 window: release timeout source after undo 2015-05-25 12:35:28 -04:00
Georges Basile Stavracas Neto b43544cae7 window: update GcalSourceDialog::manager when the window's one is updated 2015-05-25 12:35:28 -04:00
Georges Basile Stavracas Neto 6657dad17f window: remove hash table usage
Replaced by g_object_{get|set}_data methods
2015-05-25 12:35:27 -04:00
Georges Basile Stavracas Neto 491e9d3e85 window: rename GcalWindow::make_row_for_source to GcalWindow::make_row_from_source 2015-05-25 12:35:27 -04:00
Georges Basile Stavracas Neto 17f56895dd window: use markup label for in-app notification 2015-05-25 12:35:26 -04:00
Georges Basile Stavracas Neto 9df8b8077d window: implement removing and undoing the removal of a calendar
We're still facing the bug where the just-added calendar segfaults when removed.
2015-05-25 12:35:26 -04:00
Georges Basile Stavracas Neto 4585b44941 window: remove annoying compile warning
Hey GCC, they're just pointers!
2015-05-25 12:31:07 -04:00
Georges Basile Stavracas Neto d6b4aef582 window: sort calendars by name 2015-05-25 12:31:07 -04:00
Georges Basile Stavracas Neto df1b7def8c window: refresh calendar list when a source is edited 2015-05-25 12:31:07 -04:00
Georges Basile Stavracas Neto c91d5bbb59 window: hide calendar popover when the dialog is trigged 2015-05-25 12:31:06 -04:00
Georges Basile Stavracas Neto b08165364a window: set the source dialog's manager field 2015-05-25 12:31:06 -04:00
Georges Basile Stavracas Neto 557ec083da window: set the source to be edited 2015-05-25 12:31:05 -04:00
Georges Basile Stavracas Neto 95af5c72d3 window: hide the dialog after the response 2015-05-25 12:31:05 -04:00
Georges Basile Stavracas Neto 143444ddd5 window: show source dialog when a calendar is activated 2015-05-25 12:31:05 -04:00
Georges Basile Stavracas Neto 7e9d722206 window: set source dialog to create mode 2015-05-25 12:31:05 -04:00
Georges Basile Stavracas Neto 6dccbfe431 window: show sources dialog 2015-05-25 12:31:05 -04:00