[gimp] app: add missing bits so GimpToolPresetEditor doesn't warn and crash



commit ccf8d1930d89810c812b69d9423062f4648399e4
Author: Michael Natterer <mitch gimp org>
Date:   Sun Apr 11 13:40:28 2010 +0200

    app: add missing bits so GimpToolPresetEditor doesn't warn and crash

 app/actions/actions.c              |    4 ++++
 app/menus/menus.c                  |    7 +++++++
 app/widgets/gimptoolpreseteditor.c |    3 ++-
 menus/Makefile.am                  |    1 +
 menus/tool-preset-editor-menu.xml  |    8 ++++++++
 5 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/app/actions/actions.c b/app/actions/actions.c
index 5ff22b3..0bc37ac 100644
--- a/app/actions/actions.c
+++ b/app/actions/actions.c
@@ -88,6 +88,7 @@
 #include "text-tool-actions.h"
 #include "tool-options-actions.h"
 #include "tool-preset-actions.h"
+#include "tool-preset-editor-actions.h"
 #include "tools-actions.h"
 #include "vectors-actions.h"
 #include "view-actions.h"
@@ -174,6 +175,9 @@ static const GimpActionFactoryEntry action_groups[] =
   { "tool-preset", N_("Tool Presets"), GIMP_STOCK_TOOL_PRESET,
     tool_preset_actions_setup,
     tool_preset_actions_update },
+  { "tool-preset-editor", N_("Tool Preset Editor"), GIMP_STOCK_TOOL_PRESET,
+    tool_preset_editor_actions_setup,
+    tool_preset_editor_actions_update },
   { "help", N_("Help"), GTK_STOCK_HELP,
     help_actions_setup,
     help_actions_update },
diff --git a/app/menus/menus.c b/app/menus/menus.c
index 04f54f2..455d388 100644
--- a/app/menus/menus.c
+++ b/app/menus/menus.c
@@ -313,6 +313,13 @@ menus_init (Gimp              *gimp,
                                       "palette-editor-menu.xml", NULL,
                                       NULL);
 
+  gimp_menu_factory_manager_register (global_menu_factory, "<ToolPresetEditor>",
+                                      "tool-preset-editor",
+                                      NULL,
+                                      "/tool-preset-editor-popup",
+                                      "tool-preset-editor-menu.xml", NULL,
+                                      NULL);
+
   gimp_menu_factory_manager_register (global_menu_factory, "<Selection>",
                                       "select",
                                       "vectors",
diff --git a/app/widgets/gimptoolpreseteditor.c b/app/widgets/gimptoolpreseteditor.c
index c583027..954107c 100644
--- a/app/widgets/gimptoolpreseteditor.c
+++ b/app/widgets/gimptoolpreseteditor.c
@@ -77,7 +77,8 @@ static void
 gimp_tool_preset_editor_init (GimpToolPresetEditor *editor)
 {
   GimpDataEditor *data_editor = GIMP_DATA_EDITOR (editor);
-  /*Nuffink*/
+
+  editor->tool_preset_model = g_object_new (GIMP_TYPE_TOOL_PRESET, NULL);
 }
 
 static GObject *
diff --git a/menus/Makefile.am b/menus/Makefile.am
index 7a0a53a..cbb2f5a 100644
--- a/menus/Makefile.am
+++ b/menus/Makefile.am
@@ -28,6 +28,7 @@ menudata_DATA = \
 	palette-editor-menu.xml		\
 	palettes-menu.xml		\
 	patterns-menu.xml		\
+	tool-preset-editor-menu.xml	\
 	tool-preset-menu.xml		\
 	quick-mask-menu.xml		\
 	sample-points-menu.xml		\
diff --git a/menus/tool-preset-editor-menu.xml b/menus/tool-preset-editor-menu.xml
new file mode 100644
index 0000000..b4a8ee0
--- /dev/null
+++ b/menus/tool-preset-editor-menu.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE ui SYSTEM "gtkuimanager.dtd">
+
+<ui>
+  <popup action="tool-preset-editor-popup">
+    <menuitem action="tool-preset-editor-edit-active" />
+  </popup>
+</ui>



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