Show both short and long protocol name in the Filter Expression dialog.
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 24 Oct 2008 07:48:09 +0000 (07:48 +0000)
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 24 Oct 2008 07:48:09 +0000 (07:48 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26537 f5534014-38df-0310-8fa8-9805f1628bb7

epan/proto.c
epan/proto.h
gtk/dfilter_expr_dlg.c

index 4a26baed5f04dc39334e7f3a54f75b30164925d6..300e9cfdd9699cc15b3858ff5c9a5b5c26f764ef 100644 (file)
@@ -3654,6 +3654,14 @@ proto_get_protocol_short_name(protocol_t *protocol)
        return protocol->short_name;
 }
 
+const char *
+proto_get_protocol_long_name(protocol_t *protocol)
+{
+       if (protocol == NULL)
+               return "(none)";
+       return protocol->name;
+}
+
 const char *
 proto_get_protocol_filter_name(int proto_id)
 {
index 65da12ffc21ffe7ccbd99fac5ffd8bf60c8ef729..c1c5867dd87935c9c56dc969b5e361401463346d 100644 (file)
@@ -1420,6 +1420,10 @@ extern int proto_get_id(protocol_t *protocol);
  @return its short name. */
 extern const char *proto_get_protocol_short_name(protocol_t *protocol);
 
+/** Get the protocol's long name, for the given protocol's "protocol_t".
+ @return its long name. */
+extern const char *proto_get_protocol_long_name(protocol_t *protocol);
+
 /** Is protocol's decoding enabled ?
  @param protocol 
  @return TRUE if decoding is enabled, FALSE if not */
index cc4d693a23ec1e98fb0b40ea93d407e7a01cb408..af84aba9a62a23eecbe81ef8f28ae893471cf1f8 100644 (file)
@@ -1119,7 +1119,6 @@ dfilter_expr_dlg_new(GtkWidget *filter_te)
 
     GtkTreeIter iter, child_iter;
     void *cookie, *cookie2;
-    const gchar *name;
 
     for (i = proto_get_first_protocol(&cookie); i != -1;
         i = proto_get_next_protocol(&cookie)) {
@@ -1131,11 +1130,16 @@ dfilter_expr_dlg_new(GtkWidget *filter_te)
            continue;
        }
 
-       name = proto_get_protocol_short_name(protocol); /* name, short_name or filter name ? */
+       g_snprintf(str, TAG_STRING_LEN, "%s - %s", 
+                  proto_get_protocol_short_name(protocol),
+                  proto_get_protocol_long_name(protocol));
+       str[TAG_STRING_LEN]='\0';
+       strp=str;
+
        hfinfo = proto_registrar_get_nth(i);
 
        gtk_tree_store_append(store, &iter, NULL);
-       gtk_tree_store_set(store, &iter, 0, name, 1, hfinfo, -1);
+       gtk_tree_store_set(store, &iter, 0, strp, 1, hfinfo, -1);
 
        for (hfinfo = proto_get_first_protocol_field(i, &cookie2); hfinfo != NULL;
              hfinfo = proto_get_next_protocol_field(&cookie2)) {
@@ -1151,7 +1155,6 @@ dfilter_expr_dlg_new(GtkWidget *filter_te)
                            hfinfo->name);
             }
             str[TAG_STRING_LEN]='\0';
-            strp=str;
             gtk_tree_store_append(store, &child_iter, &iter);
             gtk_tree_store_set(store, &child_iter, 0, strp, 1, hfinfo, -1);
        }