diff --git a/ChangeLog b/ChangeLog index 5adea57e1c..b6476a96c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2008-09-23 Sven Neumann + + Move the "Use GEGL" check-box to the Colors menu (bug #548760): + + * app/actions/Makefile.am + * app/actions/config-actions.[ch] + * app/actions/config-commands.[ch]: new files holding the "config" + action group that includes the "use-gegl" toggle action. + + * app/actions/debug-actions.c + * app/actions/debug-commands.[ch]: removed the "use-gegl" action + here. + + * app/menus/menus.c + * app/actions/actions.c: added the new action group. + + * app/widgets/gimphelp-ids.h: added a help ID for the "use-gegl" + action. + + * menus/image-menu.xml.in: moved the "Use GEGL" check-box to the + Colors menu. + 2008-09-21 Sven Neumann * app/actions/windows-actions.c: don't set a help ID on the diff --git a/app/actions/Makefile.am b/app/actions/Makefile.am index 85f12fef3a..829f6df3f2 100644 --- a/app/actions/Makefile.am +++ b/app/actions/Makefile.am @@ -23,6 +23,10 @@ libappactions_a_SOURCES = \ colormap-actions.h \ colormap-commands.c \ colormap-commands.h \ + config-actions.c \ + config-actions.h \ + config-commands.c \ + config-commands.h \ context-actions.c \ context-actions.h \ context-commands.c \ diff --git a/app/actions/actions.c b/app/actions/actions.c index c9db1eac65..ce81ad239c 100644 --- a/app/actions/actions.c +++ b/app/actions/actions.c @@ -52,6 +52,7 @@ #include "buffers-actions.h" #include "channels-actions.h" #include "colormap-actions.h" +#include "config-actions.h" #include "context-actions.h" #include "cursor-info-actions.h" #include "debug-actions.h" @@ -112,6 +113,9 @@ static GimpActionFactoryEntry action_groups[] = { "colormap", N_("Colormap"), GIMP_STOCK_COLORMAP, colormap_actions_setup, colormap_actions_update }, + { "config", N_("Configuration"), GTK_STOCK_PREFERENCES, + config_actions_setup, + config_actions_update }, { "context", N_("Context"), GIMP_STOCK_TOOL_OPTIONS /* well... */, context_actions_setup, context_actions_update }, diff --git a/app/actions/config-actions.c b/app/actions/config-actions.c new file mode 100644 index 0000000000..d16a0ba642 --- /dev/null +++ b/app/actions/config-actions.c @@ -0,0 +1,84 @@ +/* GIMP - The GNU Image Manipulation Program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * 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 + +#include "actions-types.h" + +#include "config/gimpcoreconfig.h" + +#include "core/gimp.h" + +#include "widgets/gimpactiongroup.h" +#include "widgets/gimphelp-ids.h" + +#include "config-actions.h" +#include "config-commands.h" + +#include "gimp-intl.h" + + +static const GimpToggleActionEntry config_toggle_actions[] = +{ + { "config-use-gegl", NULL, + N_("Use _GEGL"), NULL, + N_("If possible, use GEGL for image processing"), + G_CALLBACK (config_use_gegl_cmd_callback), + FALSE, + GIMP_HELP_CONFIG_USE_GEGL } +}; + + +static void +config_actions_use_gegl_notify (GObject *config, + GParamSpec *pspec, + GimpActionGroup *group) +{ + gboolean active; + + g_object_get (config, + "use-gegl", &active, + NULL); + + gimp_action_group_set_action_active (group, "config-use-gegl", active); +} + +void +config_actions_setup (GimpActionGroup *group) +{ + gimp_action_group_add_toggle_actions (group, + config_toggle_actions, + G_N_ELEMENTS (config_toggle_actions)); + + g_signal_connect_object (group->gimp->config, + "notify::use-gegl", + G_CALLBACK (config_actions_use_gegl_notify), + group, 0); +} + +void +config_actions_update (GimpActionGroup *group, + gpointer data) +{ +#define SET_ACTIVE(action,condition) \ + gimp_action_group_set_action_active (group, action, (condition) != 0) + + SET_ACTIVE ("config-use-gegl", group->gimp->config->use_gegl); +} diff --git a/app/actions/config-actions.h b/app/actions/config-actions.h new file mode 100644 index 0000000000..b45368047a --- /dev/null +++ b/app/actions/config-actions.h @@ -0,0 +1,28 @@ +/* GIMP - The GNU Image Manipulation Program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * 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. + */ + +#ifndef __CONFIG_ACTIONS_H__ +#define __CONFIG_ACTIONS_H__ + + +void config_actions_setup (GimpActionGroup *group); +void config_actions_update (GimpActionGroup *group, + gpointer data); + + +#endif /* __CONFIG_ACTIONS_H__ */ diff --git a/app/actions/config-commands.c b/app/actions/config-commands.c new file mode 100644 index 0000000000..02d1fda875 --- /dev/null +++ b/app/actions/config-commands.c @@ -0,0 +1,43 @@ +/* GIMP - The GNU Image Manipulation Program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * 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 + +#include "actions-types.h" + +#include "core/gimp.h" + +#include "actions.h" +#include "config-commands.h" + + +/* public functions */ + +void +config_use_gegl_cmd_callback (GtkAction *action, + gpointer data) +{ + GtkToggleAction *toggle_action = GTK_TOGGLE_ACTION (action); + Gimp *gimp = action_data_get_gimp (data); + + g_object_set (gimp->config, + "use-gegl", gtk_toggle_action_get_active (toggle_action), + NULL); +} diff --git a/app/actions/config-commands.h b/app/actions/config-commands.h new file mode 100644 index 0000000000..2bd525e7ad --- /dev/null +++ b/app/actions/config-commands.h @@ -0,0 +1,27 @@ +/* GIMP - The GNU Image Manipulation Program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * 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. + */ + +#ifndef __CONFIG_COMMANDS_H__ +#define __CONFIG_COMMANDS_H__ + + +void config_use_gegl_cmd_callback (GtkAction *action, + gpointer data); + + +#endif /* __CONFIG_COMMANDS_H__ */ diff --git a/app/actions/debug-actions.c b/app/actions/debug-actions.c index 8ce8da905b..c0f7b34c31 100644 --- a/app/actions/debug-actions.c +++ b/app/actions/debug-actions.c @@ -59,32 +59,8 @@ static const GimpActionEntry debug_actions[] = NULL } }; -static const GimpToggleActionEntry debug_toggle_actions[] = -{ - { "debug-use-gegl", NULL, - "Use _GEGL", NULL, - "If possible, use GEGL for image processing", - G_CALLBACK (debug_use_gegl_cmd_callback), - FALSE, - NULL } -}; - #endif -static void -debug_actions_use_gegl_notify (GObject *config, - GParamSpec *pspec, - GimpActionGroup *group) -{ - gboolean active; - - g_object_get (config, - "use-gegl", &active, - NULL); - - gimp_action_group_set_action_active (group, "debug-use-gegl", active); -} - void debug_actions_setup (GimpActionGroup *group) { @@ -92,15 +68,6 @@ debug_actions_setup (GimpActionGroup *group) gimp_action_group_add_actions (group, debug_actions, G_N_ELEMENTS (debug_actions)); - - gimp_action_group_add_toggle_actions (group, - debug_toggle_actions, - G_N_ELEMENTS (debug_toggle_actions)); - - g_signal_connect_object (group->gimp->config, - "notify::use-gegl", - G_CALLBACK (debug_actions_use_gegl_notify), - group, 0); #endif } diff --git a/app/actions/debug-commands.c b/app/actions/debug-commands.c index a6e4d8892d..e77367a426 100644 --- a/app/actions/debug-commands.c +++ b/app/actions/debug-commands.c @@ -146,18 +146,6 @@ debug_dump_attached_data_cmd_callback (GtkAction *action, debug_print_qdata (GIMP_OBJECT (user_context)); } -void -debug_use_gegl_cmd_callback (GtkAction *action, - gpointer data) -{ - GtkToggleAction *toggle_action = GTK_TOGGLE_ACTION (action); - Gimp *gimp = action_data_get_gimp (data); - - g_object_set (gimp->config, - "use-gegl", gtk_toggle_action_get_active (toggle_action), - NULL); -} - /* private functions */ diff --git a/app/actions/debug-commands.h b/app/actions/debug-commands.h index d942e8db20..b4e700ac00 100644 --- a/app/actions/debug-commands.h +++ b/app/actions/debug-commands.h @@ -35,8 +35,6 @@ void debug_dump_managers_cmd_callback (GtkAction *action, gpointer data); void debug_dump_attached_data_cmd_callback (GtkAction *action, gpointer data); -void debug_use_gegl_cmd_callback (GtkAction *action, - gpointer data); #endif /* ENABLE_DEBUG_MENU */ diff --git a/app/menus/menus.c b/app/menus/menus.c index 9bcb0dc296..b166f3ba4e 100644 --- a/app/menus/menus.c +++ b/app/menus/menus.c @@ -94,6 +94,7 @@ menus_init (Gimp *gimp, gimp_menu_factory_manager_register (global_menu_factory, "", "file", + "config", "context", "debug", "help", @@ -121,6 +122,7 @@ menus_init (Gimp *gimp, gimp_menu_factory_manager_register (global_menu_factory, "", "file", + "config", "context", "help", "edit", @@ -140,6 +142,7 @@ menus_init (Gimp *gimp, gimp_menu_factory_manager_register (global_menu_factory, "", "file", + "config", "context", "edit", "select", diff --git a/app/widgets/gimphelp-ids.h b/app/widgets/gimphelp-ids.h index e4bd5fcdfe..63e527c1f6 100644 --- a/app/widgets/gimphelp-ids.h +++ b/app/widgets/gimphelp-ids.h @@ -499,5 +499,7 @@ #define GIMP_HELP_CONTROLLER_MIDI "gimp-controller-midi" #define GIMP_HELP_CONTROLLER_WHEEL "gimp-controller-wheel" +#define GIMP_HELP_CONFIG_USE_GEGL "gimp-config-use-gegl" + #endif /* __GIMP_HELP_IDS_H__ */ diff --git a/menus/image-menu.xml.in b/menus/image-menu.xml.in index 3e77a5604b..21abba18f7 100644 --- a/menus/image-menu.xml.in +++ b/menus/image-menu.xml.in @@ -29,8 +29,6 @@ - - @@ -488,6 +486,8 @@ + + diff --git a/po/ChangeLog b/po/ChangeLog index f06aa36359..53db6efb0e 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,6 +1,10 @@ +2008-09-23 Sven Neumann + + * POTFILES.in: added app/actions/config-actions.c. + 2008-09-22 Ignacio Casal Quinteiro - gl.po: Updated Galician translation + * gl.po: Updated Galician translation 2008-09-22 Ilkka Tuohela diff --git a/po/POTFILES.in b/po/POTFILES.in index e006d6bd1d..d13302d4f4 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -18,6 +18,7 @@ app/actions/channels-actions.c app/actions/channels-commands.c app/actions/colormap-actions.c app/actions/colormap-commands.c +app/actions/config-actions.c app/actions/context-actions.c app/actions/cursor-info-actions.c app/actions/data-commands.c