[gimp] app: Remove Tools dockable



commit c53113d0cca31f8a106791977363d6b0d34aa1e5
Author: Stephen Griffiths <scgmk5 gmail com>
Date:   Tue Jul 21 19:42:57 2009 +0200

    app: Remove Tools dockable
    
    Remove the Tools dockable. The toolbox will be configured from the
    Toolbox page in preferences instead. This is part of the fix for
    bug #500930.

 app/actions/dialogs-actions.c      |    6 --
 app/actions/tools-actions.c        |   82 -------------------
 app/actions/tools-commands.c       |  152 ------------------------------------
 app/actions/tools-commands.h       |   14 ----
 app/dialogs/dialogs-constructors.c |   25 ------
 app/dialogs/dialogs-constructors.h |    6 --
 app/dialogs/dialogs.c              |    2 -
 app/menus/menus.c                  |    7 --
 menus/Makefile.am                  |    1 -
 menus/dialogs-menuitems.xml        |    1 -
 menus/tools-menu.xml               |   10 ---
 11 files changed, 0 insertions(+), 306 deletions(-)
---
diff --git a/app/actions/dialogs-actions.c b/app/actions/dialogs-actions.c
index f8abfb2..30ad3b6 100644
--- a/app/actions/dialogs-actions.c
+++ b/app/actions/dialogs-actions.c
@@ -184,12 +184,6 @@ const GimpStringActionEntry dialogs_dockable_actions[] =
     "gimp-template-list|gimp-template-grid",
     GIMP_HELP_TEMPLATE_DIALOG },
 
-  { "dialogs-tools", GIMP_STOCK_TOOLS,
-    NC_("dialogs-action", "T_ools"), NULL,
-    NC_("dialogs-action", "Open the tools dialog"),
-    "gimp-tool-list|gimp-tool-grid",
-    GIMP_HELP_TOOLS_DIALOG },
-
   { "dialogs-error-console", GIMP_STOCK_WARNING,
     NC_("dialogs-action", "Error Co_nsole"), NULL,
     NC_("dialogs-action", "Open the error console"),
diff --git a/app/actions/tools-actions.c b/app/actions/tools-actions.c
index 223af5e..aeb1f33 100644
--- a/app/actions/tools-actions.c
+++ b/app/actions/tools-actions.c
@@ -42,54 +42,11 @@
 
 static const GimpActionEntry tools_actions[] =
 {
-  { "tools-popup", GIMP_STOCK_TOOLS,
-    NC_("tools-action", "Tools Menu"), NULL, NULL, NULL,
-    GIMP_HELP_TOOLS_DIALOG },
-
   { "tools-menu",           NULL, NC_("tools-action", "_Tools")           },
   { "tools-select-menu",    NULL, NC_("tools-action", "_Selection Tools") },
   { "tools-paint-menu",     NULL, NC_("tools-action", "_Paint Tools")     },
   { "tools-transform-menu", NULL, NC_("tools-action", "_Transform Tools") },
   { "tools-color-menu",     NULL, NC_("tools-action", "_Color Tools")     },
-
-  { "tools-raise", GTK_STOCK_GO_UP,
-    NC_("tools-action", "R_aise Tool"), NULL,
-    NC_("tools-action", "Raise this tool"),
-    G_CALLBACK (tools_raise_cmd_callback),
-    NULL },
-
-  { "tools-raise-to-top", GTK_STOCK_GOTO_TOP,
-    NC_("tools-action", "Ra_ise to Top"), NULL,
-    NC_("tools-action", "Raise this tool to the top"),
-    G_CALLBACK (tools_raise_to_top_cmd_callback),
-    NULL },
-
-  { "tools-lower", GTK_STOCK_GO_DOWN,
-    NC_("tools-action", "L_ower Tool"), NULL,
-    NC_("tools-action", "Lower this tool"),
-    G_CALLBACK (tools_lower_cmd_callback),
-    NULL },
-
-  { "tools-lower-to-bottom", GTK_STOCK_GOTO_BOTTOM,
-    NC_("tools-action", "Lo_wer to Bottom"), NULL,
-    NC_("tools-action", "Lower this tool to the bottom"),
-    G_CALLBACK (tools_lower_to_bottom_cmd_callback),
-    NULL },
-
-  { "tools-reset", GIMP_STOCK_RESET,
-    NC_("tools-action", "_Reset Order & Visibility"), NULL,
-    NC_("tools-action", "Reset tool order and visibility"),
-    G_CALLBACK (tools_reset_cmd_callback),
-    NULL }
-};
-
-static const GimpToggleActionEntry tools_toggle_actions[] =
-{
-  { "tools-visibility", GIMP_STOCK_VISIBLE,
-    NC_("tools-action", "_Show in Toolbox"), NULL, NULL,
-    G_CALLBACK (tools_toggle_visibility_cmd_callback),
-    TRUE,
-    NULL /* FIXME */ }
 };
 
 static const GimpStringActionEntry tools_alternative_actions[] =
@@ -638,10 +595,6 @@ tools_actions_setup (GimpActionGroup *group)
                                  tools_actions,
                                  G_N_ELEMENTS (tools_actions));
 
