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;
44 GtkTooltips *tooltips = gtk_tooltips_new();
47 /* Main vertical box */
48 main_vb = gtk_vbox_new(FALSE, 7);
49 gtk_container_border_width(GTK_CONTAINER(main_vb), 5);
52 main_tb = gtk_table_new(PROTOCOLS_TABLE_ROWS, 1, FALSE);
53 gtk_box_pack_start(GTK_BOX(main_vb), main_tb, FALSE, FALSE, 0);
54 gtk_table_set_row_spacings(GTK_TABLE(main_tb), 10);
55 gtk_table_set_col_spacings(GTK_TABLE(main_tb), 15);
56 gtk_widget_show(main_tb);
57 g_object_set_data(G_OBJECT(main_tb), E_TOOLTIPS_KEY, tooltips);
59 /* Show hidden protocol items in packet list */
60 display_hidden_cb = create_preference_check_button(main_tb, pos++,
61 "Display hidden protocol items:",
62 "Display all hidden protocol items in the packet list.",
63 prefs.display_hidden_proto_items);
64 g_object_set_data(G_OBJECT(main_vb), PROTOCOLS_SHOW_HIDDEN_KEY, display_hidden_cb);
66 /* Show 'em what we got */
67 gtk_widget_show_all(main_vb);
73 protocols_prefs_fetch(GtkWidget *w _U_)
75 GtkWidget *display_hidden_cb;
77 display_hidden_cb = (GtkWidget *)g_object_get_data(G_OBJECT(w), PROTOCOLS_SHOW_HIDDEN_KEY);
78 prefs.display_hidden_proto_items = (GTK_TOGGLE_BUTTON (display_hidden_cb)->active ? TRUE : FALSE);
82 protocols_prefs_apply(GtkWidget *w _U_)
87 protocols_prefs_destroy(GtkWidget *w _U_)