From 8399cad79100c86a408761148b00ce64964cbbaa Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Thu, 16 Aug 2001 20:45:43 +0000 Subject: Set the default-to-add notification to be display a message 15 minutes 2001-08-16 Federico Mena Quintero * gui/dialogs/alarm-page.c (clear_widgets): Set the default-to-add notification to be display a message 15 minutes before the start of the appointment. Fixes bug #7175. svn path=/trunk/; revision=12123 --- calendar/gui/dialogs/alarm-page.c | 89 +++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 41 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/dialogs/alarm-page.c b/calendar/gui/dialogs/alarm-page.c index fce8093149..1d3012fc9b 100644 --- a/calendar/gui/dialogs/alarm-page.c +++ b/calendar/gui/dialogs/alarm-page.c @@ -70,6 +70,47 @@ struct _AlarmPagePrivate { gboolean updating; }; +/* "relative" types */ +enum { + BEFORE, + AFTER +}; + +/* Time units */ +enum { + MINUTES, + HOURS, + DAYS +}; + +/* Option menu maps */ +static const int action_map[] = { + CAL_ALARM_DISPLAY, + CAL_ALARM_AUDIO, + CAL_ALARM_EMAIL, + CAL_ALARM_PROCEDURE, + -1 +}; + +static const int value_map[] = { + MINUTES, + HOURS, + DAYS, + -1 +}; + +static const int relative_map[] = { + BEFORE, + AFTER, + -1 +}; + +static const int time_map[] = { + CAL_ALARM_TRIGGER_RELATIVE_START, + CAL_ALARM_TRIGGER_RELATIVE_END, + -1 +}; + static void alarm_page_class_init (AlarmPageClass *class); @@ -270,6 +311,13 @@ clear_widgets (AlarmPage *apage) /* Start date */ gtk_label_set_text (GTK_LABEL (priv->date_time), ""); + /* Sane defaults */ + e_dialog_option_menu_set (priv->action, CAL_ALARM_DISPLAY, action_map); + e_dialog_spin_set (priv->interval_value, 15); + e_dialog_option_menu_set (priv->value_units, MINUTES, value_map); + e_dialog_option_menu_set (priv->relative, BEFORE, relative_map); + e_dialog_option_menu_set (priv->time, CAL_ALARM_TRIGGER_RELATIVE_START, time_map); + /* List data */ free_alarms (apage); } @@ -539,47 +587,6 @@ alarm_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) -/* "relative" types */ -enum { - BEFORE, - AFTER -}; - -/* Time units */ -enum { - MINUTES, - HOURS, - DAYS -}; - -/* Option menu maps */ -static const int action_map[] = { - CAL_ALARM_DISPLAY, - CAL_ALARM_AUDIO, - CAL_ALARM_EMAIL, - CAL_ALARM_PROCEDURE, - -1 -}; - -static const int value_map[] = { - MINUTES, - HOURS, - DAYS, - -1 -}; - -static const int relative_map[] = { - BEFORE, - AFTER, - -1 -}; - -static const int time_map[] = { - CAL_ALARM_TRIGGER_RELATIVE_START, - CAL_ALARM_TRIGGER_RELATIVE_END, - -1 -}; - /* Gets the widgets from the XML file and returns if they are all available. */ static gboolean get_widgets (AlarmPage *apage) -- cgit v1.2.3