From a24713d8b320d0446d30ca5ed69a87cb788ff281 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Tue, 17 Nov 1998 16:53:59 +0000 Subject: Doh. Fixed stupid bug where the classification buttons were not being set 1998-11-16 Federico Mena Quintero * eventedit.c (ee_classification_widgets): Doh. Fixed stupid bug where the classification buttons were not being set correctly. (ee_store_general_values_to_ical): Take into account the fact that radio group lists are stored in reverse order of insertion. * gncal-todo.c (gncal_todo_init): Use a scrolled window to put the clist into. svn path=/trunk/; revision=475 --- calendar/ChangeLog | 5 +++++ calendar/eventedit.c | 11 ++++++----- calendar/gui/eventedit.c | 11 ++++++----- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index c36eacec35..128bcdc180 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,5 +1,10 @@ 1998-11-16 Federico Mena Quintero + * eventedit.c (ee_classification_widgets): Doh. Fixed stupid bug + where the classification buttons were not being set correctly. + (ee_store_general_values_to_ical): Take into account the fact that + radio group lists are stored in reverse order of insertion. + * gncal-todo.c (gncal_todo_init): Use a scrolled window to put the clist into. diff --git a/calendar/eventedit.c b/calendar/eventedit.c index a8a972158f..ed9f03f850 100644 --- a/calendar/eventedit.c +++ b/calendar/eventedit.c @@ -404,11 +404,11 @@ ee_classification_widgets (EventEditor *ee) gtk_box_pack_start (GTK_BOX (hbox), rpriv, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), rconf, FALSE, FALSE, 0); - if (strcmp (ee->ical->class, class_names[0])) + if (strcmp (ee->ical->class, class_names[0]) == 0) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (rpub), TRUE); - else if (strcmp (ee->ical->class, class_names[1])) + else if (strcmp (ee->ical->class, class_names[1]) == 0) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (rpriv), TRUE); - else if (strcmp (ee->ical->class, class_names[2])) + else if (strcmp (ee->ical->class, class_names[2]) == 0) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (rconf), TRUE); ee->general_radios = rpub; @@ -478,11 +478,12 @@ ee_store_general_values_to_ical (EventEditor *ee) ee_store_alarm (&ical->palarm, ALARM_PROGRAM); ee_store_alarm (&ical->malarm, ALARM_MAIL); - for (idx = 0; list; list = list->next) { + for (idx = 2; list; list = list->next) { if (GTK_TOGGLE_BUTTON (list->data)->active) break; - idx++; + idx--; /* The group is stored in reverse order of insertion */ } + g_free (ical->class); ical->class = g_strdup (class_names [idx]); } diff --git a/calendar/gui/eventedit.c b/calendar/gui/eventedit.c index a8a972158f..ed9f03f850 100644 --- a/calendar/gui/eventedit.c +++ b/calendar/gui/eventedit.c @@ -404,11 +404,11 @@ ee_classification_widgets (EventEditor *ee) gtk_box_pack_start (GTK_BOX (hbox), rpriv, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), rconf, FALSE, FALSE, 0); - if (strcmp (ee->ical->class, class_names[0])) + if (strcmp (ee->ical->class, class_names[0]) == 0) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (rpub), TRUE); - else if (strcmp (ee->ical->class, class_names[1])) + else if (strcmp (ee->ical->class, class_names[1]) == 0) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (rpriv), TRUE); - else if (strcmp (ee->ical->class, class_names[2])) + else if (strcmp (ee->ical->class, class_names[2]) == 0) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (rconf), TRUE); ee->general_radios = rpub; @@ -478,11 +478,12 @@ ee_store_general_values_to_ical (EventEditor *ee) ee_store_alarm (&ical->palarm, ALARM_PROGRAM); ee_store_alarm (&ical->malarm, ALARM_MAIL); - for (idx = 0; list; list = list->next) { + for (idx = 2; list; list = list->next) { if (GTK_TOGGLE_BUTTON (list->data)->active) break; - idx++; + idx--; /* The group is stored in reverse order of insertion */ } + g_free (ical->class); ical->class = g_strdup (class_names [idx]); } -- cgit v1.2.3