2 * Dialog box for preferences common for all protocols
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #include <epan/prefs.h>
33 #include "gtk/prefs_protocols.h"
34 #include "gtk/prefs_dlg.h"
36 #define PROTOCOLS_SHOW_HIDDEN_KEY "display_hidden_items"
37 #define PROTOCOLS_TABLE_ROWS 1
40 protocols_prefs_show(void)
42 GtkWidget *main_tb, *main_vb;
43 GtkWidget *display_hidden_cb;
46 /* Main vertical box */
47 main_vb = gtk_vbox_new(FALSE, 7);
48 gtk_container_set_border_width(GTK_CONTAINER(main_vb), 5);
51 main_tb = gtk_table_new(PROTOCOLS_TABLE_ROWS, 1, FALSE);
52 gtk_box_pack_start(GTK_BOX(main_vb), main_tb, FALSE, FALSE, 0);
53 gtk_table_set_row_spacings(GTK_TABLE(main_tb), 10);
54 gtk_table_set_col_spacings(GTK_TABLE(main_tb), 15);
55 gtk_widget_show(main_tb);
57 /* Show hidden protocol items in packet list */
58 display_hidden_cb = create_preference_check_button(main_tb, pos++,
59 "Display hidden protocol items:",
60 "Display all hidden protocol items in the packet list.",
61 prefs.display_hidden_proto_items);
62 g_object_set_data(G_OBJECT(main_vb), PROTOCOLS_SHOW_HIDDEN_KEY, display_hidden_cb);
64 /* Show 'em what we got */
65 gtk_widget_show_all(main_vb);
71 protocols_prefs_fetch(GtkWidget *w _U_)
73 GtkWidget *display_hidden_cb;
75 display_hidden_cb = (GtkWidget *)g_object_get_data(G_OBJECT(w), PROTOCOLS_SHOW_HIDDEN_KEY);
76 prefs.display_hidden_proto_items = (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (display_hidden_cb)) ? TRUE : FALSE);
80 protocols_prefs_apply(GtkWidget *w _U_)
85 protocols_prefs_destroy(GtkWidget *w _U_)