display if paused in status menu

This commit is contained in:
Zach Tibbitts 2007-03-06 20:57:49 +00:00
parent f537c9badf
commit 9028b6cb8d
1 changed files with 15 additions and 2 deletions

View File

@ -582,6 +582,19 @@ class DelugeGTK:
self.manager.set_pref("max_connections", self.config.get("max_number_downloads", int, default=-1))
self.manager.set_pref("auto_seed_ratio", auto_seed_ratio)
# '%s %d%%'%(deluge.STATE_MESSAGES[state['state']], int(state['progress'] * 100))
def get_message_from_state(self, torrent_state):
state = torrent_state['state']
is_paused = torrent_state['is_paused']
progress = torrent_state['progress']
progress = '%d%%'%int(progress * 100)
if is_paused:
message = 'Paused %s'%progress
else:
message = deluge.STATE_MESSAGES[state]
if state in (1, 3, 4, 7):
message = '%s %s'%(message, progress)
return message
# UID, Q#, Name, Size, Progress, Message, Seeders, Peers, DL, UL, ETA, Share
def get_list_from_unique_id(self, unique_id):
@ -591,7 +604,7 @@ class DelugeGTK:
name = state['name']
size = long(state['total_size'])
progress = float(state['progress'] * 100)
message = '%s %d%%'%(deluge.STATE_MESSAGES[state['state']], int(state['progress'] * 100))
message = self.get_message_from_state(state)
seeds = int(state['num_seeds'])
seeds_t = int(state['total_seeds'])
peers = int(state['num_peers'])