summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2007-11-30 15:37:21 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2007-11-30 15:37:21 +0000
commit44145c21ed0988462a8ff2264eb6d2a79fb73d8e (patch)
tree38002925551e334b824a64757b0cf0cf168ccf62
parentfacb4b5d50a823d68c370e50c82cdb2746817620 (diff)
downloadwireshark-44145c21ed0988462a8ff2264eb6d2a79fb73d8e.tar.gz
Show the Display filter in Protocol Hierarchy Statistics.
svn path=/trunk/; revision=23686
-rw-r--r--gtk/proto_hier_stats_dlg.c32
-rw-r--r--proto_hier_stats.c1
-rw-r--r--proto_hier_stats.h1
3 files changed, 23 insertions, 11 deletions
diff --git a/gtk/proto_hier_stats_dlg.c b/gtk/proto_hier_stats_dlg.c
index 747139bee6..7a7d1037ff 100644
--- a/gtk/proto_hier_stats_dlg.c
+++ b/gtk/proto_hier_stats_dlg.c
@@ -315,6 +315,8 @@ proto_hier_stats_cb(GtkWidget *w _U_, gpointer d _U_)
{
ph_stats_t *ps;
GtkWidget *dlg, *ok_bt, *help_bt, *vbox, *bbox;
+ GtkWidget *label;
+ char title[256];
/* Get the statistics. */
ps = ph_stats_new();
@@ -330,31 +332,39 @@ proto_hier_stats_cb(GtkWidget *w _U_, gpointer d _U_)
gtk_container_border_width(GTK_CONTAINER(vbox), 5);
gtk_container_add(GTK_CONTAINER(dlg), vbox);
+ if (ps->dfilter) {
+ g_snprintf(title, 255, "Display filter: %s", ps->dfilter);
+ } else {
+ g_snprintf(title, 255, "Display filter: none");
+ }
+ label = gtk_label_new(title);
+ gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+
/* Data section */
create_tree(vbox, ps);
ph_stats_free(ps);
/* Button row. */
- if(topic_available(HELP_STATS_PROTO_HIERARCHY_DIALOG)) {
- bbox = dlg_button_row_new(GTK_STOCK_OK, GTK_STOCK_HELP, NULL);
- } else {
- bbox = dlg_button_row_new(GTK_STOCK_OK, NULL);
- }
+ if(topic_available(HELP_STATS_PROTO_HIERARCHY_DIALOG)) {
+ bbox = dlg_button_row_new(GTK_STOCK_OK, GTK_STOCK_HELP, NULL);
+ } else {
+ bbox = dlg_button_row_new(GTK_STOCK_OK, NULL);
+ }
gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
gtk_widget_show(bbox);
ok_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_OK);
- window_set_cancel_button(dlg, ok_bt, window_cancel_button_cb);
+ window_set_cancel_button(dlg, ok_bt, window_cancel_button_cb);
- if(topic_available(HELP_STATS_PROTO_HIERARCHY_DIALOG)) {
- help_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_HELP);
- SIGNAL_CONNECT(help_bt, "clicked", topic_cb, HELP_STATS_PROTO_HIERARCHY_DIALOG);
- }
+ if(topic_available(HELP_STATS_PROTO_HIERARCHY_DIALOG)) {
+ help_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_HELP);
+ SIGNAL_CONNECT(help_bt, "clicked", topic_cb, HELP_STATS_PROTO_HIERARCHY_DIALOG);
+ }
SIGNAL_CONNECT(dlg, "delete_event", window_delete_event_cb, NULL);
gtk_widget_show_all(dlg);
- window_present(dlg);
+ window_present(dlg);
}
diff --git a/proto_hier_stats.c b/proto_hier_stats.c
index d402492098..231182d348 100644
--- a/proto_hier_stats.c
+++ b/proto_hier_stats.c
@@ -191,6 +191,7 @@ ph_stats_new(void)
ps->stats_tree = g_node_new(NULL);
ps->first_time = 0.0;
ps->last_time = 0.0;
+ ps->dfilter = cfile.dfilter;
/* Update the progress bar when it gets to this value. */
progbar_nextstep = 0;
diff --git a/proto_hier_stats.h b/proto_hier_stats.h
index 5d5aac2510..d98d1a0a99 100644
--- a/proto_hier_stats.h
+++ b/proto_hier_stats.h
@@ -41,6 +41,7 @@ typedef struct {
GNode *stats_tree;
double first_time; /* seconds (msec resolution) of first packet */
double last_time; /* seconds (msec resolution) of last packet */
+ const char *dfilter; /* display filter */
} ph_stats_t;