aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-08-15 10:49:51 -0700
committerGuy Harris <guy@alum.mit.edu>2015-08-15 17:50:20 +0000
commitc222719a3b14617893a4ccf81856d95fb6904d8d (patch)
tree28d7b2b661ad63bc2a28e6e444dbc7104a4e9a29
parent88f334bc3935e3a5e0c49e6312383143b6b2f66d (diff)
Fix creation of menu actions in ws_menubar_create_action_group().
Action names are expected to begin with /, so prepend a /. Fixes the "plugin" menu mechanism (which could be used by built-in code as well, so it's not really a "plugin" menu mechanism). Change-Id: Ic45412399078796359649cc876d2c8bfc9a790c6 Reviewed-on: https://code.wireshark.org/review/10046 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--ui/gtk/main_menubar.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ui/gtk/main_menubar.c b/ui/gtk/main_menubar.c
index 3244c1c448..ea9e40d82f 100644
--- a/ui/gtk/main_menubar.c
+++ b/ui/gtk/main_menubar.c
@@ -5461,6 +5461,7 @@ ws_menubar_create_action_group(ext_menu_t * menu, const char * xpath_parent, Gtk
ext_menubar_t * item = NULL;
GList * children = NULL;
GtkAction * menu_item;
+ gchar *action_name;
gchar * xpath, *submenu_xpath;
@@ -5471,8 +5472,10 @@ ws_menubar_create_action_group(ext_menu_t * menu, const char * xpath_parent, Gtk
xpath = g_strconcat(xpath_parent, menu->name, NULL);
/* Create the action for the menu item and add it to the action group */
+ action_name = g_strconcat("/", menu->name, NULL);
menu_item = (GtkAction *)g_object_new ( GTK_TYPE_ACTION,
- "name", menu->name, "label", menu->label, NULL );
+ "name", action_name, "label", menu->label, NULL );
+ g_free(action_name);
gtk_action_group_add_action(action_group, menu_item);
@@ -5492,13 +5495,15 @@ ws_menubar_create_action_group(ext_menu_t * menu, const char * xpath_parent, Gtk
}
else if ( item->type != EXT_MENUBAR_SEPARATOR )
{
+ action_name = g_strconcat("/", item->name, NULL);
menu_item = (GtkAction*) g_object_new( GTK_TYPE_ACTION,
- "name", item->name,
+ "name", action_name,
"label", item->label,
"tooltip", item->tooltip,
NULL);
g_signal_connect(menu_item, "activate", G_CALLBACK(ws_menubar_external_cb), item );
gtk_action_group_add_action(action_group, menu_item);
+ g_free(action_name);
}
children = g_list_next(children);