Module: deluge
Branch: master
Commit: ccc047848adda4b4c8aafb86391e5525f690b6ac

Author: Nick Lanham <[email protected]>
Date:   Mon Feb 28 20:22:49 2011 +0100

split long lines in torrent info popup

---

 deluge/ui/console/modes/alltorrents.py |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/deluge/ui/console/modes/alltorrents.py 
b/deluge/ui/console/modes/alltorrents.py
index 65ff2a4..352a8e5 100644
--- a/deluge/ui/console/modes/alltorrents.py
+++ b/deluge/ui/console/modes/alltorrents.py
@@ -317,7 +317,16 @@ class AllTorrents(BaseMode):
                 else:
                     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()
         else:
             self.updater.set_torrent_to_update(None,None)

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to