Prefix tooltip with protocol name.

svn path=/trunk/; revision=31094
This commit is contained in:
Stig Bjørlykke 2009-11-27 13:15:41 +00:00
parent 6bcb851e06
commit a68334bcec
2 changed files with 12 additions and 2 deletions

View File

@ -687,7 +687,12 @@ packet_list_set_column_titles(void)
GTK_SHRINK, GTK_SHRINK, 0, 0);
if (cfile.cinfo.col_fmt[i] == COL_CUSTOM) {
hfi = proto_registrar_get_byname(cfile.cinfo.col_custom_field[i]);
tooltip_text = g_strdup_printf("%s (%s)", hfi->name, hfi->abbrev);
if (hfi->parent != -1) {
/* Prefix with protocol name */
tooltip_text = g_strdup_printf("%s\n%s (%s)", proto_get_protocol_name(hfi->parent), hfi->name, hfi->abbrev);
} else {
tooltip_text = g_strdup_printf("%s (%s)", hfi->name, hfi->abbrev);
}
} else {
tooltip_text = g_strdup(col_format_desc(cfile.cinfo.col_fmt[i]));
}

View File

@ -365,7 +365,12 @@ create_view_and_model(void)
title_lb = gtk_label_new(cfile.cinfo.col_title[i]);
if (cfile.cinfo.col_fmt[i] == COL_CUSTOM) {
hfi = proto_registrar_get_byname(cfile.cinfo.col_custom_field[i]);
tooltip_text = g_strdup_printf("%s (%s)", hfi->name, hfi->abbrev);
if (hfi->parent != -1) {
/* Prefix with protocol name */
tooltip_text = g_strdup_printf("%s\n%s (%s)", proto_get_protocol_name(hfi->parent), hfi->name, hfi->abbrev);
} else {
tooltip_text = g_strdup_printf("%s (%s)", hfi->name, hfi->abbrev);
}
} else {
tooltip_text = g_strdup(col_format_desc(cfile.cinfo.col_fmt[i]));
}