aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/prop.c
diff options
context:
space:
mode:
authorRussell Steinthal <steintr@src.gnome.org>1999-11-13 01:11:02 +0800
committerRussell Steinthal <steintr@src.gnome.org>1999-11-13 01:11:02 +0800
commitdded739f636bb8f75a6779bc31673e4f8b994225 (patch)
treea408cbad0fd52bb85c2a7e72d96631d17e9c4297 /calendar/prop.c
parent43fd06f8ec06257cbd135b03c5e203dfcd134fd4 (diff)
downloadgsoc2013-evolution-dded739f636bb8f75a6779bc31673e4f8b994225.tar
gsoc2013-evolution-dded739f636bb8f75a6779bc31673e4f8b994225.tar.gz
gsoc2013-evolution-dded739f636bb8f75a6779bc31673e4f8b994225.tar.bz2
gsoc2013-evolution-dded739f636bb8f75a6779bc31673e4f8b994225.tar.lz
gsoc2013-evolution-dded739f636bb8f75a6779bc31673e4f8b994225.tar.xz
gsoc2013-evolution-dded739f636bb8f75a6779bc31673e4f8b994225.tar.zst
gsoc2013-evolution-dded739f636bb8f75a6779bc31673e4f8b994225.zip
The long-awaited audio alarm timeout patch. Implements wishlist bug #3089.
Note: Per discussion on calendar-list, checks to see that timeout value is reasonable, i.e. between 1 and MAX_AALARM_TIMEOUT (set to 3600 seconds). Check is enforced by GtkSpinButton in property box and the patch when loading from disk. svn path=/trunk/; revision=1384
Diffstat (limited to 'calendar/prop.c')
-rw-r--r--calendar/prop.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/calendar/prop.c b/calendar/prop.c
index 4f1ec889d4..b1fa468010 100644
--- a/calendar/prop.c
+++ b/calendar/prop.c
@@ -50,10 +50,19 @@ static GtkWidget *priority_show_button;
/* Widgets for the alarm page */
static GtkWidget *enable_display_beep;
+static GtkWidget *to_cb;
+static GtkWidget *to_spin;
/* prototypes */
static void prop_apply_alarms (void);
static void create_alarm_page (void);
+static void to_cb_changed (GtkWidget* object, gpointer data);
+
+GtkWidget* make_spin_button (int val, int low, int high);
+void ee_create_ae (GtkTable *table, char *str, CalendarAlarm *alarm,
+ enum AlarmType type, int y, gboolean sens,
+ GtkSignalFunc dirty_func);
+void ee_store_alarm (CalendarAlarm *alarm, enum AlarmType type);
/* Callback used when the property box is closed -- just sets the prop_win variable to null. */
static int
@@ -723,8 +732,9 @@ create_alarm_page (void)
GtkWidget *default_table;
GtkWidget *misc_frame;
GtkWidget *misc_box;
+ GtkWidget *box, *l;
- main_box = gtk_hbox_new (FALSE, GNOME_PAD);
+ main_box = gtk_vbox_new (FALSE, GNOME_PAD);
gtk_container_set_border_width (GTK_CONTAINER (main_box), GNOME_PAD_SMALL);
gnome_property_box_append_page (GNOME_PROPERTY_BOX (prop_win),
main_box, gtk_label_new (_("Alarms")));
@@ -748,6 +758,23 @@ create_alarm_page (void)
(GtkSignalFunc) prop_changed,
NULL);
+ /* audio timeout widgets */
+ box = gtk_hbox_new (FALSE, GNOME_PAD);
+ to_cb = gtk_check_button_new_with_label (_("Audio alarms timeout after"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (to_cb),
+ enable_aalarm_timeout);
+ gtk_signal_connect (GTK_OBJECT (to_cb), "toggled",
+ (GtkSignalFunc) to_cb_changed, NULL);
+ gtk_box_pack_start (GTK_BOX (box), to_cb, FALSE, FALSE, 0);
+ to_spin = make_spin_button (audio_alarm_timeout, 1, MAX_AALARM_TIMEOUT);
+ gtk_widget_set_sensitive (to_spin, enable_aalarm_timeout);
+ gtk_signal_connect (GTK_OBJECT (to_spin), "changed",
+ (GtkSignalFunc) prop_changed, NULL);
+ gtk_box_pack_start (GTK_BOX (box), to_spin, FALSE, FALSE, 0);
+ l = gtk_label_new (_(" seconds"));
+ gtk_box_pack_start (GTK_BOX (box), l, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (misc_box), box, FALSE, FALSE, 0);
+
/* populate default frame/box */
default_frame = gtk_frame_new (_("Defaults"));
gtk_container_set_border_width (GTK_CONTAINER (default_frame), GNOME_PAD_SMALL);
@@ -811,5 +838,22 @@ prop_apply_alarms ()
beep_on_display = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (enable_display_beep));
gnome_config_set_bool ("/calendar/alarms/beep_on_display", beep_on_display);
+ enable_aalarm_timeout = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (to_cb));
+ gnome_config_set_bool ("/calendar/alarms/enable_audio_timeout", enable_aalarm_timeout);
+ audio_alarm_timeout = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (to_spin));
+ gnome_config_set_int ("/calendar/alarms/audio_alarm_timeout", audio_alarm_timeout);
+
gnome_config_sync();
}
+
+static void
+to_cb_changed (GtkWidget *object, gpointer data)
+{
+ gboolean active =
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (to_cb));
+ gtk_widget_set_sensitive (to_spin, active);
+ prop_changed ();
+}
+
+
+