=== modified file 'src/memaker.glade'
--- src/memaker.glade 2008-02-01 19:00:36 +0000
+++ src/memaker.glade 2008-02-12 01:36:54 +0000
@@ -20,7 +20,6 @@
300
300
True
- False
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
This is your current avatar.
=== modified file 'src/memaker.py'
--- src/memaker.py 2008-02-08 17:33:59 +0000
+++ src/memaker.py 2008-02-12 05:35:45 +0000
@@ -26,6 +26,7 @@
import pynotify
import webbrowser
import shutil
+import gnomevfs
try:
import Image, ImageChops
@@ -173,6 +174,12 @@
self.clearIt = rsvg.Handle("clearIt.svg")
self.avatarPicture.set_size_request(400,400)
self.avatarPicture.connect("expose-event", self.draw_scene)
+ #Set up drag (and drop) for avatarPicture
+ targets = [] #?!
+ self.avatarPicture.drag_source_set(gtk.gdk.BUTTON1_MASK, targets, gtk.gdk.ACTION_COPY)
+ self.avatarPicture.drag_source_add_uri_targets()
+ self.avatarPicture.connect('drag-begin', self.avatar_drag_begin_cb)
+ self.avatarPicture.connect('drag-data-get', self.avatar_drag_data_get_cb)
#Show the window now so all major changes to the gui are applied first.
windowMain.show()
#Now to load the last theme used
@@ -273,7 +280,24 @@
notifier.add_action("undo", "Undo", clickedUndo)
notifier.set_icon_from_pixbuf(pixbuf.scale_simple(50,50,gtk.gdk.INTERP_BILINEAR))
notifier.show()
-
+
+ def avatar_drag_begin_cb(self, widget, context, data=None):
+ #Generate an icon to represent the image being dragged
+ svgHandle = rsvg.Handle(data = self.currentFace.printMe())
+ pixbuf = svgHandle.get_pixbuf()
+ widget.drag_source_set_icon_pixbuf(pixbuf.scale_simple(48,48,gtk.gdk.INTERP_BILINEAR)) #FIXME: There must be some kind of a standard for the dimensions of these previews
+ return
+
+ def avatar_drag_data_get_cb(self, widget, context, selection, targetType, eventTime, data=None):
+ uris = list()
+
+ self.dndavatar_svg = os.path.expanduser('~/.MeMaker/avatar.svg')
+ file = open(self.dndavatar_svg, "w")
+ file.write(self.currentFace.printMe())
+ uris.append(gnomevfs.get_uri_from_local_path(self.dndavatar_svg))
+
+ selection.set_uris(uris)
+
def themeChanged(self, comboboxThemePicker, themesList, themesListB):
"""
Restore the proper theme for extraction