2008-03-21 Michael Natterer <mitch@gimp.org> Remove the toolbox menu: * configure.in: remove --enable-toolbox-menu option. * menus/Makefile.am * menus/toolbox-menu.xml.in: removed. * menus/image-menu.xml.in: add the debug menu here. * menus/menus.xsl: remove transformations depending on whether there is a toolbox menu or not. * app/menus/Makefile.am * app/menus/toolbox-menu.[ch]: removed. * app/menus/menus.c: remove the toolbox menu but keep the <Toolbox> UI manager around so we can configure its actions separate from normal docks. * app/actions/image-actions.c (image_actions): remove the action for the toolbox menubar. * app/widgets/gimptoolbox.c: remove all menu code. * app/plug-in/plug-in-menu-path.c: map plug-in registered toolbox menu items to their new location in the image menu unconditionally. * plug-ins/common/screenshot.c * plug-ins/common/uniteditor.c * plug-ins/script-fu/script-fu.c * plug-ins/script-fu/scripts/web-browser.scm * plug-ins/twain/twain.c * plug-ins/winsnap/winsnap.c: remove menu registrations under <Toolbox>/File and change <Toolbox>/Help to <Image>/Help. Leave <Toolbox>/Xtns untouched until its final location and name are decided. svn path=/trunk/; revision=25156
80 lines
2.1 KiB
C
80 lines
2.1 KiB
C
/* GIMP - The GNU Image Manipulation Program
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
*
|
|
* plug-in-menu-path.c
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
#include "config.h"
|
|
|
|
#include <string.h>
|
|
|
|
#include "glib-object.h"
|
|
|
|
#include "plug-in-types.h"
|
|
|
|
#include "plug-in-menu-path.h"
|
|
|
|
|
|
typedef struct _MenuPathMapping MenuPathMapping;
|
|
|
|
struct _MenuPathMapping
|
|
{
|
|
const gchar *orig_path;
|
|
const gchar *mapped_path;
|
|
};
|
|
|
|
|
|
static const MenuPathMapping menu_path_mappings[] =
|
|
{
|
|
{ "<Toolbox>/Xtns", "<Image>/Xtns" },
|
|
{ "<Toolbox>/Help", "<Image>/Help" },
|
|
{ NULL, NULL }
|
|
};
|
|
|
|
|
|
gchar *
|
|
plug_in_menu_path_map (const gchar *menu_path)
|
|
{
|
|
const MenuPathMapping *mapping;
|
|
|
|
g_return_val_if_fail (menu_path != NULL, NULL);
|
|
|
|
for (mapping = menu_path_mappings; mapping->orig_path; mapping++)
|
|
{
|
|
if (g_str_has_prefix (menu_path, mapping->orig_path))
|
|
{
|
|
gint orig_len = strlen (mapping->orig_path);
|
|
gchar *mapped_path;
|
|
|
|
if (strlen (menu_path) > orig_len)
|
|
mapped_path = g_strconcat (mapping->mapped_path,
|
|
menu_path + orig_len,
|
|
NULL);
|
|
else
|
|
mapped_path = g_strdup (mapping->mapped_path);
|
|
|
|
#if 0
|
|
g_printerr ("%s: mapped %s to %s\n", G_STRFUNC,
|
|
menu_path, mapped_path);
|
|
#endif
|
|
|
|
return mapped_path;
|
|
}
|
|
}
|
|
|
|
return g_strdup (menu_path);
|
|
}
|