diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-08-15 22:22:35 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-08-15 22:22:35 +0000 |
commit | c8cb7ffb1901bb79216f695bcb8eef41ad841e81 (patch) | |
tree | 0eb982ca51a373f40fb4cdcfedc6cf9093eb5cbc /gtk | |
parent | 75a756e8816a5890ae677fd0fdc185b5de318afd (diff) |
In "set_plist_sel_browse()", don't unselect the current packet if the
selection mode of the packet list window isn't actually going to be
changed - it's a bit annoying to have the protocol tree window clear out
from under you if all you've done is pop up the Edit->Preferences dialog
and cancelled it (or accepted it without changing any GUI preference).
svn path=/trunk/; revision=2280
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/main.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/gtk/main.c b/gtk/main.c index 9f5ce244d9..18e73326a7 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1,6 +1,6 @@ /* main.c * - * $Id: main.c,v 1.134 2000/08/15 20:46:17 deniel Exp $ + * $Id: main.c,v 1.135 2000/08/15 22:22:35 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -569,6 +569,29 @@ set_scrollbar_placement_all(int pos) void set_plist_sel_browse(gboolean val) { + gboolean old_val; + + old_val = + (GTK_CLIST(packet_list)->selection_mode == GTK_SELECTION_SINGLE); + + if (val == old_val) { + /* + * The mode isn't changing, so don't do anything. + * In particular, don't gratuitiously unselect the + * current packet. + * + * XXX - why do we have to unselect the current packet + * ourselves? The documentation for the GtkCList at + * + * http://developer.gnome.org/doc/API/gtk/gtkclist.html + * + * says "Note that setting the widget's selection mode to + * one of GTK_SELECTION_BROWSE or GTK_SELECTION_SINGLE will + * cause all the items in the GtkCList to become deselected." + */ + return; + } + if (finfo_selected) unselect_packet(&cfile); |