[gimp] PLUGINS: Adds UI consistence to jpeg-save dialog. Fixes #747054



commit cd68967b0699eaf9176ad0008dad1f646f5f6bc4
Author: Joao S. O. Bueno <gwidion gmail com>
Date:   Tue Mar 31 18:19:55 2015 -0300

    PLUGINS: Adds UI consistence to jpeg-save dialog. Fixes #747054

 plug-ins/file-jpeg/jpeg-save.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/file-jpeg/jpeg-save.c b/plug-ins/file-jpeg/jpeg-save.c
index 56545f2..6098167 100644
--- a/plug-ins/file-jpeg/jpeg-save.c
+++ b/plug-ins/file-jpeg/jpeg-save.c
@@ -123,6 +123,8 @@ static void  subsampling_changed    (GtkWidget     *combo,
                                      GtkObject     *entry);
 static void  quality_changed        (GtkObject     *scale_entry,
                                      GtkWidget     *toggle);
+static void  subsampling_changed2   (GtkObject     *combo,
+                                     GtkWidget     *toggle);
 static void  use_orig_qual_changed  (GtkWidget     *toggle,
                                      GtkObject     *scale_entry);
 static void  use_orig_qual_changed2 (GtkWidget     *toggle,
@@ -1040,7 +1042,9 @@ save_dialog (void)
 
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
                                 jsvals.use_orig_quality
-                                && (orig_quality > 0));
+                                && (orig_quality > 0)
+                                && (orig_subsmp == jsvals.subsmp)
+                               );
   gtk_widget_set_sensitive (toggle, (orig_quality > 0));
 
   /* changing quality disables custom quantization tables, and vice-versa */
@@ -1080,7 +1084,9 @@ save_dialog (void)
                                   jsvals.subsmp,
                                   G_CALLBACK (subsampling_changed),
                                   entry);
-
+      g_signal_connect (pg.subsmp, "changed",
+                        G_CALLBACK (subsampling_changed2),
+                        pg.use_orig_quality);
       g_signal_connect (pg.use_orig_quality, "toggled",
                         G_CALLBACK (use_orig_qual_changed2),
                         pg.subsmp);
@@ -1401,6 +1407,16 @@ quality_changed (GtkObject *scale_entry,
 }
 
 static void
+subsampling_changed2 (GtkObject *combo,
+                      GtkWidget *toggle)
+{
+  if (jsvals.use_orig_quality && orig_subsmp != jsvals.subsmp)
+    {
+      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), FALSE);
+    }
+}
+
+static void
 use_orig_qual_changed (GtkWidget *toggle,
                        GtkObject *scale_entry)
 {


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