aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>1999-12-16 06:20:18 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>1999-12-16 06:20:18 +0000
commitf34e877593e4ae244e130751c23a6dd9470b18fa (patch)
tree233c66497e4c6427e219cb74a31773f6b57792c8
parent1063eaaecc4765158bdb53cb4d03081f844d7b8a (diff)
Add a new page to the Preferences notebook: a GUI page. The sole
option right now is the placement of the vertical scrollbars in the 3 panes. (it's one decision; you can't have the placement of the vertical scrollbar in the packet list pane different than the placement in the protocol tree pane, for example). I did this because I find it convenient to have the vertical scrollbars on the *left* side of the text. My mouse cursor is usually expanding and collapsing the protocol tree widgets, and once the protocol tree changes size, I usually have to scroll. I'd rather move my mouse cursor just a few pixels over to find the vertical scrollbar. svn path=/trunk/; revision=1351
-rw-r--r--doc/ethereal.pod.template8
-rw-r--r--gtk/Makefile.am4
-rw-r--r--gtk/gtkglobals.h4
-rw-r--r--gtk/gui_prefs.c132
-rw-r--r--gtk/gui_prefs.h31
-rw-r--r--gtk/main.c70
-rw-r--r--gtk/prefs_dlg.c19
-rw-r--r--prefs.c16
-rw-r--r--prefs.h3
9 files changed, 262 insertions, 25 deletions
diff --git a/doc/ethereal.pod.template b/doc/ethereal.pod.template
index 3e2d20aa22..ba38bc0fe1 100644
--- a/doc/ethereal.pod.template
+++ b/doc/ethereal.pod.template
@@ -395,6 +395,14 @@ desired color. The new text colors are displayed in a sample window.
=back
+=item GUI Preferences
+
+The I<GUI> page is used to modify small aspects of the GUI to your own
+personal taste. The only current option is the placement of the
+vertical scrollbars in the three panes, either on the left or the right.
+
+=back
+
=item Filters
The I<Filters> dialog lets you create and modify filters, and set the
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index f9431b179c..d8b7089e97 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -1,7 +1,7 @@
# Makefile.am
# Automake file for the GTK interface routines for Ethereal
#
-# $Id: Makefile.am,v 1.15 1999/12/10 04:21:02 gram Exp $
+# $Id: Makefile.am,v 1.16 1999/12/16 06:20:14 gram Exp $
#
# Ethereal - Network traffic analyzer
# By Gerald Combs <gerald@zing.org>
@@ -43,6 +43,8 @@ libui_a_SOURCES = \
gtkclist.c \
gtkclist.h \
gtkglobals.h \
+ gui_prefs.c \
+ gui_prefs.h \
keys.h \
main.c \
main.h \
diff --git a/gtk/gtkglobals.h b/gtk/gtkglobals.h
index 32a23bdc39..cc6417a072 100644
--- a/gtk/gtkglobals.h
+++ b/gtk/gtkglobals.h
@@ -1,7 +1,7 @@
/* gtkglobals.h
* GTK-related Global defines, etc.
*
- * $Id: gtkglobals.h,v 1.2 1999/12/09 07:19:18 guy Exp $
+ * $Id: gtkglobals.h,v 1.3 1999/12/16 06:20:15 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -36,4 +36,6 @@ extern GdkFont *m_r_font, *m_b_font;
extern GtkStyle *item_style;
+void set_scrollbar_placement(int); /* 1=right, 0=left */
+
#endif
diff --git a/gtk/gui_prefs.c b/gtk/gui_prefs.c
new file mode 100644
index 0000000000..05a2f7f0ef
--- /dev/null
+++ b/gtk/gui_prefs.c
@@ -0,0 +1,132 @@
+/* gui_prefs.c
+ * Dialog box for GUI preferences
+ *
+ * $Id: gui_prefs.c,v 1.1 1999/12/16 06:20:15 gram Exp $
+ *
+ * Ethereal - Network traffic analyzer
+ * By Gerald Combs <gerald@zing.org>
+ * Copyright 1998 Gerald Combs
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <errno.h>
+
+#ifndef __GLOBALS_H__
+#include "globals.h"
+#endif
+
+#include "gui_prefs.h"
+#include "gtkglobals.h"
+
+#ifndef __PREFS_DLG_H__
+#include "prefs_dlg.h"
+#endif
+
+static void scrollbar_menu_item_cb(GtkWidget *w, gpointer data);
+
+static gboolean temp_gui_scrollbar_on_right;
+
+GtkWidget*
+gui_prefs_show(void)
+{
+ GtkWidget *main_vb, *hbox, *label;
+ GtkWidget *menu_item_left, *menu_item_right,
+ *scrollbar_menu, *scrollbar_option_menu;
+
+ temp_gui_scrollbar_on_right = prefs.gui_scrollbar_on_right;
+
+ /* Main vertical box */
+ main_vb = gtk_vbox_new(FALSE, 5);
+ gtk_container_border_width(GTK_CONTAINER(main_vb), 5);
+
+ /* Scrollbar placment hbox */
+ hbox = gtk_hbox_new(FALSE, 5);
+ gtk_box_pack_start( GTK_BOX(main_vb), hbox, FALSE, FALSE, 5);
+
+ label = gtk_label_new("Vertical Scrollbar Placement:");
+ gtk_container_add( GTK_CONTAINER(hbox), label );
+
+ /* Create a simple menu containing the LEFT/RIGHT choices for
+ * the scrollbar placement option */
+ scrollbar_menu = gtk_menu_new();
+ menu_item_left = gtk_menu_item_new_with_label("Left");
+ menu_item_right = gtk_menu_item_new_with_label("Right");
+ gtk_menu_append( GTK_MENU(scrollbar_menu), menu_item_left );
+ gtk_menu_append( GTK_MENU(scrollbar_menu), menu_item_right );
+
+ gtk_signal_connect( GTK_OBJECT(menu_item_left), "activate",
+ scrollbar_menu_item_cb, GINT_TO_POINTER(FALSE) );
+ gtk_signal_connect( GTK_OBJECT(menu_item_right), "activate",
+ scrollbar_menu_item_cb, GINT_TO_POINTER(TRUE) );
+
+ /* Create the option menu from the option */
+ scrollbar_option_menu = gtk_option_menu_new();
+ gtk_option_menu_set_menu( GTK_OPTION_MENU(scrollbar_option_menu),
+ scrollbar_menu );
+ gtk_option_menu_set_history( GTK_OPTION_MENU(scrollbar_option_menu),
+ temp_gui_scrollbar_on_right);
+ gtk_container_add( GTK_CONTAINER(hbox), scrollbar_option_menu );
+
+
+ /* Show 'em what we got */
+ gtk_widget_show_all(main_vb);
+
+ return(main_vb);
+}
+
+
+static void
+scrollbar_menu_item_cb(GtkWidget *w, gpointer data)
+{
+ gboolean value = GPOINTER_TO_INT(data);
+
+ temp_gui_scrollbar_on_right = value;
+ set_scrollbar_placement(value);
+}
+
+void
+gui_prefs_ok(GtkWidget *w)
+{
+ prefs.gui_scrollbar_on_right = temp_gui_scrollbar_on_right;
+ gui_prefs_delete(w);
+}
+
+void
+gui_prefs_save(GtkWidget *w)
+{
+ gui_prefs_ok(w);
+}
+
+void
+gui_prefs_cancel(GtkWidget *w)
+{
+ /* Reset scrollbar placement value back to what the
+ * current preferences says it should be */
+ temp_gui_scrollbar_on_right = prefs.gui_scrollbar_on_right;
+ set_scrollbar_placement(prefs.gui_scrollbar_on_right);
+
+ gui_prefs_delete(w);
+}
+
+void
+gui_prefs_delete(GtkWidget *w)
+{
+}
diff --git a/gtk/gui_prefs.h b/gtk/gui_prefs.h
new file mode 100644
index 0000000000..5447e68302
--- /dev/null
+++ b/gtk/gui_prefs.h
@@ -0,0 +1,31 @@
+/* gui_prefs.h
+ * Definitions for GUI preferences window
+ *
+ * $Id: gui_prefs.h,v 1.1 1999/12/16 06:20:16 gram Exp $
+ *
+ * Ethereal - Network traffic analyzer
+ * By Gerald Combs <gerald@zing.org>
+ * Copyright 1998 Gerald Combs
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+
+GtkWidget *gui_prefs_show(void);
+void gui_prefs_ok(GtkWidget *w);
+void gui_prefs_save(GtkWidget *w);
+void gui_prefs_cancel(GtkWidget *w);
+void gui_prefs_delete(GtkWidget *w);
diff --git a/gtk/main.c b/gtk/main.c
index 3657f91678..7c9c5f6bf1 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -1,6 +1,6 @@
/* main.c
*
- * $Id: main.c,v 1.75 1999/12/16 04:11:33 gram Exp $
+ * $Id: main.c,v 1.76 1999/12/16 06:20:16 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -104,12 +104,14 @@
#include "proto_draw.h"
#include "dfilter.h"
#include "keys.h"
+#include "gtkglobals.h"
FILE *data_out_file = NULL;
packet_info pi;
capture_file cf;
GtkWidget *top_level, *file_sel, *packet_list, *tree_view, *byte_view,
- *prog_bar, *info_bar;
+ *prog_bar, *info_bar, *tv_scrollw, *pkt_scrollw,
+ *bv_vscroll_left, *bv_vscroll_right;
GdkFont *m_r_font, *m_b_font;
guint main_ctx, file_ctx;
gchar comp_info_str[256];
@@ -759,6 +761,28 @@ void expand_all_cb(GtkWidget *widget, gpointer data) {
}
void
+set_scrollbar_placement(int pos) /* 0=left, 1=right */
+{
+ if (pos) {
+ gtk_scrolled_window_set_placement( GTK_SCROLLED_WINDOW(pkt_scrollw),
+ GTK_CORNER_TOP_LEFT );
+ gtk_scrolled_window_set_placement( GTK_SCROLLED_WINDOW(tv_scrollw),
+ GTK_CORNER_TOP_LEFT );
+ gtk_widget_hide(bv_vscroll_left);
+ gtk_widget_show(bv_vscroll_right);
+ }
+ else {
+ gtk_scrolled_window_set_placement( GTK_SCROLLED_WINDOW(pkt_scrollw),
+ GTK_CORNER_TOP_RIGHT );
+ gtk_scrolled_window_set_placement( GTK_SCROLLED_WINDOW(tv_scrollw),
+ GTK_CORNER_TOP_RIGHT );
+ gtk_widget_hide(bv_vscroll_right);
+ gtk_widget_show(bv_vscroll_left);
+ }
+}
+
+
+void
file_quit_cmd_cb (GtkWidget *widget, gpointer data) {
/* If we have a capture file open, and it's a temporary file,
unlink it. */
@@ -829,13 +853,12 @@ main(int argc, char *argv[])
gboolean capture_option_specified = FALSE;
#endif
GtkWidget *main_vbox, *menubar, *u_pane, *l_pane,
- *bv_table, *bv_vscroll, *stat_hbox,
- *tv_scrollw, *filter_bt, *filter_cm, *filter_te,
+ *bv_table, *stat_hbox,
+ *filter_bt, *filter_cm, *filter_te,
*filter_reset;
GList *filter_list = NULL;
GtkStyle *pl_style;
GtkAccelGroup *accel;
- GtkWidget *packet_sw;
gint pl_size = 280, tv_size = 95, bv_size = 75;
gchar *rc_file, *cf_name = NULL, *rfilter = NULL;
dfilter *rfcode = NULL;
@@ -1186,11 +1209,11 @@ main(int argc, char *argv[])
/* Packet list */
packet_list = gtk_clist_new_with_titles(cf.cinfo.num_cols, cf.cinfo.col_title);
gtk_clist_column_titles_passive(GTK_CLIST(packet_list));
- packet_sw = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(packet_sw),
+ pkt_scrollw = gtk_scrolled_window_new(NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(pkt_scrollw),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_widget_show(packet_sw);
- gtk_container_add(GTK_CONTAINER(packet_sw), packet_list);
+ gtk_widget_show(pkt_scrollw);
+ gtk_container_add(GTK_CONTAINER(pkt_scrollw), packet_list);
pl_style = gtk_style_new();
gdk_font_unref(pl_style->font);
pl_style->font = m_r_font;
@@ -1215,7 +1238,7 @@ main(int argc, char *argv[])
pl_style->font);
}
gtk_widget_set_usize(packet_list, -1, pl_size);
- gtk_paned_add1(GTK_PANED(u_pane), packet_sw);
+ gtk_paned_add1(GTK_PANED(u_pane), pkt_scrollw);
gtk_widget_show(packet_list);
/* Tree view */
@@ -1241,8 +1264,14 @@ main(int argc, char *argv[])
gdk_font_unref(item_style->font);
item_style->font = m_r_font;
- /* Byte view */
- bv_table = gtk_table_new (2, 2, FALSE);
+ /* Byte view. The table is only one row high, but 3 columns
+ * wide. The middle column contains the GtkText with the hex dump.
+ * The left and right columns contain vertical scrollbars. They both
+ * do the same thing, but only one will be shown at a time, in accordance
+ * with where the user wants the other vertical scrollbars places
+ * (on the left or the right).
+ */
+ bv_table = gtk_table_new (1, 3, FALSE);
gtk_paned_pack2(GTK_PANED(l_pane), bv_table, FALSE, FALSE);
gtk_widget_set_usize(bv_table, -1, bv_size);
gtk_widget_show(bv_table);
@@ -1250,7 +1279,7 @@ main(int argc, char *argv[])
byte_view = gtk_text_new(NULL, NULL);
gtk_text_set_editable(GTK_TEXT(byte_view), FALSE);
gtk_text_set_word_wrap(GTK_TEXT(byte_view), FALSE);
- gtk_table_attach (GTK_TABLE (bv_table), byte_view, 0, 1, 0, 1,
+ gtk_table_attach (GTK_TABLE (bv_table), byte_view, 1, 2, 0, 1,
GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 0);
gtk_widget_show(byte_view);
@@ -1261,11 +1290,18 @@ main(int argc, char *argv[])
* did not work well, and sometimes a few pixels were cut off on
* the bottom. */
- bv_vscroll = gtk_vscrollbar_new(GTK_TEXT(byte_view)->vadj);
- gtk_table_attach(GTK_TABLE(bv_table), bv_vscroll, 1, 2, 0, 1,
+ bv_vscroll_left = gtk_vscrollbar_new(GTK_TEXT(byte_view)->vadj);
+ gtk_table_attach(GTK_TABLE(bv_table), bv_vscroll_left, 0, 1, 0, 1,
GTK_FILL, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0);
- gtk_widget_show(bv_vscroll);
-
+
+ bv_vscroll_right = gtk_vscrollbar_new(GTK_TEXT(byte_view)->vadj);
+ gtk_table_attach(GTK_TABLE(bv_table), bv_vscroll_right, 2, 3, 0, 1,
+ GTK_FILL, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0);
+
+ /* Now that the 3 panes are created, set the vertical scrollbar
+ * on the left or right according to the user's preference */
+ set_scrollbar_placement(prefs->gui_scrollbar_on_right);
+
/* Progress/filter/info box */
stat_hbox = gtk_hbox_new(FALSE, 1);
gtk_container_border_width(GTK_CONTAINER(stat_hbox), 0);
diff --git a/gtk/prefs_dlg.c b/gtk/prefs_dlg.c
index 19ddc50850..0475b66591 100644
--- a/gtk/prefs_dlg.c
+++ b/gtk/prefs_dlg.c
@@ -1,7 +1,7 @@
/* prefs_dlg.c
* Routines for handling preferences
*
- * $Id: prefs_dlg.c,v 1.4 1999/12/10 06:28:24 guy Exp $
+ * $Id: prefs_dlg.c,v 1.5 1999/12/16 06:20:18 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -52,6 +52,7 @@
#include "prefs_dlg.h"
#include "print_prefs.h"
#include "stream_prefs.h"
+#include "gui_prefs.h"
#include "util.h"
e_prefs prefs;
@@ -65,14 +66,14 @@ static gboolean prefs_main_delete_cb(GtkWidget *, gpointer);
#define E_PRINT_PAGE_KEY "printer_options_page"
#define E_COLUMN_PAGE_KEY "column_options_page"
#define E_STREAM_PAGE_KEY "tcp_stream_options_page"
+#define E_GUI_PAGE_KEY "gui_options_page"
void
prefs_cb(GtkWidget *w, gpointer sp) {
GtkWidget *prefs_w, *main_vb, *top_hb, *bbox, *prefs_nb,
*ok_bt, *save_bt, *cancel_bt;
- GtkWidget *print_pg, *column_pg, *stream_pg, *label;
+ GtkWidget *print_pg, *column_pg, *stream_pg, *gui_pg, *label;
-/* GtkWidget *nlabel; */
gint start_page = (gint) sp;
@@ -108,12 +109,18 @@ prefs_cb(GtkWidget *w, gpointer sp) {
label = gtk_label_new ("Columns");
gtk_notebook_append_page (GTK_NOTEBOOK(prefs_nb), column_pg, label);
- /* Column prefs */
+ /* TCP Streams prefs */
stream_pg = stream_prefs_show();
gtk_object_set_data(GTK_OBJECT(prefs_w), E_STREAM_PAGE_KEY, stream_pg);
label = gtk_label_new ("TCP Streams");
gtk_notebook_append_page (GTK_NOTEBOOK(prefs_nb), stream_pg, label);
+ /* GUI prefs */
+ gui_pg = gui_prefs_show();
+ gtk_object_set_data(GTK_OBJECT(prefs_w), E_GUI_PAGE_KEY, gui_pg);
+ label = gtk_label_new ("GUI");
+ gtk_notebook_append_page (GTK_NOTEBOOK(prefs_nb), gui_pg, label);
+
/* Jump to the specified page, if it was supplied */
if (start_page > E_PR_PG_NONE)
gtk_notebook_set_page(GTK_NOTEBOOK(prefs_nb), start_page);
@@ -156,6 +163,7 @@ prefs_main_ok_cb(GtkWidget *ok_bt, gpointer parent_w)
printer_prefs_ok(gtk_object_get_data(GTK_OBJECT(parent_w), E_PRINT_PAGE_KEY));
column_prefs_ok(gtk_object_get_data(GTK_OBJECT(parent_w), E_COLUMN_PAGE_KEY));
stream_prefs_ok(gtk_object_get_data(GTK_OBJECT(parent_w), E_STREAM_PAGE_KEY));
+ gui_prefs_ok(gtk_object_get_data(GTK_OBJECT(parent_w), E_GUI_PAGE_KEY));
gtk_widget_destroy(GTK_WIDGET(parent_w));
}
@@ -165,6 +173,7 @@ prefs_main_save_cb(GtkWidget *save_bt, gpointer parent_w)
printer_prefs_save(gtk_object_get_data(GTK_OBJECT(parent_w), E_PRINT_PAGE_KEY));
column_prefs_save(gtk_object_get_data(GTK_OBJECT(parent_w), E_COLUMN_PAGE_KEY));
stream_prefs_save(gtk_object_get_data(GTK_OBJECT(parent_w), E_STREAM_PAGE_KEY));
+ gui_prefs_save(gtk_object_get_data(GTK_OBJECT(parent_w), E_GUI_PAGE_KEY));
write_prefs();
}
@@ -174,6 +183,7 @@ prefs_main_cancel_cb(GtkWidget *cancel_bt, gpointer parent_w)
printer_prefs_cancel(gtk_object_get_data(GTK_OBJECT(parent_w), E_PRINT_PAGE_KEY));
column_prefs_cancel(gtk_object_get_data(GTK_OBJECT(parent_w), E_COLUMN_PAGE_KEY));
stream_prefs_cancel(gtk_object_get_data(GTK_OBJECT(parent_w), E_STREAM_PAGE_KEY));
+ gui_prefs_cancel(gtk_object_get_data(GTK_OBJECT(parent_w), E_GUI_PAGE_KEY));
gtk_widget_destroy(GTK_WIDGET(parent_w));
}
@@ -183,5 +193,6 @@ prefs_main_delete_cb(GtkWidget *prefs_w, gpointer dummy)
printer_prefs_delete(gtk_object_get_data(GTK_OBJECT(prefs_w), E_PRINT_PAGE_KEY));
column_prefs_delete(gtk_object_get_data(GTK_OBJECT(prefs_w), E_COLUMN_PAGE_KEY));
stream_prefs_delete(gtk_object_get_data(GTK_OBJECT(prefs_w), E_STREAM_PAGE_KEY));
+ gui_prefs_delete(gtk_object_get_data(GTK_OBJECT(prefs_w), E_GUI_PAGE_KEY));
return FALSE;
}
diff --git a/prefs.c b/prefs.c
index b715d410e1..0d9eeb43a0 100644
--- a/prefs.c
+++ b/prefs.c
@@ -1,7 +1,7 @@
/* prefs.c
* Routines for handling preferences
*
- * $Id: prefs.c,v 1.24 1999/12/09 07:19:04 guy Exp $
+ * $Id: prefs.c,v 1.25 1999/12/16 06:19:50 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -184,6 +184,7 @@ read_prefs(char **pf_path_return) {
prefs.st_server_bg.red = 65535;
prefs.st_server_bg.green = 65535;
prefs.st_server_bg.blue = 65535;
+ prefs.gui_scrollbar_on_right = TRUE;
}
if (! pf_path) {
@@ -297,6 +298,7 @@ read_prefs(char **pf_path_return) {
#define PRS_STREAM_CL_BG "stream.client.bg"
#define PRS_STREAM_SR_FG "stream.server.fg"
#define PRS_STREAM_SR_BG "stream.server.bg"
+#define PRS_GUI_SCROLLBAR_ON_RIGHT "gui.scrollbar_on_right"
#define RED_COMPONENT(x) ((((x) >> 16) & 0xff) * 65535 / 255)
#define GREEN_COMPONENT(x) ((((x) >> 8) & 0xff) * 65535 / 255)
@@ -381,6 +383,14 @@ set_pref(gchar *pref, gchar *value) {
prefs.st_server_bg.red = RED_COMPONENT(cval);
prefs.st_server_bg.green = GREEN_COMPONENT(cval);
prefs.st_server_bg.blue = BLUE_COMPONENT(cval);
+ } else if (strcmp(pref, PRS_GUI_SCROLLBAR_ON_RIGHT) == 0) {
+ if (strcmp(value, "TRUE") == 0) {
+ prefs.gui_scrollbar_on_right = TRUE;
+ }
+ else {
+ prefs.gui_scrollbar_on_right = FALSE;
+ }
+
} else {
return 0;
}
@@ -464,5 +474,9 @@ write_prefs(void) {
(prefs.st_server_bg.green * 255 / 65535),
(prefs.st_server_bg.blue * 255 / 65535));
+ fprintf(pf, "\n# Vertical scrollbars should be on right side? TRUE/FALSE\n");
+ fprintf(pf, PRS_GUI_SCROLLBAR_ON_RIGHT ": %s\n",
+ prefs.gui_scrollbar_on_right == TRUE ? "TRUE" : "FALSE");
+
fclose(pf);
}
diff --git a/prefs.h b/prefs.h
index 2a6f680dfb..db22822cdb 100644
--- a/prefs.h
+++ b/prefs.h
@@ -1,7 +1,7 @@
/* prefs.h
* Definitions for preference handling routines
*
- * $Id: prefs.h,v 1.10 1999/12/10 04:20:53 gram Exp $
+ * $Id: prefs.h,v 1.11 1999/12/16 06:19:50 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -44,6 +44,7 @@ typedef struct _e_prefs {
GList *col_list;
gint num_cols;
GdkColor st_client_fg, st_client_bg, st_server_fg, st_server_bg;
+ gboolean gui_scrollbar_on_right;
} e_prefs;
extern e_prefs prefs;