diff options
author | Gerald Combs <gerald@wireshark.org> | 2007-12-05 23:50:28 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2007-12-05 23:50:28 +0000 |
commit | e66660cd8458e00ef70d1cca90dc7882ff129720 (patch) | |
tree | 2b74e54c845ec2fbbd0b15b9b28c542ae9c77550 /gtk | |
parent | 325b3355053c477c2877d10bf6721ead9c416e16 (diff) | |
download | wireshark-e66660cd8458e00ef70d1cca90dc7882ff129720.tar.gz |
Make sure the "auto scroll in live capture" toolbar button and menu item
correctly reflect the auto scroll state. Re-enable the ability to use
the auto scroll toolbar button and menu item during a live capture.
svn path=/trunk/; revision=23777
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/packet_list.c | 22 | ||||
-rw-r--r-- | gtk/packet_list.h | 5 |
2 files changed, 19 insertions, 8 deletions
diff --git a/gtk/packet_list.c b/gtk/packet_list.c index 2540102a3b..0279e0179b 100644 --- a/gtk/packet_list.c +++ b/gtk/packet_list.c @@ -107,6 +107,7 @@ typedef struct column_arrows { } column_arrows; GtkWidget *packet_list; +static gboolean last_at_end = FALSE; /* EthClist compare routine, overrides default to allow numeric comparison */ @@ -776,16 +777,25 @@ packet_list_moveto_end(void) } gboolean -packet_list_at_end(void) +packet_list_check_end(void) { + gboolean at_end = FALSE; + GtkAdjustment *adj; + g_return_val_if_fail (packet_list != NULL, FALSE); - g_return_val_if_fail (ETH_CLIST(packet_list) != NULL, FALSE); + adj = eth_clist_get_vadjustment(ETH_CLIST(packet_list)); + g_return_val_if_fail (adj != NULL, FALSE); - if (eth_clist_row_is_visible(ETH_CLIST(packet_list), ETH_CLIST(packet_list)->rows - 1) == GTK_VISIBILITY_NONE){ - return FALSE; - } else { - return TRUE; + if (adj->value >= adj->upper - adj->page_size) { + at_end = TRUE; } + + if (adj->value > 0 && at_end != last_at_end && at_end != auto_scroll_live) { + menu_auto_scroll_live_changed(at_end); + } + + last_at_end = at_end; + return at_end; } gint diff --git a/gtk/packet_list.h b/gtk/packet_list.h index b00c7ca80f..87d3d06069 100644 --- a/gtk/packet_list.h +++ b/gtk/packet_list.h @@ -111,11 +111,12 @@ extern void packet_list_next(void); */ extern void packet_list_prev(void); -/** Get if the packet list is at its end. +/** Check to see if the packet list is at its end. Toggles automatic + * scrolling if needed. * * @return TRUE if packet list is scrolled to greater than 90% of its total length. */ -extern gboolean packet_list_at_end(void); +extern gboolean packet_list_check_end(void); /* Different modes of copying summary data */ typedef enum { |