diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-08-21 09:48:27 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-08-21 09:48:27 +0000 |
commit | 4e2dc614bee84c03924c069aa0d1a9a1ad7260ed (patch) | |
tree | d7b146739aeaeeadc557498ee810da7b71f3d8b9 /gtk/tap_dfilter_dlg.c | |
parent | 725a18bc618e9e30db8162ce702de7ec5e0ab816 (diff) |
Add a "register_dfilter_stat()", to register stats that take a display
filter as an argument on the command line and have a dialog box to enter
the display filter through the GUI. Use it for all stats using
"gtk_tap_dfilter_dlg_cb()".
Add a top-level "stat_menu.h" file to declare "REGISTER_STAT_GROUP_E"
for the benefit of the declaration of "register_dfilter_stat()" in the
top-level "tap_dfilter_dlg.h". Rename the "stat_menu.h" in the gtk
directory to "gtk_stat_menu.h", so as not to have two headers with the
same name.
Get rid of headers not declaring any functions not being used in the
module.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15493 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk/tap_dfilter_dlg.c')
-rw-r--r-- | gtk/tap_dfilter_dlg.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gtk/tap_dfilter_dlg.c b/gtk/tap_dfilter_dlg.c index 262bc09ac7..5f937115bb 100644 --- a/gtk/tap_dfilter_dlg.c +++ b/gtk/tap_dfilter_dlg.c @@ -42,6 +42,9 @@ #include "../file.h" #include "../globals.h" #include "filter_dlg.h" +#include <epan/stat_cmd_args.h> +#include "../stat_menu.h" +#include "gtk_stat_menu.h" #include "../tap_dfilter_dlg.h" #include "tap_dfilter_dlg.h" #include "gui_utils.h" @@ -60,6 +63,20 @@ static tap_dfilter_dlg_list_item *start_dlg_list=NULL; static tap_dfilter_dlg_list_item *end_dlg_list=NULL; static tap_dfilter_dlg_list_item *current_dlg = NULL; +/* + * Register a stat that has a display filter dialog. + * We register it both as a command-line stat and a menu item stat. + */ +void +register_dfilter_stat(tap_dfilter_dlg *info, const char *name, + REGISTER_STAT_GROUP_E group) +{ + register_stat_cmd_arg(info->init_string, info->tap_init_cb); + + register_stat_menu_item(name, group, gtk_tap_dfilter_dlg_cb, NULL, + NULL, info); +} + void tap_dfilter_dlg_update (void) { tap_dfilter_dlg_list_item *dialog = start_dlg_list; |