Commit Graph
1789 Commits
Author SHA1 Message Date
Florian Brosch 8d85af0960 weather: Prepare global time zone support.
This patch allows to change time-zones for
weather reports.
2017-12-11 21:23:19 -02:00
Florian Brosch 13342ac82e weather: Properly extract and translate weather information.
Completes commit 98cc78d6de66fc3a79abd9148ba03e9b21f89fb1.
2017-12-11 21:23:19 -02:00
Florian Brosch d7c9e70c31 weather: Simplify and inline property param flags 2017-12-11 21:23:19 -02:00
Florian Brosch 17af30b19c weather: Allow to set a fix location. 2017-12-11 21:23:19 -02:00
Florian Brosch 83bec27ad5 Initial weather service.
This commit introduces two new classes:

 1. GCalWeatherService
 2. GCalWeatherInfo

GcalWeatherservice picks-up the current location and periodically
fetches weather reports represented by GcalWeatherInfo.

The weather part is not complete yet.
2017-12-11 21:23:19 -02:00
Guenther Wutz 0f6efd8668 utils: reworked uri splitting with help of libsoup
Currently we split a URI string with a Regex which is error prone. As
libsoup already provides a facility to parse a URI into its parts
we should use this instead. Therefore our utility method is not necessary anymore.
2017-12-11 20:08:09 +01:00
Mohammed Sadiq f1a8aaed5f window: Simplify navigation code
Using <accelerator> in GtkBuilder can simplify lots of C code.
2017-12-06 21:40:15 +05:30
Mohammed Sadiq fd3cb3e9b5 window: Reuse window-state-changed callback
window-state-changed signal is already handled in window_state_method.
It is better not to override it again in class_init function.
2017-12-06 21:40:15 +05:30
Mohammed Sadiq 75ad9228f6 window: Simplify saving/loading window states
Follow https://wiki.gnome.org/HowDoI/SaveWindowState

* Use tuples in gsetting schema to save size and position
* Save changes to variable instead of saving to gsettings after every timemout
* Save the changes back to gsettings when the window is finalized.
2017-12-06 19:16:40 +05:30
Georges Basile Stavracas Neto 06f4a5b182 Merge branch 'mcatanzaro/leak' into 'master'
event: Fix a minor leak

See merge request GNOME/gnome-calendar!6
2017-12-06 11:04:02 +00:00
Georges Basile Stavracas Neto 89e90fec6d Merge branch 'wip/mcatanzaro/timezone' into 'master'
Events created in month or year view are created with incorrect time and missing timezone

Closes #168

See merge request GNOME/gnome-calendar!7
2017-12-06 10:45:42 +00:00
Georges Basile Stavracas Neto 276ecef0eb Merge branch 'wip/mcatanzaro/tooltips' into 'master'
event-widget: Fix time in tooltip text

Closes #225

See merge request GNOME/gnome-calendar!8
2017-12-06 10:40:51 +00:00
Michael Catanzaro 0724d4092e event: Save local time correctly
The old code here was not setting tzid correctly. It me took hours to
figure out how to do this, but it turned out to be simple once I found
the right place, buried deep in the e-d-s source code.

Now, ideally we would not change the timezone of the event every time we
edit it. But some big changes in how GNOME Calendar tracks timezone are
going to be required if we do that. In particular, I believe we would
have to stop saving all day events in UTC, and give up on using
GDateTime as we do now, and track timezone completely separately
everywhere using icaltimezone. This is what e-d-s does, and it's
probably what we should be doing too. But that would be a big change.
This commit solves the basic problem, which is to ensure the event is
scheduled for the right time, regardless of timezone.

This finally completely fixes #168.
2017-12-05 21:54:39 -06:00
Michael Catanzaro a7304ed9b0 event: Restore handling of all day events
This brings back the original handling of all day events that we had
before I reverted the previous commit.
2017-12-05 21:54:39 -06:00
Michael Catanzaro 281ed44f1c Revert "event: correctly store timezones"
This reverts commit ce2c955269.

