diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-11-02 23:49:38 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2010-11-10 06:33:22 +0800 |
commit | dce5bdc3699faf592453492fe201606ed47e06b9 (patch) | |
tree | f533fe0d3ac9d6d75251ba5e6b1d48fcd9ab5a58 /plugins | |
parent | e3a09eb67c1f9b2a3762626eafbd9dec94bc63bf (diff) | |
download | gsoc2013-evolution-dce5bdc3699faf592453492fe201606ed47e06b9.tar.gz gsoc2013-evolution-dce5bdc3699faf592453492fe201606ed47e06b9.tar.zst gsoc2013-evolution-dce5bdc3699faf592453492fe201606ed47e06b9.zip |
Move calendar preferences to the calendar module.
Continue replacing the use of calendar-config functions with GObject
property bindings to EShellSettings properties.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/itip-formatter/itip-formatter.c | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 3630ec30d0..149d1652c7 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -43,7 +43,6 @@ #include <libedataserver/e-account-list.h> #include <e-util/e-alert-dialog.h> #include <e-util/e-mktemp.h> -#include <calendar/gui/calendar-config.h> #include <calendar/gui/itip-utils.h> #include <calendar/common/authentication.h> #include <shell/e-shell.h> @@ -542,10 +541,15 @@ static ECal * start_calendar_server (struct _itip_puri *pitip, ESource *source, ECalSourceType type, FormatItipOpenFunc func, gpointer data) { ECal *ecal; + EShell *shell; + EShellSettings *shell_settings; icaltimezone *zone = NULL; g_return_val_if_fail (source != NULL, NULL); + shell = e_shell_get_default (); + shell_settings = e_shell_get_shell_settings (shell); + ecal = g_hash_table_lookup (pitip->ecals[type], e_source_peek_uid (source)); if (ecal) { pitip->current_ecal = ecal; @@ -567,7 +571,7 @@ start_calendar_server (struct _itip_puri *pitip, ESource *source, ECalSourceType g_hash_table_insert (pitip->ecals[type], g_strdup (e_source_peek_uid (source)), ecal); - zone = calendar_config_get_icaltimezone (); + zone = e_shell_settings_get_pointer (shell_settings, "cal-timezone"); e_cal_set_default_timezone (ecal, zone, NULL); e_cal_open_async (ecal, TRUE); @@ -1680,6 +1684,8 @@ set_itip_error (struct _itip_puri *pitip, GtkContainer *container, const gchar * static gboolean extract_itip_data (struct _itip_puri *pitip, GtkContainer *container, gboolean *have_alarms) { + EShell *shell; + EShellSettings *shell_settings; icalproperty *prop; icalcomponent_kind kind = ICAL_NO_COMPONENT; icalcomponent *tz_comp; @@ -1687,6 +1693,10 @@ extract_itip_data (struct _itip_puri *pitip, GtkContainer *container, gboolean * icalcomponent *alarm_comp; icalcompiter alarm_iter; ECalComponent *comp; + gboolean use_default_reminder; + + shell = e_shell_get_default (); + shell_settings = e_shell_get_shell_settings (shell); if (!pitip->vcalendar) { set_itip_error (pitip, container, @@ -1886,14 +1896,20 @@ extract_itip_data (struct _itip_puri *pitip, GtkContainer *container, gboolean * }; /* Add default reminder if the config says so */ - if (calendar_config_get_use_default_reminder ()) { + + use_default_reminder = e_shell_settings_get_boolean ( + shell_settings, "cal-use-default-reminder"); + + if (use_default_reminder) { ECalComponentAlarm *acomp; gint interval; EDurationType units; ECalComponentAlarmTrigger trigger; - interval = calendar_config_get_default_reminder_interval (); - units = calendar_config_get_default_reminder_units (); + interval = e_shell_settings_get_int ( + shell_settings, "cal-default-reminder-interval"); + units = e_shell_settings_get_int ( + shell_settings, "cal-default-reminder-units"); acomp = e_cal_component_alarm_new (); @@ -2286,6 +2302,8 @@ in_proper_folder (CamelFolder *folder) static gboolean format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject) { + EShell *shell; + EShellSettings *shell_settings; struct _itip_puri *info; ECalComponentText text; ECalComponentOrganizer organizer; @@ -2299,6 +2317,9 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject gboolean response_enabled; gboolean have_alarms = FALSE; + shell = e_shell_get_default (); + shell_settings = e_shell_get_shell_settings (shell); + info = (struct _itip_puri *) em_format_find_puri ((EMFormat *)efh, pobject->classid); /* Accounts */ @@ -2498,7 +2519,7 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject g_string_free (gstring, TRUE); } - to_zone = calendar_config_get_icaltimezone (); + to_zone = e_shell_settings_get_pointer (shell_settings, "cal-timezone"); e_cal_component_get_dtstart (info->comp, &datetime); info->start_time = 0; |