aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-11-03 23:35:02 +0800
committerMilan Crha <mcrha@redhat.com>2010-11-03 23:35:02 +0800
commitbad8aff04f274c58c584bd5f7e8a396918aa9fb4 (patch)
tree5f6ce51b7135bb15fbf3806585592b61877f1045
parent7ce11c62eae2c3b27cb8d2c00c00f9d2a50ac560 (diff)
downloadgsoc2013-evolution-bad8aff04f274c58c584bd5f7e8a396918aa9fb4.tar
gsoc2013-evolution-bad8aff04f274c58c584bd5f7e8a396918aa9fb4.tar.gz
gsoc2013-evolution-bad8aff04f274c58c584bd5f7e8a396918aa9fb4.tar.bz2
gsoc2013-evolution-bad8aff04f274c58c584bd5f7e8a396918aa9fb4.tar.lz
gsoc2013-evolution-bad8aff04f274c58c584bd5f7e8a396918aa9fb4.tar.xz
gsoc2013-evolution-bad8aff04f274c58c584bd5f7e8a396918aa9fb4.tar.zst
gsoc2013-evolution-bad8aff04f274c58c584bd5f7e8a396918aa9fb4.zip
Bug #612181 - Show recurring events in italic in date navigator
-rw-r--r--calendar/gui/apps_evolution_calendar.schemas.in13
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.c7
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.ui17
-rw-r--r--calendar/gui/dialogs/recurrence-page.c2
-rw-r--r--calendar/gui/gnome-cal.c2
-rw-r--r--calendar/gui/tag-calendar.c22
-rw-r--r--calendar/gui/tag-calendar.h3
-rw-r--r--modules/calendar/e-cal-shell-settings.c4
8 files changed, 65 insertions, 5 deletions
diff --git a/calendar/gui/apps_evolution_calendar.schemas.in b/calendar/gui/apps_evolution_calendar.schemas.in
index c37bbbd1fb..229020a4db 100644
--- a/calendar/gui/apps_evolution_calendar.schemas.in
+++ b/calendar/gui/apps_evolution_calendar.schemas.in
@@ -506,6 +506,19 @@
</locale>
</schema>
+
+ <schema>
+ <key>/schemas/apps/evolution/calendar/display/recur_events_italic</key>
+ <applyto>/apps/evolution/calendar/display/recur_events_italic</applyto>
+ <owner>evolution-calendar</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Recurrent Events in Italic</short>
+ <long>Show days with recurrent events in italic font in bottom left calendar.</long>
+ </locale>
+ </schema>
+
<!-- Memos -->
<schema>
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c
index 266d699143..6316211c8a 100644
--- a/calendar/gui/dialogs/cal-prefs-dialog.c
+++ b/calendar/gui/dialogs/cal-prefs-dialog.c
@@ -789,6 +789,13 @@ calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs,
G_BINDING_BIDIRECTIONAL |
G_BINDING_SYNC_CREATE);
+ widget = e_builder_get_widget (prefs->builder, "recur_events_italic");
+ g_object_bind_property (
+ shell_settings, "cal-recur-events-italic",
+ widget, "active",
+ G_BINDING_BIDIRECTIONAL |
+ G_BINDING_SYNC_CREATE);
+
prefs->month_scroll_by_week = e_builder_get_widget (prefs->builder, "month_scroll_by_week");
widget = e_builder_get_widget (prefs->builder, "tasks_due_today_color");
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.ui b/calendar/gui/dialogs/cal-prefs-dialog.ui
index 6b6218df70..7e581cf4ad 100644
--- a/calendar/gui/dialogs/cal-prefs-dialog.ui
+++ b/calendar/gui/dialogs/cal-prefs-dialog.ui
@@ -978,6 +978,21 @@
</packing>
</child>
<child>
+ <object class="GtkCheckButton" id="recur_events_italic">
+ <property name="label" translatable="yes">Show r_ecurring events in italic in bottom left calendar</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkCheckButton" id="month_scroll_by_week">
<property name="label" translatable="yes">Sc_roll Month View by a week</property>
<property name="visible">True</property>
@@ -989,7 +1004,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
</object>
diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c
index 4014cfbc92..f5ef574efd 100644
--- a/calendar/gui/dialogs/recurrence-page.c
+++ b/calendar/gui/dialogs/recurrence-page.c
@@ -271,7 +271,7 @@ preview_recur (RecurrencePage *rpage)
fill_component (rpage, comp);
tag_calendar_by_comp (E_CALENDAR (priv->preview_calendar), comp,
- client, zone, TRUE, FALSE);
+ client, zone, TRUE, FALSE, FALSE);
g_object_unref (comp);
}
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 9b9400dd09..3945003a68 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -775,7 +775,7 @@ dn_e_cal_view_objects_added_cb (ECalView *query, GList *objects, gpointer data)
tag_calendar_by_comp (
priv->date_navigator, comp,
e_cal_view_get_client (query),
- NULL, FALSE, TRUE);
+ NULL, FALSE, TRUE, TRUE);
g_object_unref (comp);
}
}
diff --git a/calendar/gui/tag-calendar.c b/calendar/gui/tag-calendar.c
index f700da5a3b..0af271e1de 100644
--- a/calendar/gui/tag-calendar.c
+++ b/calendar/gui/tag-calendar.c
@@ -29,6 +29,8 @@
#endif
#include <libecal/e-cal-time-util.h>
+#include "shell/e-shell.h"
+#include "shell/e-shell-settings.h"
#include "calendar-config.h"
#include "tag-calendar.h"
@@ -39,6 +41,7 @@ struct calendar_tag_closure {
time_t end_time;
gboolean skip_transparent_events;
+ gboolean recur_events_italic;
};
/* Clears all the tags in a calendar and fills a closure structure with the
@@ -108,6 +111,8 @@ tag_calendar_cb (ECalComponent *comp,
return TRUE;
style = E_CALENDAR_ITEM_MARK_ITALIC;
+ } else if (c->recur_events_italic && e_cal_component_is_instance (comp)) {
+ style = E_CALENDAR_ITEM_MARK_ITALIC;
} else {
style = E_CALENDAR_ITEM_MARK_BOLD;
}
@@ -124,6 +129,18 @@ tag_calendar_cb (ECalComponent *comp,
return TRUE;
}
+static gboolean
+get_recur_events_italic (void)
+{
+ EShell *shell;
+ EShellSettings *shell_settings;
+
+ shell = e_shell_get_default ();
+ shell_settings = e_shell_get_shell_settings (shell);
+
+ return e_shell_settings_get_boolean (shell_settings, "cal-recur-events-italic");
+}
+
/**
* tag_calendar_by_client:
* @ecal: Calendar widget to tag.
@@ -152,6 +169,7 @@ tag_calendar_by_client (ECalendar *ecal,
return;
c.skip_transparent_events = TRUE;
+ c.recur_events_italic = get_recur_events_italic ();
e_cal_generate_instances (
client, c.start_time, c.end_time, tag_calendar_cb, &c);
@@ -202,7 +220,8 @@ tag_calendar_by_comp (ECalendar *ecal,
ECal *client,
icaltimezone *display_zone,
gboolean clear_first,
- gboolean comp_is_on_server)
+ gboolean comp_is_on_server,
+ gboolean can_recur_events_italic)
{
struct calendar_tag_closure c;
@@ -217,6 +236,7 @@ tag_calendar_by_comp (ECalendar *ecal,
return;
c.skip_transparent_events = FALSE;
+ c.recur_events_italic = can_recur_events_italic && get_recur_events_italic ();
if (comp_is_on_server)
e_cal_generate_instances_for_object (
diff --git a/calendar/gui/tag-calendar.h b/calendar/gui/tag-calendar.h
index e1d9fcf0b1..ebf996173e 100644
--- a/calendar/gui/tag-calendar.h
+++ b/calendar/gui/tag-calendar.h
@@ -33,6 +33,7 @@
void tag_calendar_by_client (ECalendar *ecal, ECal *client);
void tag_calendar_by_comp (ECalendar *ecal, ECalComponent *comp,
ECal *client, icaltimezone *display_zone,
- gboolean clear_first, gboolean comp_is_on_server);
+ gboolean clear_first, gboolean comp_is_on_server,
+ gboolean can_recur_events_italic);
#endif
diff --git a/modules/calendar/e-cal-shell-settings.c b/modules/calendar/e-cal-shell-settings.c
index 0ab35ebfee..524157c5a9 100644
--- a/modules/calendar/e-cal-shell-settings.c
+++ b/modules/calendar/e-cal-shell-settings.c
@@ -551,6 +551,10 @@ e_cal_shell_backend_init_settings (EShell *shell)
"/apps/evolution/calendar/tasks/primary_tasks");
e_shell_settings_install_property_for_key (
+ "cal-recur-events-italic",
+ "/apps/evolution/calendar/display/recur_events_italic");
+
+ e_shell_settings_install_property_for_key (
"cal-show-event-end-times",
"/apps/evolution/calendar/display/show_event_end");