From 260032a9ff49e78d4081b40e5f7102d2928fc572 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 20 Mar 2010 00:32:47 +0000 Subject: Add extensions to configure calender widgets. Make ECalendarItem, ECalendarView, ECalModel, EDateEdit, EMeetingStore, and EMeetingTimeSelector extensible and register extensions to automatically bind every instance to the appropriate EShellSettings. Conflicts: calendar/gui/gnome-cal.c modules/calendar/e-cal-shell-content.c --- modules/calendar/e-cal-config-view.c | 130 +++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 modules/calendar/e-cal-config-view.c (limited to 'modules/calendar/e-cal-config-view.c') diff --git a/modules/calendar/e-cal-config-view.c b/modules/calendar/e-cal-config-view.c new file mode 100644 index 0000000000..9783723a4e --- /dev/null +++ b/modules/calendar/e-cal-config-view.c @@ -0,0 +1,130 @@ +/* + * e-cal-config-view.c + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see + * + */ + +#include "e-cal-config-view.h" + +#include +#include +#include +#include +#include + +static void +cal_config_view_constructed (GObject *object) +{ + EExtension *extension; + EExtensible *extensible; + EShellSettings *shell_settings; + EShell *shell; + + extension = E_EXTENSION (object); + extensible = e_extension_get_extensible (extension); + + shell = e_shell_get_default (); + shell_settings = e_shell_get_shell_settings (shell); + + /*** EDayView ***/ + + if (E_IS_DAY_VIEW (extensible)) { + + e_binding_new ( + shell_settings, "cal-day-view-show-week-numbers", + E_DAY_VIEW (extensible)->week_number_label, "visible"); + + e_binding_new ( + shell_settings, "cal-marcus-bains-show-line", + extensible, "marcus-bains-show-line"); + + e_binding_new ( + shell_settings, "cal-marcus-bains-day-view-color", + extensible, "marcus-bains-day-view-color"); + + e_binding_new ( + shell_settings, "cal-marcus-bains-time-bar-color", + extensible, "marcus-bains-time-bar-color"); + + e_binding_new ( + shell_settings, "cal-time-divisions", + extensible, "mins-per-row"); + + e_binding_new ( + shell_settings, "cal-work-day-end-hour", + extensible, "work-day-end-hour"); + + e_binding_new ( + shell_settings, "cal-work-day-end-minute", + extensible, "work-day-end-minute"); + + e_binding_new ( + shell_settings, "cal-work-day-start-hour", + extensible, "work-day-start-hour"); + + e_binding_new ( + shell_settings, "cal-work-day-start-minute", + extensible, "work-day-start-minute"); + + e_binding_new ( + shell_settings, "cal-working-days-bitset", + extensible, "working-days"); + } + + /*** EWeekView ***/ + + if (E_IS_WEEK_VIEW (extensible)) { + + e_binding_new ( + shell_settings, "cal-compress-weekend", + extensible, "compress-weekend"); + + e_binding_new ( + shell_settings, "cal-show-event-end-times", + extensible, "show-event-end-times"); + } +} + +static void +cal_config_view_class_init (EExtensionClass *class) +{ + GObjectClass *object_class; + + object_class = G_OBJECT_CLASS (class); + object_class->constructed = cal_config_view_constructed; + + class->extensible_type = E_TYPE_CALENDAR_VIEW; +} + +void +e_cal_config_view_register_type (GTypeModule *type_module) +{ + static const GTypeInfo type_info = { + sizeof (EExtensionClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) cal_config_view_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class_data */ + sizeof (EExtension), + 0, /* n_preallocs */ + (GInstanceInitFunc) NULL, + NULL /* value_table */ + }; + + g_type_module_register_type ( + type_module, E_TYPE_EXTENSION, + "ECalConfigView", &type_info, 0); +} -- cgit v1.2.3 From 85fb57b9d8ec476dc8e75d10ae5481f4270dd9f2 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Sat, 17 Apr 2010 17:15:26 -0500 Subject: Use a single /apps/evolution/calendar/display/show_week_numbers We have two preferences for showing week numbers in various places. We will combine these to be a single preference. This change replaces /apps/evolution/calendar/display/day_view_show_week_number with a general /apps/evolution/calendar/display/show_week_numbers. We'll deal with the other preference in subsequent commits. Signed-off-by: Federico Mena Quintero --- modules/calendar/e-cal-config-view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/calendar/e-cal-config-view.c') diff --git a/modules/calendar/e-cal-config-view.c b/modules/calendar/e-cal-config-view.c index 9783723a4e..e543bf6c56 100644 --- a/modules/calendar/e-cal-config-view.c +++ b/modules/calendar/e-cal-config-view.c @@ -43,7 +43,7 @@ cal_config_view_constructed (GObject *object) if (E_IS_DAY_VIEW (extensible)) { e_binding_new ( - shell_settings, "cal-day-view-show-week-numbers", + shell_settings, "cal-show-week-numbers", E_DAY_VIEW (extensible)->week_number_label, "visible"); e_binding_new ( -- cgit v1.2.3