Qt: add preference to restore display filter after Follow Stream

Added new user preference 'restore_filter_after_following_stream',
defaults to false.
When true, the current display filter is restored after following a stream.

Change-Id: I153107761003658c6d7f1464711da7b3adeb60a8
Reviewed-on: https://code.wireshark.org/review/22455
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
cheloftus 2017-06-28 22:52:41 +01:00 committed by Anders Broman
parent 0553cda6da
commit 70996dc669
3 changed files with 12 additions and 0 deletions

View File

@ -3015,6 +3015,11 @@ prefs_register_modules(void)
"Place filter toolbar inside the statusbar?",
&prefs.filter_toolbar_show_in_statusbar);
prefs_register_bool_preference(gui_module, "restore_filter_after_following_stream",
"Restore current display filter after following a stream",
"Restore current display filter after following a stream?",
&prefs.restore_filter_after_following_stream);
prefs_register_enum_preference(gui_module, "protocol_tree_line_style",
"Protocol-tree line style",
"Protocol-tree line style",
@ -3950,6 +3955,7 @@ pre_init_prefs(void)
prefs.gui_ptree_expander_style = 1;
prefs.gui_hex_dump_highlight_style = 1;
prefs.filter_toolbar_show_in_statusbar = FALSE;
prefs.restore_filter_after_following_stream = FALSE;
prefs.gui_toolbar_main_style = TB_STYLE_ICONS;
prefs.gui_toolbar_filter_style = TB_STYLE_TEXT;
/* These will be g_freed, so they must be g_mallocated. */

View File

@ -154,6 +154,7 @@ typedef struct _e_prefs {
gboolean gui_altern_colors; /* GTK only */
gboolean gui_expert_composite_eyecandy;
gboolean filter_toolbar_show_in_statusbar;
gboolean restore_filter_after_following_stream;
gint gui_ptree_line_style;
gint gui_ptree_expander_style;
gboolean gui_hex_dump_highlight_style;

View File

@ -950,6 +950,11 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index,
updateWidgets(false);
endRetapPackets();
if (prefs.restore_filter_after_following_stream) {
emit updateFilter(previous_filter_, TRUE);
}
return true;
}