[gimp] Don't allow dropping colors and patterns and don't allow pasting to groups



commit 35e67dae4370c7f7647076b83b806efed69ef53a
Author: Michael Natterer <mitch gimp org>
Date:   Sat Aug 29 12:27:57 2009 +0200

    Don't allow dropping colors and patterns and don't allow pasting to groups

 app/display/gimpdisplayshell-dnd.c |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-dnd.c b/app/display/gimpdisplayshell-dnd.c
index a8cee0f..251a7ca 100644
--- a/app/display/gimpdisplayshell-dnd.c
+++ b/app/display/gimpdisplayshell-dnd.c
@@ -367,6 +367,14 @@ gimp_display_shell_dnd_bucket_fill (GimpDisplayShell   *shell,
   if (! drawable)
     return;
 
+  if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
+    {
+      gimp_message_literal (shell->display->gimp, G_OBJECT (shell->display),
+                            GIMP_MESSAGE_ERROR,
+                            _("Cannot modify the pixels of group layers."));
+      return;
+    }
+
   if (gimp_item_get_lock_content (GIMP_ITEM (drawable)))
     {
       gimp_message_literal (shell->display->gimp, G_OBJECT (shell->display),
@@ -452,12 +460,23 @@ gimp_display_shell_drop_buffer (GtkWidget    *widget,
 
   drawable = gimp_image_get_active_drawable (image);
 
-  if (drawable && gimp_item_get_lock_content (GIMP_ITEM (drawable)))
+  if (drawable)
     {
-      gimp_message_literal (shell->display->gimp, G_OBJECT (shell->display),
-                            GIMP_MESSAGE_ERROR,
-                            _("The active layer's pixels are locked."));
-      return;
+      if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
+        {
+          gimp_message_literal (shell->display->gimp, G_OBJECT (shell->display),
+                                GIMP_MESSAGE_ERROR,
+                                _("Cannot modify the pixels of group layers."));
+          return;
+        }
+
+      if (gimp_item_get_lock_content (GIMP_ITEM (drawable)))
+        {
+          gimp_message_literal (shell->display->gimp, G_OBJECT (shell->display),
+                                GIMP_MESSAGE_ERROR,
+                                _("The active layer's pixels are locked."));
+          return;
+        }
     }
 
   buffer = GIMP_BUFFER (viewable);



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