Commit Graph
1351 Commits
Author SHA1 Message Date
Ernestas Kulik 7243f703c3 month-view: update events after dnd
The month view is not updated after a DnD operation. This commit marks
the children as changed after a drop.

https://bugzilla.gnome.org/show_bug.cgi?id=769470
2016-08-11 19:05:01 +03:00
Ernestas Kulik 04617fc06b year-view: fix dnd
Currently, the end date is set by calling gcal_event_set_date_end() with
new_start instead of new_end, which is incorrect.

With the former issue fixed, the difference evaluates to one less than
required when dragging to a later date. This can be fixed by calculating
the drop date by adding to the start date and adding the difference.

This commit fixes both issues.

https://bugzilla.gnome.org/show_bug.cgi?id=769470
2016-08-11 19:05:01 +03:00
Ernestas Kulik b5fb1d4ec3 month-view: fix dnd
Currently, the event is moved by a number of cells, calculated from the
start date and the cell index. The problem with that is that it does not
work with events, whose start and end dates of which are on different
months or years. This commit changes the logic so that the start date is
calculated by taking the year and month difference into consideration
and the end date is set by adding the event length to the adjusted start
date.

https://bugzilla.gnome.org/show_bug.cgi?id=769470
2016-08-11 19:05:01 +03:00
Ernestas Kulik 46a05e5d00 edit-dialog: fake inclusive end date for all-day events
Currently, all-day multi-day events are displayed inconsistently with
regard to other calendar applications. That is due to strict following
of RFC 5545, which mandates non-inclusive all-day multi-day event end
dates. This commit makes the edit dialog display a faked date for such
events.

https://bugzilla.gnome.org/show_bug.cgi?id=769300
2016-08-03 16:41:14 +03:00
Ernestas Kulik c16864ff97 time-selector: fix 12-hour format
Currently, the date selector allows hours in range [0; 11], which is not
the convention. This commit fixes the conversion logic.

https://bugzilla.gnome.org/show_bug.cgi?id=756377
2016-07-28 16:40:56 -03:00
Ernestas Kulik d0143db01b time-selector: fix AM to PM time logic
Currently, the hour component of the time is doubled when switching from
AM to PM, which is incorrect. This commit fixes the logic by adding 12
hours when switching to PM.

https://bugzilla.gnome.org/show_bug.cgi?id=765370
2016-07-27 16:36:36 -03:00
Ernestas Kulik dd4142f255 edit-dialog: set time format unconditionally
If GcalEditDialog.format_24h is initialized to zero, the call to
gcal_edit_dialog_set_time_format() from GcalWindow will not make
period_combo boxes visible on systems, where 12-hour clocks are used.
This commit fixes that by removing the if statement from the function.

https://bugzilla.gnome.org/show_bug.cgi?id=765370
2016-07-27 16:36:36 -03:00
Ting-Wei Lan f8a3c7731c date-chooser: don't reimplement get_first_weekday
Function calendar_get_week_start do the same things with the same code as
function get_first_weekday, so it is better to remove calendar_get_week_start
and switch all the use of calendar_get_week_start to get_first_weekday.

This also fixes build problems on non-glibc systems because get_first_weekday
provides fallback for non-glibc systems.

https://bugzilla.gnome.org/show_bug.cgi?id=769140
2016-07-27 01:56:41 -03:00
Lapo Calamandrei e3d29c989e date-selector: change style class on other month days
use .other-month in place of .dim-label since the .dim-label style
was not fitting, so better to use a specific class then a generic
one.
2016-07-26 18:58:52 +02:00
Georges Basile Stavracas Neto cef7f02a65 date-selector: update text even for today
When the date selector is initialized, the text is
blank, even when the date is set for today.

Fix that by updating the text when setting the date.
2016-07-24 20:09:37 -03:00
Georges Basile Stavracas Neto faf85a7fb0 date-chooser: support hovering days
Another fixup in order to make the current date chooser
more streamlined with GNOME Shell's calendar.
2016-07-23 17:47:12 -03:00
Georges Basile Stavracas Neto 93900ae9e9 date-chooser: tweak style
To keep the current date chooser in sync with
GNOME Shell, tweak the week names to show only
the first, upcased letter of the week name.

Also, this commit avoids making day number circles
ellipses when the week number is not present.
2016-07-23 17:47:12 -03:00
Georges Basile Stavracas Neto 2744f5acd2 date-selector: bind weekday numbers with desktop
The current implementation of the new calendar widget
accepts showing the week numbers in a modern and much
more consistent way.

