mirror of
https://github.com/correl/Transmission-XBMC.git
synced 2025-03-20 09:19:25 -09:00
Merge branch 'pr/13'
Conflicts: resources/lib/gui.py
This commit is contained in:
commit
1ae11d5329
2 changed files with 6 additions and 6 deletions
resources
|
@ -21,6 +21,10 @@ CANCEL_DIALOG = EXIT_SCRIPT + ( 216, 257, 61448, )
|
||||||
|
|
||||||
UPDATE_INTERVAL = 1.0
|
UPDATE_INTERVAL = 1.0
|
||||||
|
|
||||||
|
STATUS_ICONS = {'stopped': 'pause.png',
|
||||||
|
'seeding': 'ok.png',
|
||||||
|
'downloading': 'down.png'}
|
||||||
|
|
||||||
class TransmissionGUI(xbmcgui.WindowXMLDialog):
|
class TransmissionGUI(xbmcgui.WindowXMLDialog):
|
||||||
def __init__(self, strXMLname, strFallbackPath, strDefaultName, bforeFallback=0):
|
def __init__(self, strXMLname, strFallbackPath, strDefaultName, bforeFallback=0):
|
||||||
self.list = {}
|
self.list = {}
|
||||||
|
@ -69,7 +73,7 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog):
|
||||||
self.timer.start()
|
self.timer.start()
|
||||||
def updateTorrents(self):
|
def updateTorrents(self):
|
||||||
list = self.getControl(120)
|
list = self.getControl(120)
|
||||||
torrents = self.transmission.info()
|
self.torrents = self.transmission.info()
|
||||||
for i, torrent in torrents.iteritems():
|
for i, torrent in torrents.iteritems():
|
||||||
statusline = "[%(status)s] %(down)s down (%(pct).2f%%), %(up)s up (Ratio: %(ratio).2f)" % \
|
statusline = "[%(status)s] %(down)s down (%(pct).2f%%), %(up)s up (Ratio: %(ratio).2f)" % \
|
||||||
{'down': Bytes.format(torrent.downloadedEver), 'pct': torrent.progress, \
|
{'down': Bytes.format(torrent.downloadedEver), 'pct': torrent.progress, \
|
||||||
|
@ -83,13 +87,9 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog):
|
||||||
else:
|
else:
|
||||||
# Update existing list item
|
# Update existing list item
|
||||||
l = self.list[i]
|
l = self.list[i]
|
||||||
self.torrents = torrents
|
|
||||||
statusicons = {'stopped': 'pause.png',
|
|
||||||
'seeding': 'ok.png',
|
|
||||||
'downloading': 'down.png'}
|
|
||||||
l.setLabel(torrent.name)
|
l.setLabel(torrent.name)
|
||||||
l.setLabel2(statusline)
|
l.setLabel2(statusline)
|
||||||
l.setProperty('TorrentStatusIcon', statusicons[torrent.status])
|
l.setProperty('TorrentStatusIcon', STATUS_ICONS.get(torrent.status, 'pending.png'))
|
||||||
l.setProperty('TorrentID', str(i))
|
l.setProperty('TorrentID', str(i))
|
||||||
l.setProperty('TorrentProgress', "%3d%%" % torrent.progress)
|
l.setProperty('TorrentProgress', "%3d%%" % torrent.progress)
|
||||||
l.setInfo('torrent', torrent.fields)
|
l.setInfo('torrent', torrent.fields)
|
||||||
|
|
BIN
resources/skins/Default/media/icons/pending.png
Normal file
BIN
resources/skins/Default/media/icons/pending.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 4.6 KiB |
Loading…
Add table
Reference in a new issue