[gimp/metadata-browser] app: add menu-related properties to GimpContainerEditor
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser] app: add menu-related properties to GimpContainerEditor
- Date: Fri, 2 Dec 2011 02:15:53 +0000 (UTC)
commit 55991c3513744e498b17de5b388a097b116ab9e7
Author: Michael Natterer <mitch gimp org>
Date: Sun Oct 9 21:45:02 2011 +0200
app: add menu-related properties to GimpContainerEditor
and remove the public gimp_container_editor_construct(), so this class
behaves like a proper object now.
app/widgets/gimpbrushfactoryview.c | 8 ++-
app/widgets/gimpbufferview.c | 11 +--
app/widgets/gimpcontainereditor.c | 110 ++++++++++++++++++++++++-------
app/widgets/gimpcontainereditor.h | 8 --
app/widgets/gimpcontainerpopup.c | 3 -
app/widgets/gimpdatafactoryview.c | 21 ++----
app/widgets/gimpdatafactoryview.h | 5 +-
app/widgets/gimpdocumentview.c | 14 ++--
app/widgets/gimpdynamicsfactoryview.c | 8 ++-
app/widgets/gimpfontview.c | 16 ++---
app/widgets/gimpimageview.c | 14 ++--
app/widgets/gimppatternfactoryview.c | 8 ++-
app/widgets/gimptemplateview.c | 14 ++--
app/widgets/gimptoolpresetfactoryview.c | 8 ++-
14 files changed, 146 insertions(+), 102 deletions(-)
---
diff --git a/app/widgets/gimpbrushfactoryview.c b/app/widgets/gimpbrushfactoryview.c
index 9d2615a..21a7697 100644
--- a/app/widgets/gimpbrushfactoryview.c
+++ b/app/widgets/gimpbrushfactoryview.c
@@ -34,6 +34,7 @@
#include "gimpbrushfactoryview.h"
#include "gimpcontainerview.h"
+#include "gimpmenufactory.h"
#include "gimpspinscale.h"
#include "gimpviewrenderer.h"
@@ -130,6 +131,8 @@ gimp_brush_factory_view_new (GimpViewType view_type,
g_return_val_if_fail (view_border_width >= 0 &&
view_border_width <= GIMP_VIEW_MAX_BORDER_WIDTH,
NULL);
+ g_return_val_if_fail (menu_factory == NULL ||
+ GIMP_IS_MENU_FACTORY (menu_factory), NULL);
factory_view = g_object_new (GIMP_TYPE_BRUSH_FACTORY_VIEW,
"view-type", view_type,
@@ -137,13 +140,14 @@ gimp_brush_factory_view_new (GimpViewType view_type,
"context", context,
"view-size", view_size,
"view-border-width", view_border_width,
+ "menu-factory", menu_factory,
+ "menu-identifier", "<Brushes>",
+ "ui-path", "/brushes-popup",
NULL);
factory_view->change_brush_spacing = change_brush_spacing;
if (! gimp_data_factory_view_construct (GIMP_DATA_FACTORY_VIEW (factory_view),
- menu_factory, "<Brushes>",
- "/brushes-popup",
"brushes"))
{
g_object_unref (factory_view);
diff --git a/app/widgets/gimpbufferview.c b/app/widgets/gimpbufferview.c
index 0cd0bf5..49ed7d5 100644
--- a/app/widgets/gimpbufferview.c
+++ b/app/widgets/gimpbufferview.c
@@ -141,16 +141,11 @@ gimp_buffer_view_new (GimpViewType view_type,
"context", context,
"view-size", view_size,
"view-border-width", view_border_width,
+ "menu-factory", menu_factory,
+ "menu-identifier", "<Buffers>",
+ "ui-path", "/buffers-popup",
NULL);
- if (! gimp_container_editor_construct (GIMP_CONTAINER_EDITOR (buffer_view),
- menu_factory, "<Buffers>",
- "/buffers-popup"))
- {
- g_object_unref (buffer_view);
- return NULL;
- }
-
editor = GIMP_CONTAINER_EDITOR (buffer_view);
frame = gtk_frame_new (NULL);
diff --git a/app/widgets/gimpcontainereditor.c b/app/widgets/gimpcontainereditor.c
index f427662..3f7d00b 100644
--- a/app/widgets/gimpcontainereditor.c
+++ b/app/widgets/gimpcontainereditor.c
@@ -48,17 +48,23 @@ enum
PROP_CONTAINER,
PROP_CONTEXT,
PROP_VIEW_SIZE,
- PROP_VIEW_BORDER_WIDTH
+ PROP_VIEW_BORDER_WIDTH,
+ PROP_MENU_FACTORY,
+ PROP_MENU_IDENTIFIER,
+ PROP_UI_PATH
};
struct _GimpContainerEditorPrivate
{
- GimpViewType view_type;
- GimpContainer *container;
- GimpContext *context;
- gint view_size;
- gint view_border_width;
+ GimpViewType view_type;
+ GimpContainer *container;
+ GimpContext *context;
+ gint view_size;
+ gint view_border_width;
+ GimpMenuFactory *menu_factory;
+ gchar *menu_identifier;
+ gchar *ui_path;
};
@@ -166,6 +172,27 @@ gimp_container_editor_class_init (GimpContainerEditorClass *klass)
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
+ g_object_class_install_property (object_class, PROP_MENU_FACTORY,
+ g_param_spec_object ("menu-factory",
+ NULL, NULL,
+ GIMP_TYPE_MENU_FACTORY,
+ GIMP_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_class_install_property (object_class, PROP_MENU_IDENTIFIER,
+ g_param_spec_string ("menu-identifier",
+ NULL, NULL,
+ NULL,
+ GIMP_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_class_install_property (object_class, PROP_UI_PATH,
+ g_param_spec_string ("ui-path",
+ NULL, NULL,
+ NULL,
+ GIMP_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY));
+
g_type_class_add_private (klass, sizeof (GimpContainerEditorPrivate));
}
@@ -236,6 +263,17 @@ gimp_container_editor_constructed (GObject *object)
gimp_container_view_set_reorderable (GIMP_CONTAINER_VIEW (editor->view),
! GIMP_LIST (editor->priv->container)->sort_func);
+ if (editor->priv->menu_factory &&
+ editor->priv->menu_identifier &&
+ editor->priv->ui_path)
+ {
+ gimp_editor_create_menu (GIMP_EDITOR (editor->view),
+ editor->priv->menu_factory,
+ editor->priv->menu_identifier,
+ editor->priv->ui_path,
+ editor);
+ }
+
gtk_box_pack_start (GTK_BOX (editor), GTK_WIDGET (editor->view),
TRUE, TRUE, 0);
gtk_widget_show (GTK_WIDGET (editor->view));
@@ -277,6 +315,24 @@ gimp_container_editor_dispose (GObject *object)
editor->priv->context = NULL;
}
+ if (editor->priv->menu_factory)
+ {
+ g_object_unref (editor->priv->menu_factory);
+ editor->priv->menu_factory = NULL;
+ }
+
+ if (editor->priv->menu_identifier)
+ {
+ g_free (editor->priv->menu_identifier);
+ editor->priv->menu_identifier = NULL;
+ }
+
+ if (editor->priv->ui_path)
+ {
+ g_free (editor->priv->ui_path);
+ editor->priv->ui_path = NULL;
+ }
+
G_OBJECT_CLASS (parent_class)->dispose (object);
}
@@ -310,6 +366,18 @@ gimp_container_editor_set_property (GObject *object,
editor->priv->view_border_width = g_value_get_int (value);
break;
+ case PROP_MENU_FACTORY:
+ editor->priv->menu_factory = g_value_dup_object (value);
+ break;
+
+ case PROP_MENU_IDENTIFIER:
+ editor->priv->menu_identifier = g_value_dup_string (value);
+ break;
+
+ case PROP_UI_PATH:
+ editor->priv->ui_path = g_value_dup_string (value);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -346,28 +414,22 @@ gimp_container_editor_get_property (GObject *object,
g_value_set_int (value, editor->priv->view_border_width);
break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ case PROP_MENU_FACTORY:
+ g_value_set_object (value, editor->priv->menu_factory);
break;
- }
-}
-gboolean
-gimp_container_editor_construct (GimpContainerEditor *editor,
- GimpMenuFactory *menu_factory,
- const gchar *menu_identifier,
- const gchar *ui_identifier)
-{
- g_return_val_if_fail (GIMP_IS_CONTAINER_EDITOR (editor), FALSE);
- g_return_val_if_fail (menu_factory == NULL ||
- GIMP_IS_MENU_FACTORY (menu_factory), FALSE);
+ case PROP_MENU_IDENTIFIER:
+ g_value_set_string (value, editor->priv->menu_identifier);
+ break;
- if (menu_factory && menu_identifier && ui_identifier)
- gimp_editor_create_menu (GIMP_EDITOR (editor->view),
- menu_factory, menu_identifier, ui_identifier,
- editor);
+ case PROP_UI_PATH:
+ g_value_set_string (value, editor->priv->ui_path);
+ break;
- return TRUE;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
}
GtkSelectionMode
diff --git a/app/widgets/gimpcontainereditor.h b/app/widgets/gimpcontainereditor.h
index fa2d195..9cfc00b 100644
--- a/app/widgets/gimpcontainereditor.h
+++ b/app/widgets/gimpcontainereditor.h
@@ -62,12 +62,4 @@ void gimp_container_editor_set_selection_mode (GimpContainerEditor *
GtkSelectionMode mode);
-/* protected */
-
-gboolean gimp_container_editor_construct (GimpContainerEditor *editor,
- GimpMenuFactory *menu_factory,
- const gchar *menu_identifier,
- const gchar *ui_path);
-
-
#endif /* __GIMP_CONTAINER_EDITOR_H__ */
diff --git a/app/widgets/gimpcontainerpopup.c b/app/widgets/gimpcontainerpopup.c
index e9c34af..a14a3e5 100644
--- a/app/widgets/gimpcontainerpopup.c
+++ b/app/widgets/gimpcontainerpopup.c
@@ -557,9 +557,6 @@ gimp_container_popup_create_view (GimpContainerPopup *popup)
"view-border-width", popup->view_border_width,
NULL);
- gimp_container_editor_construct (popup->editor,
- NULL, NULL, NULL);
-
gimp_container_view_set_reorderable (GIMP_CONTAINER_VIEW (popup->editor->view),
FALSE);
diff --git a/app/widgets/gimpdatafactoryview.c b/app/widgets/gimpdatafactoryview.c
index 2b9af51..72f01b8 100644
--- a/app/widgets/gimpdatafactoryview.c
+++ b/app/widgets/gimpdatafactoryview.c
@@ -45,6 +45,7 @@
#include "gimpcontainerview.h"
#include "gimpdatafactoryview.h"
#include "gimpdnd.h"
+#include "gimpmenufactory.h"
#include "gimptagentry.h"
#include "gimpuimanager.h"
#include "gimpviewrenderer.h"
@@ -246,7 +247,7 @@ gimp_data_factory_view_new (GimpViewType view_type,
gint view_border_width,
GimpMenuFactory *menu_factory,
const gchar *menu_identifier,
- const gchar *ui_identifier,
+ const gchar *ui_path,
const gchar *action_group)
{
GimpDataFactoryView *factory_view;
@@ -258,6 +259,8 @@ gimp_data_factory_view_new (GimpViewType view_type,
g_return_val_if_fail (view_border_width >= 0 &&
view_border_width <= GIMP_VIEW_MAX_BORDER_WIDTH,
NULL);
+ g_return_val_if_fail (menu_factory == NULL ||
+ GIMP_IS_MENU_FACTORY (menu_factory), NULL);
factory_view = g_object_new (GIMP_TYPE_DATA_FACTORY_VIEW,
"view-type", view_type,
@@ -265,12 +268,12 @@ gimp_data_factory_view_new (GimpViewType view_type,
"context", context,
"view-size", view_size,
"view-border-width", view_border_width,
+ "menu-factory", menu_factory,
+ "menu-identifier", menu_identifier,
+ "ui-path", ui_path,
NULL);
if (! gimp_data_factory_view_construct (factory_view,
- menu_factory,
- menu_identifier,
- ui_identifier,
action_group))
{
g_object_unref (factory_view);
@@ -332,9 +335,6 @@ gimp_data_factory_view_have (GimpDataFactoryView *factory_view,
gboolean
gimp_data_factory_view_construct (GimpDataFactoryView *factory_view,
- GimpMenuFactory *menu_factory,
- const gchar *menu_identifier,
- const gchar *ui_identifier,
const gchar *action_group)
{
GimpContainerEditor *editor;
@@ -342,13 +342,6 @@ gimp_data_factory_view_construct (GimpDataFactoryView *factory_view,
g_return_val_if_fail (GIMP_IS_DATA_FACTORY_VIEW (factory_view), FALSE);
- if (! gimp_container_editor_construct (GIMP_CONTAINER_EDITOR (factory_view),
- menu_factory, menu_identifier,
- ui_identifier))
- {
- return FALSE;
- }
-
editor = GIMP_CONTAINER_EDITOR (factory_view);
gimp_container_editor_set_selection_mode (editor, GTK_SELECTION_MULTIPLE);
diff --git a/app/widgets/gimpdatafactoryview.h b/app/widgets/gimpdatafactoryview.h
index 959bac2..f2d85ab 100644
--- a/app/widgets/gimpdatafactoryview.h
+++ b/app/widgets/gimpdatafactoryview.h
@@ -58,7 +58,7 @@ GtkWidget * gimp_data_factory_view_new (GimpViewType
gint view_border_width,
GimpMenuFactory *menu_factory,
const gchar *menu_identifier,
- const gchar *ui_identifier,
+ const gchar *ui_path,
const gchar *action_group);
GtkWidget * gimp_data_factory_view_get_edit_button (GimpDataFactoryView *factory_view);
@@ -73,9 +73,6 @@ gboolean gimp_data_factory_view_have (GimpDataFactoryVi
/* protected */
gboolean gimp_data_factory_view_construct (GimpDataFactoryView *factory_view,
- GimpMenuFactory *menu_factory,
- const gchar *menu_identifier,
- const gchar *ui_identifier,
const gchar *action_group);
diff --git a/app/widgets/gimpdocumentview.c b/app/widgets/gimpdocumentview.c
index d3091f4..b1e18e8 100644
--- a/app/widgets/gimpdocumentview.c
+++ b/app/widgets/gimpdocumentview.c
@@ -35,6 +35,7 @@
#include "gimpdocumentview.h"
#include "gimpdnd.h"
#include "gimpeditor.h"
+#include "gimpmenufactory.h"
#include "gimpuimanager.h"
#include "gimpviewrenderer.h"
#include "gimpwidgets-utils.h"
@@ -88,6 +89,8 @@ gimp_document_view_new (GimpViewType view_type,
g_return_val_if_fail (view_border_width >= 0 &&
view_border_width <= GIMP_VIEW_MAX_BORDER_WIDTH,
FALSE);
+ g_return_val_if_fail (menu_factory == NULL ||
+ GIMP_IS_MENU_FACTORY (menu_factory), NULL);
document_view = g_object_new (GIMP_TYPE_DOCUMENT_VIEW,
"view-type", view_type,
@@ -95,16 +98,11 @@ gimp_document_view_new (GimpViewType view_type,
"context", context,
"view-size", view_size,
"view-border-width", view_border_width,
+ "menu-factory", menu_factory,
+ "menu-identifier", "<Documents>",
+ "ui-path", "/documents-popup",
NULL);
- if (! gimp_container_editor_construct (GIMP_CONTAINER_EDITOR (document_view),
- menu_factory, "<Documents>",
- "/documents-popup"))
- {
- g_object_unref (document_view);
- return NULL;
- }
-
editor = GIMP_CONTAINER_EDITOR (document_view);
document_view->open_button =
diff --git a/app/widgets/gimpdynamicsfactoryview.c b/app/widgets/gimpdynamicsfactoryview.c
index 13082a8..396bf16 100644
--- a/app/widgets/gimpdynamicsfactoryview.c
+++ b/app/widgets/gimpdynamicsfactoryview.c
@@ -30,6 +30,7 @@
#include "core/gimpdatafactory.h"
#include "gimpdynamicsfactoryview.h"
+#include "gimpmenufactory.h"
#include "gimpviewrenderer.h"
@@ -64,6 +65,8 @@ gimp_dynamics_factory_view_new (GimpViewType view_type,
g_return_val_if_fail (view_border_width >= 0 &&
view_border_width <= GIMP_VIEW_MAX_BORDER_WIDTH,
NULL);
+ g_return_val_if_fail (menu_factory == NULL ||
+ GIMP_IS_MENU_FACTORY (menu_factory), NULL);
factory_view = g_object_new (GIMP_TYPE_DYNAMICS_FACTORY_VIEW,
"view-type", view_type,
@@ -71,11 +74,12 @@ gimp_dynamics_factory_view_new (GimpViewType view_type,
"context", context,
"view-size", view_size,
"view-border-width", view_border_width,
+ "menu-factory", menu_factory,
+ "menu-identifier", "<Dynamics>",
+ "ui-path", "/dynamics-popup",
NULL);
if (! gimp_data_factory_view_construct (GIMP_DATA_FACTORY_VIEW (factory_view),
- menu_factory, "<Dynamics>",
- "/dynamics-popup",
"dynamics"))
{
g_object_unref (factory_view);
diff --git a/app/widgets/gimpfontview.c b/app/widgets/gimpfontview.c
index 6099989..c040f59 100644
--- a/app/widgets/gimpfontview.c
+++ b/app/widgets/gimpfontview.c
@@ -33,6 +33,7 @@
#include "gimpeditor.h"
#include "gimpfontview.h"
#include "gimphelp-ids.h"
+#include "gimpmenufactory.h"
#include "gimpuimanager.h"
#include "gimpviewrenderer.h"
@@ -80,6 +81,8 @@ gimp_font_view_new (GimpViewType view_type,
g_return_val_if_fail (view_border_width >= 0 &&
view_border_width <= GIMP_VIEW_MAX_BORDER_WIDTH,
NULL);
+ g_return_val_if_fail (menu_factory == NULL ||
+ GIMP_IS_MENU_FACTORY (menu_factory), NULL);
font_view = g_object_new (GIMP_TYPE_FONT_VIEW,
"view-type", view_type,
@@ -87,16 +90,11 @@ gimp_font_view_new (GimpViewType view_type,
"context", context,
"view-size", view_size,
"view-border-width", view_border_width,
+ "menu-factory", menu_factory,
+ "menu-identifier", "<Fonts>",
+ "ui-path", "/fonts-popup",
NULL);
- if (! gimp_container_editor_construct (GIMP_CONTAINER_EDITOR (font_view),
- menu_factory, "<Fonts>",
- "/fonts-popup"))
- {
- g_object_unref (font_view);
- return NULL;
- }
-
editor = GIMP_CONTAINER_EDITOR (font_view);
gimp_container_view_set_reorderable (GIMP_CONTAINER_VIEW (editor->view),
@@ -114,7 +112,7 @@ gimp_font_view_new (GimpViewType view_type,
static void
gimp_font_view_activate_item (GimpContainerEditor *editor,
- GimpViewable *viewable)
+ GimpViewable *viewable)
{
if (GIMP_CONTAINER_EDITOR_CLASS (parent_class)->activate_item)
GIMP_CONTAINER_EDITOR_CLASS (parent_class)->activate_item (editor, viewable);
diff --git a/app/widgets/gimpimageview.c b/app/widgets/gimpimageview.c
index 5e65f1a..5626f4d 100644
--- a/app/widgets/gimpimageview.c
+++ b/app/widgets/gimpimageview.c
@@ -35,6 +35,7 @@
#include "gimpeditor.h"
#include "gimpimageview.h"
#include "gimpdnd.h"
+#include "gimpmenufactory.h"
#include "gimpuimanager.h"
#include "gimpviewrenderer.h"
@@ -84,6 +85,8 @@ gimp_image_view_new (GimpViewType view_type,
g_return_val_if_fail (view_border_width >= 0 &&
view_border_width <= GIMP_VIEW_MAX_BORDER_WIDTH,
NULL);
+ g_return_val_if_fail (menu_factory == NULL ||
+ GIMP_IS_MENU_FACTORY (menu_factory), NULL);
image_view = g_object_new (GIMP_TYPE_IMAGE_VIEW,
"view-type", view_type,
@@ -91,16 +94,11 @@ gimp_image_view_new (GimpViewType view_type,
"context", context,
"view-size", view_size,
"view-border-width", view_border_width,
+ "menu-factory", menu_factory,
+ "menu-identifier", "<Images>",
+ "ui-path", "/images-popup",
NULL);
- if (! gimp_container_editor_construct (GIMP_CONTAINER_EDITOR (image_view),
- menu_factory, "<Images>",
- "/images-popup"))
- {
- g_object_unref (image_view);
- return NULL;
- }
-
editor = GIMP_CONTAINER_EDITOR (image_view);
image_view->raise_button =
diff --git a/app/widgets/gimppatternfactoryview.c b/app/widgets/gimppatternfactoryview.c
index a1bd978..019f8aa 100644
--- a/app/widgets/gimppatternfactoryview.c
+++ b/app/widgets/gimppatternfactoryview.c
@@ -31,6 +31,7 @@
#include "core/gimpviewable.h"
#include "gimpeditor.h"
+#include "gimpmenufactory.h"
#include "gimppatternfactoryview.h"
#include "gimpviewrenderer.h"
@@ -67,6 +68,8 @@ gimp_pattern_factory_view_new (GimpViewType view_type,
g_return_val_if_fail (view_border_width >= 0 &&
view_border_width <= GIMP_VIEW_MAX_BORDER_WIDTH,
NULL);
+ g_return_val_if_fail (menu_factory == NULL ||
+ GIMP_IS_MENU_FACTORY (menu_factory), NULL);
factory_view = g_object_new (GIMP_TYPE_PATTERN_FACTORY_VIEW,
"view-type", view_type,
@@ -74,11 +77,12 @@ gimp_pattern_factory_view_new (GimpViewType view_type,
"context", context,
"view-size", view_size,
"view-border-width", view_border_width,
+ "menu-factory", menu_factory,
+ "menu-identifier", "<Patterns>",
+ "ui-path", "/patterns-popup",
NULL);
if (! gimp_data_factory_view_construct (GIMP_DATA_FACTORY_VIEW (factory_view),
- menu_factory, "<Patterns>",
- "/patterns-popup",
"patterns"))
{
g_object_unref (factory_view);
diff --git a/app/widgets/gimptemplateview.c b/app/widgets/gimptemplateview.c
index ddc17c6..f7db851 100644
--- a/app/widgets/gimptemplateview.c
+++ b/app/widgets/gimptemplateview.c
@@ -39,6 +39,7 @@
#include "gimpcontainertreestore.h"
#include "gimpcontainertreeview.h"
#include "gimpcontainerview.h"
+#include "gimpmenufactory.h"
#include "gimptemplateview.h"
#include "gimpdnd.h"
#include "gimphelp-ids.h"
@@ -98,6 +99,8 @@ gimp_template_view_new (GimpViewType view_type,
g_return_val_if_fail (view_border_width >= 0 &&
view_border_width <= GIMP_VIEW_MAX_BORDER_WIDTH,
NULL);
+ g_return_val_if_fail (menu_factory == NULL ||
+ GIMP_IS_MENU_FACTORY (menu_factory), NULL);
template_view = g_object_new (GIMP_TYPE_TEMPLATE_VIEW,
"view-type", view_type,
@@ -105,16 +108,11 @@ gimp_template_view_new (GimpViewType view_type,
"context", context,
"view-size", view_size,
"view-border-width", view_border_width,
+ "menu-factory", menu_factory,
+ "menu-identifier", "<Templates>",
+ "ui-path", "/templates-popup",
NULL);
- if (! gimp_container_editor_construct (GIMP_CONTAINER_EDITOR (template_view),
- menu_factory, "<Templates>",
- "/templates-popup"))
- {
- g_object_unref (template_view);
- return NULL;
- }
-
editor = GIMP_CONTAINER_EDITOR (template_view);
if (GIMP_IS_CONTAINER_TREE_VIEW (editor->view))
diff --git a/app/widgets/gimptoolpresetfactoryview.c b/app/widgets/gimptoolpresetfactoryview.c
index 99ad9f1..4d0b8cd 100644
--- a/app/widgets/gimptoolpresetfactoryview.c
+++ b/app/widgets/gimptoolpresetfactoryview.c
@@ -31,6 +31,7 @@
#include "core/gimpviewable.h"
#include "gimpeditor.h"
+#include "gimpmenufactory.h"
#include "gimptoolpresetfactoryview.h"
#include "gimpviewrenderer.h"
@@ -66,6 +67,8 @@ gimp_tool_preset_factory_view_new (GimpViewType view_type,
g_return_val_if_fail (view_border_width >= 0 &&
view_border_width <= GIMP_VIEW_MAX_BORDER_WIDTH,
NULL);
+ g_return_val_if_fail (menu_factory == NULL ||
+ GIMP_IS_MENU_FACTORY (menu_factory), NULL);
factory_view = g_object_new (GIMP_TYPE_TOOL_PRESET_FACTORY_VIEW,
"view-type", view_type,
@@ -73,11 +76,12 @@ gimp_tool_preset_factory_view_new (GimpViewType view_type,
"context", context,
"view-size", view_size,
"view-border-width", view_border_width,
+ "menu-factory", menu_factory,
+ "menu-identifier", "<ToolPreset>",
+ "ui-path", "/tool-preset-popup",
NULL);
if (! gimp_data_factory_view_construct (GIMP_DATA_FACTORY_VIEW (factory_view),
- menu_factory, "<ToolPreset>",
- "/tool-preset-popup",
"tool-preset"))
{
g_object_unref (factory_view);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]