aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-08-25 20:03:44 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-09-14 20:08:55 +0800
commite8e554ed7a73fe86016edbedb28a5c078e52d356 (patch)
tree3972aab87a06dae4e76164b62841a454c5190f49 /calendar/gui/dialogs
parent1ff635a1fea37812740ba13d1a39622268e3560c (diff)
downloadgsoc2013-evolution-e8e554ed7a73fe86016edbedb28a5c078e52d356.tar.gz
gsoc2013-evolution-e8e554ed7a73fe86016edbedb28a5c078e52d356.tar.zst
gsoc2013-evolution-e8e554ed7a73fe86016edbedb28a5c078e52d356.zip
Bug #650839 - Add option for alarms into calendar preferences
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r--calendar/gui/dialogs/calendar-setup.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/calendar/gui/dialogs/calendar-setup.c b/calendar/gui/dialogs/calendar-setup.c
index 8cb3f50d04..3894061eb0 100644
--- a/calendar/gui/dialogs/calendar-setup.c
+++ b/calendar/gui/dialogs/calendar-setup.c
@@ -307,6 +307,47 @@ eccp_general_offline (EConfig *ec,
}
static void
+alarm_status_changed_cb (GtkWidget *widget, CalendarSourceDialog *sdialog)
+{
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
+ e_source_set_property (sdialog->source, "alarm", "true");
+ else
+ e_source_set_property (sdialog->source, "alarm", "false");
+}
+
+static GtkWidget *
+eccp_notify_reminders (EConfig *ec,
+ EConfigItem *item,
+ GtkWidget *parent,
+ GtkWidget *old,
+ gint position,
+ gpointer data)
+{
+ CalendarSourceDialog *sdialog = data;
+ GtkWidget *reminder_setting = NULL;
+ guint row;
+ const gchar *alarm;
+
+ if (old)
+ return old;
+
+ alarm = e_source_get_property (sdialog->source, "alarm");
+ if (alarm && !g_ascii_strcasecmp (alarm, "never"))
+ return NULL;
+
+ g_object_get (parent, "n-rows", &row, NULL);
+
+ reminder_setting = gtk_check_button_new_with_mnemonic (_("Sh_ow reminder notifications"));
+
+ gtk_widget_show (reminder_setting);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (reminder_setting), alarm && g_str_equal (alarm, "true"));
+ g_signal_connect (reminder_setting, "toggled", G_CALLBACK (alarm_status_changed_cb), sdialog);
+ gtk_table_attach (GTK_TABLE (parent), reminder_setting, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0);
+
+ return reminder_setting;
+}
+
+static void
color_changed (GtkColorButton *color_button, ECalConfigTargetSource *target)
{
ESource *source = target->source;
@@ -398,6 +439,7 @@ static ECalConfigItem eccp_items[] = {
{ E_CONFIG_ITEM_TABLE, (gchar *) "00.general/00.source/10.name", NULL, eccp_get_source_name },
{ E_CONFIG_ITEM_TABLE, (gchar *) "00.general/00.source/20.color", NULL, eccp_get_source_color },
{ E_CONFIG_ITEM_TABLE, (gchar *) "00.general/00.source/30.offline", NULL, eccp_general_offline },
+ { E_CONFIG_ITEM_TABLE, (gchar *) "00.general/00.source/31.alarm", NULL, eccp_notify_reminders },
{ 0 },
};