merge_all_tap_menus() has been moved to menus.c.
[obnox/wireshark/wip.git] / gtk / prefs_protocols.c
1 /* prefs_protocols.c
2  * Dialog box for preferences common for all protocols
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
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.
14  *
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.
19  *
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.
23  */
24
25 #ifdef HAVE_CONFIG_H
26 #include "config.h"
27 #endif
28
29 #include <gtk/gtk.h>
30
31 #include <epan/prefs.h>
32
33 #include "gtk/prefs_protocols.h"
34 #include "gtk/prefs_dlg.h"
35
36 #define PROTOCOLS_SHOW_HIDDEN_KEY   "display_hidden_items"
37 #define PROTOCOLS_TABLE_ROWS 1
38
39 GtkWidget*
40 protocols_prefs_show(void)
41 {
42         GtkWidget   *main_tb, *main_vb;
43         GtkWidget   *display_hidden_cb;
44         int pos = 0;
45
46         /* Main vertical box */
47         main_vb = gtk_vbox_new(FALSE, 7);
48         gtk_container_set_border_width(GTK_CONTAINER(main_vb), 5);
49
50         /* Main table */
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);
56
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);
63
64         /* Show 'em what we got */
65         gtk_widget_show_all(main_vb);
66
67         return main_vb;
68 }
69
70 void
71 protocols_prefs_fetch(GtkWidget *w _U_)
72 {
73         GtkWidget *display_hidden_cb;
74
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);
77 }
78
79 void
80 protocols_prefs_apply(GtkWidget *w _U_)
81 {
82 }
83
84 void
85 protocols_prefs_destroy(GtkWidget *w _U_)
86 {
87 }
88