This commit is contained in:
parent
3461c96a1f
commit
86c092da7d
|
@ -817,16 +817,17 @@ class DelugeGTK:
|
|||
return None
|
||||
|
||||
def on_drag_data(self, widget, drag_context, x, y, selection_data, info, timestamp):
|
||||
uri_split = [ urllib.url2pathname(temp).replace("\0", "").strip() for temp in selection_data.data.split('\n') ]
|
||||
|
||||
if info == 1:
|
||||
for path in uri_split:
|
||||
if path.endswith('.torrent'):
|
||||
path.replace("file://", "")
|
||||
self.interactive_add_torrent(path)
|
||||
elif info == 2:
|
||||
if uri_split[0].startswith('http://'):
|
||||
self.get_torrent_from_url(uri_split[0])
|
||||
uri_split = selection_data.data.strip().split()
|
||||
for uri in uri_split:
|
||||
path = urllib.url2pathname(uri).strip('\r\n\x00')
|
||||
if path.startswith('file:\\\\\\'):
|
||||
path = path[8:]
|
||||
elif path.startswith('file://'):
|
||||
path = path[7:]
|
||||
elif path.startswith('file:'):
|
||||
path = path[5:]
|
||||
if path.endswith('.torrent'):
|
||||
self.interactive_add_torrent(path)
|
||||
|
||||
def interactive_add_torrent(self, torrent, append=True):
|
||||
if self.config.get('use_default_dir', bool, default=False):
|
||||
|
|
Loading…
Reference in New Issue