summaryrefslogtreecommitdiff
path: root/gtk/dfilter_expr_dlg.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-06-10 09:47:25 +0000
committerGuy Harris <guy@alum.mit.edu>2004-06-10 09:47:25 +0000
commitf2cf0c1e0f1f055e2f07a547f7c00f12ded123c6 (patch)
treebf97dd87e3516701ed17009c9b1f2421bffbe886 /gtk/dfilter_expr_dlg.c
parentd16eb303f51593d3080ba964bde0214db14ffba8 (diff)
downloadwireshark-f2cf0c1e0f1f055e2f07a547f7c00f12ded123c6.tar.gz
From Stas Grabois: don't show disabled protocols in the "Add Expression"
and "Decode As" dialogs (so that you can cut down the size of the protocol lists in those dialogs by disabling "uninteresting" protocols). svn path=/trunk/; revision=11132
Diffstat (limited to 'gtk/dfilter_expr_dlg.c')
-rw-r--r--gtk/dfilter_expr_dlg.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gtk/dfilter_expr_dlg.c b/gtk/dfilter_expr_dlg.c
index d68680ac48..f6710430d7 100644
--- a/gtk/dfilter_expr_dlg.c
+++ b/gtk/dfilter_expr_dlg.c
@@ -7,7 +7,7 @@
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com> and
* Guy Harris <guy@alum.mit.edu>
*
- * $Id: dfilter_expr_dlg.c,v 1.57 2004/05/27 19:59:48 ulfl Exp $
+ * $Id: dfilter_expr_dlg.c,v 1.58 2004/06/10 09:46:26 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1306,9 +1306,14 @@ dfilter_expr_dlg_new(GtkWidget *filter_te)
for (i = proto_get_first_protocol(&cookie); i != -1;
i = proto_get_next_protocol(&cookie)) {
hfinfo = proto_registrar_get_nth(i);
+
/* Create a node for the protocol, and remember it for
later use. */
protocol = find_protocol_by_id(i);
+
+ if (!proto_is_protocol_enabled(protocol))
+ continue;
+
name = proto_get_protocol_short_name(protocol); /* name, short_name or filter name ? */
protocol_node = gtk_ctree_insert_node(GTK_CTREE(field_tree),
NULL, NULL,
@@ -1348,6 +1353,11 @@ dfilter_expr_dlg_new(GtkWidget *filter_te)
if (hfinfo->same_name_prev != NULL)
continue;
+ if (!proto_is_protocol_enabled(find_protocol_by_id(
+ proto_registrar_get_parent(i)))) {
+ continue;
+ }
+
/* Create a node for the item, and put it
under its parent protocol. */
protocol_node = g_hash_table_lookup(proto_array,