diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2010-06-12 21:08:08 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2010-06-12 21:20:10 (GMT) |
commit | 12ce2bb69724372132366afa7abf2d3a07be1537 (patch) | |
tree | a61a4685b9d0d7cbd26a1f7feec020b88d13aaef | |
parent | 0ea988cce00ed0209a6a59d459cc60c2a2621fc5 (diff) |
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
-rw-r--r-- | Area.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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') |