Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.7, 0.7.1, and 0.7.2

synch: use text/uri-list drop target mime type

The gobject.idle_add() hack _is_ required to work around
bugs in GTK DND.

Changeset d59c31569a62

Parent 285d2dcec3a4

by Steve Borho

Changes to one file · Browse files at d59c31569a62 Showing diff from parent 285d2dcec3a4 Diff from another changeset...

Change 1 of 2 Show Entire File hggtk/​synch.py Stacked
 
128
129
130
131
 
132
133
134
 
228
229
230
231
232
233
234
235
236
237
 
 
 
238
239
240
 
128
129
130
 
131
132
133
134
 
228
229
230
 
 
 
 
 
 
 
231
232
233
234
235
236
@@ -128,7 +128,7 @@
    # support dropping of repos or bundle files   self.drag_dest_set(gtk.DEST_DEFAULT_ALL, - [("text/plain", 0, 80)], gtk.gdk.ACTION_COPY) + [("text/uri-list", 0, 1)], gtk.gdk.ACTION_COPY)   self.connect('drag_data_received', self._drag_receive)     defrow = None @@ -228,13 +228,9 @@
  self._last_drop_time = None     def _drag_receive(self, widget, context, x, y, selection, targetType, time): - if targetType == 80 and time != self._last_drop_time: - if selection.targets_include_uri(): - files = selection.get_uris() - gobject.idle_add(self._set_path, files[0]) - else: - file = selection.get_text().split()[0].strip() - gobject.idle_add(self._set_path, file) + if time != self._last_drop_time: + files = selection.get_uris() + gobject.idle_add(self._set_path, files[0])   self._last_drop_time = time     def _set_path(self, uri):