From 04656c360e73801ff0cb7eab6c3bc104cb755e4d Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 18 Jan 2001 06:34:27 +0000 Subject: Er, don't set the button insensitive if there is *1* action, set it 2001-01-18 Jeffrey Stedfast * filter-filter.c (less_parts): Er, don't set the button insensitive if there is *1* action, set it insensitive if there are less than or equal to *1* actions. Doh! (more_parts): Only set the remove button sensitive if there is more than 1 action. (get_widget): Here too. svn path=/trunk/; revision=7616 --- filter/ChangeLog | 9 +++++++++ filter/filter-filter.c | 10 ++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/filter/ChangeLog b/filter/ChangeLog index abce136c7b..656a9043ff 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,3 +1,12 @@ +2001-01-18 Jeffrey Stedfast + + * filter-filter.c (less_parts): Er, don't set the button + insensitive if there is *1* action, set it insensitive if there + are less than or equal to *1* actions. Doh! + (more_parts): Only set the remove button sensitive if there is + more than 1 action. + (get_widget): Here too. + 2001-01-16 Jason Leach * e-search-bar.[ch]: Moved ESearchBar to $(toplevel)/widgets/misc, diff --git a/filter/filter-filter.c b/filter/filter-filter.c index 88c8c76a02..bcd92d8534 100644 --- a/filter/filter-filter.c +++ b/filter/filter-filter.c @@ -355,7 +355,7 @@ less_parts (GtkWidget *button, struct _rule_data *data) gtk_container_remove (GTK_CONTAINER (data->parts), w); /* if there's only 1 action, we can't remove anymore so set insensitive */ - if (g_list_length (((FilterFilter *)data->fr)->actions) == 1) + if (g_list_length (((FilterFilter *)data->fr)->actions) <= 1) gtk_widget_set_sensitive (button, FALSE); } @@ -375,8 +375,10 @@ more_parts (GtkWidget *button, struct _rule_data *data) } /* set the "Remove action" button sensitive */ - w = gtk_object_get_data (GTK_OBJECT (button), "remove"); - gtk_widget_set_sensitive (w, TRUE); + if (g_list_length (((FilterFilter *)data->fr)->actions) > 1) { + w = gtk_object_get_data (GTK_OBJECT (button), "remove"); + gtk_widget_set_sensitive (w, TRUE); + } } static GtkWidget * @@ -424,7 +426,7 @@ get_widget (FilterRule *fr, struct _RuleContext *f) gtk_box_pack_start (GTK_BOX (hbox), remove, FALSE, FALSE, 3); /* if we only have 1 action, then we can't remove any more so disable this */ - if (g_list_length (ff->actions) == 1) + if (g_list_length (ff->actions) <= 1) gtk_widget_set_sensitive (remove, FALSE); gtk_box_pack_start (GTK_BOX (inframe), hbox, FALSE, FALSE, 3); -- cgit v1.2.3