Commit Graph
1361 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto e9a5a12d5e date-selector: remove hack
Seems like Gtk+ fixed the positioning code, and we don't
need this hack anymore.
2016-09-14 16:11:33 -03:00
Georges Basile Stavracas Neto 18c5607d87 edit-dialog: fix typo 2016-09-14 16:11:22 -03:00
Georges Basile Stavracas Neto 08fcf33a28 event-widget: don't DnD read-only events
Read-only events can't be moved, so don't allow it.

https://bugzilla.gnome.org/show_bug.cgi?id=771116
2016-09-14 14:10:13 -03:00
Georges Basile Stavracas Neto 7104c95ffb month-view: fix DnD highlight
https://bugzilla.gnome.org/show_bug.cgi?id=771115
2016-09-14 14:01:37 -03:00
Dominique Leuenberger 1b90c8b413 month-view: initialize variable
Some compilers seem to be over-pessimistic and abort the build with:

 gcal-month-view.c: In function 'gcal_month_view_drag_drop':
 gcal-month-view.c:908:32: error: 'timespan' may be used uninitialized in this function [-Werror=maybe-uninitialized]
            GDateTime *new_end = g_date_time_add (new_start, timespan);

Even though the usage of the variable is guarded by an equal if as the assignment

https://bugzilla.gnome.org/show_bug.cgi?id=770667
2016-08-31 17:16:40 -03:00
Georges Basile Stavracas Neto 56ae69d6c4 edit-dialog: keep start and end dates synchronized
Never let them enter in an invalid state, where the end
date is ahead of the start date.

https://bugzilla.gnome.org/show_bug.cgi?id=770263
2016-08-30 00:30:58 -03:00
Georges Basile Stavracas Neto 3560a9de43 edit-dialog: fix insensitive time choosers
They are hidden now, no need to handle the sensitive
state of them as well.
2016-08-30 00:30:58 -03:00
Georges Basile Stavracas Neto cd50bec506 project: fix build warnings
https://bugzilla.gnome.org/show_bug.cgi?id=770466
2016-08-29 23:08:39 -03:00
Ernestas Kulik 1cb71ea4a9 Don’t use GNOME_COMPILE_WARNINGS
GNOME_COMPILE_WARNINGS is still being used, despite its deprecated
status. This commit also tweaks configure.ac a little, removing
redundant macro calls and definitions and quoting all macro arguments.

https://bugzilla.gnome.org/show_bug.cgi?id=770466
2016-08-29 21:43:08 -03:00
nj4710 27ca660e77 month-view: highlight the whole cell of current day
In this commit, we changed the background area of current day.

Presently, the current day is highlighted by the number. This makes difficult for the user to identify it when there are lot of events.

To fix this, we changed the color of background and made background area equal to the cell's area.

https://bugzilla.gnome.org/show_bug.cgi?id=755946
2016-08-17 03:13:53 -03:00
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