Change gui to use add_torrent_alert instead of torrent_added_alert

This may fix a bug that I was unable to reproduce. Anyway, should be more robust.
feature/create-torrent
Kai Huuhko 7 years ago
parent 9a07cce43a
commit 9037ecddc4
  1. 12
      epour/gui/__init__.py

@ -172,20 +172,22 @@ class MainInterface(object):
topbox.stack_above(mbox)
topbox.show()
def torrent_added_cb(a):
def _add_torrent_cb(a):
e = a.error
if e.value() > 0:
return
h = a.handle
info_hash = h.info_hash()
log.debug("Torrent added: %s" % str(info_hash))
torrent = session.torrents[str(info_hash)]
self.add_torrent_item(torrent)
def torrent_removed_cb(a):
def _torrent_removed_cb(a):
self.remove_torrent_item(str(a.info_hash))
session.alert_manager.callback_add(
"torrent_added_alert", torrent_added_cb)
"add_torrent_alert", _add_torrent_cb)
session.alert_manager.callback_add(
"torrent_removed_alert", torrent_removed_cb)
"torrent_removed_alert", _torrent_removed_cb)
def torrent_paused_resumed_cb(a):
h = a.handle

Loading…
Cancel
Save