diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index f1abbe24ff..cf86b5af6f 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -727,7 +727,6 @@ void MainWindow::startCapture() { } /* XXX - we might need to init other pref data as well... */ -// main_auto_scroll_live_changed(auto_scroll_live); /* XXX - can this ever happen? */ if (cap_session_.state != CAPTURE_STOPPED) @@ -742,6 +741,9 @@ void MainWindow::startCapture() { CaptureFile::globalCapFile()->window = this; if (capture_start(&global_capture_opts, &cap_session_, main_window_update)) { + /* enable autoscroll timer as needed. */ + packet_list_->setAutoScroll(main_ui_->actionGoAutoScroll->isChecked()); + /* The capture succeeded, which means the capture filter syntax is valid; add this capture filter to the recent capture filter list. */ for (i = 0; i < global_capture_opts.ifaces->len; i++) { @@ -837,6 +839,9 @@ void MainWindow::stopCapture() { #ifdef HAVE_LIBPCAP capture_stop(&cap_session_); #endif // HAVE_LIBPCAP + + /* disable autoscroll timer if any. */ + packet_list_->setAutoScroll(false); } // XXX - Copied from ui/gtk/menus.c diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index d24e95a1c9..160e28198f 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -685,6 +685,8 @@ void PacketList::recolorPackets() redrawVisiblePackets(); } +/* Enable autoscroll timer. Note: must be called after the capture is started, + * otherwise the timer will not be executed. */ void PacketList::setAutoScroll(bool enabled) { tail_at_end_ = enabled;