aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorOlivier Abad <oabad@noos.fr>2003-07-19 08:59:29 +0000
committerOlivier Abad <oabad@noos.fr>2003-07-19 08:59:29 +0000
commit800027bf02c2bd8038f02ab326555fb212d07053 (patch)
tree10a004238e87df3275eb9901f40f0eb33cd7f0ff /gtk
parentc42e7146f7a03e921721248064d98288873b8572 (diff)
In set_plist_sel_browse : change broken logic when determining if the
mode has changed. svn path=/trunk/; revision=8051
Diffstat (limited to 'gtk')
-rw-r--r--gtk/main.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/gtk/main.c b/gtk/main.c
index c59e5dca25..4f9fb2e8e1 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -1,6 +1,6 @@
/* main.c
*
- * $Id: main.c,v 1.300 2003/07/18 20:55:11 oabad Exp $
+ * $Id: main.c,v 1.301 2003/07/19 08:59:29 oabad Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -957,11 +957,16 @@ void resolve_name_cb(GtkWidget *widget _U_, gpointer data _U_) {
void
set_plist_sel_browse(gboolean val)
{
- /* initialize with a mode we don't use, so that the following test will
- * fail the first time */
+ GtkSelectionMode new_mode;
+ /* initialize with a mode we don't use, so that the mode == new_mode
+ * test will fail the first time */
static GtkSelectionMode mode = GTK_SELECTION_MULTIPLE;
- if (val == (mode == GTK_SELECTION_SINGLE)) {
+ /* Yeah, GTK uses "browse" in the case where we do not, but oh well. I
+ * think "browse" in Ethereal makes more sense than "SINGLE" in GTK+ */
+ new_mode = val ? GTK_SELECTION_SINGLE : GTK_SELECTION_BROWSE;
+
+ if (mode == new_mode) {
/*
* The mode isn't changing, so don't do anything.
* In particular, don't gratuitiously unselect the
@@ -982,14 +987,7 @@ set_plist_sel_browse(gboolean val)
if (finfo_selected)
unselect_packet(&cfile);
- /* Yeah, GTK uses "browse" in the case where we do not, but oh well. I think
- * "browse" in Ethereal makes more sense than "SINGLE" in GTK+ */
- if (val) {
- mode = GTK_SELECTION_SINGLE;
- }
- else {
- mode = GTK_SELECTION_BROWSE;
- }
+ mode = new_mode;
gtk_clist_set_selection_mode(GTK_CLIST(packet_list), mode);
}