-  gimp_action_group_add_toggle_actions (group, "tools-action",
-                                        tools_toggle_actions,
-                                        G_N_ELEMENTS (tools_toggle_actions));
-
   gimp_action_group_add_string_actions (group, "tools-action",
                                         tools_alternative_actions,
                                         G_N_ELEMENTS (tools_alternative_actions),
@@ -763,39 +716,4 @@ void
 tools_actions_update (GimpActionGroup *group,
                       gpointer         data)
 {
-  GimpContext   *context   = gimp_get_user_context (group->gimp);
-  GimpToolInfo  *tool_info = gimp_context_get_tool (context);
-  GimpContainer *container = context->gimp->tool_info_list;
-  gboolean       raise     = FALSE;
-  gboolean       lower     = FALSE;
-
-#define SET_SENSITIVE(action,condition) \
-        gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
-#define SET_ACTIVE(action,condition) \
-        gimp_action_group_set_action_active (group, action, (condition) != 0)
-
-  SET_SENSITIVE ("tools-visibility", tool_info);
-
-  if (tool_info)
-    {
-      gint last_index;
-      gint index;
-
-      SET_ACTIVE ("tools-visibility", tool_info->visible);
-
-      last_index = gimp_container_get_n_children (container) -1;
-      index      = gimp_container_get_child_index   (container,
-                                                     GIMP_OBJECT (tool_info));
-
-      raise = index != 0;
-      lower = index != last_index;
-    }
-
-  SET_SENSITIVE ("tools-raise",           raise);
-  SET_SENSITIVE ("tools-raise-to-top",    raise);
-  SET_SENSITIVE ("tools-lower",           lower);
-  SET_SENSITIVE ("tools-lower-to-bottom", lower);
-
-#undef SET_SENSITIVE
-#undef SET_ACTIVE
 }
diff --git a/app/actions/tools-commands.c b/app/actions/tools-commands.c
index 7ca3687..d2d5b8b 100644
--- a/app/actions/tools-commands.c
+++ b/app/actions/tools-commands.c
@@ -103,158 +103,6 @@ tools_select_cmd_callback (GtkAction   *action,
 }
 
 void
-tools_toggle_visibility_cmd_callback (GtkAction *action,
-                                      gpointer   data)
-{
-  GimpContext  *context;
-  GimpToolInfo *tool_info;
-  return_if_no_context (context, data);
-
-  tool_info = gimp_context_get_tool (context);
-
-  if (tool_info)
-    {
-      gboolean active =
-        gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
-
-      if (active != tool_info->visible)
-        g_object_set (tool_info, "visible", active, NULL);
-    }
-}
-
-void
-tools_raise_cmd_callback (GtkAction *action,
-                          gpointer   data)
-{
-  GimpContext  *context;
-  GimpToolInfo *tool_info;
-  return_if_no_context (context, data);
-
-  tool_info = gimp_context_get_tool (context);
-
-  if (tool_info)
-    {
-      GimpContainer *container;
-      gint           index;
-
-      container = context->gimp->tool_info_list;
-      index     = gimp_container_get_child_index (container,
-                                                  GIMP_OBJECT (tool_info));
-
-      if (index > 0)
-        gimp_container_reorder (container, GIMP_OBJECT (tool_info), index - 1);
-    }
-}
-
-void
-tools_raise_to_top_cmd_callback (GtkAction *action,
-                                 gpointer   data)
-{
-  GimpContext  *context;
-  GimpToolInfo *tool_info;
-  return_if_no_context (context, data);
-
-  tool_info = gimp_context_get_tool (context);
-
-  if (tool_info)
-    {
-      GimpContainer *container;
-      gint           index;
-
-      container = context->gimp->tool_info_list;
-      index     = gimp_container_get_child_index (container,
-                                                  GIMP_OBJECT (tool_info));
-
-      if (index > 0)
-        gimp_container_reorder (container, GIMP_OBJECT (tool_info), 0);
-    }
-}
-
-void
-tools_lower_cmd_callback (GtkAction *action,
-                          gpointer   data)
-{
-  GimpContext  *context;
-  GimpToolInfo *tool_info;
-  return_if_no_context (context, data);
-
-  tool_info = gimp_context_get_tool (context);
-
-  if (tool_info)
-    {
-      GimpContainer *container;
-      gint           index;
-
-      container = context->gimp->tool_info_list;
-      index     = gimp_container_get_child_index (container,
-                                                  GIMP_OBJECT (tool_info));
-
-      if (index + 1 < gimp_container_get_n_children (container))
-        gimp_container_reorder (container, GIMP_OBJECT (tool_info), index + 1);
-    }
-}
-
-void
-tools_lower_to_bottom_cmd_callback (GtkAction *action,
-                                    gpointer   data)
-{
-  GimpContext  *context;
-  GimpToolInfo *tool_info;
-  return_if_no_context (context, data);
-
-  tool_info = gimp_context_get_tool (context);
-
-  if (tool_info)
-    {
-      GimpContainer *container;
-      gint           index;
-
-      container = context->gimp->tool_info_list;
-      index     = gimp_container_get_n_children (container) - 1;
-
-      index = index >= 0 ? index : 0;
-
-      gimp_container_reorder (container, GIMP_OBJECT (tool_info), index);
-    }
-}
-
-void
-tools_reset_cmd_callback (GtkAction *action,
-                          gpointer   data)
-{
-  GimpContext   *context;
-  GimpContainer *container;
-  GList         *list;
-  gint           i = 0;
-  return_if_no_context (context, data);
-
-  container = context->gimp->tool_info_list;
-
-  for (list = gimp_tools_get_default_order (context->gimp);
-       list;
-       list = g_list_next (list))
-    {
-      GimpObject *object = gimp_container_get_child_by_name (container,
-                                                             list->data);
-
-      if (object)
-        {
-          gboolean visible;
-
-          gimp_container_reorder (container, object, i);
-
-          visible =
-            GPOINTER_TO_INT (g_object_get_data (G_OBJECT (object),
-                                                "gimp-tool-default-visible"));
-
-          g_object_set (object, "visible", visible, NULL);
-
-          i++;
-        }
-    }
-}
-
-void
 tools_color_average_radius_cmd_callback (GtkAction *action,
                                          gint       value,
                                          gpointer   data)
diff --git a/app/actions/tools-commands.h b/app/actions/tools-commands.h
index fd3b38f..c320b28 100644
--- a/app/actions/tools-commands.h
+++ b/app/actions/tools-commands.h
@@ -22,20 +22,6 @@
 void   tools_select_cmd_callback                    (GtkAction   *action,
                                                      const gchar *value,
                                                      gpointer     data);
-void   tools_toggle_visibility_cmd_callback         (GtkAction   *action,
-                                                     gpointer     data);
-
-void   tools_raise_cmd_callback                     (GtkAction   *action,
-                                                     gpointer     data);
-void   tools_raise_to_top_cmd_callback              (GtkAction   *action,
-                                                     gpointer     data);
-void   tools_lower_cmd_callback                     (GtkAction   *action,
-                                                     gpointer     data);
-void   tools_lower_to_bottom_cmd_callback           (GtkAction   *action,
-                                                     gpointer     data);
-
-void   tools_reset_cmd_callback                     (GtkAction   *action,
-                                                     gpointer     data);
 
 void   tools_color_average_radius_cmd_callback      (GtkAction   *action,
                                                      gint         value,
diff --git a/app/dialogs/dialogs-constructors.c b/app/dialogs/dialogs-constructors.c
index 6aa75b8..e71493c 100644
--- a/app/dialogs/dialogs-constructors.c
+++ b/app/dialogs/dialogs-constructors.c
@@ -61,7 +61,6 @@
 #include "widgets/gimptemplateview.h"
 #include "widgets/gimptoolbox.h"
 #include "widgets/gimptooloptionseditor.h"
-#include "widgets/gimptoolview.h"
 #include "widgets/gimpundoeditor.h"
 #include "widgets/gimpvectorstreeview.h"
 
@@ -386,18 +385,6 @@ dialogs_font_list_view_new (GimpDialogFactory *factory,
 }
 
 GtkWidget *
-dialogs_tool_list_view_new (GimpDialogFactory *factory,
-                            GimpContext       *context,
-                            gint               view_size)
-{
-  return gimp_tool_view_new (GIMP_VIEW_TYPE_LIST,
-                             context->gimp->tool_info_list,
-                             context,
-                             view_size, 0,
-                             factory->menu_factory);
-}
-
-GtkWidget *
 dialogs_buffer_list_view_new (GimpDialogFactory *factory,
                               GimpContext       *context,
                               gint               view_size)
@@ -514,18 +501,6 @@ dialogs_font_grid_view_new (GimpDialogFactory *factory,
 }
 
 GtkWidget *
-dialogs_tool_grid_view_new (GimpDialogFactory *factory,
-                            GimpContext       *context,
-                            gint               view_size)
-{
-  return gimp_tool_view_new (GIMP_VIEW_TYPE_GRID,
-                             context->gimp->tool_info_list,
-                             context,
-                             view_size, 1,
-                             factory->menu_factory);
-}
-
-GtkWidget *
 dialogs_buffer_grid_view_new (GimpDialogFactory *factory,
                               GimpContext       *context,
                               gint               view_size)
diff --git a/app/dialogs/dialogs-constructors.h b/app/dialogs/dialogs-constructors.h
index 9747162..1c36024 100644
--- a/app/dialogs/dialogs-constructors.h
+++ b/app/dialogs/dialogs-constructors.h
@@ -113,9 +113,6 @@ GtkWidget * dialogs_palette_list_view_new  (GimpDialogFactory *factory,
 GtkWidget * dialogs_font_list_view_new     (GimpDialogFactory *factory,
                                             GimpContext       *context,
                                             gint               view_size);
-GtkWidget * dialogs_tool_list_view_new     (GimpDialogFactory *factory,
-                                            GimpContext       *context,
-                                            gint               view_size);
 GtkWidget * dialogs_buffer_list_view_new   (GimpDialogFactory *factory,
                                             GimpContext       *context,
                                             gint               view_size);
@@ -144,9 +141,6 @@ GtkWidget * dialogs_palette_grid_view_new  (GimpDialogFactory *factory,
 GtkWidget * dialogs_font_grid_view_new     (GimpDialogFactory *factory,
                                             GimpContext       *context,
                                             gint               view_size);
-GtkWidget * dialogs_tool_grid_view_new     (GimpDialogFactory *factory,
-                                            GimpContext       *context,
-                                            gint               view_size);
 GtkWidget * dialogs_buffer_grid_view_new   (GimpDialogFactory *factory,
                                             GimpContext       *context,
                                             gint               view_size);
diff --git a/app/dialogs/dialogs.c b/app/dialogs/dialogs.c
index 2c0d786..942d0d3 100644
--- a/app/dialogs/dialogs.c
+++ b/app/dialogs/dialogs.c
@@ -165,8 +165,6 @@ static const GimpDialogFactoryEntry dock_entries[] =
             GIMP_HELP_PALETTE_DIALOG, GIMP_VIEW_SIZE_MEDIUM),
   LISTGRID (font, N_("Fonts"), NULL, GIMP_STOCK_FONT,
             GIMP_HELP_FONT_DIALOG, GIMP_VIEW_SIZE_MEDIUM),
-  LISTGRID (tool, N_("Tools"), NULL, GIMP_STOCK_TOOLS,
-            GIMP_HELP_TOOLS_DIALOG, GIMP_VIEW_SIZE_SMALL),
   LISTGRID (buffer, N_("Buffers"), NULL, GIMP_STOCK_BUFFER,
             GIMP_HELP_BUFFER_DIALOG, GIMP_VIEW_SIZE_MEDIUM),
   LISTGRID (document, N_("History"), N_("Document History"), "document-open-recent",
diff --git a/app/menus/menus.c b/app/menus/menus.c
index 98dc29e..2fe93bf 100644
--- a/app/menus/menus.c
+++ b/app/menus/menus.c
@@ -268,13 +268,6 @@ menus_init (Gimp              *gimp,
                                       "images-menu.xml", NULL,
                                       NULL);
 
-  gimp_menu_factory_manager_register (global_menu_factory, "<Tools>",
-                                      "tools",
-                                      NULL,
-                                      "/tools-popup",
-                                      "tools-menu.xml", NULL,
-                                      NULL);
-
   gimp_menu_factory_manager_register (global_menu_factory, "<BrushEditor>",
                                       "brush-editor",
                                       NULL,
diff --git a/menus/Makefile.am b/menus/Makefile.am
index ed08d4e..ee1717d 100644
--- a/menus/Makefile.am
+++ b/menus/Makefile.am
@@ -33,7 +33,6 @@ menudata_DATA = \
 	text-editor-toolbar.xml		\
 	text-tool-menu.xml		\
 	tool-options-menu.xml		\
-	tools-menu.xml			\
 	undo-menu.xml			\
 	vectors-menu.xml
 
diff --git a/menus/dialogs-menuitems.xml b/menus/dialogs-menuitems.xml
index 2c708ac..fd7a0ed 100644
--- a/menus/dialogs-menuitems.xml
+++ b/menus/dialogs-menuitems.xml
@@ -26,6 +26,5 @@
   <menuitem action="dialogs-images" />
   <menuitem action="dialogs-document-history" />
   <menuitem action="dialogs-templates" />
-  <menuitem action="dialogs-tools" />
   <menuitem action="dialogs-error-console" />
 </menuitems>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]