aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorrbroker <rstbroker@gmail.com>2020-06-18 19:43:20 +0100
committerAnders Broman <a.broman58@gmail.com>2020-06-25 08:02:27 +0000
commit1f75d7b3b9fa5d489d0d4816fe7dd491d5a617d7 (patch)
tree39377641720d441b86b17c697ee09e4322d8ef07 /ui
parentc7f74a94fb96be83a9d098f59c3d157ea0e5aec4 (diff)
wslua: Add ability to query current temporary color filter text
The LUA API provides the "set_color_filter_slot" function, but without a corresponding "get_" function, it's very hard for two LUA dissectors to co-exist without one overwriting any color filters set by the other. It also looks like the documentation comment for "set_color_filter_slot" had an off-by-one error, which I've corrected as I was adding almost identical documentation for the new API. Change-Id: Ic54d23be555ec12e1830bbe6f84a1b04d04fd4f0 Reviewed-on: https://code.wireshark.org/review/37511 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/cli/tap-funnel.c1
-rw-r--r--ui/qt/funnel_statistics.cpp6
2 files changed, 7 insertions, 0 deletions
diff --git a/ui/cli/tap-funnel.c b/ui/cli/tap-funnel.c
index 0b24096f8c..0171abaa8b 100644
--- a/ui/cli/tap-funnel.c
+++ b/ui/cli/tap-funnel.c
@@ -103,6 +103,7 @@ static const funnel_ops_t funnel_ops = {
NULL,
NULL,
NULL,
+ NULL,
NULL
};
diff --git a/ui/qt/funnel_statistics.cpp b/ui/qt/funnel_statistics.cpp
index cc9dbc0156..c7f67e600a 100644
--- a/ui/qt/funnel_statistics.cpp
+++ b/ui/qt/funnel_statistics.cpp
@@ -42,6 +42,7 @@ static void funnel_statistics_retap_packets(funnel_ops_id_t *ops_id);
static void funnel_statistics_copy_to_clipboard(GString *text);
static const gchar *funnel_statistics_get_filter(funnel_ops_id_t *ops_id);
static void funnel_statistics_set_filter(funnel_ops_id_t *ops_id, const char* filter_string);
+static gchar* funnel_statistics_get_color_filter_slot(guint8 filter_num);
static void funnel_statistics_set_color_filter_slot(guint8 filter_num, const gchar* filter_string);
static gboolean funnel_statistics_open_file(funnel_ops_id_t *ops_id, const char* fname, const char* filter, char**);
static void funnel_statistics_reload_packets(funnel_ops_id_t *ops_id);
@@ -130,6 +131,7 @@ FunnelStatistics::FunnelStatistics(QObject *parent, CaptureFile &cf) :
funnel_ops_->copy_to_clipboard = funnel_statistics_copy_to_clipboard;
funnel_ops_->get_filter = funnel_statistics_get_filter;
funnel_ops_->set_filter = funnel_statistics_set_filter;
+ funnel_ops_->get_color_filter_slot = funnel_statistics_get_color_filter_slot;
funnel_ops_->set_color_filter_slot = funnel_statistics_set_color_filter_slot;
funnel_ops_->open_file = funnel_statistics_open_file;
funnel_ops_->reload_packets = funnel_statistics_reload_packets;
@@ -241,6 +243,10 @@ void funnel_statistics_set_filter(funnel_ops_id_t *ops_id, const char* filter_st
ops_id->funnel_statistics->emitSetDisplayFilter(filter_string);
}
+gchar* funnel_statistics_get_color_filter_slot(guint8 filter_num) {
+ return color_filters_get_tmp(filter_num);
+}
+
void funnel_statistics_set_color_filter_slot(guint8 filter_num, const gchar* filter_string) {
gchar *err_msg = nullptr;
if (!color_filters_set_tmp(filter_num, filter_string, FALSE, &err_msg)) {