summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSake Blok <sake@euronet.nl>2007-12-15 23:38:29 +0000
committerSake Blok <sake@euronet.nl>2007-12-15 23:38:29 +0000
commit9a2d18d3869d494dfb4e2438aafa9bf502b459cb (patch)
treef3eb646c8ea9a260d1353cab196b86020dd3d3fe
parent8f7d4aff962c86185d0e659f8ab8ffaabd46fbf5 (diff)
downloadwireshark-9a2d18d3869d494dfb4e2438aafa9bf502b459cb.tar.gz
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) svn path=/trunk/; revision=23879
-rw-r--r--color_filters.c15
-rw-r--r--color_filters.h6
-rw-r--r--gtk/menu.c4
3 files changed, 24 insertions, 1 deletions
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)
{
diff --git a/color_filters.h b/color_filters.h
index 5eebc3b6da..df7846e636 100644
--- a/color_filters.h
+++ b/color_filters.h
@@ -59,6 +59,12 @@ void color_filters_cleanup(void);
*/
gboolean color_filters_used(void);
+/** Are there any temporary coloring filters used?
+ *
+ * @return TRUE, if temporary coloring filters are used
+ */
+gboolean tmp_color_filters_used(void);
+
/** En-/disable color filters
*
* @param enable TRUE to enable (default)
diff --git a/gtk/menu.c b/gtk/menu.c
index b66d4b973e..8e7b132eb4 100644
--- a/gtk/menu.c
+++ b/gtk/menu.c
@@ -613,7 +613,7 @@ static GtkItemFactoryEntry menu_items[] =
NULL, 0, "<Separator>",NULL),
ITEM_FACTORY_STOCK_ENTRY("/View/Colorize Conversation/New Coloring Rule...", NULL,
colorize_conversation_cb, 0, GTK_STOCK_SELECT_COLOR),
- ITEM_FACTORY_ENTRY("/View/Reset Coloring", "<control>space",
+ ITEM_FACTORY_ENTRY("/View/Reset Coloring 1-10", "<control>space",
colorize_conversation_cb, 255*256, NULL, NULL),
ITEM_FACTORY_STOCK_ENTRY("/View/_Coloring Rules...", NULL, color_display_cb,
0, GTK_STOCK_SELECT_COLOR),
@@ -2677,6 +2677,8 @@ set_menus_for_selected_packet(capture_file *cf)
cf->current_frame != NULL);
set_menu_sensitivity(main_menu_factory, "/View/Colorize Conversation",
cf->current_frame != NULL);
+ set_menu_sensitivity(main_menu_factory, "/View/Reset Coloring 1-10",
+ tmp_color_filters_used());
set_menu_sensitivity(main_menu_factory, "/View/Show Packet in New Window",
cf->current_frame != NULL);
set_menu_sensitivity(packet_list_menu_factory, "/Show Packet in New Window",