Change "LED" to "icon" and add a packet comment icon to the corresponding expert info tab if the preference for displaying them is enabled. Basically, extend the fix for bug 3196 to include the packet comments tab. Also, fix some typos.

svn path=/trunk/; revision=45053
This commit is contained in:
Chris Maynard 2012-09-22 17:02:34 +00:00
parent ad32e468bf
commit 29ba21d1e7
2 changed files with 15 additions and 9 deletions

View File

@ -50,6 +50,7 @@
#include "ui/gtk/packet_panes.h"
#include "ui/gtk/old-gtk-compat.h"
#include "ui/gtk/edit_packet_comment_dlg.h"
#include "ui/gtk/capture_comment_icons.h"
enum
{
@ -378,8 +379,8 @@ static expert_tapdata_t * expert_dlg_new_table(void)
}
static void
coments_row_double_click_cb(GtkTreeView *treeview _U_, GtkTreePath *path _U_,
GtkTreeViewColumn *col _U_, gpointer userdata _U_)
comments_row_double_click_cb(GtkTreeView *treeview _U_, GtkTreePath *path _U_,
GtkTreeViewColumn *col _U_, gpointer userdata _U_)
{
edit_packet_comment_dlg(NULL, NULL);
}
@ -398,7 +399,7 @@ expert_dlg_init_comments_table(expert_tapdata_t * etd, GtkWidget *vbox)
store = gtk_list_store_new(N_COLUMNS_COMMENT_TBL, /* Total number of columns */
G_TYPE_UINT, /* No */
G_TYPE_POINTER, /* Summary */
G_TYPE_STRING, /* forground */
G_TYPE_STRING, /* Foreground */
G_TYPE_STRING); /* Background */
/* Create a view */
@ -475,7 +476,7 @@ expert_dlg_init_comments_table(expert_tapdata_t * etd, GtkWidget *vbox)
NULL);
g_signal_connect(tree, "row-activated",
G_CALLBACK(coments_row_double_click_cb), NULL);
G_CALLBACK(comments_row_double_click_cb), NULL);
etd->scrolled_window_comments=scrolled_window_new(NULL, NULL);
gtk_container_add(GTK_CONTAINER(etd->scrolled_window_comments), GTK_WIDGET (etd->tree_view_comments));
@ -500,7 +501,7 @@ expert_dlg_init_table(expert_tapdata_t * etd, GtkWidget *vbox)
G_TYPE_POINTER, /* Group */
G_TYPE_POINTER, /* Protocol */
G_TYPE_POINTER, /* Summary */
G_TYPE_STRING, /* forground */
G_TYPE_STRING, /* Foreground */
G_TYPE_STRING); /* Background */
/* Create a view */
@ -863,11 +864,16 @@ expert_comp_init(const char *optarg _U_, void* userdata _U_)
ss->all_label = gtk_label_new("Details: 0");
gtk_notebook_append_page(GTK_NOTEBOOK(main_nb), details_page, ss->all_label);
/* Paket comments */
/* Packet comments */
comments_page = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, 6, FALSE);
ss->pkt_comments_label = gtk_label_new("Packet Comments: 0/y");
gtk_widget_show(ss->pkt_comments_label);
hbox = ws_gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 3, FALSE);
if ( prefs.gui_expert_composite_eyecandy ) {
image = pixbuf_to_widget(capture_comment_update_pb_data);
gtk_widget_show(image);
gtk_box_pack_start(GTK_BOX(hbox), image, TRUE, TRUE, 0);
}
gtk_box_pack_start(GTK_BOX(hbox), ss->pkt_comments_label, TRUE, TRUE, 0);
gtk_notebook_append_page(GTK_NOTEBOOK(main_nb), comments_page, hbox);
@ -940,7 +946,7 @@ expert_comp_init(const char *optarg _U_, void* userdata _U_)
* Put our window back in front
*/
gdk_window_raise(gtk_widget_get_window(ss->win));
/* Set the lable text */
/* Set the label text */
expert_comp_draw(ss);
}

View File

@ -370,8 +370,8 @@ gui_prefs_show(void)
/* Enable Expert Infos Dialog Tab Label "eye-candy" */
expert_info_eyecandy_cb = create_preference_check_button(main_tb, pos++,
"Display LEDs in the Expert Infos dialog tab labels:",
"Whether colored LED images should be displayed in the Expert Infos dialog tab labels.",
"Display icons in the Expert Infos dialog tab labels:",
"Whether icon images should be displayed in the Expert Infos dialog tab labels.",
prefs.gui_expert_composite_eyecandy );
g_object_set_data(G_OBJECT(main_vb), GUI_EXPERT_EYECANDY_KEY, expert_info_eyecandy_cb);