diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2017-06-19 16:26:45 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-06-20 02:26:04 +0000 |
commit | be4dbf840b164ab9b788ee8c3a9466e2da1393d2 (patch) | |
tree | c252c00cd55a2f0b8338dca0d057169530c322e3 /ui/qt/packet_list.cpp | |
parent | 4e46352657df1d66e8f2ade8c5e3d38ecae18530 (diff) |
Qt: Turn off auto scroll when going to a packet
When going to a packet (first, last, next, prev and specific) during
capture we must turn off auto scroll to let the packet be shown
in the packet list.
Change-Id: If1c615eb4d422c3b4c0418114064f7a4a0b75b35
Reviewed-on: https://code.wireshark.org/review/22244
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/qt/packet_list.cpp')
-rw-r--r-- | ui/qt/packet_list.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index 60c8767b07..2a81d446c5 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -1188,6 +1188,8 @@ void PacketList::goNextPacket(void) // First visible packet. setCurrentIndex(indexAt(viewport()->rect().topLeft())); } + + scrollViewChanged(false); } void PacketList::goPreviousPacket(void) @@ -1209,18 +1211,24 @@ void PacketList::goPreviousPacket(void) goLastPacket(); } } + + scrollViewChanged(false); } void PacketList::goFirstPacket(void) { if (packet_list_model_->rowCount() < 1) return; setCurrentIndex(packet_list_model_->index(0, 0)); scrollTo(currentIndex()); + + scrollViewChanged(false); } void PacketList::goLastPacket(void) { if (packet_list_model_->rowCount() < 1) return; setCurrentIndex(packet_list_model_->index(packet_list_model_->rowCount() - 1, 0)); scrollTo(currentIndex()); + + scrollViewChanged(false); } // XXX We can jump to the wrong packet if a display filter is applied @@ -1230,6 +1238,8 @@ void PacketList::goToPacket(int packet) { if (row >= 0) { setCurrentIndex(packet_list_model_->index(row, 0)); } + + scrollViewChanged(false); } void PacketList::goToPacket(int packet, int hf_id) @@ -1599,8 +1609,13 @@ void PacketList::vScrollBarActionTriggered(int) // past the end. tail_at_end_ = (verticalScrollBar()->sliderPosition() >= verticalScrollBar()->maximum()); + scrollViewChanged(tail_at_end_); +} + +void PacketList::scrollViewChanged(bool at_end) +{ if (capture_in_progress_ && prefs.capture_auto_scroll) { - emit packetListScrolled(tail_at_end_); + emit packetListScrolled(at_end); } } |