diff options
-rw-r--r-- | color.h | 3 | ||||
-rw-r--r-- | gtk/color_dlg.c | 6 | ||||
-rw-r--r-- | gtk/color_filters.c | 17 |
3 files changed, 21 insertions, 5 deletions
@@ -1,7 +1,7 @@ /* color.h * Definitions for "toolkit-independent" colors * - * $Id: color.h,v 1.4 2003/08/18 21:27:07 sahlberg Exp $ + * $Id: color.h,v 1.5 2004/01/09 20:19:34 obiot Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -58,6 +58,7 @@ typedef struct _color_filter { /* List of all color filters. */ extern GSList *filter_list; +extern GSList *removed_filter_list; void filter_list_prime_edt(epan_dissect_t *edt); diff --git a/gtk/color_dlg.c b/gtk/color_dlg.c index 34cfdb0b3e..e0fc725130 100644 --- a/gtk/color_dlg.c +++ b/gtk/color_dlg.c @@ -1,7 +1,7 @@ /* color_dlg.c * Definitions for dialog boxes for color filters * - * $Id: color_dlg.c,v 1.29 2004/01/02 00:19:59 sharpe Exp $ + * $Id: color_dlg.c,v 1.30 2004/01/09 20:20:41 obiot Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1045,7 +1045,7 @@ color_delete(gint row, GtkWidget *color_filters) gtk_widget_destroy(colorf->edit_dialog); /* Remove the color filter from the list of color filters. */ - delete_color_filter(colorf); + remove_color_filter(colorf); /* If we grab the focus after updating the selection, the first * row is always selected, so we do it before */ @@ -1063,7 +1063,7 @@ color_delete(gint row, GtkWidget *color_filters) gtk_widget_destroy(colorf->edit_dialog); /* Remove the color filter from the list of color filters. */ - delete_color_filter(colorf); + remove_color_filter(colorf); #endif } diff --git a/gtk/color_filters.c b/gtk/color_filters.c index a3efb3e323..0dbd0a4981 100644 --- a/gtk/color_filters.c +++ b/gtk/color_filters.c @@ -1,7 +1,7 @@ /* color_filters.c * Routines for color filters * - * $Id: color_filters.c,v 1.4 2003/08/27 22:55:51 guy Exp $ + * $Id: color_filters.c,v 1.5 2004/01/09 20:20:42 obiot Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -49,6 +49,20 @@ static gboolean read_filters(void); static gboolean read_global_filters(void); GSList *filter_list; +GSList *removed_filter_list; + +/* Remove the specified filter from the list of existing color filters, + * and add it to the list of removed color filters. + * This way, unmarking and marking a packet which matches a now removed + * color filter will still be colored correctly as the color filter is + * still reachable. */ +void remove_color_filter(color_filter_t *colorf) +{ + /* Remove colorf from the list of color filters */ + filter_list = g_slist_remove(filter_list, colorf); + /* Add colorf to the list of removed color filters */ + removed_filter_list = g_slist_prepend(removed_filter_list, colorf); +} /* delete the specified filter */ void @@ -79,6 +93,7 @@ static void delete_all_color_filters (void) { g_slist_foreach(filter_list, delete_color_filter_it, NULL); + g_slist_foreach(removed_filter_list, delete_color_filter_it, NULL); } /* Initialize the filter structures (reading from file) for general running, including app startup */ |