[gimp/wip/animation: 337/373] plug-ins: save onion-skin preference in the parasite.



commit 701195150384f43babe7ecf31bd6bca15003709a
Author: Jehan <jehan girinstud io>
Date:   Sun Jun 25 00:54:10 2017 +0200

    plug-ins: save onion-skin preference in the parasite.

 .../animation-play/core/animation-celanimation.c   |   12 ++++++++++--
 plug-ins/animation-play/widgets/animation-dialog.c |    6 ++++++
 2 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/animation-play/core/animation-celanimation.c 
b/plug-ins/animation-play/core/animation-celanimation.c
index b2c9d1a..cfdf25d 100644
--- a/plug-ins/animation-play/core/animation-celanimation.c
+++ b/plug-ins/animation-play/core/animation-celanimation.c
@@ -758,9 +758,11 @@ animation_cel_animation_serialize (Animation   *animation,
   priv = ANIMATION_CEL_ANIMATION (animation)->priv;
 
   xml = g_strdup_printf ("<animation type=\"cels\" framerate=\"%f\" "
-                          " duration=\"%d\" width=\"\" height=\"\">%s",
+                          " duration=\"%d\" onion-skins=\"%d\""
+                          " width=\"\" height=\"\">%s",
                           animation_get_framerate (animation),
-                          priv->duration, playback_xml);
+                          priv->duration, priv->onion_skins,
+                          playback_xml);
 
   for (iter = priv->tracks; iter; iter = iter->next)
     {
@@ -1075,6 +1077,12 @@ animation_cel_animation_start_element (GMarkupParseContext  *context,
 
               animation_cel_animation_set_duration (animation, duration);
             }
+          else if (strcmp (*names, "onion-skins") == 0 && **values)
+            {
+              gint skins = (gint) g_ascii_strtoull (*values, NULL, 10);
+
+              animation_cel_animation_set_onion_skins (animation, skins);
+            }
 
           names++;
           values++;
diff --git a/plug-ins/animation-play/widgets/animation-dialog.c 
b/plug-ins/animation-play/widgets/animation-dialog.c
index 9bb754b..ae2317c 100755
--- a/plug-ins/animation-play/widgets/animation-dialog.c
+++ b/plug-ins/animation-play/widgets/animation-dialog.c
@@ -1389,6 +1389,7 @@ animation_dialog_set_animation (AnimationDialog *dialog,
   else
     {
       GtkWidget *scrolled_win;
+      gint       skins;
 
       scrolled_win = gtk_scrolled_window_new (NULL, NULL);
       gtk_notebook_prepend_page (GTK_NOTEBOOK (priv->right_notebook),
@@ -1407,6 +1408,11 @@ animation_dialog_set_animation (AnimationDialog *dialog,
 
       /* The animation type box. */
       gtk_combo_box_set_active (GTK_COMBO_BOX (priv->animation_type_combo), 1);
+
+      /* Settings: onion-skins */
+      skins = animation_cel_animation_get_onion_skins (ANIMATION_CEL_ANIMATION (animation));
+      gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->onion_spin),
+                                 (gdouble) skins);
     }
 
   /* The bottom panel. */


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