changed Gimp parameter to GimpContext and use it instead of getting the

2006-10-02  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimptoolbox.[ch] (gimp_toolbox_new): changed Gimp
	parameter to GimpContext and use it instead of getting the user
	context from the Gimp.

	(toolbox_tool_button_toggled): set the tool on the dock's
	context instead of the user context.

	* app/dialogs/dialogs-constructors.c (dialogs_toolbox_get): pass
	the context to gimp_toolbox_new() instead of context->gimp.
This commit is contained in:
Michael Natterer 2006-10-02 17:41:04 +00:00 committed by Michael Natterer
parent 6b32123bd1
commit 42dd70e14a
4 changed files with 22 additions and 8 deletions

View File

@ -1,8 +1,20 @@
2006-10-02 Michael Natterer <mitch@gimp.org>
* app/widgets/gimptoolbox.[ch] (gimp_toolbox_new): changed Gimp
parameter to GimpContext and use it instead of getting the user
context from the Gimp.
(toolbox_tool_button_toggled): set the tool on the dock's
context instead of the user context.
* app/dialogs/dialogs-constructors.c (dialogs_toolbox_get): pass
the context to gimp_toolbox_new() instead of context->gimp.
2006-10-02 Jakub Steiner <jimmac@ximian.com> 2006-10-02 Jakub Steiner <jimmac@ximian.com>
* stock-controller-midi*: * stock-controller-midi*:
* stock-controller-wheel*: start replacing mitch's masterpieces with these * stock-controller-wheel*: start replacing mitch's masterpieces
boring ones. with these boring ones.
2006-10-02 Michael Natterer <mitch@gimp.org> 2006-10-02 Michael Natterer <mitch@gimp.org>

View File

@ -214,7 +214,7 @@ dialogs_toolbox_get (GimpDialogFactory *factory,
* the toolbox constructor, because the global_toolbox_factory has no * the toolbox constructor, because the global_toolbox_factory has no
* dockables registered * dockables registered
*/ */
return gimp_toolbox_new (global_dock_factory, context->gimp); return gimp_toolbox_new (global_dock_factory, context);
} }
GtkWidget * GtkWidget *

View File

@ -537,16 +537,16 @@ gimp_toolbox_set_geometry (GimpToolbox *toolbox)
GtkWidget * GtkWidget *
gimp_toolbox_new (GimpDialogFactory *dialog_factory, gimp_toolbox_new (GimpDialogFactory *dialog_factory,
Gimp *gimp) GimpContext *context)
{ {
GimpToolbox *toolbox; GimpToolbox *toolbox;
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (dialog_factory), NULL); g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (dialog_factory), NULL);
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
toolbox = g_object_new (GIMP_TYPE_TOOLBOX, toolbox = g_object_new (GIMP_TYPE_TOOLBOX,
"title", GIMP_ACRONYM, "title", GIMP_ACRONYM,
"context", gimp_get_user_context (gimp), "context", context,
"dialog-factory", dialog_factory, "dialog-factory", dialog_factory,
NULL); NULL);
@ -838,8 +838,10 @@ static void
toolbox_tool_button_toggled (GtkWidget *widget, toolbox_tool_button_toggled (GtkWidget *widget,
GimpToolInfo *tool_info) GimpToolInfo *tool_info)
{ {
GtkWidget *toolbox = gtk_widget_get_toplevel (widget);
if (GTK_TOGGLE_BUTTON (widget)->active) if (GTK_TOGGLE_BUTTON (widget)->active)
gimp_context_set_tool (gimp_get_user_context (tool_info->gimp), tool_info); gimp_context_set_tool (GIMP_DOCK (toolbox)->context, tool_info);
} }
static gboolean static gboolean

View File

@ -59,7 +59,7 @@ struct _GimpToolboxClass
GType gimp_toolbox_get_type (void) G_GNUC_CONST; GType gimp_toolbox_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_toolbox_new (GimpDialogFactory *factory, GtkWidget * gimp_toolbox_new (GimpDialogFactory *factory,
Gimp *gimp); GimpContext *context);
#endif /* __GIMP_TOOLBOX_H__ */ #endif /* __GIMP_TOOLBOX_H__ */