6577: Mulltiple drop from clipboard on embeddedlist not working

svn: r21788
This commit is contained in:
Benny Malengier 2013-03-28 16:02:10 +00:00
parent 16ba9f25de
commit 1a36e77b0c

View File

@ -253,24 +253,30 @@ class EmbeddedList(ButtonTab):
and decide if this is a move or a reorder. and decide if this is a move or a reorder.
""" """
if sel_data and sel_data.get_data(): if sel_data and sel_data.get_data():
(mytype, selfid, obj, row_from) = pickle.loads(sel_data.get_data()) data = pickle.loads(sel_data.get_data())
if isinstance(data, list):
data = [pickle.loads(x) for x in data]
else:
data = [data]
for value in data:
(mytype, selfid, obj, row_from) = value
# make sure this is the correct DND type for this object # make sure this is the correct DND type for this object
if mytype == self._DND_TYPE.drag_type: if mytype == self._DND_TYPE.drag_type:
# determine the destination row # determine the destination row
row = self._find_row(x, y) row = self._find_row(x, y)
# if the is same object, we have a move, otherwise, # if the is same object, we have a move, otherwise,
# it is a standard drag-n-drop # it is a standard drag-n-drop
if id(self) == selfid and self.get_selected() is not None: if id(self) == selfid and self.get_selected() is not None:
self._move(row_from, row, obj) self._move(row_from, row, obj)
else: else:
self._handle_drag(row, obj) self._handle_drag(row, obj)
self.rebuild() elif self._DND_EXTRA and mytype == self._DND_EXTRA.drag_type:
elif self._DND_EXTRA and mytype == self._DND_EXTRA.drag_type: self.handle_extra_type(mytype, obj)
self.handle_extra_type(mytype, obj) self.rebuild()
def tree_drag_motion(self, *args): def tree_drag_motion(self, *args):
""" """