Show the percentage next to the progress bar in the details window

This commit is contained in:
Artem Glebov 2013-03-09 14:02:59 +03:00
parent 50e9e2f286
commit 25d418d9f5
2 changed files with 11 additions and 2 deletions

View file

@ -210,10 +210,11 @@ class TorrentInfoGUI(xbmcgui.WindowXMLDialog):
list = self.getControl(220) list = self.getControl(220)
labelName = self.getControl(1) labelName = self.getControl(1)
labelStatus = self.getControl(2) labelStatus = self.getControl(2)
labelProgress = self.getControl(11)
torrent = self.transmission.info()[self.torrent_id] torrent = self.transmission.info()[self.torrent_id]
files = self.transmission.get_files(self.torrent_id)[self.torrent_id] files = self.transmission.get_files(self.torrent_id)[self.torrent_id]
statusline = "[%(status)s] %(down)s down (%(pct).2f%%), %(up)s up (Ratio: %(ratio).2f)" % \ statusline = "[%(status)s] %(down)s down, %(up)s up (Ratio: %(ratio).2f)" % \
{'down': Bytes.format(torrent.downloadedEver), 'pct': torrent.progress, \ {'down': Bytes.format(torrent.downloadedEver), 'pct': torrent.progress, \
'up': Bytes.format(torrent.uploadedEver), 'ratio': torrent.ratio, \ 'up': Bytes.format(torrent.uploadedEver), 'ratio': torrent.ratio, \
'status': torrent.status} 'status': torrent.status}
@ -223,6 +224,7 @@ class TorrentInfoGUI(xbmcgui.WindowXMLDialog):
labelName.setLabel(torrent.name) labelName.setLabel(torrent.name)
labelStatus.setLabel(statusline) labelStatus.setLabel(statusline)
labelProgress.setLabel('%3d%%' % (torrent.progress))
pbar.setPercent(torrent.progress) pbar.setPercent(torrent.progress)
for i, file in files.iteritems(): for i, file in files.iteritems():

View file

@ -63,10 +63,17 @@
<description>Torrent progress</description> <description>Torrent progress</description>
<posx>20</posx> <posx>20</posx>
<posy>70</posy> <posy>70</posy>
<width>890</width> <width>830</width>
<height>30</height> <height>30</height>
<visible>true</visible> <visible>true</visible>
</control> </control>
<control type="label" id="11">
<posx>855</posx>
<posy>69</posy>
<width>70</width>
<height>30</height>
<label></label>
</control>
</control> </control>
<control type="list" id="220"> <control type="list" id="220">
<description>File list</description> <description>File list</description>