aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs/alarm-page.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/dialogs/alarm-page.c')
-rw-r--r--calendar/gui/dialogs/alarm-page.c89
1 files changed, 48 insertions, 41 deletions
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)