aboutsummaryrefslogtreecommitdiffstats
path: root/filter/rule-editor.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-07-06 08:14:36 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-07-06 08:14:36 +0800
commit03ec245d4e927b7c2ae32bea6c35851ee9ac35d9 (patch)
treeac847459cf2f8db8b562b31cdd120ae46e25689f /filter/rule-editor.c
parent9dd6f8341cfd10406782cff940db767eccee08a3 (diff)
downloadgsoc2013-evolution-03ec245d4e927b7c2ae32bea6c35851ee9ac35d9.tar
gsoc2013-evolution-03ec245d4e927b7c2ae32bea6c35851ee9ac35d9.tar.gz
gsoc2013-evolution-03ec245d4e927b7c2ae32bea6c35851ee9ac35d9.tar.bz2
gsoc2013-evolution-03ec245d4e927b7c2ae32bea6c35851ee9ac35d9.tar.lz
gsoc2013-evolution-03ec245d4e927b7c2ae32bea6c35851ee9ac35d9.tar.xz
gsoc2013-evolution-03ec245d4e927b7c2ae32bea6c35851ee9ac35d9.tar.zst
gsoc2013-evolution-03ec245d4e927b7c2ae32bea6c35851ee9ac35d9.zip
Select the most appropriate filter rule.
2001-07-05 Jeffrey Stedfast <fejj@ximian.com> * rule-editor.c (rule_delete): Select the most appropriate filter rule. svn path=/trunk/; revision=10836
Diffstat (limited to 'filter/rule-editor.c')
-rw-r--r--filter/rule-editor.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/filter/rule-editor.c b/filter/rule-editor.c
index 33e85aea73..19c49bb16e 100644
--- a/filter/rule-editor.c
+++ b/filter/rule-editor.c
@@ -320,15 +320,22 @@ rule_delete (GtkWidget *widget, RuleEditor *re)
d(printf ("delete rule\n"));
pos = rule_context_get_rank_rule (re->context, re->current, re->source);
if (pos != -1) {
+ gint len;
+
rule_context_remove_rule (re->context, re->current);
- item = g_list_nth_data (((GtkList *)re->list)->children, pos);
+ item = g_list_nth_data (GTK_LIST (re->list)->children, pos);
l = g_list_append (NULL, item);
gtk_list_remove_items (re->list, l);
g_list_free (l);
gtk_object_unref (GTK_OBJECT (re->current));
re->current = NULL;
+
+ /* now select the next rule */
+ len = g_list_length (GTK_LIST (re->list)->children);
+ pos = pos >= len ? len - 1 : pos;
+ gtk_list_select_item (GTK_LIST (re->list), pos);
}
rule_editor_set_sensitive (re);