This commit is not right. Lots of code in Calendar relies on being able
to set the timezone of a GcalEvent, and this results in us always
ignoring the timezone set by Calendar in preference to whatever happened
to be in the ECalComponentDateTime previously. That might not be so bad,
but additionally, the time is not adjusted accordingly, so this actually
results in the time of events changing unexpectedly from what Calendar
is trying to set.

The code to explicitly store UTC times for all day events is OK (I
guess) and will be restored in a subsequent commit.
2017-12-05 21:54:39 -06:00
Michael Catanzaro 1d8a164634 event: Fix changing the timezone
g_date_time_equal() corrects for timezone offsets to ensure that, e.g.,
6 AM CST is treated as equal to 12 PM UTC. This means attempts to change
the start and end times of events to the same time in another timezone
are currently failing. We need to remove this attempt at optimization
because it prevents gcal_event_set_timezone() from ever doing anything.
2017-12-05 21:53:00 -06:00
Michael Catanzaro 8740ca2df1 event-widget: Fix time in tooltip text
The tooltips think all events start and end between 1:00 and 1:59,
because we are missing a % in the format string and the I looks like 1.

I like it when bugs turn out to be easy. Fixes #225.
2017-12-05 21:50:32 -06:00
Georges Basile Stavracas Neto bbbabecc58 Merge branch 'master' into 'master'
Add <Ctrl>+f shortcut to activate search bar.

See merge request GNOME/gnome-calendar!5
2017-12-05 23:13:44 +00:00
Michael Catanzaro ce8e8c217e edit-dialog: Fix timezone for events created in month view
In month view, when clicking on a day of the month, every event is
initially an All Day event until the user opens the Edit Details dialog
and unchecks the checkbox. This means that the event is originally
created in UTC time, and needs to be explicitly switched to local time.
2017-12-05 16:28:18 -06:00
Michael Catanzaro 2cca96c349 event: Fix a minor leak 2017-12-05 13:36:29 -06:00
George Willian Condomitti 7c2ca40f0b window: Add <Ctrl>+f shortcut to toggle search bar.
[221]
2017-12-04 16:04:41 -02:00
Georges Basile Stavracas Neto 8c4a0ca613 event-widget: always hide color box on vertical events
Otherwise we get weird borders on Week view.
2017-12-01 11:26:59 -02:00
Georges Basile Stavracas Neto e8468ec0df event-widget: use a 16px rounded rectangle for event colors
This looks better than the thin borders, helps a lot colorblind
people and makes the overall layout just as good.

Ship it!

