From c481b9e821cb8510b0eb7c4986e951f11c15d182 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Fri, 4 Apr 2003 21:58:34 +0000 Subject: description is a text buffer (alarm_to_malarm_widgets): ditto 2003-04-04 JP Rosevear * gui/dialogs/alarm-options.c (alarm_to_dalarm_widgets): description is a text buffer (alarm_to_malarm_widgets): ditto (dalarm_widgets_to_alarm): ditto (malarm_widgets_to_alarm): ditto (alarm_to_repeat_widgets): check repeat status correctly svn path=/trunk/; revision=20677 --- calendar/gui/dialogs/alarm-options.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'calendar/gui/dialogs') diff --git a/calendar/gui/dialogs/alarm-options.c b/calendar/gui/dialogs/alarm-options.c index 2261bb0bd7..bfd92fed16 100644 --- a/calendar/gui/dialogs/alarm-options.c +++ b/calendar/gui/dialogs/alarm-options.c @@ -30,6 +30,8 @@ #include #include #include +#include +#include #include #include #include @@ -304,10 +306,12 @@ static void alarm_to_dalarm_widgets (Dialog *dialog, CalComponentAlarm *alarm) { CalComponentText description; - + GtkTextBuffer *text_buffer; + cal_component_alarm_get_description (alarm, &description); - e_dialog_editable_set (dialog->dalarm_description, description.value); + text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->dalarm_description)); + gtk_text_buffer_set_text (text_buffer, description.value ? description.value : "", -1); } /* Fills the mail alarm widgets with the values from the alarm component */ @@ -315,6 +319,7 @@ static void alarm_to_malarm_widgets (Dialog *dialog, CalComponentAlarm *alarm) { CalComponentText description; + GtkTextBuffer *text_buffer; GSList *attendee_list, *l; EDestination **destv; int len, i; @@ -357,7 +362,9 @@ alarm_to_malarm_widgets (Dialog *dialog, CalComponentAlarm *alarm) /* Description */ cal_component_alarm_get_description (alarm, &description); - e_dialog_editable_set (dialog->malarm_description, description.value); + + text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->malarm_description)); + gtk_text_buffer_set_text (text_buffer, description.value ? description.value : "", -1); } /* Fills the procedure alarm widgets with the values from the alarm component */ @@ -433,7 +440,7 @@ alarm_to_repeat_widgets (Dialog *dialog, CalComponentAlarm *alarm) /* Sensitivity */ - if (dialog->repeat || repeat.repetitions == 0) { + if (!dialog->repeat || repeat.repetitions == 0) { gtk_widget_set_sensitive (dialog->repeat_toggle, dialog->repeat); gtk_widget_set_sensitive (dialog->repeat_group, FALSE); e_dialog_toggle_set (dialog->repeat_toggle, FALSE); @@ -575,10 +582,16 @@ dalarm_widgets_to_alarm (Dialog *dialog, CalComponentAlarm *alarm) { char *str; CalComponentText description; + GtkTextBuffer *text_buffer; + GtkTextIter text_iter_start, text_iter_end; icalcomponent *icalcomp; icalproperty *icalprop; - str = e_dialog_editable_get (dialog->dalarm_description); + 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); + str = gtk_text_buffer_get_text (text_buffer, &text_iter_start, &text_iter_end, FALSE); + description.value = str; description.altrep = NULL; @@ -610,6 +623,8 @@ malarm_widgets_to_alarm (Dialog *dialog, CalComponentAlarm *alarm) CalComponentText description; GSList *attendee_list = NULL; EDestination **destv; + GtkTextBuffer *text_buffer; + GtkTextIter text_iter_start, text_iter_end; icalcomponent *icalcomp; icalproperty *icalprop; int i; @@ -639,7 +654,11 @@ malarm_widgets_to_alarm (Dialog *dialog, CalComponentAlarm *alarm) e_destination_freev (destv); /* Description */ - str = e_dialog_editable_get (dialog->malarm_description); + 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); + str = gtk_text_buffer_get_text (text_buffer, &text_iter_start, &text_iter_end, FALSE); + description.value = str; description.altrep = NULL; -- cgit