Add upload slots to session status

This commit is contained in:
Kai Huuhko 2014-07-19 23:23:02 +03:00
parent b6d117af84
commit 9e0dddcb9f
1 changed files with 14 additions and 3 deletions

View File

@ -343,7 +343,7 @@ class SessionStatus(Table):
self.pack(u_l, 1, 2, 1, 1)
u_l.show()
peer_t = Label(parent, text="Peers")
peer_t = Label(parent, text="Peer connections")
self.pack(peer_t, 0, 3, 1, 1)
peer_t.show()
@ -351,13 +351,22 @@ class SessionStatus(Table):
self.pack(peer_l, 1, 3, 1, 1)
peer_l.show()
uploads_t = Label(parent, text="Upload slots")
self.pack(uploads_t, 0, 4, 1, 1)
uploads_t.show()
t = "%s/%s" % (str(s.num_unchoked), str(s.allowed_upload_slots))
uploads_l = self.uploads_l = Label(parent, text=t)
self.pack(uploads_l, 1, 4, 1, 1)
uploads_l.show()
listen_t = Label(parent, text="Listening")
self.pack(listen_t, 0, 4, 1, 1)
self.pack(listen_t, 0, 5, 1, 1)
listen_t.show()
listen_l = self.listen_l = Label(
parent, text=str(session.is_listening()))
self.pack(listen_l, 1, 4, 1, 1)
self.pack(listen_l, 1, 5, 1, 1)
listen_l.show()
self.show()
@ -370,6 +379,8 @@ class SessionStatus(Table):
self.d_l.text = "{}/s".format(intrepr(s.payload_download_rate))
self.u_l.text = "{}/s".format(intrepr(s.payload_upload_rate))
self.peer_l.text = str(s.num_peers)
t = "%s/%s" % (str(s.num_unchoked), str(s.allowed_upload_slots))
self.uploads_l.text = t
self.listen_l.text = str(self.session.is_listening())
if self.session.is_paused():
icon = "player_pause"