[gimp] app: Fix and enable duplicate for dynamics



commit 60a77f6db2a0d25b7f32864afa61ebc26cb643d9
Author: Alexia Death <alexiadeath gmail com>
Date:   Wed Feb 2 21:47:23 2011 +0200

    app: Fix and enable duplicate for dynamics

 app/core/gimpdynamics.c               |   18 ++++++++++++++++++
 app/widgets/gimpdynamicsfactoryview.c |    2 --
 2 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/app/core/gimpdynamics.c b/app/core/gimpdynamics.c
index e461788..469a857 100644
--- a/app/core/gimpdynamics.c
+++ b/app/core/gimpdynamics.c
@@ -79,6 +79,8 @@ static void          gimp_dynamics_output_notify (GObject          *output,
                                                   const GParamSpec *pspec,
                                                   GimpDynamics     *dynamics);
 
+static GimpData *    gimp_dynamics_duplicate     (GimpData *data);
+
 
 G_DEFINE_TYPE (GimpDynamics, gimp_dynamics,
                GIMP_TYPE_DATA)
@@ -99,6 +101,7 @@ gimp_dynamics_class_init (GimpDynamicsClass *klass)
 
   data_class->save                          = gimp_dynamics_save;
   data_class->get_extension                 = gimp_dynamics_get_extension;
+  data_class->duplicate                     = gimp_dynamics_duplicate;
 
   GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_NAME,
                                    "name", NULL,
@@ -511,3 +514,18 @@ gimp_dynamics_output_notify (GObject          *output,
 {
   g_object_notify (G_OBJECT (dynamics), gimp_object_get_name (output));
 }
+
+static GimpData *
+gimp_dynamics_duplicate (GimpData *data)
+{
+
+  GimpData *dest;
+
+  dest = gimp_dynamics_new (NULL, gimp_object_get_name (GIMP_DYNAMICS(data)));
+
+  gimp_config_copy (GIMP_CONFIG (data),
+                    GIMP_CONFIG (dest),
+                    GIMP_CONFIG_PARAM_SERIALIZE);
+
+  return GIMP_DATA(dest);
+}
\ No newline at end of file
diff --git a/app/widgets/gimpdynamicsfactoryview.c b/app/widgets/gimpdynamicsfactoryview.c
index 322eff9..25e0c5f 100644
--- a/app/widgets/gimpdynamicsfactoryview.c
+++ b/app/widgets/gimpdynamicsfactoryview.c
@@ -85,7 +85,5 @@ gimp_dynamics_factory_view_new (GimpViewType      view_type,
 
   editor = GIMP_CONTAINER_EDITOR (factory_view);
 
-  gtk_widget_hide (gimp_data_factory_view_get_duplicate_button (GIMP_DATA_FACTORY_VIEW (factory_view)));
-
   return GTK_WIDGET (factory_view);
 }



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