aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-11-02 23:49:38 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2010-11-10 06:33:22 +0800
commitdce5bdc3699faf592453492fe201606ed47e06b9 (patch)
treef533fe0d3ac9d6d75251ba5e6b1d48fcd9ab5a58 /calendar/gui/dialogs
parente3a09eb67c1f9b2a3762626eafbd9dec94bc63bf (diff)
downloadgsoc2013-evolution-dce5bdc3699faf592453492fe201606ed47e06b9.tar
gsoc2013-evolution-dce5bdc3699faf592453492fe201606ed47e06b9.tar.gz
gsoc2013-evolution-dce5bdc3699faf592453492fe201606ed47e06b9.tar.bz2
gsoc2013-evolution-dce5bdc3699faf592453492fe201606ed47e06b9.tar.lz
gsoc2013-evolution-dce5bdc3699faf592453492fe201606ed47e06b9.tar.xz
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 'calendar/gui/dialogs')
-rw-r--r--calendar/gui/dialogs/Makefile.am164
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.c915
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.h113
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.ui1440
-rw-r--r--calendar/gui/dialogs/comp-editor-util.c6
-rw-r--r--calendar/gui/dialogs/comp-editor-util.h5
-rw-r--r--calendar/gui/dialogs/comp-editor.c308
-rw-r--r--calendar/gui/dialogs/comp-editor.h28
-rw-r--r--calendar/gui/dialogs/delete-comp.c12
-rw-r--r--calendar/gui/dialogs/e-send-options-utils.c6
-rw-r--r--calendar/gui/dialogs/e-send-options-utils.h11
-rw-r--r--calendar/gui/dialogs/event-editor.c2
-rw-r--r--calendar/gui/dialogs/event-page.c105
-rw-r--r--calendar/gui/dialogs/event-page.h4
-rw-r--r--calendar/gui/dialogs/recurrence-page.c54
-rw-r--r--calendar/gui/dialogs/recurrence-page.h7
-rw-r--r--calendar/gui/dialogs/schedule-page.c12
-rw-r--r--calendar/gui/dialogs/task-details-page.c23
-rw-r--r--calendar/gui/dialogs/task-page.c29
19 files changed, 570 insertions, 2674 deletions
diff --git a/calendar/gui/dialogs/Makefile.am b/calendar/gui/dialogs/Makefile.am
index 0bd89de799..38e0c47e62 100644
--- a/calendar/gui/dialogs/Makefile.am
+++ b/calendar/gui/dialogs/Makefile.am
@@ -20,101 +20,97 @@ libcal_dialogs_la_CPPFLAGS = \
ecalendarincludedir = $(privincludedir)/calendar/gui/dialogs
-ecalendarinclude_HEADERS = \
- comp-editor-page.h \
- comp-editor.h \
- alarm-dialog.h \
- alarm-list-dialog.h \
- cal-prefs-dialog.h \
- calendar-setup.h \
- cancel-comp.h \
- changed-comp.h \
- comp-editor-util.h \
- copy-source-dialog.h \
- delete-comp.h \
- delete-error.h \
- e-delegate-dialog.h \
- e-send-options-utils.h \
- event-editor.h \
- event-page.h \
- memo-editor.h \
- memo-page.h \
- recurrence-page.h \
- recur-comp.h \
- save-comp.h \
- schedule-page.h \
- select-source-dialog.h \
- send-comp.h \
- task-editor.h \
- task-details-page.h \
- task-page.h
+ecalendarinclude_HEADERS = \
+ comp-editor-page.h \
+ comp-editor.h \
+ alarm-dialog.h \
+ alarm-list-dialog.h \
+ calendar-setup.h \
+ cancel-comp.h \
+ changed-comp.h \
+ comp-editor-util.h \
+ copy-source-dialog.h \
+ delete-comp.h \
+ delete-error.h \
+ e-delegate-dialog.h \
+ e-send-options-utils.h \
+ event-editor.h \
+ event-page.h \
+ memo-editor.h \
+ memo-page.h \
+ recurrence-page.h \
+ recur-comp.h \
+ save-comp.h \
+ schedule-page.h \
+ select-source-dialog.h \
+ send-comp.h \
+ task-editor.h \
+ task-details-page.h \
+ task-page.h
libcal_dialogs_la_LIBADD = \
$(top_builddir)/addressbook/util/libeabutil.la \
$(CAMEL_LIBS) \
$(GNOME_PLATFORM_LIBS)
-libcal_dialogs_la_SOURCES = \
- $(IDL_GENERATED) \
- alarm-dialog.c \
- alarm-dialog.h \
- alarm-list-dialog.c \
- alarm-list-dialog.h \
- cal-prefs-dialog.c \
- cal-prefs-dialog.h \
- calendar-setup.c \
- calendar-setup.h \
- cancel-comp.c \
- cancel-comp.h \
- changed-comp.c \
- changed-comp.h \
- comp-editor.c \
- comp-editor.h \
- comp-editor-page.c \
- comp-editor-page.h \
- comp-editor-util.c \
- comp-editor-util.h \
- copy-source-dialog.c \
- copy-source-dialog.h \
- delete-comp.c \
- delete-comp.h \
- delete-error.c \
- delete-error.h \
- e-delegate-dialog.c \
- e-delegate-dialog.h \
- e-send-options-utils.c \
- e-send-options-utils.h \
- event-editor.c \
- event-editor.h \
- event-page.c \
- event-page.h \
- memo-editor.c \
- memo-editor.h \
- memo-page.c \
- memo-page.h \
- recurrence-page.c \
- recurrence-page.h \
- recur-comp.c \
- recur-comp.h \
- save-comp.c \
- save-comp.h \
- schedule-page.c \
- schedule-page.h \
- select-source-dialog.c \
- select-source-dialog.h \
- send-comp.c \
- send-comp.h \
- task-editor.c \
- task-editor.h \
- task-details-page.c \
- task-details-page.h \
- task-page.c \
+libcal_dialogs_la_SOURCES = \
+ $(IDL_GENERATED) \
+ alarm-dialog.c \
+ alarm-dialog.h \
+ alarm-list-dialog.c \
+ alarm-list-dialog.h \
+ calendar-setup.c \
+ calendar-setup.h \
+ cancel-comp.c \
+ cancel-comp.h \
+ changed-comp.c \
+ changed-comp.h \
+ comp-editor.c \
+ comp-editor.h \
+ comp-editor-page.c \
+ comp-editor-page.h \
+ comp-editor-util.c \
+ comp-editor-util.h \
+ copy-source-dialog.c \
+ copy-source-dialog.h \
+ delete-comp.c \
+ delete-comp.h \
+ delete-error.c \
+ delete-error.h \
+ e-delegate-dialog.c \
+ e-delegate-dialog.h \
+ e-send-options-utils.c \
+ e-send-options-utils.h \
+ event-editor.c \
+ event-editor.h \
+ event-page.c \
+ event-page.h \
+ memo-editor.c \
+ memo-editor.h \
+ memo-page.c \
+ memo-page.h \
+ recurrence-page.c \
+ recurrence-page.h \
+ recur-comp.c \
+ recur-comp.h \
+ save-comp.c \
+ save-comp.h \
+ schedule-page.c \
+ schedule-page.h \
+ select-source-dialog.c \
+ select-source-dialog.h \
+ send-comp.c \
+ send-comp.h \
+ task-editor.c \
+ task-editor.h \
+ task-details-page.c \
+ task-details-page.h \
+ task-page.c \
task-page.h
ui_DATA = \
alarm-dialog.ui \
alarm-list-dialog.ui \
- cal-prefs-dialog.ui \
e-delegate-dialog.ui \
event-page.ui \
memo-page.ui \
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c
deleted file mode 100644
index f404d08927..0000000000
--- a/calendar/gui/dialogs/cal-prefs-dialog.c
+++ /dev/null
@@ -1,915 +0,0 @@
-/*
- * 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 <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * Damon Chaplin <damon@ximian.com>
- * Ettore Perazzoli <ettore@ximian.com>
- * David Trowbridge <trowbrds cs colorado edu>
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "../e-cal-config.h"
-#include "../e-timezone-entry.h"
-#include "../calendar-config.h"
-#include "cal-prefs-dialog.h"
-#include <widgets/misc/e-dateedit.h>
-#include "e-util/e-util.h"
-#include "e-util/e-datetime-format.h"
-#include "e-util/e-dialog-widgets.h"
-#include "e-util/e-util-private.h"
-#include "shell/e-shell-utils.h"
-#include <glib/gi18n.h>
-#include <string.h>
-
-static const gint time_division_map[] = {
- 60, 30, 15, 10, 5, -1
-};
-
-/* The following two are kept separate in case we need to re-order each menu individually */
-static const gint hide_completed_units_map[] = {
- E_DURATION_MINUTES, E_DURATION_HOURS, E_DURATION_DAYS, -1
-};
-
-/* same is used for Birthdays & Anniversaries calendar */
-static const gint default_reminder_units_map[] = {
- E_DURATION_MINUTES, E_DURATION_HOURS, E_DURATION_DAYS, -1
-};
-
-static GtkVBoxClass *parent_class = NULL;
-
-static void
-calendar_prefs_dialog_finalize (GObject *obj)
-{
- CalendarPrefsDialog *prefs = (CalendarPrefsDialog *) obj;
-
- g_object_unref (prefs->builder);
-
- if (prefs->gconf) {
- g_object_unref (prefs->gconf);
- prefs->gconf = NULL;
- }
-
- ((GObjectClass *)(parent_class))->finalize (obj);
-}
-
-static void
-calendar_prefs_dialog_class_init (CalendarPrefsDialogClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = (GObjectClass *) klass;
- parent_class = g_type_class_ref (GTK_TYPE_VBOX);
-
- object_class->finalize = calendar_prefs_dialog_finalize;
-}
-
-static void
-calendar_prefs_dialog_init (CalendarPrefsDialog *dialog)
-{
-}
-
-static GtkWidget *
-eccp_widget_glade (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data)
-{
- CalendarPrefsDialog *prefs = data;
-
- return e_builder_get_widget (prefs->builder, item->label);
-}
-
-static void
-update_day_second_zone_caption (CalendarPrefsDialog *prefs)
-{
- gchar *location;
- const gchar *caption;
- icaltimezone *zone;
-
- g_return_if_fail (prefs != NULL);
-
- /* Translators: "None" indicates no second time zone set for a day view */
- caption = C_("cal-second-zone", "None");
-
- location = calendar_config_get_day_second_zone ();
- if (location && *location) {
- zone = icaltimezone_get_builtin_timezone (location);
- if (zone && icaltimezone_get_display_name (zone)) {
- caption = icaltimezone_get_display_name (zone);
- }
- }
- g_free (location);
-
- gtk_button_set_label (GTK_BUTTON (prefs->day_second_zone), caption);
-}
-
-static void
-on_set_day_second_zone (GtkWidget *item, CalendarPrefsDialog *prefs)
-{
- if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item)))
- return;
-
- calendar_config_set_day_second_zone (g_object_get_data (G_OBJECT (item), "timezone"));
- update_day_second_zone_caption (prefs);
-}
-
-static void
-on_select_day_second_zone (GtkWidget *item, CalendarPrefsDialog *prefs)
-{
- g_return_if_fail (prefs != NULL);
-
- calendar_config_select_day_second_zone ();
- update_day_second_zone_caption (prefs);
-}
-
-static void
-day_second_zone_clicked (GtkWidget *widget, CalendarPrefsDialog *prefs)
-{
- GtkWidget *menu, *item;
- GSList *group = NULL, *recent_zones, *s;
- gchar *location;
- icaltimezone *zone, *second_zone = NULL;
-
- menu = gtk_menu_new ();
-
- location = calendar_config_get_day_second_zone ();
- if (location && *location)
- second_zone = icaltimezone_get_builtin_timezone (location);
- g_free (location);
-
- group = NULL;
- item = gtk_radio_menu_item_new_with_label (group, C_("cal-second-zone", "None"));
- group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
- if (!second_zone)
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- g_signal_connect (item, "toggled", G_CALLBACK (on_set_day_second_zone), prefs);
-
- recent_zones = calendar_config_get_day_second_zones ();
- for (s = recent_zones; s != NULL; s = s->next) {
- zone = icaltimezone_get_builtin_timezone (s->data);
- if (!zone)
- continue;
-
- item = gtk_radio_menu_item_new_with_label (group, icaltimezone_get_display_name (zone));
- group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
- /* both comes from builtin, thus no problem to compare pointers */
- if (zone == second_zone)
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- g_object_set_data_full (G_OBJECT (item), "timezone", g_strdup (s->data), g_free);
- g_signal_connect (item, "toggled", G_CALLBACK (on_set_day_second_zone), prefs);
- }
- calendar_config_free_day_second_zones (recent_zones);
-
- item = gtk_separator_menu_item_new ();
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-
- item = gtk_menu_item_new_with_label (_("Select..."));
- g_signal_connect (item, "activate", G_CALLBACK (on_select_day_second_zone), prefs);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-
- gtk_widget_show_all (menu);
-
- gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
- 0, gtk_get_current_event_time ());
-}
-
-static void
-start_of_day_changed (GtkWidget *widget, CalendarPrefsDialog *prefs)
-{
- gint start_hour, start_minute, end_hour, end_minute;
- EDateEdit *start, *end;
-
- start = E_DATE_EDIT (prefs->start_of_day);
- end = E_DATE_EDIT (prefs->end_of_day);
-
- e_date_edit_get_time_of_day (start, &start_hour, &start_minute);
- e_date_edit_get_time_of_day (end, &end_hour, &end_minute);
-
- if ((start_hour > end_hour) || (start_hour == end_hour && start_minute > end_minute)) {
- if (start_hour < 23)
- e_date_edit_set_time_of_day (end, start_hour + 1, start_minute);
- else
- e_date_edit_set_time_of_day (end, 23, 59);
-
- return;
- }
-
- calendar_config_set_day_start_hour (start_hour);
- calendar_config_set_day_start_minute (start_minute);
-}
-
-static void
-end_of_day_changed (GtkWidget *widget, CalendarPrefsDialog *prefs)
-{
- gint start_hour, start_minute, end_hour, end_minute;
- EDateEdit *start, *end;
-
- start = E_DATE_EDIT (prefs->start_of_day);
- end = E_DATE_EDIT (prefs->end_of_day);
-
- e_date_edit_get_time_of_day (start, &start_hour, &start_minute);
- e_date_edit_get_time_of_day (end, &end_hour, &end_minute);
-
- if ((end_hour < start_hour) || (end_hour == start_hour && end_minute < start_minute)) {
- if (end_hour < 1)
- e_date_edit_set_time_of_day (start, 0, 0);
- else
- e_date_edit_set_time_of_day (start, end_hour - 1, end_minute);
-
- return;
- }
-
- calendar_config_set_day_end_hour (end_hour);
- calendar_config_set_day_end_minute (end_minute);
-}
-
-static void
-time_divisions_changed (GtkWidget *widget, CalendarPrefsDialog *prefs)
-{
- gint time_divisions;
-
- time_divisions = e_dialog_combo_box_get (prefs->time_divisions, time_division_map);
- calendar_config_set_time_divisions (time_divisions);
-}
-
-static void
-month_scroll_by_week_toggled (GtkToggleButton *toggle, CalendarPrefsDialog *prefs)
-{
- calendar_config_set_month_scroll_by_week (gtk_toggle_button_get_active (toggle));
-}
-
-static void
-hide_completed_tasks_toggled (GtkToggleButton *toggle, CalendarPrefsDialog *prefs)
-{
- gboolean hide;
-
- hide = gtk_toggle_button_get_active (toggle);
-
- gtk_widget_set_sensitive (prefs->tasks_hide_completed_interval, hide);
- gtk_widget_set_sensitive (prefs->tasks_hide_completed_units, hide);
-
- calendar_config_set_hide_completed_tasks (hide);
-}
-
-static void
-hide_completed_tasks_changed (GtkWidget *widget, CalendarPrefsDialog *prefs)
-{
- calendar_config_set_hide_completed_tasks_value (
- gtk_spin_button_get_value_as_int (
- GTK_SPIN_BUTTON (prefs->tasks_hide_completed_interval)));
-}
-
-static void
-hide_completed_tasks_units_changed (GtkWidget *widget, CalendarPrefsDialog *prefs)
-{
- calendar_config_set_hide_completed_tasks_units (
- e_dialog_combo_box_get (prefs->tasks_hide_completed_units, hide_completed_units_map));
-}
-
-static void
-default_reminder_toggled (GtkToggleButton *toggle, CalendarPrefsDialog *prefs)
-{
- calendar_config_set_use_default_reminder (gtk_toggle_button_get_active (toggle));
-}
-
-static void
-default_reminder_interval_changed (GtkWidget *widget, CalendarPrefsDialog *prefs)
-{
- const gchar *str;
- gdouble value;
-
- str = gtk_entry_get_text (GTK_ENTRY (widget));
- value = g_ascii_strtod (str, NULL);
-
- calendar_config_set_default_reminder_interval (value);
-}
-
-static void
-default_reminder_units_changed (GtkWidget *widget, CalendarPrefsDialog *prefs)
-{
- calendar_config_set_default_reminder_units (
- e_dialog_combo_box_get (prefs->default_reminder_units, default_reminder_units_map));
-}
-
-static void
-ba_reminder_toggled (GtkToggleButton *toggle, CalendarPrefsDialog *prefs)
-{
- gboolean enabled = gtk_toggle_button_get_active (toggle);
-
- calendar_config_set_ba_reminder (&enabled, NULL, NULL);
-}
-
-static void
-ba_reminder_interval_changed (GtkWidget *widget, CalendarPrefsDialog *prefs)
-{
- const gchar *str;
- gint value;
-
- str = gtk_entry_get_text (GTK_ENTRY (widget));
- value = (gint) g_ascii_strtod (str, NULL);
-
- calendar_config_set_ba_reminder (NULL, &value, NULL);
-}
-
-static void
-ba_reminder_units_changed (GtkWidget *widget, CalendarPrefsDialog *prefs)
-{
- EDurationType units = e_dialog_combo_box_get (prefs->ba_reminder_units, default_reminder_units_map);
-
- calendar_config_set_ba_reminder (NULL, NULL, &units);
-}
-
-static void
-notify_with_tray_toggled (GtkToggleButton *toggle, CalendarPrefsDialog *prefs)
-{
- GConfClient *gconf;
-
- g_return_if_fail (toggle != NULL);
-
- gconf = gconf_client_get_default ();
- gconf_client_set_bool (gconf, "/apps/evolution/calendar/notify/notify_with_tray", gtk_toggle_button_get_active (toggle), NULL);
- g_object_unref (gconf);
-}
-
-static void
-alarms_selection_changed (ESourceSelector *selector, CalendarPrefsDialog *prefs)
-{
- ESourceList *source_list = prefs->alarms_list;
- GSList *selection;
- GSList *l;
- GSList *groups;
- ESource *source;
- const gchar *alarm;
-
- /* first we clear all the alarm flags from all sources */
- for (groups = e_source_list_peek_groups (source_list); groups; groups = groups->next) {
- ESourceGroup *group = E_SOURCE_GROUP (groups->data);
- GSList *sources;
- for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) {
- source = E_SOURCE (sources->data);
-
- alarm = e_source_get_property (source, "alarm");
- if (alarm && !g_ascii_strcasecmp (alarm, "never"))
- continue;
-
- e_source_set_property (source, "alarm", "false");
- }
- }
-
- /* then we loop over the selector's selection, setting the
- property on those sources */
- selection = e_source_selector_get_selection (selector);
- for (l = selection; l; l = l->next) {
- source = E_SOURCE (l->data);
-
- alarm = (gchar *)e_source_get_property (source, "alarm");
- if (alarm && !g_ascii_strcasecmp (alarm, "never"))
- continue;
-
- e_source_set_property (E_SOURCE (l->data), "alarm", "true");
- }
- e_source_selector_free_selection (selection);
-
- /* FIXME show an error if this fails? */
- e_source_list_sync (source_list, NULL);
-}
-
-static void
-update_system_tz_widgets (EShellSettings *shell_settings,
- GParamSpec *pspec,
- CalendarPrefsDialog *prefs)
-{
- GtkWidget *widget;
- icaltimezone *zone;
- const gchar *display_name;
- gchar *text;
-
- widget = e_builder_get_widget (prefs->builder, "system-tz-label");
- g_return_if_fail (GTK_IS_LABEL (widget));
-
- zone = e_cal_util_get_system_timezone ();
- if (zone != NULL)
- display_name = gettext (icaltimezone_get_display_name (zone));
- else
- display_name = "UTC";
-
- text = g_strdup_printf ("(%s)", display_name);
- gtk_label_set_text (GTK_LABEL (widget), text);
- g_free (text);
-}
-
-static void
-setup_changes (CalendarPrefsDialog *prefs)
-{
- g_signal_connect (G_OBJECT (prefs->day_second_zone), "clicked", G_CALLBACK (day_second_zone_clicked), prefs);
-
- g_signal_connect (G_OBJECT (prefs->start_of_day), "changed", G_CALLBACK (start_of_day_changed), prefs);
- g_signal_connect (G_OBJECT (prefs->end_of_day), "changed", G_CALLBACK (end_of_day_changed), prefs);
-
- g_signal_connect (G_OBJECT (prefs->time_divisions), "changed", G_CALLBACK (time_divisions_changed), prefs);
-
- g_signal_connect (G_OBJECT (prefs->month_scroll_by_week), "toggled", G_CALLBACK (month_scroll_by_week_toggled), prefs);
-
- g_signal_connect (G_OBJECT (prefs->tasks_hide_completed), "toggled",
- G_CALLBACK (hide_completed_tasks_toggled), prefs);
- g_signal_connect (G_OBJECT (prefs->tasks_hide_completed_interval), "value-changed",
- G_CALLBACK (hide_completed_tasks_changed), prefs);
- g_signal_connect (G_OBJECT (prefs->tasks_hide_completed_units), "changed", G_CALLBACK (hide_completed_tasks_units_changed), prefs);
-
- g_signal_connect (G_OBJECT (prefs->default_reminder), "toggled", G_CALLBACK (default_reminder_toggled), prefs);
- g_signal_connect (G_OBJECT (prefs->default_reminder_interval), "changed",
- G_CALLBACK (default_reminder_interval_changed), prefs);
- g_signal_connect (G_OBJECT (prefs->default_reminder_units), "changed", G_CALLBACK (default_reminder_units_changed), prefs);
-
- g_signal_connect (G_OBJECT (prefs->ba_reminder), "toggled", G_CALLBACK (ba_reminder_toggled), prefs);
- g_signal_connect (G_OBJECT (prefs->ba_reminder_interval), "changed",
- G_CALLBACK (ba_reminder_interval_changed), prefs);
- g_signal_connect (G_OBJECT (prefs->ba_reminder_units), "changed", G_CALLBACK (ba_reminder_units_changed), prefs);
-
- g_signal_connect (G_OBJECT (prefs->notify_with_tray), "toggled", G_CALLBACK (notify_with_tray_toggled), prefs);
- g_signal_connect (G_OBJECT (prefs->alarm_list_widget), "selection_changed", G_CALLBACK (alarms_selection_changed), prefs);
-}
-
-/* Shows the current task list settings in the dialog */
-static void
-show_task_list_config (CalendarPrefsDialog *prefs)
-{
- EDurationType units;
- gboolean hide_completed_tasks;
-
- /* Hide Completed Tasks. */
- hide_completed_tasks = calendar_config_get_hide_completed_tasks ();
- gtk_toggle_button_set_active (
- GTK_TOGGLE_BUTTON (prefs->tasks_hide_completed),
- hide_completed_tasks);
-
- /* Hide Completed Tasks Units. */
- units = calendar_config_get_hide_completed_tasks_units ();
- e_dialog_combo_box_set (prefs->tasks_hide_completed_units, units, hide_completed_units_map);
-
- /* Hide Completed Tasks Value. */
- gtk_spin_button_set_value (
- GTK_SPIN_BUTTON (prefs->tasks_hide_completed_interval),
- calendar_config_get_hide_completed_tasks_value ());
-
- gtk_widget_set_sensitive (prefs->tasks_hide_completed_interval, hide_completed_tasks);
- gtk_widget_set_sensitive (prefs->tasks_hide_completed_units, hide_completed_tasks);
-}
-
-static void
-initialize_selection (ESourceSelector *selector, ESourceList *source_list)
-{
- GSList *groups;
-
- for (groups = e_source_list_peek_groups (source_list); groups; groups = groups->next) {
- ESourceGroup *group = E_SOURCE_GROUP (groups->data);
- GSList *sources;
- for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) {
- ESource *source = E_SOURCE (sources->data);
- const gchar *completion = e_source_get_property (source, "alarm");
- if (!completion || !g_ascii_strcasecmp (completion, "true")) {
- if (!completion)
- e_source_set_property (E_SOURCE (source), "alarm", "true");
- e_source_selector_select_source (selector, source);
- }
- }
- }
-}
-
-static void
-show_alarms_config (CalendarPrefsDialog *prefs)
-{
- GConfClient *gconf;
-
- if (e_cal_get_sources (&prefs->alarms_list, E_CAL_SOURCE_TYPE_EVENT, NULL)) {
- prefs->alarm_list_widget = e_source_selector_new (prefs->alarms_list);
- atk_object_set_name (gtk_widget_get_accessible (prefs->alarm_list_widget), _("Selected Calendars for Alarms"));
- gtk_container_add (GTK_CONTAINER (prefs->scrolled_window), prefs->alarm_list_widget);
- gtk_widget_show (prefs->alarm_list_widget);
- initialize_selection (E_SOURCE_SELECTOR (prefs->alarm_list_widget), prefs->alarms_list);
- }
-
- gconf = gconf_client_get_default ();
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs->notify_with_tray), gconf_client_get_bool (gconf, "/apps/evolution/calendar/notify/notify_with_tray", NULL));
- g_object_unref (gconf);
-}
-
-/* Shows the current config settings in the dialog. */
-static void
-show_config (CalendarPrefsDialog *prefs)
-{
- gint time_divisions;
- gboolean set = FALSE;
- EDurationType units;
- gint interval;
-
- /* Day's second zone */
- update_day_second_zone_caption (prefs);
-
- /* Day's second zone */
- update_day_second_zone_caption (prefs);
-
- /* Start of Day. */
- e_date_edit_set_time_of_day (E_DATE_EDIT (prefs->start_of_day), calendar_config_get_day_start_hour (), calendar_config_get_day_start_minute ());
-
- /* End of Day. */
- e_date_edit_set_time_of_day (E_DATE_EDIT (prefs->end_of_day), calendar_config_get_day_end_hour (), calendar_config_get_day_end_minute ());
-
- /* Time Divisions. */
- time_divisions = calendar_config_get_time_divisions ();
- e_dialog_combo_box_set (prefs->time_divisions, time_divisions, time_division_map);
-
- /* Month View - Scroll by a week */
- gtk_toggle_button_set_active (
- GTK_TOGGLE_BUTTON (prefs->month_scroll_by_week),
- calendar_config_get_month_scroll_by_week ());
-
- /* Task list */
- show_task_list_config (prefs);
-
- /* Alarms list*/
- show_alarms_config (prefs);
-
- /* Other page */
- gtk_toggle_button_set_active (
- GTK_TOGGLE_BUTTON (prefs->default_reminder),
- calendar_config_get_use_default_reminder ());
- gtk_spin_button_set_value (
- GTK_SPIN_BUTTON (prefs->default_reminder_interval),
- calendar_config_get_default_reminder_interval ());
- e_dialog_combo_box_set (prefs->default_reminder_units, calendar_config_get_default_reminder_units (), default_reminder_units_map);
-
- /* Birthdays & Anniversaries reminder */
- set = calendar_config_get_ba_reminder (&interval, &units);
-
- gtk_toggle_button_set_active (
- GTK_TOGGLE_BUTTON (prefs->ba_reminder), set);
- gtk_spin_button_set_value (
- GTK_SPIN_BUTTON (prefs->ba_reminder_interval), interval);
- e_dialog_combo_box_set (prefs->ba_reminder_units, units, default_reminder_units_map);
-}
-
-/* plugin meta-data */
-static ECalConfigItem eccp_items[] = {
- { E_CONFIG_BOOK, (gchar *) "", (gchar *) "toplevel-notebook", eccp_widget_glade },
- { E_CONFIG_PAGE, (gchar *) "00.general", (gchar *) "general", eccp_widget_glade },
- { E_CONFIG_SECTION_TABLE, (gchar *) "00.general/00.time", (gchar *) "time", eccp_widget_glade },
- { E_CONFIG_SECTION_TABLE, (gchar *) "00.general/10.workWeek", (gchar *) "workWeek", eccp_widget_glade },
- { E_CONFIG_SECTION, (gchar *) "00.general/20.alerts", (gchar *) "alerts", eccp_widget_glade },
- { E_CONFIG_PAGE, (gchar *) "10.display", (gchar *) "display", eccp_widget_glade },
- { E_CONFIG_SECTION, (gchar *) "10.display/00.general", (gchar *) "displayGeneral", eccp_widget_glade },
- { E_CONFIG_SECTION, (gchar *) "10.display/10.taskList", (gchar *) "taskList", eccp_widget_glade },
- { E_CONFIG_PAGE, (gchar *) "15.alarms", (gchar *) "alarms", eccp_widget_glade },
- { E_CONFIG_PAGE, (gchar *) "20.freeBusy", (gchar *) "freebusy", eccp_widget_glade },
- { E_CONFIG_SECTION, (gchar *) "20.freeBusy/00.defaultServer", (gchar *) "default-freebusy-vbox", eccp_widget_glade },
-};
-
-static void
-eccp_free (EConfig *ec, GSList *items, gpointer data)
-{
- g_slist_free (items);
-}
-
-static void
-calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs,
- EShell *shell)
-{
- ECalConfig *ec;
- ECalConfigTargetPrefs *target;
- EShellSettings *shell_settings;
- gboolean locale_supports_12_hour_format;
- gint i;
- GtkWidget *toplevel;
- GtkWidget *widget;
- GtkWidget *table;
- GSList *l;
-
- shell_settings = e_shell_get_shell_settings (shell);
-
- locale_supports_12_hour_format =
- calendar_config_locale_supports_12_hour_format ();
-
- /* Force 24 hour format for locales which don't support 12 hour format */
- if (!locale_supports_12_hour_format
- && !e_shell_settings_get_boolean (shell_settings, "cal-use-24-hour-format"))
- e_shell_settings_set_boolean (shell_settings, "cal-use-24-hour-format", TRUE);
-
- /* Make sure our custom widget classes are registered with
- * GType before we load the GtkBuilder definition file. */
- E_TYPE_DATE_EDIT;
- E_TYPE_TIMEZONE_ENTRY;
-
- prefs->builder = gtk_builder_new ();
- e_load_ui_builder_definition (prefs->builder, "cal-prefs-dialog.ui");
-
- prefs->gconf = gconf_client_get_default ();
-
- /** @HookPoint-ECalConfig: Calendar Preferences Page
- * @Id: org.gnome.evolution.calendar.prefs
- * @Type: E_CONFIG_BOOK
- * @Class: org.gnome.evolution.calendar.config:1.0
- * @Target: ECalConfigTargetPrefs
- *
- * The mail calendar preferences page
- */
- ec = e_cal_config_new (E_CONFIG_BOOK, "org.gnome.evolution.calendar.prefs");
- l = NULL;
- for (i = 0; i < G_N_ELEMENTS (eccp_items); i++)
- l = g_slist_prepend (l, &eccp_items[i]);
- e_config_add_items ((EConfig *) ec, l, NULL, NULL, eccp_free, prefs);
-
- widget = e_builder_get_widget (prefs->builder, "use-system-tz-check");
- g_object_bind_property (
- shell_settings, "cal-use-system-timezone",
- widget, "active",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE);
- g_signal_connect (
- shell_settings, "notify::cal-use-system-timezone",
- G_CALLBACK (update_system_tz_widgets), prefs);
- g_object_notify (G_OBJECT (shell_settings), "cal-use-system-timezone");
-
- widget = e_builder_get_widget (prefs->builder, "timezone");
- g_object_bind_property (
- shell_settings, "cal-timezone",
- widget, "timezone",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE);
- g_object_bind_property (
- shell_settings, "cal-use-system-timezone",
- widget, "sensitive",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE |
- G_BINDING_INVERT_BOOLEAN);
-
- /* General tab */
- prefs->day_second_zone = e_builder_get_widget (prefs->builder, "day_second_zone");
-
- widget = e_builder_get_widget (prefs->builder, "sun_button");
- g_object_bind_property (
- shell_settings, "cal-working-days-sunday",
- widget, "active",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE);
-
- widget = e_builder_get_widget (prefs->builder, "mon_button");
- g_object_bind_property (
- shell_settings, "cal-working-days-monday",
- widget, "active",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE);
-
- widget = e_builder_get_widget (prefs->builder, "tue_button");
- g_object_bind_property (
- shell_settings, "cal-working-days-tuesday",
- widget, "active",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE);
-
- widget = e_builder_get_widget (prefs->builder, "wed_button");
- g_object_bind_property (
- shell_settings, "cal-working-days-wednesday",
- widget, "active",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE);
-
- widget = e_builder_get_widget (prefs->builder, "thu_button");
- g_object_bind_property (
- shell_settings, "cal-working-days-thursday",
- widget, "active",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE);
-
- widget = e_builder_get_widget (prefs->builder, "fri_button");
- g_object_bind_property (
- shell_settings, "cal-working-days-friday",
- widget, "active",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE);
-
- widget = e_builder_get_widget (prefs->builder, "sat_button");
- g_object_bind_property (
- shell_settings, "cal-working-days-saturday",
- widget, "active",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE);
-
- widget = e_builder_get_widget (prefs->builder, "week_start_day");
- g_object_bind_property (
- shell_settings, "cal-week-start-day",
- widget, "active",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE);
-
- widget = e_builder_get_widget (prefs->builder, "start_of_day");
- prefs->start_of_day = widget; /* XXX delete this */
- if (locale_supports_12_hour_format)
- g_object_bind_property (
- shell_settings, "cal-use-24-hour-format",
- widget, "use-24-hour-format",
- G_BINDING_SYNC_CREATE);
-
- widget = e_builder_get_widget (prefs->builder, "end_of_day");
- prefs->end_of_day = widget; /* XXX delete this */
- if (locale_supports_12_hour_format)
- g_object_bind_property (
- shell_settings, "cal-use-24-hour-format",
- widget, "use-24-hour-format",
- G_BINDING_SYNC_CREATE);
-
- widget = e_builder_get_widget (prefs->builder, "use_12_hour");
- gtk_widget_set_sensitive (widget, locale_supports_12_hour_format);
- g_object_bind_property (
- shell_settings, "cal-use-24-hour-format",
- widget, "active",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE |
- G_BINDING_INVERT_BOOLEAN);
-
- widget = e_builder_get_widget (prefs->builder, "use_24_hour");
- gtk_widget_set_sensitive (widget, locale_supports_12_hour_format);
- g_object_bind_property (
- shell_settings, "cal-use-24-hour-format",
- widget, "active",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE);
-
- widget = e_builder_get_widget (prefs->builder, "confirm_delete");
- g_object_bind_property (
- shell_settings, "cal-confirm-delete",
- widget, "active",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE);
-
- prefs->default_reminder = e_builder_get_widget (prefs->builder, "default_reminder");
- prefs->default_reminder_interval = e_builder_get_widget (prefs->builder, "default_reminder_interval");
- prefs->default_reminder_units = e_builder_get_widget (prefs->builder, "default_reminder_units");
- prefs->ba_reminder = e_builder_get_widget (prefs->builder, "ba_reminder");
- prefs->ba_reminder_interval = e_builder_get_widget (prefs->builder, "ba_reminder_interval");
- prefs->ba_reminder_units = e_builder_get_widget (prefs->builder, "ba_reminder_units");
-
- /* Display tab */
- prefs->time_divisions = e_builder_get_widget (prefs->builder, "time_divisions");
-
- widget = e_builder_get_widget (prefs->builder, "show_end_times");
- g_object_bind_property (
- shell_settings, "cal-show-event-end-times",
- widget, "active",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE);
-
- widget = e_builder_get_widget (prefs->builder, "compress_weekend");
- g_object_bind_property (
- shell_settings, "cal-compress-weekend",
- widget, "active",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE);
-
- widget = e_builder_get_widget (prefs->builder, "show_week_numbers");
- g_object_bind_property (
- shell_settings, "cal-show-week-numbers",
- widget, "active",
- 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");
- g_object_bind_property_full (
- shell_settings, "cal-tasks-color-due-today",
- widget, "color",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE,
- e_binding_transform_string_to_color,
- e_binding_transform_color_to_string,
- NULL, (GDestroyNotify) NULL);
-
- widget = e_builder_get_widget (prefs->builder, "tasks_overdue_color");
- g_object_bind_property_full (
- shell_settings, "cal-tasks-color-overdue",
- widget, "color",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE,
- e_binding_transform_string_to_color,
- e_binding_transform_color_to_string,
- (GDestroyNotify) NULL, NULL);
-
- prefs->tasks_hide_completed = e_builder_get_widget (prefs->builder, "tasks_hide_completed");
- prefs->tasks_hide_completed_interval = e_builder_get_widget (prefs->builder, "tasks_hide_completed_interval");
- prefs->tasks_hide_completed_units = e_builder_get_widget (prefs->builder, "tasks_hide_completed_units");
-
- /* Alarms tab */
- prefs->notify_with_tray = e_builder_get_widget (prefs->builder, "notify_with_tray");
- prefs->scrolled_window = e_builder_get_widget (prefs->builder, "calendar-source-scrolled-window");
-
- /* Free/Busy tab */
- widget = e_builder_get_widget (prefs->builder, "template_url");
- g_object_bind_property (
- shell_settings, "cal-free-busy-template",
- widget, "text",
- G_BINDING_BIDIRECTIONAL |
- G_BINDING_SYNC_CREATE);
-
- /* date/time format */
- table = e_builder_get_widget (prefs->builder, "datetime_format_table");
- e_datetime_format_add_setup_widget (table, 0, "calendar", "table", DTFormatKindDateTime, _("Ti_me and date:"));
- e_datetime_format_add_setup_widget (table, 1, "calendar", "table", DTFormatKindDate, _("_Date only:"));
-
- /* Hide senseless preferences when running in Express mode */
- e_shell_hide_widgets_for_express_mode (shell, prefs->builder,
- "label_second_zone",
- "hbox_second_zone",
- "timezone",
- "timezone_label",
- "hbox_use_system_timezone",
- "hbox_time_divisions",
- "show_end_times",
- "month_scroll_by_week",
- NULL);
-
- /* HACK: GTK+ 2.18 and 2.20 has a GtkTable which includes row/column spacing even for empty rows/columns.
- * When Evo runs in Express mode, we hide all the rows in the Time section of the calendar's General
- * preferences page. However, due to that behavior in GTK+, we get a lot of extra spacing in that
- * section. Since we know that in Express mode we only leave a single row visible, we'll make the
- * table's row spacing equal to 0 in that case.
- */
- if (e_shell_get_express_mode (shell)) {
- widget = e_builder_get_widget (prefs->builder, "time");
- gtk_table_set_row_spacings (GTK_TABLE (widget), 0);
- }
-
- /* Hook up and add the toplevel widget */
-
- target = e_cal_config_target_new_prefs (ec, prefs->gconf);
- e_config_set_target ((EConfig *)ec, (EConfigTarget *) target);
- toplevel = e_config_create_widget ((EConfig *)ec);
- gtk_container_add (GTK_CONTAINER (prefs), toplevel);
-
- show_config (prefs);
- /* FIXME: weakref? */
- setup_changes (prefs);
-}
-
-GType
-calendar_prefs_dialog_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static GTypeInfo type_info = {
- sizeof (CalendarPrefsDialogClass),
- NULL, NULL,
- (GClassInitFunc) calendar_prefs_dialog_class_init,
- NULL, NULL,
- sizeof (CalendarPrefsDialog),
- 0,
- (GInstanceInitFunc) calendar_prefs_dialog_init,
- };
-
- type = g_type_register_static (GTK_TYPE_VBOX, "CalendarPrefsDialog", &type_info, 0);
- }
-
- return type;
-}
-
-GtkWidget *
-calendar_prefs_dialog_new (EPreferencesWindow *window)
-{
- EShell *shell;
- CalendarPrefsDialog *dialog;
-
- shell = e_preferences_window_get_shell (window);
-
- g_return_val_if_fail (E_IS_SHELL (shell), NULL);
-
- dialog = g_object_new (CALENDAR_TYPE_PREFS_DIALOG, NULL);
-
- /* FIXME Kill this function. */
- calendar_prefs_dialog_construct (dialog, shell);
-
- return GTK_WIDGET (dialog);
-}
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.h b/calendar/gui/dialogs/cal-prefs-dialog.h
deleted file mode 100644
index 869003f664..0000000000
--- a/calendar/gui/dialogs/cal-prefs-dialog.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * 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 <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * David Trowbridge <trowbrds cs colorado edu>
- * Damon Chaplin <damon@ximian.com>
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- */
-
-#ifndef CAL_PREFS_DIALOG_H
-#define CAL_PREFS_DIALOG_H
-
-#include <gtk/gtk.h>
-#include <gconf/gconf-client.h>
-#include <libedataserverui/e-source-selector.h>
-#include <widgets/misc/e-preferences-window.h>
-
-/* Standard GObject macros */
-#define CALENDAR_TYPE_PREFS_DIALOG \
- (calendar_prefs_dialog_get_type ())
-#define CALENDAR_PREFS_DIALOG(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST \
- ((obj), CALENDAR_TYPE_PREFS_DIALOG, CalendarPrefsDialog))
-#define CALENDAR_PREFS_DIALOG_CLASS(cls) \
- (G_TYPE_CHECK_CLASS_CAST \
- ((cls), CALENDAR_TYPE_PREFS_DIALOG, CalendarPrefsDialogClass))
-#define CALENDAR_IS_PREFS_DIALOG(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE \
- ((obj), CALENDAR_TYPE_PREFS_DIALOG))
-#define CALENDAR_IS_PREFS_DIALOG_CLASS(cls) \
- (G_TYPE_CHECK_CLASS_TYPE \
- ((cls), CALENDAR_TYPE_PREFS_DIALOG))
-#define CALENDAR_PREFS_DIALOG_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS \
- ((obj), CALENDAR_TYPE_PREFS_DIALOG, CalendarPrefsDialogClass))
-
-G_BEGIN_DECLS
-
-typedef struct _CalendarPrefsDialog CalendarPrefsDialog;
-typedef struct _CalendarPrefsDialogClass CalendarPrefsDialogClass;
-
-struct _CalendarPrefsDialog {
- GtkVBox parent;
-
- GtkBuilder *builder;
-
- GConfClient *gconf;
-
- /* General tab */
- GtkWidget *day_second_zone;
- GtkWidget *working_days[7];
- GtkWidget *week_start_day;
- GtkWidget *start_of_day;
- GtkWidget *end_of_day;
- GtkWidget *confirm_delete;
- GtkWidget *default_reminder;
- GtkWidget *default_reminder_interval;
- GtkWidget *default_reminder_units;
- GtkWidget *ba_reminder;
- GtkWidget *ba_reminder_interval;
- GtkWidget *ba_reminder_units;
-
- /* Display tab */
- GtkWidget *time_divisions;
- GtkWidget *show_end_times;
- GtkWidget *compress_weekend;
- GtkWidget *month_scroll_by_week;
- GtkWidget *tasks_hide_completed;
- GtkWidget *tasks_hide_completed_interval;
- GtkWidget *tasks_hide_completed_units;
-
- /* Alarms tab */
- GtkWidget *notify_with_tray;
- GtkWidget *scrolled_window;
- ESourceList *alarms_list;
- GtkWidget *alarm_list_widget;
-
- /* Free/Busy tab */
- GtkWidget *url_add;
- GtkWidget *url_edit;
- GtkWidget *url_remove;
- GtkWidget *url_enable;
- GtkWidget *url_enable_label;
- GtkWidget *url_enable_image;
- GtkWidget *url_list;
- GtkWidget *template_url;
- guint destroyed : 1;
-};
-
-struct _CalendarPrefsDialogClass {
- GtkVBoxClass parent;
-};
-
-GType calendar_prefs_dialog_get_type (void);
-GtkWidget * calendar_prefs_dialog_new (EPreferencesWindow *window);
-
-G_END_DECLS
-
-#endif /* CAL_PREFS_DIALOG_H */
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.ui b/calendar/gui/dialogs/cal-prefs-dialog.ui
deleted file mode 100644
index 7e581cf4ad..0000000000
--- a/calendar/gui/dialogs/cal-prefs-dialog.ui
+++ /dev/null
@@ -1,1440 +0,0 @@
-<?xml version="1.0"?>
-<interface>
- <requires lib="gtk+" version="2.16"/>
- <!-- interface-requires evolution 0.0 -->
- <!-- interface-naming-policy toplevel-contextual -->
- <object class="GtkAdjustment" id="adjustment1">
- <property name="upper">9999</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- </object>
- <object class="GtkAdjustment" id="adjustment2">
- <property name="upper">9999</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- </object>
- <object class="GtkAdjustment" id="adjustment3">
- <property name="value">1</property>
- <property name="upper">9999</property>
- <property name="step_increment">1</property>
- <property name="page_increment">10</property>
- </object>
- <object class="GtkListStore" id="model1">
- <columns>
- <!-- column-name gchararray -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">Monday</col>
- </row>
- <row>
- <col id="0" translatable="yes">Tuesday</col>
- </row>
- <row>
- <col id="0" translatable="yes">Wednesday</col>
- </row>
- <row>
- <col id="0" translatable="yes">Thursday</col>
- </row>
- <row>
- <col id="0" translatable="yes">Friday</col>
- </row>
- <row>
- <col id="0" translatable="yes">Saturday</col>
- </row>
- <row>
- <col id="0" translatable="yes">Sunday</col>
- </row>
- </data>
- </object>
- <object class="GtkListStore" id="model2">
- <columns>
- <!-- column-name gchararray -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">Minutes</col>
- </row>
- <row>
- <col id="0" translatable="yes">Hours</col>
- </row>
- <row>
- <col id="0" translatable="yes">Days</col>
- </row>
- </data>
- </object>
- <object class="GtkListStore" id="model3">
- <columns>
- <!-- column-name gchararray -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">Minutes</col>
- </row>
- <row>
- <col id="0" translatable="yes">Hours</col>
- </row>
- <row>
- <col id="0" translatable="yes">Days</col>
- </row>
- </data>
- </object>
- <object class="GtkListStore" id="model4">
- <columns>
- <!-- column-name gchararray -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">60 minutes</col>
- </row>
- <row>
- <col id="0" translatable="yes">30 minutes</col>
- </row>
- <row>
- <col id="0" translatable="yes">15 minutes</col>
- </row>
- <row>
- <col id="0" translatable="yes">10 minutes</col>
- </row>
- <row>
- <col id="0" translatable="yes">05 minutes</col>
- </row>
- </data>
- </object>
- <object class="GtkListStore" id="model5">
- <columns>
- <!-- column-name gchararray -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">Minutes</col>
- </row>
- <row>
- <col id="0" translatable="yes">Hours</col>
- </row>
- <row>
- <col id="0" translatable="yes">Days</col>
- </row>
- </data>
- </object>
- <object class="GtkNotebook" id="toplevel-notebook">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <object class="GtkVBox" id="general">
- <property name="visible">True</property>
- <property name="border_width">12</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Time</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox1">
- <property name="visible">True</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="label7">
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="time">
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">6</property>
- <property name="row_spacing">6</property>
- <child>
- <object class="GtkLabel" id="label_second_zone">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Se_cond zone:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">day_second_zone</property>
- </object>
- <packing>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox_second_zone">
- <property name="visible">True</property>
- <child>
- <object class="GtkButton" id="day_second_zone">
- <property name="label" translatable="yes" context="cal-second-zone">None</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label64">
- <property name="visible">True</property>
- <property name="xpad">6</property>
- <property name="label" translatable="yes">(Shown in a Day View)</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="ETimezoneEntry" id="timezone">
- <property name="visible">True</property>
- <accessibility>
- <relation type="labelled-by" target="timezone_label"/>
- </accessibility>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="timezone_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Time _zone:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">timezone</property>
- </object>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox_use_system_timezone">
- <property name="visible">True</property>
- <child>
- <object class="GtkCheckButton" id="use-system-tz-check">
- <property name="label" translatable="yes">Use s_ystem time zone</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="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="system-tz-label">
- <property name="visible">True</property>
- <property name="xpad">5</property>
- <property name="label">(system/tz)</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_time_format">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Time format:</property>
- </object>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox_time_format">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkRadioButton" id="use_12_hour">
- <property name="label" translatable="yes">_12 hour (AM/PM)</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="active">True</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="use_24_hour">
- <property name="label" translatable="yes">_24 hour</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>
- <property name="group">use_12_hour</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Work Week</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox2">
- <property name="visible">True</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="label8">
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="workWeek">
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">6</property>
- <property name="row_spacing">6</property>
- <child>
- <object class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes" comments="A weekday like &quot;Monday&quot; follows">Wee_k starts on:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">week_start_day</property>
- </object>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label13">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Work days:</property>
- </object>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="day_start_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Day begins:</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox5">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkCheckButton" id="mon_button">
- <property name="label" translatable="yes" comments="Monday">_Mon</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>
- <child internal-child="accessible">
- <object class="AtkObject" id="mon_button-atkobject">
- <property name="AtkObject::accessible-name" translatable="yes">Monday</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="tue_button">
- <property name="label" translatable="yes" comments="Tuesday">_Tue</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>
- <child internal-child="accessible">
- <object class="AtkObject" id="tue_button-atkobject">
- <property name="AtkObject::accessible-name" translatable="yes">Tuesday</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="wed_button">
- <property name="label" translatable="yes" comments="Wednesday">_Wed</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>
- <child internal-child="accessible">
- <object class="AtkObject" id="wed_button-atkobject">
- <property name="AtkObject::accessible-name" translatable="yes">Wednesday</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="thu_button">
- <property name="label" translatable="yes" comments="Thursday">T_hu</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>
- <child internal-child="accessible">
- <object class="AtkObject" id="thu_button-atkobject">
- <property name="AtkObject::accessible-name" translatable="yes">Thursday</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="fri_button">
- <property name="label" translatable="yes" comments="Friday">_Fri</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>
- <child internal-child="accessible">
- <object class="AtkObject" id="fri_button-atkobject">
- <property name="AtkObject::accessible-name" translatable="yes">Friday</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="sat_button">
- <property name="label" translatable="yes" comments="Saturday">_Sat</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>
- <child internal-child="accessible">
- <object class="AtkObject" id="sat_button-atkobject">
- <property name="AtkObject::accessible-name" translatable="yes">Saturday</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">5</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="sun_button">
- <property name="label" translatable="yes" comments="Sunday">S_un</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>
- <child internal-child="accessible">
- <object class="AtkObject" id="sun_button-atkobject">
- <property name="AtkObject::accessible-name" translatable="yes">Sunday</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">6</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="week_start_day">
- <property name="visible">True</property>
- <property name="model">model1</property>
- <child>
- <object class="GtkCellRendererText" id="renderer1"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox13">
- <property name="visible">True</property>
- <property name="spacing">12</property>
- <child>
- <object class="EDateEdit" id="start_of_day">
- <property name="visible">True</property>
- <property name="show_date">False</property>
- <property name="show_week_numbers">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="day_end_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Day _ends:</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="EDateEdit" id="end_of_day">
- <property name="visible">True</property>
- <property name="show_date">False</property>
- <property name="show_week_numbers">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Alerts</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox3">
- <property name="visible">True</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="label9">
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="alerts">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkCheckButton" id="confirm_delete">
- <property name="label" translatable="yes">_Ask for confirmation when deleting items</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">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox6">
- <property name="visible">True</property>
- <property name="spacing">4</property>
- <child>
- <object class="GtkCheckButton" id="default_reminder">
- <property name="label" translatable="yes" comments="This is the first half of a user preference. &quot;Show a reminder [time-period] before every appointment&quot;">Sh_ow a reminder</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">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="default_reminder_interval">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">adjustment1</property>
- <property name="climb_rate">1</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="default_reminder_units">
- <property name="visible">True</property>
- <property name="model">model2</property>
- <child>
- <object class="GtkCellRendererText" id="renderer2"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label16">
- <property name="visible">True</property>
- <property name="label" translatable="yes" comments="This is the last half of a user preference. &quot;Show a reminder [time-period] before every appointment&quot;">before every appointment</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox7">
- <property name="visible">True</property>
- <property name="spacing">4</property>
- <child>
- <object class="GtkCheckButton" id="ba_reminder">
- <property name="label" translatable="yes" comments="This is the first half of a user preference. &quot;Show a reminder [time-period] before every anniversary/birthday&quot;">Show a _reminder</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">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="ba_reminder_interval">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">adjustment2</property>
- <property name="climb_rate">1</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="ba_reminder_units">
- <property name="visible">True</property>
- <property name="model">model3</property>
- <child>
- <object class="GtkCellRendererText" id="renderer3"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="ba_reminder_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes" comments="This is the last half of a user preference. &quot;Show a reminder [time-period] before every anniversary/birthday&quot;">before every anniversary/birthday</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">5</property>
- </packing>
- </child>
- </object>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">General</property>
- </object>
- <packing>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="display">
- <property name="visible">True</property>
- <property name="border_width">12</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="label17">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">General</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox8">
- <property name="visible">True</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="label19">
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="displayGeneral">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkHBox" id="hbox_time_divisions">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="label23">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Time divisions:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">time_divisions</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="time_divisions">
- <property name="visible">True</property>
- <property name="model">model4</property>
- <child>
- <object class="GtkCellRendererText" id="renderer4"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="show_end_times">
- <property name="label" translatable="yes">_Show appointment end times in week and month view</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">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="compress_weekend">
- <property name="label" translatable="yes">_Compress weekends in month view</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">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="show_week_numbers">
- <property name="label" translatable="yes">Show week _numbers</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">3</property>
- </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>
- <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">5</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label18">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Task List</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox9">
- <property name="visible">True</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="label20">
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="taskList">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkHBox" id="hbox14">
- <property name="visible">True</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="label21">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">T_asks due today:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">tasks_due_today_color</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkColorButton" id="tasks_due_today_color">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="title" translatable="yes">Pick a color</property>
- <property name="color">#000000000000</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label22">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Overdue tasks:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">tasks_overdue_color</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkColorButton" id="tasks_overdue_color">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="title" translatable="yes">Pick a color</property>
- <property name="color">#000000000000</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox11">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkCheckButton" id="tasks_hide_completed">
- <property name="label" translatable="yes">_Hide completed tasks after</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">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="tasks_hide_completed_interval">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">adjustment3</property>
- <property name="climb_rate">1</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="tasks_hide_completed_units">
- <property name="visible">True</property>
- <property name="model">model5</property>
- <child>
- <object class="GtkCellRendererText" id="renderer5"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label65">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Date/Time Format</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox27">
- <property name="visible">True</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="label66">
- <property name="visible">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="datetime_format_table">
- <property name="visible">True</property>
- <property name="n_columns">3</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">5</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Display</property>
- </object>
- <packing>
- <property name="position">1</property>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="alarms">
- <property name="visible">True</property>
- <property name="border_width">12</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="label67">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Alarms</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="left_padding">10</property>
- <child>
- <object class="GtkCheckButton" id="notify_with_tray">
- <property name="label" translatable="yes">Display alarms in _notification area only</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>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label62">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Select the calendars for alarm notification</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="calendar-source-scrolled-window">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">in</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="alarm-label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Alarms</property>
- </object>
- <packing>
- <property name="position">2</property>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="freebusy">
- <property name="visible">True</property>
- <property name="border_width">12</property>
- <property name="orientation">vertical</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="default-freebusy-header">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Default Free/Busy Server</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="default-freebusy-alignment">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <object class="GtkVBox" id="default-freebusy-vbox">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkHBox" id="hbox18">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="label33">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Template:</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="template_url">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">&#x25CF;</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label32">
- <property name="visible">True</property>
- <property name="label" translatable="yes">%u and %d will be replaced by user and domain from the email address.</property>
- <property name="wrap">True</property>
- <attributes>
- <attribute name="style" value="italic"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Free/Busy</property>
- </object>
- <packing>
- <property name="position">3</property>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- </object>
- <object class="GtkSizeGroup" id="day_begins_ends_sizegroup">
- <widgets>
- <widget name="day_end_label"/>
- <widget name="day_start_label"/>
- </widgets>
- </object>
-</interface>
diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c
index 69ec171917..a29d75739c 100644
--- a/calendar/gui/dialogs/comp-editor-util.c
+++ b/calendar/gui/dialogs/comp-editor-util.c
@@ -33,7 +33,6 @@
#include <libedataserver/e-time-utils.h>
#include <libecal/e-cal-time-util.h>
#include "widgets/misc/e-dateedit.h"
-#include "../calendar-config.h"
#include "../itip-utils.h"
#include <shell/e-shell.h>
#include "comp-editor-util.h"
@@ -147,14 +146,15 @@ comp_editor_new_date_edit (gboolean show_date,
FIXME: Should probably use the timezone from somewhere in the component
rather than the current timezone. */
struct tm
-comp_editor_get_current_time (GObject *object, gpointer data)
+comp_editor_get_current_time (EDateEdit *date_edit,
+ CompEditor *editor)
{
icaltimezone *zone;
struct icaltimetype tt;
struct tm tmp_tm = { 0 };
/* Get the current timezone. */
- zone = calendar_config_get_icaltimezone ();
+ zone = comp_editor_get_timezone (editor);
tt = icaltime_from_timet_with_zone (time (NULL), FALSE, zone);
diff --git a/calendar/gui/dialogs/comp-editor-util.h b/calendar/gui/dialogs/comp-editor-util.h
index 07ba65a799..a4ecc468a7 100644
--- a/calendar/gui/dialogs/comp-editor-util.h
+++ b/calendar/gui/dialogs/comp-editor-util.h
@@ -26,8 +26,9 @@
#define _COMP_EDITOR_UTIL_H_
#include <gtk/gtk.h>
-#include "comp-editor-page.h"
+#include "comp-editor.h"
#include "../e-meeting-attendee.h"
+#include <misc/e-dateedit.h>
void comp_editor_dates (CompEditorPageDates *date, ECalComponent *comp);
void comp_editor_free_dates (CompEditorPageDates *dates);
@@ -38,7 +39,7 @@ GtkWidget * comp_editor_new_date_edit (gboolean show_date,
gboolean show_time,
gboolean make_time_insensitive);
-struct tm comp_editor_get_current_time (GObject *object, gpointer data);
+struct tm comp_editor_get_current_time (EDateEdit *date_edit, CompEditor *editor);
gchar *comp_editor_strip_categories (const gchar *categories);
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index af5b23d384..1714ef405d 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -38,6 +38,7 @@
#include <e-util/e-util.h>
#include <e-util/e-alert-sink.h>
#include <e-util/e-dialog-utils.h>
+#include <e-util/e-extensible.h>
#include <e-util/e-util-private.h>
#include <e-util/gconf-bridge.h>
#include <shell/e-shell.h>
@@ -112,6 +113,14 @@ struct _CompEditorPrivate {
below */
CompEditorFlags flags;
+ icaltimezone *zone;
+ gboolean use_24_hour_format;
+
+ gint work_day_end_hour;
+ gint work_day_end_minute;
+ gint work_day_start_hour;
+ gint work_day_start_minute;
+
gboolean changed;
gboolean needs_send;
@@ -131,7 +140,13 @@ enum {
PROP_FLAGS,
PROP_FOCUS_TRACKER,
PROP_SHELL,
- PROP_SUMMARY
+ PROP_SUMMARY,
+ PROP_TIMEZONE,
+ PROP_USE_24_HOUR_FORMAT,
+ PROP_WORK_DAY_END_HOUR,
+ PROP_WORK_DAY_END_MINUTE,
+ PROP_WORK_DAY_START_HOUR,
+ PROP_WORK_DAY_START_MINUTE
};
static const gchar *ui =
@@ -731,11 +746,12 @@ action_print_cb (GtkAction *action,
CompEditor *editor)
{
CompEditorPrivate *priv = editor->priv;
- GtkPrintOperationAction print_action;
ECalComponent *comp;
GList *l;
icalcomponent *component;
icalcomponent *clone;
+ icaltimezone *zone;
+ gboolean use_24_hour_format;
comp = e_cal_component_new ();
component = e_cal_component_get_icalcomponent (priv->comp);
@@ -745,8 +761,12 @@ action_print_cb (GtkAction *action,
for (l = priv->pages; l != NULL; l = l->next)
comp_editor_page_fill_component (l->data, comp);
- print_action = GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG;
- print_comp (comp, priv->client, print_action);
+ zone = comp_editor_get_timezone (editor);
+ use_24_hour_format = comp_editor_get_use_24_hour_format (editor);
+
+ print_comp (
+ comp, priv->client, zone, use_24_hour_format,
+ GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG);
g_object_unref (comp);
}
@@ -756,11 +776,12 @@ action_print_preview_cb (GtkAction *action,
CompEditor *editor)
{
CompEditorPrivate *priv = editor->priv;
- GtkPrintOperationAction print_action;
ECalComponent *comp;
GList *l;
icalcomponent *component;
icalcomponent *clone;
+ icaltimezone *zone;
+ gboolean use_24_hour_format;
comp = e_cal_component_new ();
component = e_cal_component_get_icalcomponent (priv->comp);
@@ -770,8 +791,12 @@ action_print_preview_cb (GtkAction *action,
for (l = priv->pages; l != NULL; l = l->next)
comp_editor_page_fill_component (l->data, comp);
- print_action = GTK_PRINT_OPERATION_ACTION_PREVIEW;
- print_comp (comp, priv->client, print_action);
+ zone = comp_editor_get_timezone (editor);
+ use_24_hour_format = comp_editor_get_use_24_hour_format (editor);
+
+ print_comp (
+ comp, priv->client, zone, use_24_hour_format,
+ GTK_PRINT_OPERATION_ACTION_PREVIEW);
g_object_unref (comp);
}
@@ -1271,6 +1296,42 @@ comp_editor_set_property (GObject *object,
COMP_EDITOR (object),
g_value_get_string (value));
return;
+
+ case PROP_TIMEZONE:
+ comp_editor_set_timezone (
+ COMP_EDITOR (object),
+ g_value_get_pointer (value));
+ return;
+
+ case PROP_USE_24_HOUR_FORMAT:
+ comp_editor_set_use_24_hour_format (
+ COMP_EDITOR (object),
+ g_value_get_boolean (value));
+ return;
+
+ case PROP_WORK_DAY_END_HOUR:
+ comp_editor_set_work_day_end_hour (
+ COMP_EDITOR (object),
+ g_value_get_int (value));
+ return;
+
+ case PROP_WORK_DAY_END_MINUTE:
+ comp_editor_set_work_day_end_minute (
+ COMP_EDITOR (object),
+ g_value_get_int (value));
+ return;
+
+ case PROP_WORK_DAY_START_HOUR:
+ comp_editor_set_work_day_start_hour (
+ COMP_EDITOR (object),
+ g_value_get_int (value));
+ return;
+
+ case PROP_WORK_DAY_START_MINUTE:
+ comp_editor_set_work_day_start_minute (
+ COMP_EDITOR (object),
+ g_value_get_int (value));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -1318,6 +1379,42 @@ comp_editor_get_property (GObject *object,
value, comp_editor_get_summary (
COMP_EDITOR (object)));
return;
+
+ case PROP_TIMEZONE:
+ g_value_set_pointer (
+ value, comp_editor_get_timezone (
+ COMP_EDITOR (object)));
+ return;
+
+ case PROP_USE_24_HOUR_FORMAT:
+ g_value_set_boolean (
+ value, comp_editor_get_use_24_hour_format (
+ COMP_EDITOR (object)));
+ return;
+
+ case PROP_WORK_DAY_END_HOUR:
+ g_value_set_int (
+ value, comp_editor_get_work_day_end_hour (
+ COMP_EDITOR (object)));
+ return;
+
+ case PROP_WORK_DAY_END_MINUTE:
+ g_value_set_int (
+ value, comp_editor_get_work_day_end_minute (
+ COMP_EDITOR (object)));
+ return;
+
+ case PROP_WORK_DAY_START_HOUR:
+ g_value_set_int (
+ value, comp_editor_get_work_day_start_hour (
+ COMP_EDITOR (object)));
+ return;
+
+ case PROP_WORK_DAY_START_MINUTE:
+ g_value_set_int (
+ value, comp_editor_get_work_day_start_minute (
+ COMP_EDITOR (object)));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -1605,14 +1702,81 @@ comp_editor_class_init (CompEditorClass *class)
NULL,
G_PARAM_READWRITE));
- signals[OBJECT_CREATED] =
- g_signal_new ("object_created",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (CompEditorClass, object_created),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
+ g_object_class_install_property (
+ object_class,
+ PROP_TIMEZONE,
+ g_param_spec_pointer (
+ "timezone",
+ "Time Zone",
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_USE_24_HOUR_FORMAT,
+ g_param_spec_boolean (
+ "use-24-hour-format",
+ "Use 24-hour Format",
+ NULL,
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_WORK_DAY_END_HOUR,
+ g_param_spec_int (
+ "work-day-end-hour",
+ "Work Day End Hour",
+ NULL,
+ 0,
+ 23,
+ 0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_WORK_DAY_END_MINUTE,
+ g_param_spec_int (
+ "work-day-end-minute",
+ "Work Day End Minute",
+ NULL,
+ 0,
+ 59,
+ 0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_WORK_DAY_START_HOUR,
+ g_param_spec_int (
+ "work-day-start-hour",
+ "Work Day Start Hour",
+ NULL,
+ 0,
+ 23,
+ 0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_WORK_DAY_START_MINUTE,
+ g_param_spec_int (
+ "work-day-start-minute",
+ "Work Day Start Minute",
+ NULL,
+ 0,
+ 59,
+ 0,
+ G_PARAM_READWRITE));
+
+ signals[OBJECT_CREATED] = g_signal_new (
+ "object_created",
+ G_TYPE_FROM_CLASS (class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (CompEditorClass, object_created),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
}
static void
@@ -2091,6 +2255,120 @@ comp_editor_get_summary (CompEditor *editor)
return editor->priv->summary;
}
+icaltimezone *
+comp_editor_get_timezone (CompEditor *editor)
+{
+ g_return_val_if_fail (IS_COMP_EDITOR (editor), NULL);
+
+ return editor->priv->zone;
+}
+
+void
+comp_editor_set_timezone (CompEditor *editor,
+ icaltimezone *zone)
+{
+ g_return_if_fail (IS_COMP_EDITOR (editor));
+
+ editor->priv->zone = zone;
+
+ g_object_notify (G_OBJECT (editor), "timezone");
+}
+
+gboolean
+comp_editor_get_use_24_hour_format (CompEditor *editor)
+{
+ g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE);
+
+ return editor->priv->use_24_hour_format;
+}
+
+void
+comp_editor_set_use_24_hour_format (CompEditor *editor,
+ gboolean use_24_hour_format)
+{
+ g_return_if_fail (IS_COMP_EDITOR (editor));
+
+ editor->priv->use_24_hour_format = use_24_hour_format;
+
+ g_object_notify (G_OBJECT (editor), "use-24-hour-format");
+}
+
+gint
+comp_editor_get_work_day_end_hour (CompEditor *editor)
+{
+ g_return_val_if_fail (IS_COMP_EDITOR (editor), 0);
+
+ return editor->priv->work_day_end_hour;
+}
+
+void
+comp_editor_set_work_day_end_hour (CompEditor *editor,
+ gint work_day_end_hour)
+{
+ g_return_if_fail (IS_COMP_EDITOR (editor));
+
+ editor->priv->work_day_end_hour = work_day_end_hour;
+
+ g_object_notify (G_OBJECT (editor), "work-day-end-hour");
+}
+
+gint
+comp_editor_get_work_day_end_minute (CompEditor *editor)
+{
+ g_return_val_if_fail (IS_COMP_EDITOR (editor), 0);
+
+ return editor->priv->work_day_end_minute;
+}
+
+void
+comp_editor_set_work_day_end_minute (CompEditor *editor,
+ gint work_day_end_minute)
+{
+ g_return_if_fail (IS_COMP_EDITOR (editor));
+
+ editor->priv->work_day_end_minute = work_day_end_minute;
+
+ g_object_notify (G_OBJECT (editor), "work-day-end-minute");
+}
+
+gint
+comp_editor_get_work_day_start_hour (CompEditor *editor)
+{
+ g_return_val_if_fail (IS_COMP_EDITOR (editor), 0);
+
+ return editor->priv->work_day_start_hour;
+}
+
+void
+comp_editor_set_work_day_start_hour (CompEditor *editor,
+ gint work_day_start_hour)
+{
+ g_return_if_fail (IS_COMP_EDITOR (editor));
+
+ editor->priv->work_day_start_hour = work_day_start_hour;
+
+ g_object_notify (G_OBJECT (editor), "work-day-start-hour");
+}
+
+gint
+comp_editor_get_work_day_start_minute (CompEditor *editor)
+{
+ g_return_val_if_fail (IS_COMP_EDITOR (editor), 0);
+
+ return editor->priv->work_day_start_minute;
+}
+
+void
+comp_editor_set_work_day_start_minute (CompEditor *editor,
+ gint work_day_start_minute)
+{
+ g_return_if_fail (IS_COMP_EDITOR (editor));
+
+ editor->priv->work_day_start_minute = work_day_start_minute;
+
+ g_object_notify (G_OBJECT (editor), "work-day-start-minute");
+}
+
/**
* comp_editor_set_changed:
* @editor: A component editor
diff --git a/calendar/gui/dialogs/comp-editor.h b/calendar/gui/dialogs/comp-editor.h
index 09ced8f533..591300ffd2 100644
--- a/calendar/gui/dialogs/comp-editor.h
+++ b/calendar/gui/dialogs/comp-editor.h
@@ -123,6 +123,34 @@ EShell * comp_editor_get_shell (CompEditor *editor);
void comp_editor_set_summary (CompEditor *editor,
const gchar *summary);
const gchar * comp_editor_get_summary (CompEditor *editor);
+icaltimezone * comp_editor_get_timezone (CompEditor *editor);
+void comp_editor_set_timezone (CompEditor *editor,
+ icaltimezone *zone);
+gboolean comp_editor_get_use_24_hour_format
+ (CompEditor *editor);
+void comp_editor_set_use_24_hour_format
+ (CompEditor *editor,
+ gboolean use_24_hour_format);
+gint comp_editor_get_work_day_end_hour
+ (CompEditor *editor);
+void comp_editor_set_work_day_end_hour
+ (CompEditor *editor,
+ gint work_day_end_hour);
+gint comp_editor_get_work_day_end_minute
+ (CompEditor *editor);
+void comp_editor_set_work_day_end_minute
+ (CompEditor *editor,
+ gint work_day_end_minute);
+gint comp_editor_get_work_day_start_hour
+ (CompEditor *editor);
+void comp_editor_set_work_day_start_hour
+ (CompEditor *editor,
+ gint work_day_start_hour);
+gint comp_editor_get_work_day_start_minute
+ (CompEditor *editor);
+void comp_editor_set_work_day_start_minute
+ (CompEditor *editor,
+ gint work_day_start_minute);
void comp_editor_append_page (CompEditor *editor,
CompEditorPage *page,
const gchar *label,
diff --git a/calendar/gui/dialogs/delete-comp.c b/calendar/gui/dialogs/delete-comp.c
index ecdaf58762..b0ccb953b2 100644
--- a/calendar/gui/dialogs/delete-comp.c
+++ b/calendar/gui/dialogs/delete-comp.c
@@ -28,7 +28,6 @@
#include <glib/gi18n.h>
#include "e-util/e-alert-dialog.h"
-#include "../calendar-config.h"
#include "delete-comp.h"
@@ -57,9 +56,10 @@
**/
gboolean
delete_component_dialog (ECalComponent *comp,
- gboolean consider_as_untitled,
- gint n_comps, ECalComponentVType vtype,
- GtkWidget *widget)
+ gboolean consider_as_untitled,
+ gint n_comps,
+ ECalComponentVType vtype,
+ GtkWidget *widget)
{
const gchar *id;
gchar *arg0 = NULL;
@@ -74,12 +74,8 @@ delete_component_dialog (ECalComponent *comp,
g_return_val_if_fail (vtype != E_CAL_COMPONENT_NO_TYPE, FALSE);
}
- g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- if (!calendar_config_get_confirm_delete ())
- return TRUE;
-
if (comp) {
ECalComponentText summary;
diff --git a/calendar/gui/dialogs/e-send-options-utils.c b/calendar/gui/dialogs/e-send-options-utils.c
index c56caab8bf..b21352d6f3 100644
--- a/calendar/gui/dialogs/e-send-options-utils.c
+++ b/calendar/gui/dialogs/e-send-options-utils.c
@@ -23,7 +23,6 @@
*/
#include "e-send-options-utils.h"
-#include "../calendar-config.h"
#include <glib.h>
#include <string.h>
@@ -151,7 +150,9 @@ e_send_options_utils_set_default_data (ESendOptionsDialog *sod, ESource *source,
}
void
-e_send_options_utils_fill_component (ESendOptionsDialog *sod, ECalComponent *comp)
+e_send_options_utils_fill_component (ESendOptionsDialog *sod,
+ ECalComponent *comp,
+ icaltimezone *zone)
{
gint i = 1;
icalproperty *prop;
@@ -189,7 +190,6 @@ e_send_options_utils_fill_component (ESendOptionsDialog *sod, ECalComponent *com
struct icaltimetype temp;
gchar *str;
- icaltimezone *zone = calendar_config_get_icaltimezone ();
temp = icaltime_from_timet_with_zone (gopts->delay_until, FALSE, zone);
str = icaltime_as_ical_string_r (temp);
diff --git a/calendar/gui/dialogs/e-send-options-utils.h b/calendar/gui/dialogs/e-send-options-utils.h
index d6852b8f5a..c1a63a291a 100644
--- a/calendar/gui/dialogs/e-send-options-utils.h
+++ b/calendar/gui/dialogs/e-send-options-utils.h
@@ -29,6 +29,13 @@
#include <libecal/e-cal-component.h>
#include <libedataserver/e-source-list.h>
-void e_send_options_utils_set_default_data (ESendOptionsDialog *sod, ESource *source, const gchar *type);
-void e_send_options_utils_fill_component (ESendOptionsDialog *sod, ECalComponent *comp);
+void e_send_options_utils_set_default_data
+ (ESendOptionsDialog *sod,
+ ESource *source,
+ const gchar *type);
+void e_send_options_utils_fill_component
+ (ESendOptionsDialog *sod,
+ ECalComponent *comp,
+ icaltimezone *zone);
+
#endif
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c
index ad3c963ca6..11dbe134c0 100644
--- a/calendar/gui/dialogs/event-editor.c
+++ b/calendar/gui/dialogs/event-editor.c
@@ -330,7 +330,7 @@ event_editor_constructor (GType type,
content_area =
gtk_dialog_get_content_area (GTK_DIALOG (priv->recur_window));
- priv->recur_page = recurrence_page_new (editor);
+ priv->recur_page = recurrence_page_new (priv->model, editor);
page = COMP_EDITOR_PAGE (priv->recur_page);
if (!e_shell_get_express_mode (shell)) {
gtk_container_add (
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index 0418c7f5df..32c2c18653 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -40,7 +40,6 @@
#include "misc/e-send-options.h"
#include "misc/e-buffer-tagger.h"
#include <libecal/e-cal-time-util.h>
-#include "../calendar-config.h"
#include "../e-timezone-entry.h"
#include "e-util/e-util.h"
@@ -166,7 +165,7 @@ struct _EventPagePrivate {
GtkWidget *attendees_label;
/* ListView stuff */
- EMeetingStore *model;
+ EMeetingStore *meeting_store;
EMeetingListView *list_view;
gint row;
@@ -380,7 +379,9 @@ set_all_day (EventPage *epage, gboolean all_day)
}
static void
-update_time (EventPage *epage, ECalComponentDateTime *start_date, ECalComponentDateTime *end_date)
+update_time (EventPage *epage,
+ ECalComponentDateTime *start_date,
+ ECalComponentDateTime *end_date)
{
EventPagePrivate *priv = epage->priv;
CompEditor *editor;
@@ -431,7 +432,8 @@ update_time (EventPage *epage, ECalComponentDateTime *start_date, ECalComponentD
timezone, so that if the user toggles the 'All Day Event' checkbox
the event uses the current timezone rather than none at all. */
if (all_day_event)
- start_zone = calendar_config_get_icaltimezone ();
+ start_zone = e_meeting_store_get_timezone (
+ epage->priv->meeting_store);
g_signal_handlers_block_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
@@ -457,7 +459,7 @@ update_time (EventPage *epage, ECalComponentDateTime *start_date, ECalComponentD
if (start_zone)
e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (priv->start_timezone),
start_zone);
- def_zone = calendar_config_get_icaltimezone ();
+ def_zone = e_meeting_store_get_timezone (epage->priv->meeting_store);
if (!def_zone || !start_zone || strcmp (icaltimezone_get_tzid (def_zone), icaltimezone_get_tzid (start_zone)))
homezone = FALSE;
@@ -1126,7 +1128,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
a = get_current_account (epage);
if (a != NULL) {
- priv->ia = e_meeting_store_add_attendee_with_defaults (priv->model);
+ priv->ia = e_meeting_store_add_attendee_with_defaults (priv->meeting_store);
g_object_ref (priv->ia);
if (!(backend_addr && *backend_addr) || !g_ascii_strcasecmp (backend_addr, a->id->address)) {
@@ -1403,8 +1405,10 @@ event_page_fill_component (CompEditorPage *page, ECalComponent *comp)
e_cal_component_set_transparency (comp, busy ? E_CAL_COMPONENT_TRANSP_OPAQUE : E_CAL_COMPONENT_TRANSP_TRANSPARENT);
/* send options */
- if (priv->sendoptions_shown && priv->sod)
- e_send_options_utils_fill_component (priv->sod, comp);
+ if (priv->sendoptions_shown && priv->sod) {
+ icaltimezone *zone = comp_editor_get_timezone (editor);
+ e_send_options_utils_fill_component (priv->sod, comp, zone);
+ }
/* Alarm */
e_cal_component_remove_all_alarms (comp);
@@ -1491,7 +1495,7 @@ event_page_fill_component (CompEditorPage *page, ECalComponent *comp)
break;
case ALARM_USER_TIME:
- switch (calendar_config_get_default_reminder_units ()) {
+ switch (e_meeting_store_get_default_reminder_units (priv->meeting_store)) {
case E_DURATION_DAYS:
trigger.u.rel_duration.days = priv->alarm_interval;
break;
@@ -1559,7 +1563,7 @@ event_page_fill_component (CompEditorPage *page, ECalComponent *comp)
g_free (sentby);
}
- if (e_meeting_store_count_actual_attendees (priv->model) < 1) {
+ if (e_meeting_store_count_actual_attendees (priv->meeting_store) < 1) {
e_notice (priv->main, GTK_MESSAGE_ERROR,
_("At least one attendee is required."));
return FALSE;
@@ -1568,7 +1572,7 @@ event_page_fill_component (CompEditorPage *page, ECalComponent *comp)
if (flags & COMP_EDITOR_DELEGATE) {
GSList *attendee_list, *l;
gint i;
- const GPtrArray *attendees = e_meeting_store_get_attendees (priv->model);
+ const GPtrArray *attendees = e_meeting_store_get_attendees (priv->meeting_store);
e_cal_component_get_attendee_list (priv->comp, &attendee_list);
@@ -1595,7 +1599,7 @@ event_page_fill_component (CompEditorPage *page, ECalComponent *comp)
e_cal_component_set_attendee_list (comp, attendee_list);
e_cal_component_free_attendee_list (attendee_list);
} else
- set_attendees (comp, e_meeting_store_get_attendees (priv->model));
+ set_attendees (comp, e_meeting_store_get_attendees (priv->meeting_store));
}
return TRUE;
@@ -1767,7 +1771,7 @@ add_clicked_cb (GtkButton *btn, EventPage *epage)
editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (epage));
flags = comp_editor_get_flags (editor);
- attendee = e_meeting_store_add_attendee_with_defaults (epage->priv->model);
+ attendee = e_meeting_store_add_attendee_with_defaults (epage->priv->meeting_store);
if (flags & COMP_EDITOR_DELEGATE) {
e_meeting_attendee_set_delfrom (attendee, g_strdup_printf ("MAILTO:%s", epage->priv->user_add));
@@ -1837,7 +1841,7 @@ remove_attendee (EventPage *epage, EMeetingAttendee *ia)
if (e_meeting_attendee_is_set_delfrom (ia)) {
EMeetingAttendee *ib;
- ib = e_meeting_store_find_attendee (priv->model, e_meeting_attendee_get_delfrom (ia), &pos);
+ ib = e_meeting_store_find_attendee (priv->meeting_store, e_meeting_attendee_get_delfrom (ia), &pos);
if (ib != NULL) {
e_meeting_attendee_set_delto (ib, NULL);
@@ -1857,11 +1861,11 @@ remove_attendee (EventPage *epage, EMeetingAttendee *ia)
}
if (e_meeting_attendee_get_delto (ia) != NULL)
- ib = e_meeting_store_find_attendee (priv->model, e_meeting_attendee_get_delto (ia), NULL);
+ ib = e_meeting_store_find_attendee (priv->meeting_store, e_meeting_attendee_get_delto (ia), NULL);
comp_editor_manage_new_attendees (priv->comp, ia, FALSE);
e_meeting_list_view_remove_attendee_from_name_selector (priv->list_view, ia);
- e_meeting_store_remove_attendee (priv->model, ia);
+ e_meeting_store_remove_attendee (priv->meeting_store, ia);
ia = ib;
}
@@ -1885,7 +1889,7 @@ remove_clicked_cb (GtkButton *btn, EventPage *epage)
priv = epage->priv;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list_view));
- model = GTK_TREE_MODEL (priv->model);
+ model = GTK_TREE_MODEL (priv->meeting_store);
if (!(paths = gtk_tree_selection_get_selected_rows (selection, &model ))) {
g_warning ("Could not get a selection to delete.");
return;
@@ -1895,10 +1899,10 @@ remove_clicked_cb (GtkButton *btn, EventPage *epage)
for (tmp = paths; tmp; tmp=tmp->next) {
path = tmp->data;
- gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->model), &iter, path);
+ gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->meeting_store), &iter, path);
- gtk_tree_model_get (GTK_TREE_MODEL (priv->model), &iter, E_MEETING_STORE_ADDRESS_COL, &address, -1);
- ia = e_meeting_store_find_attendee (priv->model, address, NULL);
+ gtk_tree_model_get (GTK_TREE_MODEL (priv->meeting_store), &iter, E_MEETING_STORE_ADDRESS_COL, &address, -1);
+ ia = e_meeting_store_find_attendee (priv->meeting_store, address, NULL);
g_free (address);
if (!ia) {
g_warning ("Cannot delete attendee\n");
@@ -1912,10 +1916,10 @@ remove_clicked_cb (GtkButton *btn, EventPage *epage)
}
/* Select closest item after removal */
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->model), &iter, path);
+ valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->meeting_store), &iter, path);
if (!valid_iter) {
gtk_tree_path_prev (path);
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->model), &iter, path);
+ valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->meeting_store), &iter, path);
}
if (valid_iter) {
@@ -1963,7 +1967,7 @@ attendee_added_cb (EMeetingListView *emlv,
gtk_widget_set_sensitive (priv->add, FALSE);
gtk_widget_set_sensitive (priv->edit, FALSE);
- delegator = e_meeting_store_find_attendee (priv->model, priv->user_add, NULL);
+ delegator = e_meeting_store_find_attendee (priv->meeting_store, priv->user_add, NULL);
g_return_if_fail (delegator != NULL);
e_meeting_attendee_set_delto (delegator, g_strdup (e_meeting_attendee_get_address (ia)));
@@ -1983,7 +1987,7 @@ list_view_event (EMeetingListView *list_view, GdkEvent *event, EventPage *epage)
if (event->type == GDK_2BUTTON_PRESS && flags & COMP_EDITOR_USER_ORG) {
EMeetingAttendee *attendee;
- attendee = e_meeting_store_add_attendee_with_defaults (priv->model);
+ attendee = e_meeting_store_add_attendee_with_defaults (priv->meeting_store);
if (flags & COMP_EDITOR_DELEGATE) {
e_meeting_attendee_set_delfrom (attendee, g_strdup_printf ("MAILTO:%s", epage->priv->user_add));
@@ -2081,8 +2085,10 @@ event_page_set_all_day_event (EventPage *epage, gboolean all_day)
/* The event is within one day, so we set the event
start to the start of the working day, and the end
to one hour later. */
- start_tt.hour = calendar_config_get_day_start_hour ();
- start_tt.minute = calendar_config_get_day_start_minute ();
+ start_tt.hour =
+ comp_editor_get_work_day_start_hour (editor);
+ start_tt.minute =
+ comp_editor_get_work_day_start_minute (editor);
start_tt.second = 0;
end_tt = start_tt;
@@ -2271,7 +2277,7 @@ get_widgets (EventPage *epage)
priv->attendee_box = GW ("attendee-box");
priv->org_cal_label = GW ("org-cal-label");
- priv->list_view = e_meeting_list_view_new (priv->model);
+ priv->list_view = e_meeting_list_view_new (priv->meeting_store);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
@@ -2630,7 +2636,7 @@ source_changed_cb (ESourceComboBox *source_combo_box, EventPage *epage)
if (client) {
icaltimezone *zone;
- zone = calendar_config_get_icaltimezone ();
+ zone = e_meeting_store_get_timezone (epage->priv->meeting_store);
e_cal_set_default_timezone (client, zone, NULL);
}
@@ -2743,7 +2749,7 @@ alarm_changed_cb (GtkWidget *widget,
case ALARM_USER_TIME:
e_alarm_list_clear (priv->alarm_list_store);
- switch (calendar_config_get_default_reminder_units ()) {
+ switch (e_meeting_store_get_default_reminder_units (priv->meeting_store)) {
case E_DURATION_DAYS:
trigger.u.rel_duration.days = priv->alarm_interval;
break;
@@ -2859,12 +2865,16 @@ init_widgets (EventPage *epage)
/* Make sure the EDateEdit widgets use our timezones to get the
current time. */
- e_date_edit_set_get_time_callback (E_DATE_EDIT (priv->start_time),
- (EDateEditGetTimeCallback) comp_editor_get_current_time,
- epage, NULL);
- e_date_edit_set_get_time_callback (E_DATE_EDIT (priv->end_time),
- (EDateEditGetTimeCallback) comp_editor_get_current_time,
- epage, NULL);
+ e_date_edit_set_get_time_callback (
+ E_DATE_EDIT (priv->start_time),
+ (EDateEditGetTimeCallback) comp_editor_get_current_time,
+ g_object_ref (editor),
+ (GDestroyNotify) g_object_unref);
+ e_date_edit_set_get_time_callback (
+ E_DATE_EDIT (priv->end_time),
+ (EDateEditGetTimeCallback) comp_editor_get_current_time,
+ g_object_ref (editor),
+ (GDestroyNotify) g_object_unref);
/* Generic informative messages */
gtk_widget_hide (priv->info_hbox);
@@ -2987,8 +2997,12 @@ init_widgets (EventPage *epage)
g_signal_connect (priv->minute_selector, "value-changed", G_CALLBACK (minute_sel_changed), epage);
/* Add the user defined time if necessary */
- priv->alarm_units = calendar_config_get_default_reminder_units ();
- priv->alarm_interval = calendar_config_get_default_reminder_interval ();
+ priv->alarm_units =
+ e_meeting_store_get_default_reminder_units (
+ priv->meeting_store);
+ priv->alarm_interval =
+ e_meeting_store_get_default_reminder_interval (
+ priv->meeting_store);
combo_label = NULL;
switch (priv->alarm_units) {
@@ -3057,7 +3071,7 @@ init_widgets (EventPage *epage)
G_CALLBACK (comp_editor_page_changed), epage);
/* Set the default timezone, so the timezone entry may be hidden. */
- zone = calendar_config_get_icaltimezone ();
+ zone = e_meeting_store_get_timezone (priv->meeting_store);
e_timezone_entry_set_default_timezone (E_TIMEZONE_ENTRY (priv->start_timezone), zone);
e_timezone_entry_set_default_timezone (E_TIMEZONE_ENTRY (priv->end_timezone), zone);
@@ -3137,15 +3151,15 @@ event_page_select_organizer (EventPage *epage, const gchar *backend_address)
* created.
**/
EventPage *
-event_page_construct (EventPage *epage, EMeetingStore *model)
+event_page_construct (EventPage *epage,
+ EMeetingStore *meeting_store)
{
EventPagePrivate *priv;
EIterator *it;
EAccount *a;
priv = epage->priv;
- g_object_ref (model);
- priv->model = model;
+ priv->meeting_store = g_object_ref (meeting_store);
/* Make sure our custom widget classes are registered with
* GType before we load the GtkBuilder definition file. */
@@ -3210,12 +3224,13 @@ event_page_construct (EventPage *epage, EMeetingStore *model)
* not be created.
**/
EventPage *
-event_page_new (EMeetingStore *model, CompEditor *editor)
+event_page_new (EMeetingStore *meeting_store,
+ CompEditor *editor)
{
EventPage *epage;
epage = g_object_new (TYPE_EVENT_PAGE, "editor", editor, NULL);
- if (!event_page_construct (epage, model)) {
+ if (!event_page_construct (epage, meeting_store)) {
g_object_unref (epage);
g_return_val_if_reached (NULL);
}
@@ -3298,7 +3313,7 @@ event_page_add_attendee (EventPage *epage, EMeetingAttendee *attendee)
e_meeting_attendee_set_delfrom (attendee, g_strdup_printf ("MAILTO:%s", epage->priv->user_add));
}
- e_meeting_store_add_attendee (priv->model, attendee);
+ e_meeting_store_add_attendee (priv->meeting_store, attendee);
e_meeting_list_view_add_attendee_to_name_selector (E_MEETING_LIST_VIEW (priv->list_view), attendee);
}
@@ -3317,7 +3332,7 @@ event_page_remove_all_attendees (EventPage *epage)
priv = epage->priv;
- e_meeting_store_remove_all_attendees (priv->model);
+ e_meeting_store_remove_all_attendees (priv->meeting_store);
e_meeting_list_view_remove_all_attendees_from_name_selector (E_MEETING_LIST_VIEW (priv->list_view));
}
diff --git a/calendar/gui/dialogs/event-page.h b/calendar/gui/dialogs/event-page.h
index 3cfff34b89..04665eb9de 100644
--- a/calendar/gui/dialogs/event-page.h
+++ b/calendar/gui/dialogs/event-page.h
@@ -70,8 +70,8 @@ struct _EventPageClass {
GType event_page_get_type (void);
EventPage * event_page_construct (EventPage *epage,
- EMeetingStore *model);
-EventPage * event_page_new (EMeetingStore *model,
+ EMeetingStore *meeting_store);
+EventPage * event_page_new (EMeetingStore *meeting_store,
CompEditor *editor);
ECalComponent * event_page_get_cancel_comp (EventPage *page);
void event_page_show_options (EventPage *page);
diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c
index f5ef574efd..dd8cda94fa 100644
--- a/calendar/gui/dialogs/recurrence-page.c
+++ b/calendar/gui/dialogs/recurrence-page.c
@@ -36,7 +36,6 @@
#include <misc/e-dateedit.h>
#include <libecal/e-cal-recur.h>
#include <libecal/e-cal-time-util.h>
-#include "../calendar-config.h"
#include "../tag-calendar.h"
#include "../weekday-picker.h"
#include "comp-editor-util.h"
@@ -190,6 +189,9 @@ struct _RecurrencePagePrivate {
/* For the recurrence preview, the actual widget */
GtkWidget *preview_calendar;
+
+ /* This just holds some settings we need */
+ EMeetingStore *meeting_store;
};
@@ -324,6 +326,11 @@ recurrence_page_dispose (GObject *object)
priv->exception_list_store = NULL;
}
+ if (priv->meeting_store != NULL) {
+ g_object_unref (priv->meeting_store);
+ priv->meeting_store = NULL;
+ }
+
/* Chain up to parent's dispose() method. */
G_OBJECT_CLASS (recurrence_page_parent_class)->dispose (object);
}
@@ -436,7 +443,7 @@ clear_widgets (RecurrencePage *rpage)
g_signal_handlers_unblock_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
priv->ending_date_tt = icaltime_today ();
- priv->ending_count = calendar_config_get_default_count ();
+ priv->ending_count = 2;
g_signal_handlers_block_matched (priv->ending_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
e_dialog_combo_box_set (priv->ending_combo,
@@ -672,7 +679,7 @@ simple_recur_to_comp (RecurrencePage *rpage, ECalComponent *comp)
r.interval = gtk_spin_button_get_value_as_int (
GTK_SPIN_BUTTON (priv->interval_value));
r.week_start = ICAL_SUNDAY_WEEKDAY
- + calendar_config_get_week_start_day ();
+ + e_meeting_store_get_week_start_day (priv->meeting_store);
/* Frequency-specific data */
@@ -947,6 +954,7 @@ make_weekly_special (RecurrencePage *rpage)
GtkWidget *hbox;
GtkWidget *label;
WeekdayPicker *wp;
+ gint week_start_day;
priv = rpage->priv;
@@ -972,7 +980,8 @@ make_weekly_special (RecurrencePage *rpage)
/* Set the weekdays */
- weekday_picker_set_week_start_day (wp, calendar_config_get_week_start_day ());
+ week_start_day = e_meeting_store_get_week_start_day (priv->meeting_store);
+ weekday_picker_set_week_start_day (wp, week_start_day);
weekday_picker_set_days (wp, priv->weekday_day_mask);
g_signal_connect_swapped (
@@ -1381,9 +1390,11 @@ make_ending_until_special (RecurrencePage *rpage)
/* Make sure the EDateEdit widget uses our timezones to get the
current time. */
- e_date_edit_set_get_time_callback (de,
- (EDateEditGetTimeCallback) comp_editor_get_current_time,
- rpage, NULL);
+ e_date_edit_set_get_time_callback (
+ de,
+ (EDateEditGetTimeCallback) comp_editor_get_current_time,
+ g_object_ref (editor),
+ (GDestroyNotify) g_object_unref);
}
/* Creates the special contents for the occurrence count case */
@@ -1504,7 +1515,7 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r)
e_cal_component_get_dtstart (priv->comp, &dt);
if (dt.value->is_date)
- to_zone = calendar_config_get_icaltimezone ();
+ to_zone = e_meeting_store_get_timezone (priv->meeting_store);
else if (dt.tzid == NULL)
to_zone = icaltimezone_get_utc_timezone ();
else
@@ -2282,9 +2293,11 @@ init_widgets (RecurrencePage *rpage)
priv->preview_calendar);
gtk_widget_show (priv->preview_calendar);
- e_calendar_item_set_get_time_callback (ecal->calitem,
- (ECalendarItemGetTimeCallback) comp_editor_get_current_time,
- rpage, NULL);
+ e_calendar_item_set_get_time_callback (
+ ecal->calitem,
+ (ECalendarItemGetTimeCallback) comp_editor_get_current_time,
+ g_object_ref (editor),
+ (GDestroyNotify) g_object_unref);
/* Recurrence types */
@@ -2334,6 +2347,11 @@ init_widgets (RecurrencePage *rpage)
gtk_tree_view_set_model (GTK_TREE_VIEW (priv->exception_list),
GTK_TREE_MODEL (priv->exception_list_store));
+ g_object_bind_property (
+ editor, "use-24-hour-format",
+ priv->exception_list_store, "use-24-hour-format",
+ G_BINDING_SYNC_CREATE);
+
/* View */
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_title (column, _("Date/Time"));
@@ -2356,11 +2374,15 @@ init_widgets (RecurrencePage *rpage)
* created.
**/
RecurrencePage *
-recurrence_page_construct (RecurrencePage *rpage)
+recurrence_page_construct (RecurrencePage *rpage,
+ EMeetingStore *meeting_store)
{
- RecurrencePagePrivate *priv = rpage->priv;
+ RecurrencePagePrivate *priv;
CompEditor *editor;
+ priv = rpage->priv;
+ priv->meeting_store = g_object_ref (meeting_store);
+
editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (rpage));
priv->builder = gtk_builder_new ();
@@ -2390,14 +2412,16 @@ recurrence_page_construct (RecurrencePage *rpage)
* be created.
**/
RecurrencePage *
-recurrence_page_new (CompEditor *editor)
+recurrence_page_new (EMeetingStore *meeting_store,
+ CompEditor *editor)
{
RecurrencePage *rpage;
+ g_return_val_if_fail (E_IS_MEETING_STORE (meeting_store), NULL);
g_return_val_if_fail (IS_COMP_EDITOR (editor), NULL);
rpage = g_object_new (TYPE_RECURRENCE_PAGE, "editor", editor, NULL);
- if (!recurrence_page_construct (rpage)) {
+ if (!recurrence_page_construct (rpage, meeting_store)) {
g_object_unref (rpage);
g_return_val_if_reached (NULL);
}
diff --git a/calendar/gui/dialogs/recurrence-page.h b/calendar/gui/dialogs/recurrence-page.h
index 1dce00d2c9..709b5ae14b 100644
--- a/calendar/gui/dialogs/recurrence-page.h
+++ b/calendar/gui/dialogs/recurrence-page.h
@@ -32,6 +32,7 @@
#include "comp-editor.h"
#include "comp-editor-page.h"
+#include "../e-meeting-store.h"
/* Standard GObject macros */
#define TYPE_RECURRENCE_PAGE \
@@ -68,8 +69,10 @@ struct _RecurrencePageClass {
};
GType recurrence_page_get_type (void);
-RecurrencePage *recurrence_page_construct (RecurrencePage *rpage);
-RecurrencePage *recurrence_page_new (CompEditor *editor);
+RecurrencePage *recurrence_page_construct (RecurrencePage *rpage,
+ EMeetingStore *meeting_store);
+RecurrencePage *recurrence_page_new (EMeetingStore *meeting_store,
+ CompEditor *editor);
G_END_DECLS
diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c
index efc6795834..4d234880b4 100644
--- a/calendar/gui/dialogs/schedule-page.c
+++ b/calendar/gui/dialogs/schedule-page.c
@@ -34,7 +34,6 @@
#include <e-util/e-dialog-widgets.h>
#include <e-util/e-util-private.h>
#include <misc/e-dateedit.h>
-#include "../calendar-config.h"
#include "../e-meeting-time-sel.h"
#include "../itip-utils.h"
#include "comp-editor-util.h"
@@ -385,11 +384,12 @@ schedule_page_construct (SchedulePage *spage, EMeetingStore *ems)
/* Selector */
priv->sel = E_MEETING_TIME_SELECTOR (e_meeting_time_selector_new (ems));
gtk_widget_set_size_request ((GtkWidget *) priv->sel, -1, 400);
- e_meeting_time_selector_set_working_hours (priv->sel,
- calendar_config_get_day_start_hour (),
- calendar_config_get_day_start_minute (),
- calendar_config_get_day_end_hour (),
- calendar_config_get_day_end_minute ());
+ e_meeting_time_selector_set_working_hours (
+ priv->sel,
+ comp_editor_get_work_day_start_hour (editor),
+ comp_editor_get_work_day_start_minute (editor),
+ comp_editor_get_work_day_end_hour (editor),
+ comp_editor_get_work_day_end_minute (editor));
gtk_widget_show (GTK_WIDGET (priv->sel));
gtk_box_pack_start (GTK_BOX (priv->main), GTK_WIDGET (priv->sel), TRUE, TRUE, 6);
diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c
index ec63458d81..43f38a20a5 100644
--- a/calendar/gui/dialogs/task-details-page.c
+++ b/calendar/gui/dialogs/task-details-page.c
@@ -33,7 +33,6 @@
#include <glib/gi18n.h>
#include <misc/e-dateedit.h>
#include <misc/e-url-entry.h>
-#include "../calendar-config.h"
#include "../e-timezone-entry.h"
#include "comp-editor-util.h"
#include "task-details-page.h"
@@ -227,12 +226,15 @@ task_details_page_fill_widgets (CompEditorPage *page,
gint *priority_value, *percent = NULL;
TaskEditorPriority priority;
icalproperty_status status;
+ CompEditor *editor;
const gchar *url;
struct icaltimetype *completed = NULL;
tdpage = TASK_DETAILS_PAGE (page);
priv = tdpage->priv;
+ editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tdpage));
+
/* Clean the screen */
clear_widgets (tdpage);
@@ -274,7 +276,7 @@ task_details_page_fill_widgets (CompEditorPage *page,
/* Completed is in UTC, but that would confuse the user, so
we convert it to local time. */
utc_zone = icaltimezone_get_utc_timezone ();
- zone = calendar_config_get_icaltimezone ();
+ zone = comp_editor_get_timezone (editor);
icaltimezone_convert_time (completed, utc_zone, zone);
@@ -316,14 +318,18 @@ task_details_page_fill_component (CompEditorPage *page,
struct icaltimetype icalcomplete, icaltoday;
icalproperty_status status;
TaskEditorPriority priority;
+ CompEditor *editor;
gint priority_value, percent;
gchar *url;
gboolean date_set;
- icaltimezone *zone = calendar_config_get_icaltimezone ();
+ icaltimezone *zone;
tdpage = TASK_DETAILS_PAGE (page);
priv = tdpage->priv;
+ editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tdpage));
+ zone = comp_editor_get_timezone (editor);
+
/* Percent Complete. */
percent = gtk_spin_button_get_value_as_int (
GTK_SPIN_BUTTON (priv->percent_complete));
@@ -661,14 +667,19 @@ init_widgets (TaskDetailsPage *tdpage)
{
TaskDetailsPagePrivate *priv;
GtkAdjustment *adjustment;
+ CompEditor *editor;
priv = tdpage->priv;
+ editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tdpage));
+
/* Make sure the EDateEdit widgets use our timezones to get the
current time. */
- e_date_edit_set_get_time_callback (E_DATE_EDIT (priv->completed_date),
- (EDateEditGetTimeCallback) comp_editor_get_current_time,
- tdpage, NULL);
+ e_date_edit_set_get_time_callback (
+ E_DATE_EDIT (priv->completed_date),
+ (EDateEditGetTimeCallback) comp_editor_get_current_time,
+ g_object_ref (editor),
+ (GDestroyNotify) g_object_unref);
/* These are created by hand, so hook the mnemonics manually */
gtk_label_set_mnemonic_widget (
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index 68fa61c36e..9b2df7d546 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -40,7 +40,6 @@
#include <e-util/e-dialog-utils.h>
#include "common/authentication.h"
#include "../e-timezone-entry.h"
-#include "../calendar-config.h"
#include "comp-editor.h"
#include "comp-editor-util.h"
#include "e-send-options-utils.h"
@@ -588,7 +587,7 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
e_cal_component_free_text_list (l);
e_buffer_tagger_update_tags (GTK_TEXT_VIEW (priv->description));
- default_zone = calendar_config_get_icaltimezone ();
+ default_zone = comp_editor_get_timezone (editor);
/* Due Date. */
e_cal_component_get_due (comp, &d);
@@ -938,8 +937,10 @@ task_page_fill_component (CompEditorPage *page, ECalComponent *comp)
e_cal_component_set_classification (comp, classification);
/* send options */
- if (priv->sendoptions_shown && priv->sod)
- e_send_options_utils_fill_component (priv->sod, comp);
+ if (priv->sendoptions_shown && priv->sod) {
+ icaltimezone *zone = comp_editor_get_timezone (editor);
+ e_send_options_utils_fill_component (priv->sod, comp, zone);
+ }
/* Categories */
cat = e_dialog_editable_get (priv->categories);
@@ -1726,7 +1727,7 @@ source_changed_cb (ESourceComboBox *source_combo_box, TaskPage *tpage)
if (client) {
icaltimezone *zone;
- zone = calendar_config_get_icaltimezone ();
+ zone = comp_editor_get_timezone (editor);
e_cal_set_default_timezone (client, zone, NULL);
}
@@ -1842,12 +1843,16 @@ init_widgets (TaskPage *tpage)
/* Make sure the EDateEdit widgets use our timezones to get the
current time. */
- e_date_edit_set_get_time_callback (E_DATE_EDIT (priv->start_date),
- (EDateEditGetTimeCallback) comp_editor_get_current_time,
- tpage, NULL);
- e_date_edit_set_get_time_callback (E_DATE_EDIT (priv->due_date),
- (EDateEditGetTimeCallback) comp_editor_get_current_time,
- tpage, NULL);
+ e_date_edit_set_get_time_callback (
+ E_DATE_EDIT (priv->start_date),
+ (EDateEditGetTimeCallback) comp_editor_get_current_time,
+ g_object_ref (editor),
+ (GDestroyNotify) g_object_unref);
+ e_date_edit_set_get_time_callback (
+ E_DATE_EDIT (priv->due_date),
+ (EDateEditGetTimeCallback) comp_editor_get_current_time,
+ g_object_ref (editor),
+ (GDestroyNotify) g_object_unref);
/* Generic informative messages */
gtk_widget_hide (priv->info_hbox);
@@ -1931,7 +1936,7 @@ init_widgets (TaskPage *tpage)
g_signal_connect (priv->list_view, "attendee_added", G_CALLBACK (attendee_added_cb), tpage);
/* Set the default timezone, so the timezone entry may be hidden. */
- zone = calendar_config_get_icaltimezone ();
+ zone = comp_editor_get_timezone (editor);
e_timezone_entry_set_default_timezone (E_TIMEZONE_ENTRY (priv->timezone), zone);
action = comp_editor_get_action (editor, "view-time-zone");