Commit 730e5ab5 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

app/widgets/gimpcontrollereditor.[ch] pass a GimpContext to

2006-09-14  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpcontrollereditor.[ch]
	* app/widgets/gimpcontrollerlist.c: pass a GimpContext to
	gimp_viewable_dialog_new().
parent 14d80ba1
2006-09-14 Sven Neumann <sven@gimp.org>
* app/widgets/gimpcontrollereditor.[ch]
* app/widgets/gimpcontrollerlist.c: pass a GimpContext to
gimp_viewable_dialog_new().
2006-09-14 Sven Neumann <sven@gimp.org>
* app/actions/image-actions.c
......
......@@ -32,6 +32,8 @@
#include "widgets-types.h"
#include "core/gimpcontext.h"
#include "gimpactionview.h"
#include "gimpcontrollereditor.h"
#include "gimpcontrollerinfo.h"
......@@ -46,7 +48,8 @@
enum
{
PROP_0,
PROP_CONTROLLER_INFO
PROP_CONTROLLER_INFO,
PROP_CONTEXT
};
enum
......@@ -123,6 +126,12 @@ gimp_controller_editor_class_init (GimpControllerEditorClass *klass)
GIMP_TYPE_CONTROLLER_INFO,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_CONTEXT,
g_param_spec_object ("context",
NULL, NULL,
GIMP_TYPE_CONTEXT,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
}
static void
......@@ -435,6 +444,11 @@ gimp_controller_editor_set_property (GObject *object,
case PROP_CONTROLLER_INFO:
editor->info = GIMP_CONTROLLER_INFO (g_value_dup_object (value));
break;
case PROP_CONTEXT:
editor->context = GIMP_CONTEXT (g_value_dup_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
......@@ -454,6 +468,11 @@ gimp_controller_editor_get_property (GObject *object,
case PROP_CONTROLLER_INFO:
g_value_set_object (value, editor->info);
break;
case PROP_CONTEXT:
g_value_set_object (value, editor->context);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
......@@ -473,6 +492,12 @@ gimp_controller_editor_finalize (GObject *object)
editor->info = NULL;
}
if (editor->context)
{
g_object_unref (editor->context);
editor->context = NULL;
}
if (editor->edit_dialog)
gtk_widget_destroy (editor->edit_dialog);
......@@ -495,12 +520,15 @@ gimp_controller_editor_unmap (GtkWidget *widget)
/* public functions */
GtkWidget *
gimp_controller_editor_new (GimpControllerInfo *info)
gimp_controller_editor_new (GimpControllerInfo *info,
GimpContext *context)
{
g_return_val_if_fail (GIMP_IS_CONTROLLER_INFO (info), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
return g_object_new (GIMP_TYPE_CONTROLLER_EDITOR,
"controller-info", info,
"context", context,
NULL);
}
......@@ -664,7 +692,7 @@ gimp_controller_editor_edit_clicked (GtkWidget *button,
event_blurb);
editor->edit_dialog =
gimp_viewable_dialog_new (GIMP_VIEWABLE (editor->info), NULL, /* FIXME */
gimp_viewable_dialog_new (GIMP_VIEWABLE (editor->info), editor->context,
_("Select Controller Event Action"),
"gimp-controller-action-dialog",
GTK_STOCK_EDIT,
......
......@@ -41,6 +41,7 @@ struct _GimpControllerEditor
GtkVBox parent_instance;
GimpControllerInfo *info;
GimpContext *context;
GtkTreeSelection *sel;
......@@ -60,7 +61,8 @@ struct _GimpControllerEditorClass
GType gimp_controller_editor_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_controller_editor_new (GimpControllerInfo *info);
GtkWidget * gimp_controller_editor_new (GimpControllerInfo *info,
GimpContext *context);
#endif /* __GIMP_CONTROLLER_EDITOR_H__ */
......@@ -629,7 +629,8 @@ gimp_controller_list_edit_clicked (GtkWidget *button,
return;
}
dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (list->dest_info), NULL, /* FIXME */
dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (list->dest_info),
gimp_get_user_context (list->gimp),
_("Configure Controller"),
"gimp-controller-editor-dialog",
GTK_STOCK_EDIT,
......@@ -650,7 +651,8 @@ gimp_controller_list_edit_clicked (GtkWidget *button,
G_CALLBACK (gtk_widget_destroy),
NULL);
editor = gimp_controller_editor_new (list->dest_info);
editor = gimp_controller_editor_new (list->dest_info,
gimp_get_user_context (list->gimp));
gtk_container_set_border_width (GTK_CONTAINER (editor), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), editor);
gtk_widget_show (editor);
......
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