# HG changeset patch # User drewp@bigasterisk.com # Date 1402791648 0 # Node ID c99096504c79ce24f6fbd3ae02c6f2bc8a6cf742 # Parent b750b61094692739cb0f129c6881e5bf1599ba77 accept drag data type 'TEXT' which i'm getting from chrome instead of text/uri-list Ignore-this: 26f9691f227d8dfebc736cb8d8943253 diff -r b750b6109469 -r c99096504c79 light9/editchoicegtk.py --- a/light9/editchoicegtk.py Sat Jun 14 23:55:46 2014 +0000 +++ b/light9/editchoicegtk.py Sun Jun 15 00:20:48 2014 +0000 @@ -47,14 +47,16 @@ 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)