diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2011-06-27 11:07:31 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2011-06-27 11:07:31 +0000 |
commit | b979f2da27f2ee87edf75a741adfaba2fa6ff5a5 (patch) | |
tree | d1cc4f986d2170dd883deb33d5c5d7024c9f427b /epan/wslua | |
parent | 53debee8a847bd91173dc49a0328f3a8df72ed53 (diff) |
From bug 6057:
Lua API: add support to temporary color filters (10 color slots)
svn path=/trunk/; revision=37801
Diffstat (limited to 'epan/wslua')
-rw-r--r-- | epan/wslua/wslua_gui.c | 19 |
1 files changed, 19 insertions, 0 deletions
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"); |