Show both short and long protocol name in the Filter Expression dialog.

svn path=/trunk/; revision=26537
This commit is contained in:
Stig Bjørlykke 2008-10-24 07:48:09 +00:00
parent 3934dfb936
commit 5e5a674e76
3 changed files with 19 additions and 4 deletions

View 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)
{

View 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 */

View 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);
}