changeset 142:c28e29056218

Removed source_container value from data_drag.
author KarstenBock@gmx.net
date Sun, 09 Oct 2011 18:22:48 +0200
parents 658e06a20fa5
children fa5c769468f0
files gui/containergui.py gui/containergui_base.py gui/drag_drop_data.py gui/inventorygui.py
diffstat 4 files changed, 5 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/gui/containergui.py	Sun Oct 09 14:43:47 2011 +0200
+++ b/gui/containergui.py	Sun Oct 09 18:22:48 2011 +0200
@@ -67,8 +67,7 @@
             # get the up and down images of the widget
             up_image = drag_widget.up_image
             down_image = drag_widget.down_image
-            self.setDragData(drag_widget.item, down_image, up_image, 
-                             self.container)
+            self.setDragData(drag_widget.item, down_image, up_image)
             container.take_item(self.container, drag_widget.item.slot)
             
             # after dragging the 'item', set the widgets' images
@@ -99,8 +98,7 @@
             if replace_item:
                 up_image = drop_widget.up_image
                 down_image = drop_widget.down_image
-                self.setDragData(replace_item, down_image, up_image, 
-                                 self.container)
+                self.setDragData(replace_item, down_image, up_image)
             else:
                 data_drag.dragging = False
                 #reset the mouse cursor to the normal cursor
--- a/gui/containergui_base.py	Sun Oct 09 14:43:47 2011 +0200
+++ b/gui/containergui_base.py	Sun Oct 09 18:22:48 2011 +0200
@@ -65,14 +65,13 @@
         pass    
     
 
-    def setDragData(self, drag_item, down_image, up_image, container):
+    def setDragData(self, drag_item, down_image, up_image):
         """Set the dragging data"""
         # set the mouse cursor to be the widget's image
         self.controller.setMouseCursor(up_image.source, down_image.source)
         data_drag.dragged_item = drag_item
         data_drag.dragged_image = up_image.source
         data_drag.dragging = True
-        data_drag.source_container = container
         
     def createMenuItems(self, item, actions):
         """Creates context menu items for all classes based on ContainerGUI"""
--- a/gui/drag_drop_data.py	Sun Oct 09 14:43:47 2011 +0200
+++ b/gui/drag_drop_data.py	Sun Oct 09 18:22:48 2011 +0200
@@ -20,4 +20,3 @@
 dragging = False
 dragged_image = None
 dragged_item = None
-source_container = None
--- a/gui/inventorygui.py	Sun Oct 09 14:43:47 2011 +0200
+++ b/gui/inventorygui.py	Sun Oct 09 18:22:48 2011 +0200
@@ -199,7 +199,7 @@
                 drag_item = drag_item.containable
             # get the image of the widget
             image = drag_widget.image
-            self.setDragData(drag_item, image, image, self.container)
+            self.setDragData(drag_item, image, image)
             container.take_item(self.container, drag_item.slot)
             
             # after dragging the 'item', set the widgets' images
@@ -229,7 +229,7 @@
             #if there was no item the stop dragging and reset cursor
             if replace_item:
                 image = drop_widget.image
-                self.setDragData(replace_item, image, image, self.container)
+                self.setDragData(replace_item, image, image)
             else:
                 data_drag.dragging = False
                 #reset the mouse cursor to the normal cursor