diff options
-rw-r--r-- | epan/funnel.h | 1 | ||||
-rw-r--r-- | epan/wslua/wslua_gui.c | 19 | ||||
-rw-r--r-- | gtk/funnel_stat.c | 7 | ||||
-rw-r--r-- | tap-funnel.c | 5 |
4 files changed, 29 insertions, 3 deletions
diff --git a/epan/funnel.h b/epan/funnel.h index aa82a3bf35..bcd4e925fd 100644 --- a/epan/funnel.h +++ b/epan/funnel.h @@ -78,6 +78,7 @@ typedef struct _funnel_ops_t { void (*copy_to_clipboard)(GString *str); void (*set_filter)(const char*); + void (*set_color_filter_slot)(guint8 flit_nr, const gchar* filter); gboolean (*open_file)(const char* fname, const char* filter, const char** error); void (*reload)(void); void (*apply_filter)(void); diff --git a/epan/wslua/wslua_gui.c b/epan/wslua/wslua_gui.c index 530dfba88c..dfd4ace889 100644 --- a/epan/wslua/wslua_gui.c +++ b/epan/wslua/wslua_gui.c @@ -801,6 +801,25 @@ WSLUA_FUNCTION wslua_set_filter(lua_State* L) { /* Set the main filter text */ return 0; } +WSLUA_FUNCTION wslua_set_color_filter_slot(lua_State* L) { /* Set color of the current packet */ +#define WSLUA_ARG_set_color_filter_slot_ROW 1 /* The row count in tmp filter list */ +#define WSLUA_ARG_set_color_filter_slot_TEXT 2 /* Filter */ + guint8 row = luaL_checkint(L,WSLUA_ARG_set_color_filter_slot_ROW); + const gchar* filter_str = luaL_checkstring(L,WSLUA_ARG_set_color_filter_slot_TEXT); + + if (!ops->set_color_filter_slot) { + WSLUA_ERROR(set_color_filter_slot, "GUI not available"); + } + + if (!filter_str) { + WSLUA_ARG_ERROR(set_color_filter_slot,TEXT,"Must be a string"); + } + + ops->set_color_filter_slot(row, filter_str); + + return 0; +} + WSLUA_FUNCTION wslua_apply_filter(lua_State* L) { /* Apply the filter in the main filter box */ if (!ops->apply_filter) { WSLUA_ERROR(apply_filter, "GUI not available"); diff --git a/gtk/funnel_stat.c b/gtk/funnel_stat.c index e1445262e7..25d3ad5be2 100644 --- a/gtk/funnel_stat.c +++ b/gtk/funnel_stat.c @@ -51,8 +51,8 @@ #include "../simple_dialog.h" #include "../file.h" #include "../stat_menu.h" -#include "../file.h" #include "../progress_dlg.h" +#include "../color_filters.h" #include "gtk/gui_utils.h" #include "gtk/dlg_utils.h" @@ -464,6 +464,10 @@ static void funnel_set_filter(const char* filter_string) { gtk_entry_set_text(GTK_ENTRY(main_display_filter_widget), filter_string); } +static void funnel_set_color_filter_slot(guint8 filt_nr, const gchar* filter_string) { + color_filters_set_tmp(filt_nr, (gchar *)filter_string, FALSE); +} + static void funnel_apply_filter(void) { const char* filter_string = gtk_entry_get_text(GTK_ENTRY(main_display_filter_widget)); main_filter_packets(&cfile, filter_string, FALSE); @@ -560,6 +564,7 @@ static const funnel_ops_t funnel_ops = { funnel_retap_packets, copy_to_clipboard, funnel_set_filter, + funnel_set_color_filter_slot, funnel_open_file, funnel_reload, funnel_apply_filter, diff --git a/tap-funnel.c b/tap-funnel.c index 1353e90469..290459e94b 100644 --- a/tap-funnel.c +++ b/tap-funnel.c @@ -107,8 +107,9 @@ static const funnel_ops_t funnel_ops = { NULL, NULL, NULL, - NULL, - NULL, + NULL, + NULL, + NULL, NULL, NULL, NULL |