aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-config.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2001-09-19 04:56:38 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2001-09-19 04:56:38 +0800
commit54141f67b759d3533605a06305ead06d1d3ec4f7 (patch)
treeb8793851ff338d1e79e1bfa98ca4c5623e4caeed /calendar/gui/calendar-config.c
parentcc2f35f2b15566cbd90f673ec2f7d3caa017a988 (diff)
downloadgsoc2013-evolution-54141f67b759d3533605a06305ead06d1d3ec4f7.tar.gz
gsoc2013-evolution-54141f67b759d3533605a06305ead06d1d3ec4f7.tar.zst
gsoc2013-evolution-54141f67b759d3533605a06305ead06d1d3ec4f7.zip
Fixes bug #2830.
2001-09-18 Federico Mena Quintero <federico@ximian.com> Fixes bug #2830. * gui/calendar-config.c (calendar_config_get_confirm_delete): New function. (calendar_config_set_confirm_delete): New function. (config_read): Get the default value for the ConfirmDelete option. (calendar_config_write): Set the value of ConfirmDelete. * gui/dialogs/delete-comp.c (delete_component_dialog): Handle the configuration option for confirmation. * gui/dialogs/cal-prefs-dialog.c (CalPrefsDialogPrivate): Added the fields for the Other page. (get_widgets): Handle the new widgets. (cal_prefs_dialog_show_config): Likewise. (cal_prefs_dialog_update_config): Likewise. svn path=/trunk/; revision=12953
Diffstat (limited to 'calendar/gui/calendar-config.c')
-rw-r--r--calendar/gui/calendar-config.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c
index aed61238ec..995eac2fb3 100644
--- a/calendar/gui/calendar-config.c
+++ b/calendar/gui/calendar-config.c
@@ -65,6 +65,7 @@ typedef struct
gboolean hide_completed_tasks;
CalUnits hide_completed_tasks_units;
gint hide_completed_tasks_value;
+ gboolean confirm_delete;
} CalendarConfig;
@@ -208,6 +209,8 @@ config_read (void)
config->hide_completed_tasks_value = bonobo_config_get_long_with_default (
db, "/Calendar/Tasks/HideCompletedTasksValue", 1, NULL);
+ config->confirm_delete = bonobo_config_get_boolean_with_default (
+ db, "/Calendar/Other/ConfirmDelete", TRUE, NULL);
bonobo_object_release_unref (db, NULL);
}
@@ -278,6 +281,8 @@ calendar_config_write (void)
"/Calendar/Tasks/HideCompletedTasksValue",
config->hide_completed_tasks_value, NULL);
+ bonobo_config_set_boolean (db, "/Calendar/Other/ConfirmDelete", config->confirm_delete, NULL);
+
Bonobo_ConfigDatabase_sync (db, &ev);
bonobo_object_release_unref (db, NULL);
@@ -626,6 +631,33 @@ calendar_config_set_hide_completed_tasks_value (gint value)
config->hide_completed_tasks_value = value;
}
+/**
+ * calendar_config_get_confirm_delete:
+ *
+ * Queries the configuration value for whether a confirmation dialog is
+ * presented when deleting calendar/tasks items.
+ *
+ * Return value: Whether confirmation is required when deleting items.
+ **/
+gboolean
+calendar_config_get_confirm_delete (void)
+{
+ return config->confirm_delete;
+}
+
+/**
+ * calendar_config_set_confirm_delete:
+ * @confirm: Whether confirmation is required when deleting items.
+ *
+ * Sets the configuration value for whether a confirmation dialog is presented
+ * when deleting calendar/tasks items.
+ **/
+void
+calendar_config_set_confirm_delete (gboolean confirm)
+{
+ config->confirm_delete = confirm;
+}
+
/* This sets all the common config settings for an ECalendar widget.
These are the week start day, and whether we show week numbers. */