mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 16:38:43 +00:00
fix bug in close to tray and in external torrent adding
This commit is contained in:
parent
de6952fc99
commit
b105063a27
1 changed files with 7 additions and 7 deletions
|
@ -36,12 +36,11 @@ class DelugeGTK(dbus.service.Object):
|
||||||
def external_add_torrent(self, torrent_file):
|
def external_add_torrent(self, torrent_file):
|
||||||
print "Ding!"
|
print "Ding!"
|
||||||
print "Got torrent externally:", os.path.basename(torrent_file)
|
print "Got torrent externally:", os.path.basename(torrent_file)
|
||||||
print "Here's the raw output:", torrent_file
|
print "Here's the raw data:", torrent_file
|
||||||
print "\tNow, what to do with it?"
|
print "\tNow, what to do with it?"
|
||||||
if self.is_running:
|
if self.is_running:
|
||||||
print "\t\tthe client seems to already be running, i'll try and add the torrent"
|
print "\t\tthe client seems to already be running, i'll try and add the torrent"
|
||||||
uid = self.manager.add_torrent(torrent_file, ".", True)
|
uid = self.interactive_add_torrent(torrent_file)
|
||||||
self.store.append(self.get_list_from_unique_id(uid))
|
|
||||||
else:
|
else:
|
||||||
print "\t\tthe client hasn't started yet, I'll queue the torrent"
|
print "\t\tthe client hasn't started yet, I'll queue the torrent"
|
||||||
self.torrent_file_queue.append(torrent_file)
|
self.torrent_file_queue.append(torrent_file)
|
||||||
|
@ -452,7 +451,7 @@ class DelugeGTK(dbus.service.Object):
|
||||||
for torrent_file in self.torrent_file_queue:
|
for torrent_file in self.torrent_file_queue:
|
||||||
print "adding torrent", torrent_file
|
print "adding torrent", torrent_file
|
||||||
try:
|
try:
|
||||||
interactive_add_torrent(torrent_file)
|
self.interactive_add_torrent(torrent_file, append=False)
|
||||||
except deluge.DelugeError:
|
except deluge.DelugeError:
|
||||||
print "duplicate torrent found, ignoring", torrent_file
|
print "duplicate torrent found, ignoring", torrent_file
|
||||||
## add torrents in manager to interface
|
## add torrents in manager to interface
|
||||||
|
@ -615,7 +614,7 @@ class DelugeGTK(dbus.service.Object):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def interactive_add_torrent(self, torrent):
|
def interactive_add_torrent(self, torrent, append=True):
|
||||||
if self.pref.get('use_default_dir', bool):
|
if self.pref.get('use_default_dir', bool):
|
||||||
path = self.pref.get('default_download_path')
|
path = self.pref.get('default_download_path')
|
||||||
else:
|
else:
|
||||||
|
@ -623,7 +622,8 @@ class DelugeGTK(dbus.service.Object):
|
||||||
if path is None:
|
if path is None:
|
||||||
return
|
return
|
||||||
unique_id = self.manager.add_torrent(torrent, path, True)
|
unique_id = self.manager.add_torrent(torrent, path, True)
|
||||||
self.store.append(self.get_list_from_unique_id(unique_id))
|
if append:
|
||||||
|
self.store.append(self.get_list_from_unique_id(unique_id))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -753,7 +753,7 @@ class DelugeGTK(dbus.service.Object):
|
||||||
self.pref.set("show_share", self.share_column.get_visible())
|
self.pref.set("show_share", self.share_column.get_visible())
|
||||||
|
|
||||||
def close(self, widget, event):
|
def close(self, widget, event):
|
||||||
if self.pref.get("close_to_tray", bool):
|
if self.pref.get("close_to_tray", bool) and self.pref.get("enable_system_tray", bool):
|
||||||
self.window.hide()
|
self.window.hide()
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue