Commit c53113d0 authored by Stephen Griffiths's avatar Stephen Griffiths Committed by Martin Nordholts

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.
parent 87f25f29
......@@ -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"),
......
......@@ -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
}
......@@ -102,158 +102,6 @@ tools_select_cmd_callback (GtkAction *action,
tool_manager_initialize_active (gimp, display);
}
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,
......
......@@ -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,
......
......@@ -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"
......@@ -385,18 +384,6 @@ dialogs_font_list_view_new (GimpDialogFactory *factory,
factory->menu_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,
......@@ -513,18 +500,6 @@ dialogs_font_grid_view_new (GimpDialogFactory *factory,
factory->menu_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,
......
......@@ -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);
......
......@@ -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",
......
......@@ -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,
......
......@@ -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
......
......@@ -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>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE ui SYSTEM "gtkuimanager.dtd">
<ui>
<popup action="tools-popup">
<menuitem action="tools-visibility" />
<separator />
<menuitem action="tools-reset" />
</popup>
</ui>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment