Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-08-24 12:12:08 (GMT)
committer Simon Schampijer <simon@laptop.org>2012-08-27 17:03:35 (GMT)
commit2a25005eda0eecdfb2c10d730b90ae306b4eda89 (patch)
tree64d155eb7787a85badbe32709705b079293b6a0d /src
parent2d4ff6a1e2142b51591ec6fa42e82b50255cff69 (diff)
Frame: Drop support for XdndDirectSave in the clipboard
It was added to allow dragging images from the old mozilla based web browser to the frame. The mozilla side of the patch was never upstreamed and anyway the new webkit based browser doesn't support the protocol. This is preliminary to the gtk3 port, we are trying to get rid of window.property_change calls which are not working with introspection. Signed-off-by: Daniel Narvaez <dwnarvaez@gmail.com> Acked-by: Manuel QuiƱones <manuq@laptop.org>
Diffstat (limited to 'src')
-rw-r--r--src/jarabe/frame/clipboard.py6
-rw-r--r--src/jarabe/frame/clipboardtray.py39
2 files changed, 4 insertions, 41 deletions
diff --git a/src/jarabe/frame/clipboard.py b/src/jarabe/frame/clipboard.py
index a09ac5b..09e652a 100644
--- a/src/jarabe/frame/clipboard.py
+++ b/src/jarabe/frame/clipboard.py
@@ -84,11 +84,7 @@ class Clipboard(gobject.GObject):
logging.debug('Clipboard.add_object_format')
cb_object = self._objects[object_id]
- if format_type == 'XdndDirectSave0':
- format_ = Format('text/uri-list', data + '\r\n', on_disk)
- format_.owns_disk_data = True
- cb_object.add_format(format_)
- elif on_disk and cb_object.get_percent() == 100:
+ if on_disk and cb_object.get_percent() == 100:
new_uri = self._copy_file(data)
cb_object.add_format(Format(format_type, new_uri, on_disk))
logging.debug('Added format of type ' + format_type
diff --git a/src/jarabe/frame/clipboardtray.py b/src/jarabe/frame/clipboardtray.py
index 779ffed..72c6f39 100644
--- a/src/jarabe/frame/clipboardtray.py
+++ b/src/jarabe/frame/clipboardtray.py
@@ -14,13 +14,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-import os
import logging
-import tempfile
import gtk
-from sugar import util
from sugar.graphics import tray
from sugar.graphics import style
@@ -158,28 +155,9 @@ class ClipboardTray(tray.VTray):
self._context_map.add_context(context, object_id, len(context.targets))
- if 'XdndDirectSave0' in context.targets:
- window = context.source_window
- prop_type, format_, filename = \
- window.property_get('XdndDirectSave0', 'text/plain')
-
- # FIXME query the clipboard service for a filename?
- base_dir = tempfile.gettempdir()
- dest_filename = util.unique_id()
-
- name_, dot, extension = filename.rpartition('.')
- dest_filename += dot + extension
-
- dest_uri = 'file://' + os.path.join(base_dir, dest_filename)
-
- window.property_change('XdndDirectSave0', prop_type, format_,
- gtk.gdk.PROP_MODE_REPLACE, dest_uri)
-
- widget.drag_get_data(context, 'XdndDirectSave0', time)
- else:
- for target in context.targets:
- if str(target) not in ('TIMESTAMP', 'TARGETS', 'MULTIPLE'):
- widget.drag_get_data(context, target, time)
+ for target in context.targets:
+ if str(target) not in ('TIMESTAMP', 'TARGETS', 'MULTIPLE'):
+ widget.drag_get_data(context, target, time)
cb_service.set_object_percent(object_id, percent=100)
@@ -195,17 +173,6 @@ class ClipboardTray(tray.VTray):
if selection is None:
logging.warn('ClipboardTray: empty selection for target %s',
selection.target)
- elif selection.target == 'XdndDirectSave0':
- if selection.data == 'S':
- window = context.source_window
-
- prop_type, format_, dest = window.property_get(
- 'XdndDirectSave0', 'text/plain')
-
- clipboardservice = clipboard.get_instance()
- clipboardservice.add_object_format(object_id,
- 'XdndDirectSave0',
- dest, on_disk=True)
else:
self._add_selection(object_id, selection)