The behavior, however, is not aligned with the rest of
the application and the desktop, which share a setting
to show or hide the week number.

Fix that by synchronizing the new calendar's week number
property with the specific setting.
2016-07-23 17:47:11 -03:00
Georges Basile Stavracas Neto bdac4e4c79 date-selector: turn into a entry
After making the date selector use the brand
new date chooser widget, it is now time to make
it an entry.

This commit, then turns GcalDateSelector into a
GtkEntry subclass, and add all the plumbing that
is necessary to make it work as such.

As a side effect, this commit adds rudimentary
natural language support for parsing dates.
2016-07-23 17:47:11 -03:00
Georges Basile Stavracas Neto 4ef9f75dfb date-selector: move to use the new date chooser
After adding the new GcalDateChooser widget, change the
current date selector to use it as the internal widget
of the popover.

The next logical step is turning GcalDateSelector into
an entry.
2016-07-23 17:47:11 -03:00
Georges Basile Stavracas Neto c2dca8a3dc date-chooser: add date chooser widget
This is mainly a copy-paste from an old branch authored
by Matthias Clasen. The code style was updated to match
Calendar's one, and the theming was improved a little bit.
2016-07-23 17:47:11 -03:00
Lapo Calamandrei 679796b403 window: remove the separator from calendar rows 2016-07-08 20:59:03 -03:00
Georges Basile Stavracas Neto 3d033e1f5f window: toggle calendar visibility when selecting the row
Instead of opening the calendar for editing, toggle its visibility
when clicking the listbox row.
2016-07-08 20:59:03 -03:00
Georges Basile Stavracas Neto 33d9901c49 search-view: don't subscribe to invalid dates 2016-07-08 20:53:56 -03:00
Georges Basile Stavracas Neto d7e082af0f window: add "calendar-color-image" in calendar popover 2016-07-08 16:53:57 -03:00
Georges Basile Stavracas Neto 243c8b75da quick-add-popover: add "calendar-color-image" css class in rows 2016-07-08 16:42:23 -03:00
Georges Basile Stavracas Neto cb7f195966 utils: add "calendars-list" css class to the container
Following the previous commit, add the CSS class to the GtkBox
that is the container of the calendars.
2016-07-08 16:27:49 -03:00
Georges Basile Stavracas Neto f528a36bdb window: use a circle icon for calendars' popover 2016-07-08 16:17:32 -03:00
Georges Basile Stavracas Neto a1882ff25e utils: add calendar-color-image css class to popover icons 2016-07-08 16:16:19 -03:00
Georges Basile Stavracas Neto a5634dc5fb edit-dialog: put the time selectors in a revealer 2016-07-06 18:54:59 -03:00
Georges Basile Stavracas Neto 025d931da8 edit-dialog: use circular icons for sources
They look nicer in the current UI.
2016-07-06 18:54:59 -03:00
Georges Basile Stavracas Neto 9e17710052 edit-dialog: implement moving events between sources
After adding the button in the headerbar, it is natural to
bring back the ability to move events between sources.

This commit finally includes the usage of GcalManager:move_event_to_source
function, which was implemented ages ago.
2016-07-06 18:54:59 -03:00
Georges Basile Stavracas Neto bbcf20cf44 edit-dialog: add a button in the headerbar
This button will be used to select the new source of the event.
2016-07-06 18:54:59 -03:00
Georges Basile Stavracas Neto 7844122dd2 event-widget: avoid crash when retrieving the DnD pixbuf
Since we're storing the GdkWindow relative to the event widget,
it's usually safer to create a pixbuf of the widget *after* it's
drawn, and not while it's being drawed.

This commit moves the pixbuf retrieval code to the draw-begin
implementation, so we only create the pixbuf when actually
using it.
2016-07-06 15:57:19 -03:00
Georges Basile Stavracas Neto c406b604e2 edit-dialog: fix Reminders dim label size 2016-07-06 12:38:09 -03:00
Georges Basile Stavracas Neto dc1f742cfe edit-dialog: make buttons sensitive when removing alarm 2016-07-06 03:13:38 -03:00
Georges Basile Stavracas Neto db2983be61 edit-dialog: sort alarms by relative date 2016-07-06 03:01:56 -03:00
Georges Basile Stavracas Neto 9723d60233 edit-dialog: make already-added alarms' buttons insensitive
Since we only support 1 alarm per time, we have to check and
eventually make insensitive the buttons related to the alarms.
2016-07-06 03:01:56 -03:00
Georges Basile Stavracas Neto 2e7d17fe63 edit-dialog: implement add alarm popover
The new popover handles all the possible alarms we support.
2016-07-06 03:01:56 -03:00
Georges Basile Stavracas Neto 2a18761908 edit-dialog: show available alarms
This commit introduces the ability in Edit dialog to
display the currently available alarms, as well as basic
editing of these alarms.

