From 746658e3964c58bcc1242db715677a78e55cd96d Mon Sep 17 00:00:00 2001 From: sake Date: Sat, 15 Dec 2007 23:38:29 +0000 Subject: Changes the name of the menu item "View/Reset Coloring" to "View/Reset Coloring 1-10" and adds sensitivity to it so that it will be greyed out when none of the temporary color filters are used. (as per discussion on wireshark-dev some time ago) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23879 f5534014-38df-0310-8fa8-9805f1628bb7 --- color_filters.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'color_filters.c') diff --git a/color_filters.c b/color_filters.c index d075be2571..239823ce0b 100644 --- a/color_filters.c +++ b/color_filters.c @@ -62,6 +62,10 @@ static GSList *color_filter_valid_list = NULL; /* Color Filters can en-/disabled. */ gboolean filters_enabled = TRUE; +/* Remember if there are temporary coloring filters set to + * add sensitivity to the "Reset Coloring 1-10" menu item + */ +gboolean tmp_colors_set = FALSE; /* Create a new filter */ color_filter_t * @@ -183,6 +187,9 @@ color_filters_set_tmp(guint8 filt_nr, gchar *filter, gboolean disabled) colorf->filter_text = g_strdup(tmpfilter); colorf->c_colorfilter = compiled_filter; colorf->disabled = ((i!=filt_nr) ? TRUE : disabled); + /* Remember that there are now temporary coloring filters set */ + if( filter ) + tmp_colors_set = TRUE; } } g_free(name); @@ -199,6 +206,8 @@ color_filters_reset_tmp() for ( i=1 ; i<=10 ; i++ ) { color_filters_set_tmp(i, NULL, TRUE); } + /* Remember that there are now *no* temporary coloring filters set */ + tmp_colors_set = FALSE; return; } @@ -373,6 +382,12 @@ color_filters_used(void) return color_filter_list != NULL && filters_enabled; } +gboolean +tmp_color_filters_used(void) +{ + return tmp_colors_set; +} + void color_filters_enable(gboolean enable) { -- cgit v1.2.3