aboutsummaryrefslogtreecommitdiffstats
path: root/prefs.c
diff options
context:
space:
mode:
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>1999-12-29 20:10:12 +0000
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>1999-12-29 20:10:12 +0000
commit4c3ff16e7940e10641d634a1825a2d356a2e7412 (patch)
treec6fa5d6ff97fee388a3f2f0efd5ccccce1abe957 /prefs.c
parent9c6574e088c1508ec0a24225042104fee18025bb (diff)
Changed the protocol tree widget from a GtkTree to a GtkCTree. The two reasons
I did this: First, Havoc Pennington, in "GTK+/Gnome Application Development", in Appendix seciton A.3.88, recommends using GtkCTree instead of GtkTree because GtkCtree is faster, and GtkTree has limitation on its total row height: since it must fit inside a GdkWindow, it is limited to 32,768 pixels of height. GtkTree is more flexible with regards to the types of widgets that can be placed in the tree, but since we deal only with text, that doesn't matter, at least for now. Secondly, a GtkTree doesn't allow arrow-key navigation (at least as far as I could tell). It always bothered me that the up and down arrow keys worked in the packet list and in the hex dump, but no in the protocol tree. GtkCTree does allow arrow-key navigation. In fact, GtkCTree is a subclass of GtkCList (the packet list widget), so they behave a lot alike. I went ahead and fixed the selection bar which has been bothering Richard for a long time now. :) In the GUI preferences dialogue, you can now set both the packet list selection bar and the protocol tree selection bar to either "browse" or "select" mode. "browse" mode is what you're used to: the arrow keys move an outline of the selection bar, but do not change the selection. "select" mode does change the selection when the arrow keys are pressed. The default behavior is set to "select", which seems more natural for a first-time user. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1393 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'prefs.c')
-rw-r--r--prefs.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/prefs.c b/prefs.c
index 81d79c1254..40b46385c3 100644
--- a/prefs.c
+++ b/prefs.c
@@ -1,7 +1,7 @@
/* prefs.c
* Routines for handling preferences
*
- * $Id: prefs.c,v 1.26 1999/12/29 05:53:41 guy Exp $
+ * $Id: prefs.c,v 1.27 1999/12/29 20:09:46 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -187,6 +187,8 @@ read_prefs(char **pf_path_return) {
prefs.st_server_bg.green = 65535;
prefs.st_server_bg.blue = 65535;
prefs.gui_scrollbar_on_right = TRUE;
+ prefs.gui_plist_sel_browse = FALSE;
+ prefs.gui_ptree_sel_browse = FALSE;
}
if (! pf_path) {
@@ -301,6 +303,8 @@ read_prefs(char **pf_path_return) {
#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 PRS_GUI_PLIST_SEL_BROWSE "gui.packet_list_sel_browse"
+#define PRS_GUI_PTREE_SEL_BROWSE "gui.protocol_tree_sel_browse"
#define RED_COMPONENT(x) ((((x) >> 16) & 0xff) * 65535 / 255)
#define GREEN_COMPONENT(x) ((((x) >> 8) & 0xff) * 65535 / 255)
@@ -392,6 +396,20 @@ set_pref(gchar *pref, gchar *value) {
else {
prefs.gui_scrollbar_on_right = FALSE;
}
+ } else if (strcmp(pref, PRS_GUI_PLIST_SEL_BROWSE) == 0) {
+ if (strcmp(value, "TRUE") == 0) {
+ prefs.gui_plist_sel_browse = TRUE;
+ }
+ else {
+ prefs.gui_plist_sel_browse = FALSE;
+ }
+ } else if (strcmp(pref, PRS_GUI_PTREE_SEL_BROWSE) == 0) {
+ if (strcmp(value, "TRUE") == 0) {
+ prefs.gui_ptree_sel_browse = TRUE;
+ }
+ else {
+ prefs.gui_ptree_sel_browse = FALSE;
+ }
} else {
return 0;
@@ -480,5 +498,12 @@ write_prefs(void) {
fprintf(pf, PRS_GUI_SCROLLBAR_ON_RIGHT ": %s\n",
prefs.gui_scrollbar_on_right == TRUE ? "TRUE" : "FALSE");
+ fprintf(pf, "\n# Packet-list selection bar can be used to browse w/o selecting? TRUE/FALSE\n");
+ fprintf(pf, PRS_GUI_PLIST_SEL_BROWSE ": %s\n",
+ prefs.gui_plist_sel_browse == TRUE ? "TRUE" : "FALSE");
+
+ fprintf(pf, "\n# Protocol-tree selection bar can be used to browse w/o selecting? TRUE/FALSE\n");
+ fprintf(pf, PRS_GUI_PTREE_SEL_BROWSE ": %s\n",
+ prefs.gui_ptree_sel_browse == TRUE ? "TRUE" : "FALSE");
fclose(pf);
}