diff --git a/encryption/msgfmt.pyc b/encryption/msgfmt.pyc index 386e797dd..d22814856 100644 Binary files a/encryption/msgfmt.pyc and b/encryption/msgfmt.pyc differ diff --git a/src/deluge_core.cpp b/src/deluge_core.cpp index 13d93fc23..55be1b9fc 100644 --- a/src/deluge_core.cpp +++ b/src/deluge_core.cpp @@ -588,15 +588,6 @@ static PyObject *torrent_get_torrent_state(PyObject *self, PyObject *args) std::vector peers; t.handle.get_peer_info(peers); - long total_seeds = 0; - long total_peers = 0; - - for (unsigned long i = 0; i < peers.size(); i++) - if (peers[i].seed) - total_seeds++; - else - total_peers++; - return Py_BuildValue("{s:s,s:l,s:l,s:l,s:l,s:f,s:f,s:d,s:f,s:l,s:l,s:s,s:s,s:f,s:d,s:l,s:l,s:l,s:d,s:l,s:l,s:l,s:l,s:l,s:l,s:d,s:d,s:l,s:l}", "name", t.handle.get_torrent_info().name().c_str(), "num_files", t.handle.get_torrent_info().num_files(), @@ -620,8 +611,8 @@ static PyObject *torrent_get_torrent_state(PyObject *self, PyObject *args) "total_size", double(i.total_size()), "piece_length", long(i.piece_length()), "num_pieces", long(i.num_pieces()), - "total_seeds", total_seeds, - "total_peers", total_peers, + "total_seeds", s.num_complete, + "total_peers", s.num_incomplete, "is_paused", long(t.handle.is_paused()), "is_seed", long(t.handle.is_seed()), "total_wanted", double(s.total_wanted), @@ -773,11 +764,12 @@ static PyObject *torrent_pop_event(PyObject *self, PyObject *args) return NULL; if (handle_exists(handle)) - return Py_BuildValue("{s:i,s:i,s:s,s:s}", + return Py_BuildValue("{s:i,s:i,s:s,s:i,s:s}", "event_type", EVENT_TRACKER, "unique_ID", M_torrents->at(index).unique_ID, "tracker_status", "Announce succeeded", + "num_peers", long(dynamic_cast(popped_alert)->num_peers), "message", a->msg().c_str() ); else { Py_INCREF(Py_None); return Py_None; } diff --git a/src/interface.py b/src/interface.py index 9a3bd716e..63c734714 100644 --- a/src/interface.py +++ b/src/interface.py @@ -609,6 +609,9 @@ class DelugeGTK: ## Call via a timer to update the interface def update(self): + # Tell the core to handle messages (now, so we show their output on this tick) + self.manager.handle_events() + # Make sure that the interface still exists try: tab = self.wtree.get_widget("torrent_info").get_current_page()