[pitivi: 12/19] StartupWizard: unset RecentChooserWidget treeview as a drag source



commit 67d8b4fd738a5a47389a8afa0145ac6c2d6d77ff
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date:   Tue Nov 16 14:33:07 2010 +0000

    StartupWizard: unset RecentChooserWidget treeview as a drag source

 pitivi/ui/startupwizard.py |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/ui/startupwizard.py b/pitivi/ui/startupwizard.py
index cff4ec6..ca1ca37 100644
--- a/pitivi/ui/startupwizard.py
+++ b/pitivi/ui/startupwizard.py
@@ -39,7 +39,26 @@ class StartUpWizard(object):
         chooser.add_filter(filtre)
         chooser.get_children()[0].get_children()[1].\
         get_children()[0].hide()
-        
+
+        # FIXME: the gtk.RecentChooserWidget crashes the application when the
+        # user drags a file from its treeview to any other window.
+
+        # First we find the treeview using depth-first search:
+
+        def find_treeview(widget):
+            stack = [widget]
+            while stack:
+                cur = stack.pop()
+                if isinstance(cur, gtk.TreeView):
+                    return cur
+                elif isinstance(cur, gtk.Container):
+                    stack.extend(cur.get_children())
+            return None
+
+        treeview = find_treeview(chooser)
+
+        # then unset the window as a drag source
+        treeview.drag_source_unset()
 
     def _newProjectCb(self, unused_button4):
         self.quit()



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