diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-10-22 22:13:13 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-10-22 22:13:13 +0000 |
commit | 44a967d7e6426c24c5b6b3608e744a210e4d3ee0 (patch) | |
tree | c6daf57d829d565e45294c4cbfe023f768b97684 /prefs.c | |
parent | 83980ea4ff46d7d80ace5a00327cd40a7b88d1d8 (diff) |
From Ulf Lamping: add a preference to control whether to show or hide
the main toolbar (currently no GUI to set it; that's in progress).
svn path=/trunk/; revision=8754
Diffstat (limited to 'prefs.c')
-rw-r--r-- | prefs.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -1,7 +1,7 @@ /* prefs.c * Routines for handling preferences * - * $Id: prefs.c,v 1.110 2003/10/16 21:19:11 guy Exp $ + * $Id: prefs.c,v 1.111 2003/10/22 22:13:12 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -917,6 +917,7 @@ read_prefs(int *gpf_errno_return, int *gpf_read_errno_return, prefs.gui_ptree_line_style = 0; prefs.gui_ptree_expander_style = 1; prefs.gui_hex_dump_highlight_style = 1; + prefs.gui_toolbar_main_show = TRUE; prefs.gui_toolbar_main_style = TB_STYLE_ICONS; #ifdef WIN32 prefs.gui_font_name = g_strdup("-*-lucida console-medium-r-*-*-*-100-*-*-*-*-*-*"); @@ -1272,6 +1273,7 @@ prefs_set_pref(char *prefarg) #define PRS_GUI_GEOMETRY_MAIN_Y "gui.geometry.main.y" #define PRS_GUI_GEOMETRY_MAIN_WIDTH "gui.geometry.main.width" #define PRS_GUI_GEOMETRY_MAIN_HEIGHT "gui.geometry.main.height" +#define PRS_GUI_TOOLBAR_MAIN_SHOW "gui.toolbar_main_show" #define PRS_GUI_TOOLBAR_MAIN_STYLE "gui.toolbar_main_style" /* @@ -1506,6 +1508,14 @@ set_pref(gchar *pref_name, gchar *value) } else if (strcmp(pref_name, PRS_GUI_HEX_DUMP_HIGHLIGHT_STYLE) == 0) { prefs.gui_hex_dump_highlight_style = find_index_from_string_array(value, gui_hex_dump_highlight_style_text, 1); + } else if (strcmp(pref_name, PRS_GUI_TOOLBAR_MAIN_SHOW) == 0) { + /* see toolbar.c for details */ + if (strcasecmp(value, "true") == 0) { + prefs.gui_toolbar_main_show = TRUE; + } + else { + prefs.gui_toolbar_main_show = FALSE; + } } else if (strcmp(pref_name, PRS_GUI_TOOLBAR_MAIN_STYLE) == 0) { /* see toolbar.c for details, "icons only" is default */ prefs.gui_toolbar_main_style = @@ -2077,6 +2087,11 @@ write_prefs(char **pf_path_return) fprintf(pf, PRS_GUI_HEX_DUMP_HIGHLIGHT_STYLE ": %s\n", gui_hex_dump_highlight_style_text[prefs.gui_hex_dump_highlight_style]); + fprintf(pf, "\n# Main Toolbar show/hide.\n"); + fprintf(pf, "# TRUE or FALSE (case-insensitive).\n"); + fprintf(pf, PRS_GUI_TOOLBAR_MAIN_SHOW ": %s\n", + prefs.gui_toolbar_main_show == TRUE ? "TRUE" : "FALSE"); + fprintf(pf, "\n# Main Toolbar style.\n"); fprintf(pf, "# One of: ICONS, TEXT, BOTH\n"); fprintf(pf, PRS_GUI_TOOLBAR_MAIN_STYLE ": %s\n", @@ -2221,6 +2236,7 @@ copy_prefs(e_prefs *dest, e_prefs *src) dest->gui_ptree_line_style = src->gui_ptree_line_style; dest->gui_ptree_expander_style = src->gui_ptree_expander_style; dest->gui_hex_dump_highlight_style = src->gui_hex_dump_highlight_style; + dest->gui_toolbar_main_show = src->gui_toolbar_main_show; dest->gui_toolbar_main_style = src->gui_toolbar_main_style; dest->gui_font_name = g_strdup(src->gui_font_name); dest->gui_marked_fg = src->gui_marked_fg; |