aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs/alarm-dialog.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@novell.com>2004-06-25 21:37:39 +0800
committerJP Rosevear <jpr@src.gnome.org>2004-06-25 21:37:39 +0800
commit3c8ba7a13ff813aa4be767ca3db8813ce99566fc (patch)
treef1c274af8a9d2216b6f41751710ca967bbff8a0b /calendar/gui/dialogs/alarm-dialog.c
parentc3744c7c3cc38f6373dc55e5e957d7d8a76ade87 (diff)
downloadgsoc2013-evolution-3c8ba7a13ff813aa4be767ca3db8813ce99566fc.tar
gsoc2013-evolution-3c8ba7a13ff813aa4be767ca3db8813ce99566fc.tar.gz
gsoc2013-evolution-3c8ba7a13ff813aa4be767ca3db8813ce99566fc.tar.bz2
gsoc2013-evolution-3c8ba7a13ff813aa4be767ca3db8813ce99566fc.tar.lz
gsoc2013-evolution-3c8ba7a13ff813aa4be767ca3db8813ce99566fc.tar.xz
gsoc2013-evolution-3c8ba7a13ff813aa4be767ca3db8813ce99566fc.tar.zst
gsoc2013-evolution-3c8ba7a13ff813aa4be767ca3db8813ce99566fc.zip
free old_summary (is_custom_alarm): take description into account when
004-06-25 JP Rosevear <jpr@novell.com> * gui/dialogs/event-page.c (event_page_finalize): free old_summary (is_custom_alarm): take description into account when checking for custom alarm (is_custom_alarm_uid_list): pass old_summary (is_custom_alarm_store): ditto (is_custom_alarm_store): ditto (sensitize_widgets): ditto (event_page_fill_component): ditto (event_page_fill_widgets): store the initial summary (alarm_changed_cb): make sure the needs description property gets set on the default alarm (alarm_custom_clicked_cb): copy the current store in case the user hits cancel, if all the alarms are erased uncheck the alarm toggle * gui/dialogs/alarm-dialog.glade: add toggles for custom messages and sound * gui/dialogs/alarm-dialog.c (aalarm_widgets_to_alarm): store custom sound only if the toggle is checked (dalarm_widgets_to_alarm): store custom message only if toggle is checked (get_widgets): load new widgets (aalarm_sound_toggled_cb): sensitize sound entry (dalarm_message_toggled_cb): sensitize message entry (init_widgets): listen for toggle signals svn path=/trunk/; revision=26511
Diffstat (limited to 'calendar/gui/dialogs/alarm-dialog.c')
-rw-r--r--calendar/gui/dialogs/alarm-dialog.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/calendar/gui/dialogs/alarm-dialog.c b/calendar/gui/dialogs/alarm-dialog.c
index e3d4b12be2..779ecf6b7b 100644
--- a/calendar/gui/dialogs/alarm-dialog.c
+++ b/calendar/gui/dialogs/alarm-dialog.c
@@ -89,10 +89,12 @@ typedef struct {
/* Display alarm widgets */
GtkWidget *dalarm_group;
+ GtkWidget *dalarm_message;
GtkWidget *dalarm_description;
/* Audio alarm widgets */
GtkWidget *aalarm_group;
+ GtkWidget *aalarm_sound;
GtkWidget *aalarm_attach;
/* Mail alarm widgets */
@@ -186,6 +188,8 @@ clear_widgets (Dialog *dialog)
e_dialog_option_menu_set (dialog->time, E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START, time_map);
gtk_widget_set_sensitive (dialog->repeat_group, FALSE);
+ gtk_widget_set_sensitive (dialog->dalarm_group, FALSE);
+ gtk_widget_set_sensitive (dialog->aalarm_group, FALSE);
gtk_notebook_set_current_page (GTK_NOTEBOOK (dialog->option_notebook), 0);
}
@@ -210,7 +214,6 @@ alarm_to_dialog (Dialog *dialog)
else
gtk_widget_set_sensitive (l->data, TRUE);
}
-
/* If we can repeat */
repeat = !e_cal_get_static_capability (dialog->ecal, CAL_STATIC_CAPABILITY_NO_ALARM_REPEAT);
gtk_widget_set_sensitive (dialog->repeat_toggle, repeat);
@@ -259,6 +262,9 @@ aalarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm)
char *url;
icalattach *attach;
+ if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->aalarm_sound)))
+ return;
+
url = e_dialog_editable_get (dialog->aalarm_attach);
attach = icalattach_new_from_url (url ? url : "");
g_free (url);
@@ -278,6 +284,9 @@ dalarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm)
icalcomponent *icalcomp;
icalproperty *icalprop;
+ if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->dalarm_message)))
+ return;
+
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->dalarm_description));
gtk_text_buffer_get_start_iter (text_buffer, &text_iter_start);
gtk_text_buffer_get_end_iter (text_buffer, &text_iter_end);
@@ -532,9 +541,11 @@ get_widgets (Dialog *dialog)
dialog->option_notebook = GW ("option-notebook");
dialog->dalarm_group = GW ("dalarm-group");
+ dialog->dalarm_message = GW ("dalarm-message");
dialog->dalarm_description = GW ("dalarm-description");
dialog->aalarm_group = GW ("aalarm-group");
+ dialog->aalarm_sound = GW ("aalarm-sound");
dialog->aalarm_attach = GW ("aalarm-attach");
dialog->malarm_group = GW ("malarm-group");
@@ -560,8 +571,10 @@ get_widgets (Dialog *dialog)
&& dialog->repeat_unit
&& dialog->option_notebook
&& dialog->dalarm_group
+ && dialog->dalarm_message
&& dialog->dalarm_description
&& dialog->aalarm_group
+ && dialog->aalarm_sound
&& dialog->aalarm_attach
&& dialog->malarm_group
&& dialog->malarm_address_group
@@ -674,6 +687,28 @@ repeat_toggle_toggled_cb (GtkToggleButton *toggle, gpointer data)
gtk_widget_set_sensitive (dialog->repeat_group, active);
}
+static void
+aalarm_sound_toggled_cb (GtkToggleButton *toggle, gpointer data)
+{
+ Dialog *dialog = data;
+ gboolean active;
+
+ active = gtk_toggle_button_get_active (toggle);
+
+ gtk_widget_set_sensitive (dialog->aalarm_group, active);
+}
+
+static void
+dalarm_message_toggled_cb (GtkToggleButton *toggle, gpointer data)
+{
+ Dialog *dialog = data;
+ gboolean active;
+
+ active = gtk_toggle_button_get_active (toggle);
+
+ gtk_widget_set_sensitive (dialog->dalarm_group, active);
+}
+
/* Hooks the widget signals */
static void
init_widgets (Dialog *dialog)
@@ -687,6 +722,11 @@ init_widgets (Dialog *dialog)
g_signal_connect (G_OBJECT (dialog->repeat_toggle), "toggled",
G_CALLBACK (repeat_toggle_toggled_cb), dialog);
+
+ g_signal_connect (G_OBJECT (dialog->aalarm_sound), "toggled",
+ G_CALLBACK (aalarm_sound_toggled_cb), dialog);
+ g_signal_connect (G_OBJECT (dialog->dalarm_message), "toggled",
+ G_CALLBACK (dalarm_message_toggled_cb), dialog);
}
gboolean