Allow Multiselection of packets to work during live captures

During live capture, the previous logic was to jump to row 1 when there is no
'current_frame'. When multiselect is active, there is no 'current_frame', so
it would always jump back to row 1, when >1 packet was selected.

Bug: 16293
Change-Id: Id1c9eb36fcae83f67ae342be6f9dfc1405ce7025
Reviewed-on: https://code.wireshark.org/review/35747
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Dylan Ulis 2020-01-11 13:54:39 -05:00 committed by Michael Mann
parent f582c85623
commit d5cfa99217
3 changed files with 11 additions and 1 deletions

2
file.c
View File

@ -845,7 +845,7 @@ cf_continue_tail(capture_file *cf, volatile int to_read, wtap_rec *rec,
/* With the new packet list the first packet
* isn't automatically selected.
*/
if (!cf->current_frame)
if (!cf->current_frame && !packet_list_multi_select_active())
packet_list_select_first_row();
/* moving to the end of the packet list - if the user requested so and

View File

@ -203,6 +203,15 @@ packet_list_recent_write_all(FILE *rf) {
gbl_cur_packet_list->writeRecent(rf);
}
gboolean
packet_list_multi_select_active(void)
{
if (gbl_cur_packet_list) {
return gbl_cur_packet_list->multiSelectActive();
}
return FALSE;
}
#define MIN_COL_WIDTH_STR "MMMMMM"
PacketList::PacketList(QWidget *parent) :

View File

@ -68,6 +68,7 @@ void packet_list_select_first_row(void);
void packet_list_moveto_end(void);
gboolean packet_list_select_row_from_data(frame_data *fdata_needle);
void packet_list_resize_column(gint col);
gboolean packet_list_multi_select_active(void);
/* XXX - Yes this isn't the best place, but they are used by file_dlg_win32.c, which is supposed
to be GUI independent, but has lots of GTK leanings. But if you put these in a GTK UI