Changeset - c99096504c79
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 11 years ago 2014-06-15 00:20:48
drewp@bigasterisk.com
accept drag data type 'TEXT' which i'm getting from chrome instead of text/uri-list
Ignore-this: 26f9691f227d8dfebc736cb8d8943253
1 file changed with 6 insertions and 4 deletions:
0 comments (0 inline, 0 general)
light9/editchoicegtk.py
Show inline comments
 
@@ -47,14 +47,16 @@ class EditChoice(Gtk.HBox):
 
         
 
    def makeDropTarget(self):
 
        def ddr(widget, drag_context, x, y, selection_data, info, timestamp):
 
            if selection_data.get_data_type().name() != 'text/uri-list':
 
                raise ValueError("unknown DnD selection type %r" %
 
                                 selection_data.get_data_type())
 
            dtype = selection_data.get_data_type()
 
            if dtype.name() not in ['text/uri-list', 'TEXT']:
 
                raise ValueError("unknown DnD selection type %r" % dtype)
 
            self.resourceObservable(URIRef(selection_data.get_data().strip()))
 
        
 
        self.currentLink.drag_dest_set(
 
            flags=Gtk.DestDefaults.ALL,
 
            targets=[Gtk.TargetEntry.new('text/uri-list', 0, 0)],
 
            targets=[Gtk.TargetEntry.new('text/uri-list', 0, 0),
 
                     Gtk.TargetEntry.new('TEXT', 0, 0), # getting this from chrome :(
 
                 ],
 
            actions=Gdk.DragAction.LINK  | Gdk.DragAction.COPY)
 
        self.currentLink.connect("drag_data_received", ddr)
 
                
0 comments (0 inline, 0 general)