From 12ce2bb69724372132366afa7abf2d3a07be1537 Mon Sep 17 00:00:00 2001 From: Gonzalo Odiard Date: Sat, 12 Jun 2010 21:08:08 +0000 Subject: fix #813 problem with clipboard , OLPC #9022 also This resolves pasting of a image from Browse to Paint or inside Paint Not resolves draging one image from the frame to Paint --- diff --git a/Area.py b/Area.py index 7b921b8..8340d50 100644 --- a/Area.py +++ b/Area.py @@ -69,6 +69,7 @@ import math import pango from fill import * from Desenho import Desenho +from urlparse import urlparse ##Tools and events manipulation are handle with this class. class Area(gtk.DrawingArea): @@ -741,6 +742,11 @@ class Area(gtk.DrawingArea): self.tool['name'] = 'marquee-rectangular' self.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.FLEUR)) self.emit('select') + elif clipBoard.wait_is_uris_available(): + selection = clipBoard.wait_for_contents('text/uri-list') + if selection != None: + for uri in selection.get_uris(): + self.loadImage(urlparse(uri).path, self) else: self.loadImage(tempPath, self) logging.debug('Area.past(self): Load from clipboard fails, loading from tempPatch') -- cgit v0.9.1