aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2006-04-20 19:58:50 +0000
committerUlf Lamping <ulf.lamping@web.de>2006-04-20 19:58:50 +0000
commitc858e7e993d10ffe102f53e09c23adc7dfdb0bba (patch)
treeb082219641e95bb0e7ae196d742f5123ff2df8ed
parenta70e3c548c2272df6cc0b3c83bec82b78bb22686 (diff)
add a help button to the "Follow TCP Stream" dialog (and use standard button row for it too)
svn path=/trunk/; revision=17931
-rw-r--r--gtk/compat_macros.h3
-rw-r--r--gtk/dlg_utils.c2
-rw-r--r--gtk/follow_dlg.c34
-rw-r--r--gtk/toolbar.c4
4 files changed, 27 insertions, 16 deletions
diff --git a/gtk/compat_macros.h b/gtk/compat_macros.h
index 008d28f2fa..c9394aa643 100644
--- a/gtk/compat_macros.h
+++ b/gtk/compat_macros.h
@@ -221,6 +221,7 @@ gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), name)
#define ETHEREAL_STOCK_FILE_SET_LIST "List Files"
#define ETHEREAL_STOCK_FILE_SET_NEXT "Next File"
#define ETHEREAL_STOCK_FILE_SET_PREVIOUS "Previous File"
+#define ETHEREAL_STOCK_FILTER_OUT_STREAM "Filter Out This Stream"
/** Create a stock button. Will create a "normal" button for GTK1.
*
@@ -353,6 +354,7 @@ g_signal_stop_emission_by_name(G_OBJECT(widget), name)
#define ETHEREAL_STOCK_LABEL_FILE_SET_LIST "List Files"
#define ETHEREAL_STOCK_LABEL_FILE_SET_NEXT "Next File"
#define ETHEREAL_STOCK_LABEL_FILE_SET_PREVIOUS "Previous File"
+#define ETHEREAL_STOCK_LABEL_FILTER_OUT_STREAM "Filter Out This Stream"
#ifdef HAVE_LIBPCAP
#define ETHEREAL_STOCK_CAPTURE_INTERFACES "Ethereal_Stock_CaptureInterfaces"
@@ -390,6 +392,7 @@ g_signal_stop_emission_by_name(G_OBJECT(widget), name)
#define ETHEREAL_STOCK_FILE_SET_LIST "Ethereal_Stock_File_Set_List"
#define ETHEREAL_STOCK_FILE_SET_NEXT "Ethereal_Stock_File_Set_Next"
#define ETHEREAL_STOCK_FILE_SET_PREVIOUS "Ethereal_Stock_File_Set_Previous"
+#define ETHEREAL_STOCK_FILTER_OUT_STREAM "Ethereal_Stock_Filter_Out_This_Stream"
#define BUTTON_NEW_FROM_STOCK(stock_id) \
gtk_button_new_from_stock(stock_id);
diff --git a/gtk/dlg_utils.c b/gtk/dlg_utils.c
index 2dacc9750d..6af8bd0fbb 100644
--- a/gtk/dlg_utils.c
+++ b/gtk/dlg_utils.c
@@ -153,6 +153,8 @@ dlg_button_row_new(const gchar *stock_id_first, ...)
yes = stock_id;
} else if (strcmp(stock_id, GTK_STOCK_NO) == 0) {
no = stock_id;
+ } else if (strcmp(stock_id, ETHEREAL_STOCK_FILTER_OUT_STREAM) == 0) {
+ start = stock_id;
} else {
/* we don't know that button! */
g_assert_not_reached();
diff --git a/gtk/follow_dlg.c b/gtk/follow_dlg.c
index a478b6ebdc..cc290dd74e 100644
--- a/gtk/follow_dlg.c
+++ b/gtk/follow_dlg.c
@@ -63,6 +63,7 @@
#include <epan/ipproto.h>
#include "print_mswin.h"
#include "font_utils.h"
+#include "help_dlg.h"
/* This is backwards-compatibility code for old versions of GTK+ (2.2.1 and
* earlier). It defines the new wrap behavior (unknown in earlier versions)
@@ -161,7 +162,7 @@ void
follow_stream_cb(GtkWidget * w, gpointer data _U_)
{
GtkWidget *streamwindow, *vbox, *txt_scrollw, *text, *filter_te;
- GtkWidget *hbox, *button_hbox, *button, *radio_bt;
+ GtkWidget *hbox, *bbox, *button, *radio_bt;
GtkWidget *stream_fr, *stream_vb;
GtkWidget *stream_om, *stream_menu, *stream_mi;
GtkTooltips *tooltips;
@@ -441,27 +442,30 @@ follow_stream_cb(GtkWidget * w, gpointer data _U_)
follow_info);
follow_info->raw_bt = radio_bt;
- /* button hbox */
- button_hbox = gtk_hbutton_box_new();
- gtk_box_pack_start(GTK_BOX(vbox), button_hbox, FALSE, FALSE, 0);
- gtk_button_box_set_layout (GTK_BUTTON_BOX(button_hbox), GTK_BUTTONBOX_END);
- gtk_button_box_set_spacing(GTK_BUTTON_BOX(button_hbox), 5);
+ /* Button row: (help), filter out, close button */
+ if(topic_available(HELP_FILESET_DIALOG)) {
+ bbox = dlg_button_row_new(ETHEREAL_STOCK_FILTER_OUT_STREAM, GTK_STOCK_CLOSE, GTK_STOCK_HELP, NULL);
+ } else {
+ bbox = dlg_button_row_new(ETHEREAL_STOCK_FILTER_OUT_STREAM, GTK_STOCK_CLOSE, NULL);
+ }
+ gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 5);
- /* Create exclude stream button */
- button = gtk_button_new_with_label("Filter Out This Stream");
- SIGNAL_CONNECT(button, "clicked", follow_filter_out_stream, follow_info);
+
+ button = OBJECT_GET_DATA(bbox, ETHEREAL_STOCK_FILTER_OUT_STREAM);
gtk_tooltips_set_tip (tooltips, button,
"Build a display filter which cuts this stream from the capture", NULL);
- gtk_box_pack_start(GTK_BOX(button_hbox), button, FALSE, FALSE, 0);
+ SIGNAL_CONNECT(button, "clicked", follow_filter_out_stream, follow_info);
- /* Create Close Button */
- button = BUTTON_NEW_FROM_STOCK(GTK_STOCK_CLOSE);
+ button = OBJECT_GET_DATA(bbox, GTK_STOCK_CLOSE);
+ window_set_cancel_button(streamwindow, button, window_cancel_button_cb);
gtk_tooltips_set_tip (tooltips, button,
"Close the dialog and keep the current display filter", NULL);
- gtk_box_pack_start(GTK_BOX(button_hbox), button, FALSE, FALSE, 0);
- GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
+ gtk_widget_grab_default(button);
- window_set_cancel_button(streamwindow, button, window_cancel_button_cb);
+ if(topic_available(HELP_FILESET_DIALOG)) {
+ button = OBJECT_GET_DATA(bbox, GTK_STOCK_HELP);
+ SIGNAL_CONNECT(button, "clicked", topic_cb, HELP_FOLLOW_TCP_STREAM_DIALOG);
+ }
/* Tuck away the follow_info object into the window */
OBJECT_SET_DATA(streamwindow, E_FOLLOW_INFO_KEY, follow_info);
diff --git a/gtk/toolbar.c b/gtk/toolbar.c
index dbb3f3bf42..ddcb66cad2 100644
--- a/gtk/toolbar.c
+++ b/gtk/toolbar.c
@@ -208,7 +208,8 @@ static void ethereal_stock_icons(void) {
{ ETHEREAL_STOCK_CHECKBOX, ETHEREAL_STOCK_LABEL_CHECKBOX, 0, 0, NULL },
{ ETHEREAL_STOCK_FILE_SET_LIST, ETHEREAL_STOCK_LABEL_FILE_SET_LIST, 0, 0, NULL },
{ ETHEREAL_STOCK_FILE_SET_NEXT, ETHEREAL_STOCK_LABEL_FILE_SET_NEXT, 0, 0, NULL },
- { ETHEREAL_STOCK_FILE_SET_PREVIOUS, ETHEREAL_STOCK_LABEL_FILE_SET_PREVIOUS, 0, 0, NULL }
+ { ETHEREAL_STOCK_FILE_SET_PREVIOUS, ETHEREAL_STOCK_LABEL_FILE_SET_PREVIOUS, 0, 0, NULL },
+ { ETHEREAL_STOCK_FILTER_OUT_STREAM, ETHEREAL_STOCK_LABEL_FILTER_OUT_STREAM, 0, 0, NULL }
};
static const stock_pixmap_t pixmaps[] = {
@@ -247,6 +248,7 @@ static void ethereal_stock_icons(void) {
{ ETHEREAL_STOCK_FILE_SET_LIST, file_set_list_16_xpm},
{ ETHEREAL_STOCK_FILE_SET_NEXT, file_set_next_16_xpm},
{ ETHEREAL_STOCK_FILE_SET_PREVIOUS, file_set_previous_16_xpm},
+ { ETHEREAL_STOCK_FILTER_OUT_STREAM, display_filter_24_xpm},
{ NULL, NULL }
};