--- plugins/applicationsmenu/applicationsmenu.c 2015-01-21 20:11:48.066670303 -0500 +++ plugins/applicationsmenu.Tony/applicationsmenu.c 2015-03-12 19:43:04.028029054 -0400 @@ -40,8 +40,6 @@ #define DEFAULT_ICON_NAME "xfce4-panel-menu" #define DEFAULT_ICON_SIZE (16) - - struct _ApplicationsMenuPluginClass { XfcePanelPluginClass __parent__; @@ -64,6 +62,7 @@ gchar *button_icon; gboolean custom_menu; gchar *custom_menu_file; + gchar *menu_editor; /* temp item we store here when the * properties dialog is opened */ @@ -83,7 +82,8 @@ PROP_BUTTON_TITLE, PROP_BUTTON_ICON, PROP_CUSTOM_MENU, - PROP_CUSTOM_MENU_FILE + PROP_CUSTOM_MENU_FILE, + PROP_MENU_EDITOR }; @@ -193,6 +193,13 @@ NULL, NULL, NULL, EXO_PARAM_READWRITE)); + + g_object_class_install_property (gobject_class, + PROP_MENU_EDITOR, + g_param_spec_string ("menu-editor", + NULL, NULL, + NULL, + EXO_PARAM_READWRITE)); } @@ -285,6 +292,10 @@ g_value_set_string (value, plugin->custom_menu_file); break; + case PROP_MENU_EDITOR: + g_value_set_string (value, plugin->menu_editor); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -367,6 +378,14 @@ applications_menu_plugin_set_garcon_menu (plugin); break; + case PROP_MENU_EDITOR: + g_free (plugin->menu_editor); + plugin->menu_editor = g_value_dup_string (value); + + if (plugin->is_constructed) + applications_menu_plugin_set_garcon_menu (plugin); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -395,6 +414,7 @@ { "button-icon", G_TYPE_STRING }, { "custom-menu", G_TYPE_BOOLEAN }, { "custom-menu-file", G_TYPE_STRING }, + { "menu-editor", G_TYPE_STRING }, { NULL } }; @@ -594,15 +614,14 @@ ApplicationsMenuPlugin *plugin) { GError *error = NULL; - const gchar command[] = "alacarte"; - + panel_return_if_fail (XFCE_IS_APPLICATIONS_MENU_PLUGIN (plugin)); panel_return_if_fail (GTK_IS_WIDGET (button)); - if (!xfce_spawn_command_line_on_screen (gtk_widget_get_screen (button), command, + if (!xfce_spawn_command_line_on_screen (gtk_widget_get_screen (button), plugin->menu_editor, FALSE, FALSE, &error)) { - xfce_dialog_show_error (NULL, error, _("Failed to execute command \"%s\"."), command); + xfce_dialog_show_error (NULL, error, _("Failed to execute command \"%s\"."), plugin->menu_editor); g_error_free (error); } } @@ -619,6 +638,8 @@ gchar *path; const gchar *check_names[] = { "show-generic-names", "show-menu-icons", "show-tooltips", "show-button-title" }; + const gchar *menu_editors[] = { "alacarte", "menulibre", + "lxmed", "xame" }; /* setup the dialog */ PANEL_UTILS_LINK_4UI @@ -655,8 +676,19 @@ /* whether we show the edit menu button */ object = gtk_builder_get_object (builder, "edit-menu-button"); panel_return_if_fail (GTK_IS_BUTTON (object)); - path = g_find_program_in_path ("alacarte"); - if (path != NULL) + + /* iterate through list of menu editors until one is found that is installed. */ + for (i = 0; i < G_N_ELEMENTS (menu_editors); ++i) + { + path = g_find_program_in_path (menu_editors[i]); + if (path != NULL) + { + plugin->menu_editor = menu_editors[i]; + break; + } + } + + if (plugin->menu_editor != NULL) { object2 = gtk_builder_get_object (builder, "use-default-menu"); panel_return_if_fail (GTK_IS_RADIO_BUTTON (object2));