[pitivi] Fix drag sources



commit 231af92ba6a920e0559da7b03a69a21737b0598e
Author: Renà Stadler <mail renestadler de>
Date:   Sat Aug 4 02:21:37 2012 +0200

    Fix drag sources
    
    Drag destinations remain broken for now.

 pitivi/effects.py      |    6 +++---
 pitivi/medialibrary.py |   10 ++++++----
 2 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/pitivi/effects.py b/pitivi/effects.py
index d0f7e91..a4a3e65 100644
--- a/pitivi/effects.py
+++ b/pitivi/effects.py
@@ -510,7 +510,7 @@ class EffectListWidget(gtk.VBox, Loggable):
         path = paths[0]
         pixbuf = model.get_value(model.get_iter(path), COL_ICON)
         if pixbuf:
-            context.set_icon_pixbuf(pixbuf, 0, 0)
+            gtk.drag_set_icon_pixbuf(context, pixbuf, 0, 0)
 
     def _rowUnderMouseSelected(self, view, event):
         result = view.get_path_at_pos(int(event.x), int(event.y))
@@ -566,7 +566,7 @@ class EffectListWidget(gtk.VBox, Loggable):
         if view.drag_check_threshold(self._dragX, self._dragY,
             int(event.x), int(event.y)):
             context = view.drag_begin(
-                self._getTargetEntries(),
+                gtk.TargetList.new(self._getTargetEntries()),
                 gtk.gdk.ACTION_COPY,
                 self._dragButton,
                 event)
@@ -598,7 +598,7 @@ class EffectListWidget(gtk.VBox, Loggable):
             return
 
         selection.set(selection.target, 8, factory)
-        context.set_icon_pixbuf(INVISIBLE, 0, 0)
+        gtk.drag_set_icon_pixbuf(context, INVISIBLE, 0, 0)
 
     def _effectTypeChangedCb(self, combobox):
         self.modelFilter.refilter()
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index 7310fc7..b9ccd63 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -1139,7 +1139,8 @@ class MediaLibraryWidget(gtk.VBox, Loggable):
         if treeview.drag_check_threshold(self._dragX, self._dragY,
             int(event.x), int(event.y)):
             context = treeview.drag_begin(
-                [dnd.URI_TARGET_ENTRY, dnd.FILESOURCE_TARGET_ENTRY],
+                gtk.TargetList.new([dnd.URI_TARGET_ENTRY,
+                                    dnd.FILESOURCE_TARGET_ENTRY]),
                 gtk.gdk.ACTION_COPY,
                 self._dragButton,
                 event)
@@ -1184,7 +1185,8 @@ class MediaLibraryWidget(gtk.VBox, Loggable):
         if iconview.drag_check_threshold(self._dragX, self._dragY,
             int(event.x), int(event.y)):
             context = iconview.drag_begin(
-                [dnd.URI_TARGET_ENTRY, dnd.FILESOURCE_TARGET_ENTRY],
+                gtk.TargetList([dnd.URI_TARGET_ENTRY,
+                                dnd.FILESOURCE_TARGET_ENTRY]),
                 gtk.gdk.ACTION_COPY,
                 self._dragButton,
                 event)
@@ -1303,7 +1305,7 @@ class MediaLibraryWidget(gtk.VBox, Loggable):
             context.drag_abort(int(time.time()))
         else:
             row = self.modelFilter[paths[0]]
-            context.set_icon_pixbuf(row[COL_ICON], 0, 0)
+            gtk.drag_set_icon_pixbuf(context, row[COL_ICON], 0, 0)
 
     def getSelectedPaths(self):
         """ Returns a list of selected treeview or iconview items """
@@ -1333,6 +1335,6 @@ class MediaLibraryWidget(gtk.VBox, Loggable):
         if len(uris) < 1:
             return
         selection.set(selection.target, 8, '\n'.join(uris))
-        context.set_icon_pixbuf(INVISIBLE, 0, 0)
+        gtk.drag_set_icon_pixbuf(context, INVISIBLE, 0, 0)
 
 gobject.type_register(MediaLibraryWidget)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]