aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-08-25 20:03:44 +0800
committerMilan Crha <mcrha@redhat.com>2011-08-25 20:03:44 +0800
commit7fe7c162b6fba95d1146cc79753e49ac36215b14 (patch)
tree24d0881363c2f4b6e8bab280ade335c2534f259e /calendar/gui
parent6554585adedff314f2b1788e2a6974c063cbce0b (diff)
downloadgsoc2013-evolution-7fe7c162b6fba95d1146cc79753e49ac36215b14.tar
gsoc2013-evolution-7fe7c162b6fba95d1146cc79753e49ac36215b14.tar.gz
gsoc2013-evolution-7fe7c162b6fba95d1146cc79753e49ac36215b14.tar.bz2
gsoc2013-evolution-7fe7c162b6fba95d1146cc79753e49ac36215b14.tar.lz
gsoc2013-evolution-7fe7c162b6fba95d1146cc79753e49ac36215b14.tar.xz
gsoc2013-evolution-7fe7c162b6fba95d1146cc79753e49ac36215b14.tar.zst
gsoc2013-evolution-7fe7c162b6fba95d1146cc79753e49ac36215b14.zip
Bug #650839 - Add option for alarms into calendar preferences
Diffstat (limited to 'calendar/gui')
-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 },
};