[#211]
2017-11-30 14:45:47 -02:00
Günther Wutz fff12ced31 source-dialog: fixed URI label in dialog
Show new the correct URI scheme and port for calendar location in
source dialog. We had a hard coded URI label and always showed https
even when the calendar source used http, and no port. So the showed
label was most of the time wrong.

Related to #41
2017-11-28 18:10:17 -02:00
Georges Basile Stavracas Neto ea8b9e76e7 event-widget: use a stack to handle orientation
Instead of setting the position of the labels in a grid,
use two different grids and switch between them using a
stack.
2017-11-25 11:43:52 -02:00
Georges Basile Stavracas Neto f8ce4937c2 month-view: move variables around
Just to make it clear that these variables are only used when
we really need to reprocess the event widgets.
2017-11-25 11:43:52 -02:00
Georges Basile Stavracas Neto 63f3078a80 week-grid: don't try to optimize allocation
This is making the week grid miss some valid reallocation
cases.
2017-11-25 11:43:52 -02:00
Caio Marcelo de Oliveira Filho ad404c26ed utils: simplify gcal_dup_icaltime
Instead of copying member by member, copy the entire struct contents.
It works as before, but doesn't depend on the member names.

This fixes compiling gnome-calendar with libical 3.0.0, since the
struct icaltimetype had one of the members removed (is_utc).

https://bugzilla.gnome.org/show_bug.cgi?id=790072
2017-11-24 15:13:02 -02:00
Georges Basile Stavracas Neto cbcffe3bcd trivial: remove obsolete TODO 2017-11-21 22:51:57 -02:00
Georges Basile Stavracas Neto e73240bc9a trivial: style fix 2017-11-21 20:13:28 -02:00
Georges Basile Stavracas Neto e34964802c month-view: remove unused variable 2017-11-21 20:13:28 -02:00
Georges Basile Stavracas Neto a3d1bfcfc5 application: load custom css files
So that theme maintainers can drop their CSS here,
and make Calendar look beautiful everywhere.
2017-11-19 13:42:11 -02:00
Georges Basile Stavracas Neto bb2566dab8 month-view: hide last row if it's empty
This can make it put up to 5 events in my 1366x768 screen!

\o/
2017-11-19 12:29:29 -02:00
Georges Basile Stavracas Neto 0f1a8c93f2 month-view: fix hiding event widgets when removing 2017-11-19 12:18:32 -02:00
Georges Basile Stavracas Neto 1f1e351c47 month-view: remove useless field
This also fixes the bug where changing the text
direction doesn't reposition the event widgets.
2017-11-19 12:11:02 -02:00
Georges Basile Stavracas Neto 2e750b69e5 month-view: reorganize code
This is another major reorganization of the Month view's
allocation code. The goal is not to reduce the number
of lines, but to make them readable and maintainable.

During this reorganization, multiple bugs that were never
hit were ironed out! That itself would be a major win, but
since the code is actually more readable, we can expect
more improvements from now on.
2017-11-19 12:05:52 -02:00
Georges Basile Stavracas Neto 192e860edc trivial: style fix 2017-11-18 21:57:25 -02:00
Georges Basile Stavracas Neto 9fa9de2df7 month-view: use a custom structure to help multiday allocation
Instead of using 3 different, barely synchronized arrays. This
makes the code easier to read, and is more semantic too.
2017-11-18 21:57:25 -02:00
Günther Wutz 35c8d0d363 event-widget: reposition drag source to initial position 2017-11-16 18:35:25 -02:00
Günther Wutz b83b2b4e46 month-popover: typo fix in comment 2017-11-16 17:14:25 -02:00
Georges Basile Stavracas Neto 34d20a07ec month-popover: remove leftover comment 2017-11-15 21:04:46 -02:00
Georges Basile Stavracas Neto 4d23949a99 month-view: properly update today mark
https://bugzilla.gnome.org/show_bug.cgi?id=775103
2017-11-15 20:15:28 -02:00
Georges Basile Stavracas Neto 54839efbf4 month-view: fix rtl
This removes much of the subtle complexities of the size allocation
function in month view, and finally delivers a readable and working
implementation of the month view.

This also introduces a small code refactoring, and fixes clicking
on a cell on RTL.
2017-11-15 19:03:10 -02:00
Georges Basile Stavracas Neto b638a1537c event-widget: also compare by multiday 2017-11-15 15:32:37 -02:00
Georges Basile Stavracas Neto 09cd5d05cb month-popover: sort events 2017-11-15 03:17:04 -02:00
Georges Basile Stavracas Neto 72b9b34235 month-view: win the fight against the sizing machinery
We can now guarantee that the month cells unconditionally get
their desired allocations, but the event widgets are only created
when necessary.

I won.
2017-11-15 02:31:03 -02:00
Georges Basile Stavracas Neto eff50668d4 month-view: introduce new overflow popover window
This ~almost~ implements a perfectly semantic transition (which
is kinda impossible now).
2017-11-15 02:03:26 -02:00
Georges Basile Stavracas Neto 8d6785b6f7 month-view: implement a different hiding algorithm
As if the previous one wasn't crazy enough :(
2017-11-13 19:27:55 -02:00
Georges Basile Stavracas Neto b4cc36b344 month-view: fight the sizing machinery even harder
Make sure something changed in child widgets AND events,
otherwise just top allocating at all.
2017-11-13 17:06:38 -02:00
Georges Basile Stavracas Neto 31409b6e44 month-view: improve layout algorithm
Multiday event handling was a mess, and still it. But this commit
makes it at least layout things correctly.

It's not perfect, though; This commit brought back that terrible
allocation cycle issue, since we're showing and hiding events in
size-allocate.
2017-11-13 14:23:35 -02:00