[gimp] app: fix export and delete sensitivity in GimpSettingsEditor



commit d3a83c9940a019cc1b8766365f2ddc354ea2f646
Author: Michael Natterer <mitch gimp org>
Date:   Tue Mar 1 01:29:35 2011 +0100

    app: fix export and delete sensitivity in GimpSettingsEditor
    
    and make sure "select-item" is emitted also when NULL is selected,
    so the sensitivity is set correctly.

 app/widgets/gimpsettingseditor.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/app/widgets/gimpsettingseditor.c b/app/widgets/gimpsettingseditor.c
index b806b07..29ea8c2 100644
--- a/app/widgets/gimpsettingseditor.c
+++ b/app/widgets/gimpsettingseditor.c
@@ -292,12 +292,15 @@ gimp_settings_editor_select_item (GimpContainerView  *view,
                                   gpointer            insert_data,
                                   GimpSettingsEditor *editor)
 {
+  gboolean sensitive;
+
   editor->selected_setting = G_OBJECT (viewable);
 
-  gtk_widget_set_sensitive (editor->export_button,
-                            editor->selected_setting != NULL);
-  gtk_widget_set_sensitive (editor->delete_button,
-                            editor->selected_setting != NULL);
+  sensitive = (editor->selected_setting != NULL &&
+               gimp_object_get_name (editor->selected_setting));
+
+  gtk_widget_set_sensitive (editor->export_button, sensitive);
+  gtk_widget_set_sensitive (editor->delete_button, sensitive);
 }
 
 static void
@@ -341,9 +344,8 @@ gimp_settings_editor_delete_clicked (GtkWidget          *widget,
       gimp_container_remove (editor->container,
                              GIMP_OBJECT (editor->selected_setting));
 
-      if (new)
-        gimp_container_view_select_item (GIMP_CONTAINER_VIEW (editor->view),
-                                         GIMP_VIEWABLE (new));
+      gimp_container_view_select_item (GIMP_CONTAINER_VIEW (editor->view),
+                                       GIMP_VIEWABLE (new));
     }
 }
 



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