diff options
author | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-06-14 10:27:46 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-06-14 10:27:46 (GMT) |
commit | 42e2b95379d2e3ddc8a03de1210c2957220fc72b (patch) | |
tree | 2efd76ee633aadcd1f85473c1221b02895fdd3b8 /shell | |
parent | e6e649419a9d64e13b3e991721e6f5ff8389aa27 (diff) |
Misc dnd fixes.
Diffstat (limited to 'shell')
-rw-r--r-- | shell/view/frame/clipboardbox.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/shell/view/frame/clipboardbox.py b/shell/view/frame/clipboardbox.py index 965a6c6..fc81bce 100644 --- a/shell/view/frame/clipboardbox.py +++ b/shell/view/frame/clipboardbox.py @@ -62,9 +62,12 @@ class ClipboardBox(hippo.CanvasBox): return self._owns_clipboard def _get_icon_at_coords(self, x, y): + box_x, box_y = self.get_context().get_position(self) + x -= box_x + y -= box_y for object_id, icon in self._icons.iteritems(): - [icon_x, icon_y] = self.get_position(icon) - [icon_width, icon_height] = icon.get_allocation() + icon_x, icon_y = self.get_position(icon) + icon_width, icon_height = icon.get_allocation() if (x >= icon_x ) and (x <= icon_x + icon_width) and \ (y >= icon_y ) and (y <= icon_y + icon_height): @@ -88,11 +91,11 @@ class ClipboardBox(hippo.CanvasBox): # Copy the file, as it will be deleted when the dnd operation finishes. new_file_path = os.path.join(path, 'cb' + file_name) - shutil.copyfile(uri.path, new_file_path) + shutil.copyfile(uri[2], new_file_path) cb_service.add_object_format(object_id, selection.type, - uri.scheme + "://" + new_file_path, + uri[0] + "://" + new_file_path, on_disk=True) else: cb_service.add_object_format(object_id, @@ -184,7 +187,7 @@ class ClipboardBox(hippo.CanvasBox): return True def drag_data_received_cb(self, widget, context, x, y, selection, targetType, time): - logging.debug('ClipboardBox: got data for target ' + selection.target) + logging.debug('ClipboardBox: got data for target %r' % selection.target) try: if selection: object_id = self._context_map.get_object_id(context) |