aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-05-24 03:10:56 +0000
committerGuy Harris <guy@alum.mit.edu>2013-05-24 03:10:56 +0000
commit3598d9e2ac7582715d0af8a32b5ffccefeec98a9 (patch)
tree9ae7974f944846b2e2ff5444abae9beb983973c3
parentba77e3c54d6aaf5617c76ffbcc2f4a6759b702bb (diff)
Have register_param_stat() add menu items, rather than having the menu
items hardcoded into ui/gtk/main_menubar.c Get rid of more stuff implying that the code for adding menu items is used only by Lua, as it's also used by register_param_stat(). Add the items to the menu list sorted by the menu item name shown to the user. Get rid of some const declarations that are lies. Use the label given for a menu item as the label in the menu, rather than parsing it from a token. svn path=/trunk/; revision=49552
-rw-r--r--ui/gtk/afp_stat.c6
-rw-r--r--ui/gtk/camel_srt.c6
-rw-r--r--ui/gtk/conversations_table.c2
-rw-r--r--ui/gtk/diameter_stat.c6
-rw-r--r--ui/gtk/fc_stat.c6
-rw-r--r--ui/gtk/funnel_stat.c17
-rw-r--r--ui/gtk/gtp_stat.c6
-rw-r--r--ui/gtk/gui_stat_menu.h17
-rw-r--r--ui/gtk/h225_ras_srt.c6
-rw-r--r--ui/gtk/ldap_stat.c5
-rw-r--r--ui/gtk/main_menubar.c108
-rw-r--r--ui/gtk/megaco_stat.c6
-rw-r--r--ui/gtk/mgcp_stat.c5
-rw-r--r--ui/gtk/ncp_stat.c5
-rw-r--r--ui/gtk/radius_stat.c5
-rw-r--r--ui/gtk/scsi_stat.c6
-rw-r--r--ui/gtk/smb2_stat.c5
-rw-r--r--ui/gtk/smb_stat.c5
-rw-r--r--ui/gtk/tap_param_dlg.c54
19 files changed, 103 insertions, 173 deletions
diff --git a/ui/gtk/afp_stat.c b/ui/gtk/afp_stat.c
index cfec380f5d..56af2e4b11 100644
--- a/ui/gtk/afp_stat.c
+++ b/ui/gtk/afp_stat.c
@@ -204,9 +204,3 @@ register_tap_listener_gtkafpstat(void)
register_param_stat(&afp_stat_dlg, "AFP",
REGISTER_STAT_GROUP_RESPONSE_TIME);
}
-
-void afp_srt_stat_cb(GtkAction *action, gpointer user_data _U_)
-{
- tap_param_dlg_cb(action, &afp_stat_dlg);
-}
-
diff --git a/ui/gtk/camel_srt.c b/ui/gtk/camel_srt.c
index 3179ae1c28..b52cc2c904 100644
--- a/ui/gtk/camel_srt.c
+++ b/ui/gtk/camel_srt.c
@@ -239,9 +239,3 @@ register_tap_listener_gtk_camelsrt(void)
register_param_stat(&camel_srt_dlg, "CAMEL",
REGISTER_STAT_GROUP_RESPONSE_TIME);
}
-
-void camel_srt_cb(GtkAction *action, gpointer user_data _U_)
-{
- tap_param_dlg_cb(action, &camel_srt_dlg);
-}
-
diff --git a/ui/gtk/conversations_table.c b/ui/gtk/conversations_table.c
index 7dd8dbb5a2..6c7c86075e 100644
--- a/ui/gtk/conversations_table.c
+++ b/ui/gtk/conversations_table.c
@@ -39,6 +39,8 @@
#include "../globals.h"
+#include "../stat_menu.h"
+
#include "ui/simple_dialog.h"
#include "ui/utf8_entities.h"
diff --git a/ui/gtk/diameter_stat.c b/ui/gtk/diameter_stat.c
index 7f044188f6..a5887c3577 100644
--- a/ui/gtk/diameter_stat.c
+++ b/ui/gtk/diameter_stat.c
@@ -233,9 +233,3 @@ register_tap_listener_gtkdiameterstat(void)
register_param_stat(&diameter_stat_dlg, "Diameter",
REGISTER_STAT_GROUP_RESPONSE_TIME);
}
-
-void diameter_srt_cb(GtkAction *action, gpointer user_data _U_)
-{
- tap_param_dlg_cb(action, &diameter_stat_dlg);
-}
-
diff --git a/ui/gtk/fc_stat.c b/ui/gtk/fc_stat.c
index 40bbd57a35..85d64227db 100644
--- a/ui/gtk/fc_stat.c
+++ b/ui/gtk/fc_stat.c
@@ -210,9 +210,3 @@ register_tap_listener_gtkfcstat(void)
register_param_stat(&fc_stat_dlg, "Fibre Channel",
REGISTER_STAT_GROUP_RESPONSE_TIME);
}
-
-void fc_srt_cb(GtkAction *action, gpointer user_data _U_)
-{
- tap_param_dlg_cb(action, &fc_stat_dlg);
-}
-
diff --git a/ui/gtk/funnel_stat.c b/ui/gtk/funnel_stat.c
index b245df78a6..4af421486b 100644
--- a/ui/gtk/funnel_stat.c
+++ b/ui/gtk/funnel_stat.c
@@ -596,23 +596,6 @@ static void our_menu_callback(void* unused _U_, gpointer data) {
if (mcb->retap) cf_retap_packets(&cfile);
}
-static const char* stat_group_name(register_stat_group_t group) {
- /* See make_menu_xml() for an explanation of the string format */
- static const value_string group_name_vals[] = {
- {REGISTER_ANALYZE_GROUP_UNSORTED, "/Menubar/AnalyzeMenu|Analyze"}, /* unsorted analyze stuff */
- {REGISTER_ANALYZE_GROUP_CONVERSATION_FILTER, "/Menubar/AnalyzeMenu|Analyze/ConversationFilterMenu|Analyze#ConversationFilter"}, /* conversation filters */
- {REGISTER_STAT_GROUP_UNSORTED, "/Menubar/StatisticsMenu|Statistics"}, /* unsorted statistic function */
- {REGISTER_STAT_GROUP_GENERIC, "/Menubar/StatisticsMenu|Statistics"}, /* generic statistic function, not specific to a protocol */
- {REGISTER_STAT_GROUP_CONVERSATION_LIST, "/Menubar/StatisticsMenu|Statistics/ConversationListMenu|Statistics#ConversationList"}, /* member of the conversation list */
- {REGISTER_STAT_GROUP_ENDPOINT_LIST, "/Menubar/StatisticsMenu|Statistics/EndpointListMenu|Statistics#EndpointList"}, /* member of the endpoint list */
- {REGISTER_STAT_GROUP_RESPONSE_TIME, "/Menubar/StatisticsMenu|Statistics/ServiceResponseTimeMenu|Statistics#ServiceResponseTime"}, /* member of the service response time list */
- {REGISTER_STAT_GROUP_TELEPHONY, "/Menubar/TelephonyMenu|Telephony"}, /* telephony specific */
- {REGISTER_TOOLS_GROUP_UNSORTED, "/Menubar/ToolsMenu|Tools"}, /* unsorted tools */
- {0, NULL}
- };
- return val_to_str_const(group, group_name_vals, "/Menubar/ToolsMenu|Tools");
-}
-
static void register_menu_cb(const char *name,
register_stat_group_t group,
void (*callback)(gpointer),
diff --git a/ui/gtk/gtp_stat.c b/ui/gtk/gtp_stat.c
index 3e6c27c437..908a8a95f8 100644
--- a/ui/gtk/gtp_stat.c
+++ b/ui/gtk/gtp_stat.c
@@ -228,9 +228,3 @@ register_tap_listener_gtkgtpstat(void)
register_param_stat(&gtp_stat_dlg, "GTP",
REGISTER_STAT_GROUP_RESPONSE_TIME);
}
-
-void gtp_srt_cb(GtkAction *action, gpointer user_data _U_)
-{
- tap_param_dlg_cb(action, &gtp_stat_dlg);
-}
-
diff --git a/ui/gtk/gui_stat_menu.h b/ui/gtk/gui_stat_menu.h
index 63a36a8e35..60388ba19b 100644
--- a/ui/gtk/gui_stat_menu.h
+++ b/ui/gtk/gui_stat_menu.h
@@ -33,6 +33,9 @@ extern "C" {
* Add a new menu item for a stat.
*/
+const char *
+stat_group_name(register_stat_group_t group);
+
/**
* XXX TODO: Rewrite me
* NOTE comments refere to old menus.c implementation.
@@ -153,21 +156,7 @@ void wsp_stat_cb(GtkAction *action, gpointer user_data);
void gsm_map_stat_gtk_cb(GtkAction *action, gpointer user_data);
void gsm_map_stat_gtk_sum_cb(GtkAction *action, gpointer user_data);
-void afp_srt_stat_cb(GtkAction *action, gpointer user_data);
-void camel_srt_cb(GtkAction *action, gpointer user_data);
void gtk_dcerpcstat_cb(GtkAction *action, gpointer user_data);
-void diameter_srt_cb(GtkAction *action, gpointer user_data);
-void fc_srt_cb(GtkAction *action, gpointer user_data);
-void gtp_srt_cb(GtkAction *action, gpointer user_data);
-void h225_srt_cb(GtkAction *action, gpointer user_data);
-void ldap_srt_cb(GtkAction *action, gpointer user_data);
-void megaco_srt_cb(GtkAction *action, gpointer user_data);
-void mgcp_srt_cb(GtkAction *action, gpointer user_data);
-void ncp_srt_cb(GtkAction *action, gpointer user_data);
-void radius_srt_cb(GtkAction *action, gpointer user_data);
-void scsi_srt_cb(GtkAction *action, gpointer user_data);
-void smb2_srt_cb(GtkAction *action, gpointer user_data);
-void smb_srt_cb(GtkAction *action, gpointer user_data);
void rlc_lte_graph_cb(GtkAction *action, gpointer user_data);
void rlc_lte_graph_known_channel_launch(guint16 ueid, guint8 rlcMode,
diff --git a/ui/gtk/h225_ras_srt.c b/ui/gtk/h225_ras_srt.c
index eb70db6746..bd12ac71d2 100644
--- a/ui/gtk/h225_ras_srt.c
+++ b/ui/gtk/h225_ras_srt.c
@@ -335,9 +335,3 @@ register_tap_listener_gtk_h225rassrt(void)
register_param_stat(&h225_rassrt_dlg, "H.225 RAS",
REGISTER_STAT_GROUP_RESPONSE_TIME);
}
-
-void h225_srt_cb(GtkAction *action, gpointer user_data _U_)
-{
- tap_param_dlg_cb(action, &h225_rassrt_dlg);
-}
-
diff --git a/ui/gtk/ldap_stat.c b/ui/gtk/ldap_stat.c
index ce757d86d0..e34255211e 100644
--- a/ui/gtk/ldap_stat.c
+++ b/ui/gtk/ldap_stat.c
@@ -242,8 +242,3 @@ register_tap_listener_gtkldapstat(void)
register_param_stat(&ldap_stat_dlg, "LDAP",
REGISTER_STAT_GROUP_RESPONSE_TIME);
}
-void ldap_srt_cb(GtkAction *action, gpointer user_data _U_)
-{
- tap_param_dlg_cb(action, &ldap_stat_dlg);
-}
-
diff --git a/ui/gtk/main_menubar.c b/ui/gtk/main_menubar.c
index af7a169240..408d2d837a 100644
--- a/ui/gtk/main_menubar.c
+++ b/ui/gtk/main_menubar.c
@@ -141,7 +141,7 @@ static GSList *popup_menu_list = NULL;
static GtkAccelGroup *grp;
-static GList *merge_lua_menu_items_list = NULL;
+static GList *merge_menu_items_list = NULL;
static GList *build_menubar_items_callback_list = NULL;
GtkWidget *popup_menu_object;
@@ -151,7 +151,7 @@ static void add_recent_items (guint merge_id, GtkUIManager *ui_manager);
static void add_tap_plugins (guint merge_id, GtkUIManager *ui_manager);
static void menus_init(void);
-static void merge_lua_menu_items(GList *node);
+static void merge_menu_items(GList *node);
static void ws_menubar_build_external_menus(void);
static void set_menu_sensitivity (GtkUIManager *ui_manager, const gchar *, gint);
#if !defined(WANT_PACKET_EDITOR) || !defined(HAVE_LIBPCAP)
@@ -1194,22 +1194,8 @@ static const char *ui_desc_menubar =
" <menuitem name='WLAN' action='/Statistics/EndpointList/WLAN'/>\n"
" </menu>\n"
" <menu name='ServiceResponseTimeMenu' action='/Statistics/ServiceResponseTime'>\n"
-" <menuitem name='AFP' action='/Statistics/ServiceResponseTime/AFP'/>\n"
-" <menuitem name='ONC-RPC' action='/Statistics/ServiceResponseTime/ONC-RPC'/>\n"
-" <menuitem name='Camel' action='/Statistics/ServiceResponseTime/Camel'/>\n"
" <menuitem name='DCE-RPC' action='/Statistics/ServiceResponseTime/DCE-RPC'/>\n"
-" <menuitem name='Diameter' action='/Statistics/ServiceResponseTime/Diameter'/>\n"
-" <menuitem name='FibreChannel' action='/Statistics/ServiceResponseTime/FibreChannel'/>\n"
-" <menuitem name='GTP' action='/Statistics/ServiceResponseTime/GTP'/>\n"
-" <menuitem name='H225' action='/Statistics/ServiceResponseTime/H225'/>\n"
-" <menuitem name='LDAP' action='/Statistics/ServiceResponseTime/LDAP'/>\n"
-" <menuitem name='MEGACO' action='/Statistics/ServiceResponseTime/MEGACO'/>\n"
-" <menuitem name='MGCP' action='/Statistics/ServiceResponseTime/MGCP'/>\n"
-" <menuitem name='NCP' action='/Statistics/ServiceResponseTime/NCP'/>\n"
-" <menuitem name='RADIUS' action='/Statistics/ServiceResponseTime/RADIUS'/>\n"
-" <menuitem name='SCSI' action='/Statistics/ServiceResponseTime/SCSI'/>\n"
-" <menuitem name='SMB' action='/Statistics/ServiceResponseTime/SMB'/>\n"
-" <menuitem name='SMB2' action='/Statistics/ServiceResponseTime/SMB2'/>\n"
+" <menuitem name='ONC-RPC' action='/Statistics/ServiceResponseTime/ONC-RPC'/>\n"
" </menu>\n"
" <separator/>\n"
" <menuitem name='ANCP' action='/StatisticsMenu/ancp'/>\n"
@@ -1650,23 +1636,9 @@ static const GtkActionEntry main_menu_bar_entries[] = {
{ "/Statistics/EndpointList/USB", WIRESHARK_STOCK_ENDPOINTS, "USB", NULL, NULL, G_CALLBACK(gtk_usb_hostlist_cb) },
{ "/Statistics/EndpointList/WLAN", WIRESHARK_STOCK_ENDPOINTS, "WLAN", NULL, NULL, G_CALLBACK(gtk_wlan_hostlist_cb) },
- { "/Statistics/ServiceResponseTime", NULL, "Service _Response Time", NULL, NULL, NULL },
- { "/Statistics/ServiceResponseTime/ONC-RPC", WIRESHARK_STOCK_TIME, "ONC-RPC...", NULL, NULL, G_CALLBACK(gtk_rpcstat_cb) },
- { "/Statistics/ServiceResponseTime/AFP", WIRESHARK_STOCK_TIME, "AFP...", NULL, NULL, G_CALLBACK(afp_srt_stat_cb) },
- { "/Statistics/ServiceResponseTime/Camel", WIRESHARK_STOCK_TIME, "Camel...", NULL, NULL, G_CALLBACK(camel_srt_cb) },
- { "/Statistics/ServiceResponseTime/DCE-RPC", WIRESHARK_STOCK_TIME, "DCE-RPC...", NULL, NULL, G_CALLBACK(gtk_dcerpcstat_cb) },
- { "/Statistics/ServiceResponseTime/Diameter", WIRESHARK_STOCK_TIME, "Diameter...", NULL, NULL, G_CALLBACK(diameter_srt_cb) },
- { "/Statistics/ServiceResponseTime/FibreChannel", WIRESHARK_STOCK_TIME, "Fibre Channel...", NULL, NULL, G_CALLBACK(fc_srt_cb) },
- { "/Statistics/ServiceResponseTime/GTP", WIRESHARK_STOCK_TIME, "GTP...", NULL, NULL, G_CALLBACK(gtp_srt_cb) },
- { "/Statistics/ServiceResponseTime/H225", WIRESHARK_STOCK_TIME, "H225...", NULL, NULL, G_CALLBACK(h225_srt_cb) },
- { "/Statistics/ServiceResponseTime/LDAP", WIRESHARK_STOCK_TIME, "LDAP...", NULL, NULL, G_CALLBACK(ldap_srt_cb) },
- { "/Statistics/ServiceResponseTime/MEGACO", WIRESHARK_STOCK_TIME, "MEGACO...", NULL, NULL, G_CALLBACK(megaco_srt_cb) },
- { "/Statistics/ServiceResponseTime/MGCP", WIRESHARK_STOCK_TIME, "MGCP...", NULL, NULL, G_CALLBACK(mgcp_srt_cb) },
- { "/Statistics/ServiceResponseTime/NCP", WIRESHARK_STOCK_TIME, "NCP...", NULL, NULL, G_CALLBACK(ncp_srt_cb) },
- { "/Statistics/ServiceResponseTime/RADIUS", WIRESHARK_STOCK_TIME, "RADIUS...", NULL, NULL, G_CALLBACK(radius_srt_cb) },
- { "/Statistics/ServiceResponseTime/SCSI", WIRESHARK_STOCK_TIME, "SCSI...", NULL, NULL, G_CALLBACK(scsi_srt_cb) },
- { "/Statistics/ServiceResponseTime/SMB", WIRESHARK_STOCK_TIME, "SMB...", NULL, NULL, G_CALLBACK(smb_srt_cb) },
- { "/Statistics/ServiceResponseTime/SMB2", WIRESHARK_STOCK_TIME, "SMB2...", NULL, NULL, G_CALLBACK(smb2_srt_cb) },
+ { "/Statistics/ServiceResponseTime", NULL, "Service _Response Time", NULL, NULL, NULL },
+ { "/Statistics/ServiceResponseTime/DCE-RPC", WIRESHARK_STOCK_TIME, "DCE-RPC...", NULL, NULL, G_CALLBACK(gtk_dcerpcstat_cb) },
+ { "/Statistics/ServiceResponseTime/ONC-RPC", WIRESHARK_STOCK_TIME, "ONC-RPC...", NULL, NULL, G_CALLBACK(gtk_rpcstat_cb) },
{ "/StatisticsMenu/ancp", NULL, "ANCP", NULL, NULL, G_CALLBACK(gtk_stats_tree_cb) },
{ "/StatisticsMenu/BACnet", NULL, "BACnet", NULL, NULL, NULL },
@@ -3573,8 +3545,7 @@ menus_init(void)
popup_menu_list = g_slist_append((GSList *)popup_menu_list, ui_manager_statusbar_profiles_menu);
menu_dissector_filter(&cfile);
- /* Only Lua uses this currently. */
- merge_lua_menu_items(merge_lua_menu_items_list);
+ merge_menu_items(merge_menu_items_list);
/* Add external menus and items */
ws_menubar_build_external_menus();
@@ -3644,6 +3615,15 @@ typedef struct _menu_item {
gboolean (*selected_tree_row_enabled)(field_info *, gpointer callback_data);
} menu_item_t;
+static gint
+insert_sorted_by_label(gconstpointer aparam, gconstpointer bparam)
+{
+ const menu_item_t *a = (menu_item_t *)aparam;
+ const menu_item_t *b = (menu_item_t *)bparam;
+
+ return g_ascii_strcasecmp(a->label, b->label);
+}
+
void register_menu_bar_menu_items(
const char *gui_path,
const char *name,
@@ -3672,8 +3652,9 @@ void register_menu_bar_menu_items(
menu_item_data->selected_packet_enabled = selected_packet_enabled;
menu_item_data->selected_tree_row_enabled = selected_tree_row_enabled;
- merge_lua_menu_items_list = g_list_append(merge_lua_menu_items_list, menu_item_data);
-
+ merge_menu_items_list = g_list_insert_sorted(merge_menu_items_list,
+ menu_item_data,
+ insert_sorted_by_label);
}
#define XMENU_MAX_DEPTH (1 + 32) /* max number of menus in an xpath (+1 for Menubar) */
@@ -3808,7 +3789,6 @@ make_menu_xml(const char *path)
/* free the GString object, return the allocated char buf which must be g_freed */
markup = g_string_free(xml, FALSE);
- /* printf("Lua Menu XML:\n%s\n", markup); */
return markup;
}
@@ -3818,14 +3798,13 @@ make_menu_xml(const char *path)
* use g_object_unref() on the returned pointer if transferring scope.
*/
static GtkActionGroup*
-make_menu_actions(const char *path, const menu_item_t *menu_item_data)
+make_menu_actions(char *path, const menu_item_t *menu_item_data)
{
GtkActionGroup *action_group;
GtkAction *action;
char **p;
char **tokens;
- char *lbl;
- const char *tok = path;
+ char *tok = path, *lbl;
action_group = gtk_action_group_new (path);
@@ -3847,7 +3826,7 @@ make_menu_actions(const char *path, const menu_item_t *menu_item_data)
*lbl++ = '\0';
}
if ((lbl == NULL) || (*lbl == '\0')) {
- lbl = (char*)tok;
+ lbl = tok;
}
action = (GtkAction *)g_object_new (
@@ -3863,20 +3842,10 @@ make_menu_actions(const char *path, const menu_item_t *menu_item_data)
/* handle menu item (blank names ok) */
if ( (tok != NULL) /* && (tok[0] != '\0') */ && (menu_item_data != NULL) ) {
-
- /* parse label from token */
- lbl = strchr(tok, '|');
- if (lbl != NULL) {
- *lbl++ = '\0';
- }
- if ((lbl == NULL) || (*lbl == '\0')) {
- lbl = (char*)tok;
- }
-
action = (GtkAction *)g_object_new (
GTK_TYPE_ACTION,
"name", tok,
- "label", lbl,
+ "label", menu_item_data->label,
"stock-id", menu_item_data->stock_id,
"tooltip", menu_item_data->tooltip,
"sensitive", menu_item_data->enabled,
@@ -3901,7 +3870,7 @@ make_menu_actions(const char *path, const menu_item_t *menu_item_data)
}
static void
-merge_lua_menu_items(GList *lcl_merge_lua_menu_items_list)
+merge_menu_items(GList *lcl_merge_menu_items_list)
{
guint merge_id;
GtkActionGroup *action_group;
@@ -3910,13 +3879,11 @@ merge_lua_menu_items(GList *lcl_merge_lua_menu_items_list)
const gchar *xml;
gchar *xpath;
- while (lcl_merge_lua_menu_items_list != NULL) {
- menu_item_data = (menu_item_t *)lcl_merge_lua_menu_items_list->data;
+ while (lcl_merge_menu_items_list != NULL) {
+ menu_item_data = (menu_item_t *)lcl_merge_menu_items_list->data;
xpath = g_strdup_printf("%s/%s", menu_item_data->gui_path, menu_item_data->name);
-
xml = make_menu_xml(xpath);
if (xml != NULL) {
-
/* create action group for menu elements */
action_group = make_menu_actions(xpath, menu_item_data);
gtk_ui_manager_insert_action_group (ui_manager_main_menubar, action_group, 0);
@@ -3925,7 +3892,7 @@ merge_lua_menu_items(GList *lcl_merge_lua_menu_items_list)
err = NULL;
merge_id = gtk_ui_manager_add_ui_from_string (ui_manager_main_menubar, xml, -1, &err);
if (err != NULL) {
- fprintf (stderr, "Warning: building Lua menus failed: %s\n",
+ fprintf (stderr, "Warning: building menus failed: %s\n",
err->message);
g_error_free (err);
@@ -3938,10 +3905,29 @@ merge_lua_menu_items(GList *lcl_merge_lua_menu_items_list)
}
g_free(xpath);
- lcl_merge_lua_menu_items_list = g_list_next(lcl_merge_lua_menu_items_list);
+ lcl_merge_menu_items_list = g_list_next(lcl_merge_menu_items_list);
}
}
+const char *
+stat_group_name(register_stat_group_t group)
+{
+ /* See make_menu_xml() for an explanation of the string format */
+ static const value_string group_name_vals[] = {
+ {REGISTER_ANALYZE_GROUP_UNSORTED, "/Menubar/AnalyzeMenu|Analyze"}, /* unsorted analyze stuff */
+ {REGISTER_ANALYZE_GROUP_CONVERSATION_FILTER, "/Menubar/AnalyzeMenu|Analyze/ConversationFilterMenu|Analyze#ConversationFilter"}, /* conversation filters */
+ {REGISTER_STAT_GROUP_UNSORTED, "/Menubar/StatisticsMenu|Statistics"}, /* unsorted statistic function */
+ {REGISTER_STAT_GROUP_GENERIC, "/Menubar/StatisticsMenu|Statistics"}, /* generic statistic function, not specific to a protocol */
+ {REGISTER_STAT_GROUP_CONVERSATION_LIST, "/Menubar/StatisticsMenu|Statistics/ConversationListMenu|Statistics#ConversationList"}, /* member of the conversation list */
+ {REGISTER_STAT_GROUP_ENDPOINT_LIST, "/Menubar/StatisticsMenu|Statistics/EndpointListMenu|Statistics#EndpointList"}, /* member of the endpoint list */
+ {REGISTER_STAT_GROUP_RESPONSE_TIME, "/Menubar/StatisticsMenu|Statistics/ServiceResponseTimeMenu|Statistics#ServiceResponseTime"}, /* member of the service response time list */
+ {REGISTER_STAT_GROUP_TELEPHONY, "/Menubar/TelephonyMenu|Telephony"}, /* telephony specific */
+ {REGISTER_TOOLS_GROUP_UNSORTED, "/Menubar/ToolsMenu|Tools"}, /* unsorted tools */
+ {0, NULL}
+ };
+ return val_to_str_const(group, group_name_vals, "/Menubar/ToolsMenu|Tools");
+}
+
/*
* Enable/disable menu sensitivity.
*/
diff --git a/ui/gtk/megaco_stat.c b/ui/gtk/megaco_stat.c
index a24648a0f5..5f0b0bab7d 100644
--- a/ui/gtk/megaco_stat.c
+++ b/ui/gtk/megaco_stat.c
@@ -227,9 +227,3 @@ register_tap_listener_gtkmegacostat(void)
register_param_stat(&megaco_srt_dlg, "MEGACO",
REGISTER_STAT_GROUP_RESPONSE_TIME);
}
-
-void megaco_srt_cb(GtkAction *action, gpointer user_data _U_)
-{
- tap_param_dlg_cb(action, &megaco_srt_dlg);
-}
-
diff --git a/ui/gtk/mgcp_stat.c b/ui/gtk/mgcp_stat.c
index 3a98abf606..aea8739278 100644
--- a/ui/gtk/mgcp_stat.c
+++ b/ui/gtk/mgcp_stat.c
@@ -314,8 +314,3 @@ register_tap_listener_gtkmgcpstat(void)
register_param_stat(&mgcp_srt_dlg, "MGCP",
REGISTER_STAT_GROUP_RESPONSE_TIME);
}
-void mgcp_srt_cb(GtkAction *action, gpointer user_data _U_)
-{
- tap_param_dlg_cb(action, &mgcp_srt_dlg);
-}
-
diff --git a/ui/gtk/ncp_stat.c b/ui/gtk/ncp_stat.c
index 9dbcfe60d7..6ab3b91242 100644
--- a/ui/gtk/ncp_stat.c
+++ b/ui/gtk/ncp_stat.c
@@ -725,8 +725,3 @@ register_tap_listener_gtkncpstat(void)
register_param_stat(&ncp_stat_dlg, "NCP",
REGISTER_STAT_GROUP_RESPONSE_TIME);
}
-void ncp_srt_cb(GtkAction *action, gpointer user_data _U_)
-{
- tap_param_dlg_cb(action, &ncp_stat_dlg);
-}
-
diff --git a/ui/gtk/radius_stat.c b/ui/gtk/radius_stat.c
index 990d058872..cd73e76795 100644
--- a/ui/gtk/radius_stat.c
+++ b/ui/gtk/radius_stat.c
@@ -383,8 +383,3 @@ register_tap_listener_gtkradiusstat(void)
register_param_stat(&radius_srt_dlg, "RADIUS",
REGISTER_STAT_GROUP_RESPONSE_TIME);
}
-void radius_srt_cb(GtkAction *action, gpointer user_data _U_)
-{
- tap_param_dlg_cb(action, &radius_srt_dlg);
-}
-
diff --git a/ui/gtk/scsi_stat.c b/ui/gtk/scsi_stat.c
index c4acc1e03f..b8c3892bd2 100644
--- a/ui/gtk/scsi_stat.c
+++ b/ui/gtk/scsi_stat.c
@@ -301,9 +301,3 @@ register_tap_listener_gtkscsistat(void)
register_param_stat(&scsi_stat_dlg, "SCSI",
REGISTER_STAT_GROUP_RESPONSE_TIME);
}
-
-void scsi_srt_cb(GtkAction *action, gpointer user_data _U_)
-{
- tap_param_dlg_cb(action, &scsi_stat_dlg);
-}
-
diff --git a/ui/gtk/smb2_stat.c b/ui/gtk/smb2_stat.c
index 1aa06868d5..b875bd57d7 100644
--- a/ui/gtk/smb2_stat.c
+++ b/ui/gtk/smb2_stat.c
@@ -208,8 +208,3 @@ register_tap_listener_gtksmb2stat(void)
register_param_stat(&smb2_stat_dlg, "SMB2",
REGISTER_STAT_GROUP_RESPONSE_TIME);
}
-void smb2_srt_cb(GtkAction *action, gpointer user_data _U_)
-{
- tap_param_dlg_cb(action, &smb2_stat_dlg);
-}
-
diff --git a/ui/gtk/smb_stat.c b/ui/gtk/smb_stat.c
index 24a8132143..8d81688727 100644
--- a/ui/gtk/smb_stat.c
+++ b/ui/gtk/smb_stat.c
@@ -246,8 +246,3 @@ register_tap_listener_gtksmbstat(void)
register_param_stat(&smb_stat_dlg, "SMB",
REGISTER_STAT_GROUP_RESPONSE_TIME);
}
-void smb_srt_cb(GtkAction *action, gpointer user_data _U_)
-{
- tap_param_dlg_cb(action, &smb_stat_dlg);
-}
-
diff --git a/ui/gtk/tap_param_dlg.c b/ui/gtk/tap_param_dlg.c
index 7f0f890f69..e830dcb4de 100644
--- a/ui/gtk/tap_param_dlg.c
+++ b/ui/gtk/tap_param_dlg.c
@@ -64,11 +64,59 @@ static tap_param_dlg_list_item *current_dlg = NULL;
* We register it both as a command-line stat and a menu item stat.
*/
void
-register_param_stat(tap_param_dlg *info, const char *name _U_,
- register_stat_group_t group _U_ )
+register_param_stat(tap_param_dlg *info, const char *name,
+ register_stat_group_t group)
{
+ gchar *full_name;
+ const gchar *stock_id = NULL;
+
register_stat_cmd_arg(info->init_string, info->tap_init_cb, NULL);
-/* funnel_register_menu(name, group, ???, ???, ???); */
+
+ /*
+ * This menu item will pop up a dialog box, so append "..."
+ * to it.
+ */
+ full_name = g_strdup_printf("%s...", name);
+
+ switch (group) {
+
+ case REGISTER_ANALYZE_GROUP_UNSORTED:
+ case REGISTER_ANALYZE_GROUP_CONVERSATION_FILTER:
+ case REGISTER_STAT_GROUP_UNSORTED:
+ case REGISTER_STAT_GROUP_GENERIC:
+ break;
+
+ case REGISTER_STAT_GROUP_CONVERSATION_LIST:
+ stock_id = WIRESHARK_STOCK_CONVERSATIONS;
+ break;
+
+ case REGISTER_STAT_GROUP_ENDPOINT_LIST:
+ stock_id = WIRESHARK_STOCK_ENDPOINTS;
+ break;
+
+ case REGISTER_STAT_GROUP_RESPONSE_TIME:
+ stock_id = WIRESHARK_STOCK_TIME;
+ break;
+
+ case REGISTER_STAT_GROUP_TELEPHONY:
+ break;
+
+ case REGISTER_TOOLS_GROUP_UNSORTED:
+ break;
+ }
+
+ register_menu_bar_menu_items(
+ stat_group_name(group), /* GUI path to the place holder in the menu */
+ name, /* Action name */
+ stock_id, /* Stock id */
+ full_name, /* label */
+ NULL, /* Accelerator */
+ NULL, /* Tooltip */
+ tap_param_dlg_cb, /* Callback */
+ info, /* Callback data */
+ TRUE, /* Enabled */
+ NULL,
+ NULL);
}
void tap_param_dlg_update (void)