[gimp] Bug 704432 - Warning occurs when using a tool with a GimpToolGui



commit fb078df6fb1dc54719a871ab09572d3c42ad001b
Author: Michael Natterer <mitch gimp org>
Date:   Sun Jul 21 15:05:50 2013 +0200

    Bug 704432 - Warning occurs when using a tool with a GimpToolGui
    
    gimp_tool_gui_update_buttons(): set the alternative order on the
    buttons only if it was already provided.

 app/display/gimptoolgui.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/app/display/gimptoolgui.c b/app/display/gimptoolgui.c
index 28e1aff..2bc70d6 100644
--- a/app/display/gimptoolgui.c
+++ b/app/display/gimptoolgui.c
@@ -650,6 +650,7 @@ gimp_tool_gui_update_buttons (GimpToolGui *gui)
   GList              *list;
   gint               *ids;
   gint                n_ids;
+  gint                n_alternatives = 0;
   gint                i;
 
   n_ids = g_list_length (private->response_entries);
@@ -665,17 +666,21 @@ gimp_tool_gui_update_buttons (GimpToolGui *gui)
           entry->alternative_position < n_ids)
         {
           ids[entry->alternative_position] = entry->response_id;
+          n_alternatives++;
         }
     }
 
-  if (private->overlay)
-    {
-      /* TODO */
-    }
-  else
+  if (n_ids == n_alternatives)
     {
-      gtk_dialog_set_alternative_button_order_from_array (GTK_DIALOG (private->dialog),
-                                                          n_ids, ids);
+      if (private->overlay)
+        {
+          /* TODO */
+        }
+      else
+        {
+          gtk_dialog_set_alternative_button_order_from_array (GTK_DIALOG (private->dialog),
+                                                              n_ids, ids);
+        }
     }
 
   g_free (ids);


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