Currently, only removing the alarms and modifying it to
play a sound or not is available. The following up commit
will add the ability to add new alarms.
2016-07-06 03:01:56 -03:00
Georges Basile Stavracas Neto 19d68573dd utils: move utility method to get alarm's minutes 2016-07-06 03:01:56 -03:00
Georges Basile Stavracas Neto f518cba8e4 edit-dialog: simplify action handling
Instead of keeping a ref to the GcalEditDialog::select-calendar
action, use the builtin facilities and simplify the action
handling by using a const structure.

This is also a preparation for the next few commits where alarms
will be added.
2016-07-06 03:01:56 -03:00
Georges Basile Stavracas Neto 1ddc690810 event: add support for alarms
This commit prepares GcalEvent to handle alarms. Basically,
it is now able to load the current alarms of an event, and add
and remove alarms for them.
2016-07-06 03:01:56 -03:00
Georges Basile Stavracas Neto dfdaa3a590 year-view: simplify empty sidebar list calculation 2016-07-05 23:55:33 -03:00
Georges Basile Stavracas Neto 9fcb224032 window: avoid a crashing timeout
If the user quickly performs a search, open up the calendar
and close it immediately after, the timeout for showing the
event is mistakenly called after the window is destroyed and
causes Calendar to crash.

Fix that by keeping the source id tracked, and realizing it
on finalize().
2016-06-30 00:01:06 -03:00
Georges Basile Stavracas Neto 58b193f886 manager: keep the Shell's activated event alive
Currently, the user performs a search in Shell and activates
the result. That should show the edit dialog with the event
being edited, but it's not happening correctly.

Debugging the warnings generated, it was found that the event
was being unref()d and, obviously, that was not what we wanted.

Fix that by only unref()ing the events we don't want, and keeping
the wanted event alive.
2016-06-30 00:01:06 -03:00
Georges Basile Stavracas Neto 33c7031164 project: remove GbScrolledWindow
The max-content-height property was ported to GtkScrolledWindow,
which means we don't have to use a custom class anymore.
2016-06-17 18:18:38 -03:00
Isaque Galdino 3dbe4addeb year-view: Popover position
Year view was placing popover to mouse click (x,y) position. That was a
little odd because sometimes popover was placed above the selected day.

This patch address that by placing popover always out of the day box.

When selecting the whole month or more than one day, popover will also
be placed out of the month box. reducing the chance to cover selected
days.

https://bugzilla.gnome.org/show_bug.cgi?id=743306
2016-06-17 18:00:32 -03:00
Georges Basile Stavracas Neto de921ff54b source-dialog: open file when response is ok
The source dialog currently skips the file selected by
pressing the Open button.

Fix that by also considering the response of the dialog.
2016-06-01 11:59:22 -03:00
Iain Lane 9b358eb0ba year-view: Use the new schema from gsettings-desktop-schemas
So that we don't have to depend on GNOME shell.

https://bugzilla.gnome.org/show_bug.cgi?id=764001
2016-05-31 14:18:13 -03:00
Georges Basile Stavracas Neto 82b5953b76 month-view: fix invalid cell calculation 2016-05-21 19:15:14 -03:00
Georges Basile Stavracas Neto 1c90791d3b year-view: fix hover & dnd drawing on RTL locales 2016-05-21 19:06:15 -03:00
Georges Basile Stavracas Neto 5960a45d00 month-view: consider the days delay when dealing with the cell
The cell number does not consider the days delay, thus is not
the current day. To find the current day, we must remove the
days delay.
2016-05-21 19:02:39 -03:00
Georges Basile Stavracas Neto 88730dbafb year-view: don't render DnD when it leaves 2016-05-21 18:54:47 -03:00
Georges Basile Stavracas Neto 82c7918b15 year-view: implement the ::drag-drop operation
This magical commit finally implements the Drag and Drop
on Year view, enabling users to drop events from the sidebar
to the year navigator.
2016-05-21 18:54:47 -03:00