mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-12 04:24:27 +00:00
split long lines in torrent info popup
This commit is contained in:
parent
11d8332e43
commit
ccc047848a
@ -317,7 +317,16 @@ class AllTorrents(BaseMode):
|
|||||||
else:
|
else:
|
||||||
info = state[f[2][0]]
|
info = state[f[2][0]]
|
||||||
|
|
||||||
self.popup.add_line("{!info!}%s: {!input!}%s"%(f[0],info))
|
nl = len(f[0])+4
|
||||||
|
if (nl+len(info))>self.popup.width:
|
||||||
|
self.popup.add_line("{!info!}%s: {!input!}%s"%(f[0],info[:(self.popup.width - nl)]))
|
||||||
|
info = info[(self.popup.width - nl):]
|
||||||
|
n = self.popup.width-3
|
||||||
|
chunks = [info[i:i+n] for i in xrange(0, len(info), n)]
|
||||||
|
for c in chunks:
|
||||||
|
self.popup.add_line(" %s"%c)
|
||||||
|
else:
|
||||||
|
self.popup.add_line("{!info!}%s: {!input!}%s"%(f[0],info))
|
||||||
self.refresh()
|
self.refresh()
|
||||||
else:
|
else:
|
||||||
self.updater.set_torrent_to_update(None,None)
|
self.updater.set_torrent_to_update(None,None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user