diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2012-03-16 02:36:32 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2012-03-16 02:36:32 +0000 |
commit | 80a72873605e2da9ff20734b9a80abbd50c00f27 (patch) | |
tree | c0fbc9dc0fe18eab58d79992fce84eac47fe2e8d /ui/gtk/funnel_stat.c | |
parent | fe9aac8af05c43066d47ba882a5d63d7232f4ee6 (diff) | |
download | wireshark-80a72873605e2da9ff20734b9a80abbd50c00f27.tar.gz |
Get the Lua menus working again: when adding UI menus, it appears that our
description of existing menus must be accurate: if a name and action are
both specified then the to-be-added-XML must include both the name and the
action.
It appears that the formats given in stat_group_name()'s value_string were
designed to take this into account, but there was no code to separate the menu
name from its action. Adding that separation is complicated by the fact that
menus are separated by /'s and actions may also contain that character. To
deal with that, "escape" the /'s in actions by replacing them with #'s.
make_menu_xml() then un-escapes them back into /'s.
There has to be an easier way to do all of this...
svn path=/trunk/; revision=41591
Diffstat (limited to 'ui/gtk/funnel_stat.c')
-rw-r--r-- | ui/gtk/funnel_stat.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/ui/gtk/funnel_stat.c b/ui/gtk/funnel_stat.c index 68394e0fe4..8e62766570 100644 --- a/ui/gtk/funnel_stat.c +++ b/ui/gtk/funnel_stat.c @@ -32,7 +32,7 @@ * * (From original checkin message: * The funneled GUI mini API. - * A very reduced set of gui ops (by now just a text window) + * A very reduced set of gui ops (by now just a text window) * that can be funneled to dissectors (even plugins) via epan. */ @@ -608,19 +608,20 @@ static void our_menu_callback(void* unused _U_, gpointer data) { } static const char* stat_group_name(register_stat_group_t group _U_) { + /* See make_menu_xml() for an explanation of the string format */ static const value_string VALS_GROUP_NAMES[] = { - {REGISTER_ANALYZE_GROUP_UNSORTED, "/Menubar/AnalyzeMenu|_Analyze"}, /* unsorted analyze stuff */ - {REGISTER_ANALYZE_GROUP_CONVERSATION_FILTER, "/Menubar/AnalyzeMenu/ConversationFilterMenu|Conversation Filter"}, /* conversation filters */ + {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|_Conversation List"}, /* member of the conversation list */ - {REGISTER_STAT_GROUP_ENDPOINT_LIST, "/Menubar/StatisticsMenu|Statistics/EndpointListMenu|_Endpoint List"}, /* member of the endpoint list */ - {REGISTER_STAT_GROUP_RESPONSE_TIME, "/Menubar/StatisticsMenu|Statistics/ServiceResponseTimeMenu|Service _Response Time"}, /* member of the service response time list */ - {REGISTER_STAT_GROUP_TELEPHONY, "/Menubar/TelephonyMenu|Telephon_y"}, /* telephony specific */ - {REGISTER_TOOLS_GROUP_UNSORTED, "/Menubar/ToolsMenu|_Tools"}, /* unsorted tools */ + {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, VALS_GROUP_NAMES, "/Menubar/ToolsMenu|_Tools"); + return val_to_str_const(group, VALS_GROUP_NAMES, "/Menubar/ToolsMenu|Tools"); } static void register_menu_cb(const char *name, |