mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-28 20:25:10 +00:00
have interactive_add return unique_id
This commit is contained in:
parent
5e7329026e
commit
8d33015ef4
@ -1065,7 +1065,7 @@ class DelugeGTK:
|
|||||||
if url:
|
if url:
|
||||||
filename = common.fetch_url(url)
|
filename = common.fetch_url(url)
|
||||||
if filename:
|
if filename:
|
||||||
self.interactive_add_torrent(filename)
|
return self.interactive_add_torrent(filename)
|
||||||
|
|
||||||
def interactive_add_torrent(self, torrent):
|
def interactive_add_torrent(self, torrent):
|
||||||
if self.config.get('use_default_dir'):
|
if self.config.get('use_default_dir'):
|
||||||
@ -1076,9 +1076,11 @@ class DelugeGTK:
|
|||||||
if path is None:
|
if path is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.interactive_add_torrent_path(torrent, path)
|
return self.interactive_add_torrent_path(torrent, path)
|
||||||
|
|
||||||
def interactive_add_torrent_path(self, torrent, path):
|
def interactive_add_torrent_path(self, torrent, path):
|
||||||
|
unique_id = False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dumped_torrent = self.manager.dump_torrent_file_info(torrent)
|
dumped_torrent = self.manager.dump_torrent_file_info(torrent)
|
||||||
if self.config.get('enable_files_dialog'):
|
if self.config.get('enable_files_dialog'):
|
||||||
@ -1091,7 +1093,7 @@ class DelugeGTK:
|
|||||||
if files_dialog.is_private_flag_checked():
|
if files_dialog.is_private_flag_checked():
|
||||||
self.manager.set_priv(unique_id, True)
|
self.manager.set_priv(unique_id, True)
|
||||||
else:
|
else:
|
||||||
return
|
return False
|
||||||
else:
|
else:
|
||||||
unique_id = self.manager.add_torrent(torrent, path,
|
unique_id = self.manager.add_torrent(torrent, path,
|
||||||
self.config.get('use_compact_storage'))
|
self.config.get('use_compact_storage'))
|
||||||
@ -1124,6 +1126,8 @@ class DelugeGTK:
|
|||||||
_("Available Space:") + " " + nice_free)
|
_("Available Space:") + " " + nice_free)
|
||||||
else:
|
else:
|
||||||
self.torrent_model_append(unique_id)
|
self.torrent_model_append(unique_id)
|
||||||
|
|
||||||
|
return unique_id
|
||||||
|
|
||||||
def launchpad(self, obj=None):
|
def launchpad(self, obj=None):
|
||||||
common.open_url_in_browser('https://translations.launchpad.net/deluge/trunk/+pots/deluge')
|
common.open_url_in_browser('https://translations.launchpad.net/deluge/trunk/+pots/deluge')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user