kuuko pushed a commit to branch master.

http://git.enlightenment.org/apps/epour.git/commit/?id=d704c5e13c29350ab96c0518f8bda9db439fbeee

commit d704c5e13c29350ab96c0518f8bda9db439fbeee
Author: Kai Huuhko <[email protected]>
Date:   Wed Aug 13 04:17:01 2014 +0300

    Add some font styles to ui strings
---
 epour/gui/__init__.py | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/epour/gui/__init__.py b/epour/gui/__init__.py
index 3380235..21478af 100644
--- a/epour/gui/__init__.py
+++ b/epour/gui/__init__.py
@@ -437,12 +437,11 @@ class TorrentClass(GenlistItemClass):
                 qp = "seeding"
 
             return "{:.0%} complete, ETA: {} " \
-                "(Down: {}/s Up: {}/s Peers: {} Queue pos: {})".format(
+                "(Down: {}/s Up: {}/s Queue pos: {})".format(
                     s.progress,
                     timedelta(seconds=self.get_eta(s)),
                     intrepr(s.download_payload_rate, precision=0),
                     intrepr(s.upload_payload_rate, precision=0),
-                    s.num_peers,
                     qp,
                 )
 
@@ -614,6 +613,8 @@ class TorrentTooltip(Table):
         ("Number of peers", None, "num_peers"),
         )
 
+    bold = "font_weight=Bold"
+
     def __init__(self, parent, h, s):
 
         Table.__init__(self, parent, size_hint_weight=EXPAND_BOTH)
@@ -621,12 +622,16 @@ class TorrentTooltip(Table):
         value_labels = []
 
         for i, (desc, conv, attr_name) in enumerate(self.items):
+            desc = "<font %s>%s</>" % (self.bold, desc)
             l1 = Label(self, text=desc)
             l1.show()
             self.pack(l1, 0, i, 1, 1)
             v = getattr(s, attr_name)
             if conv:
-                v = conv(v)
+                if conv == datetime.fromtimestamp and v == 0:
+                    v = "N/A"
+                else:
+                    v = conv(v)
             l2 = Label(self, text=str(v))
             value_labels.append(l2)
             l2.show()
@@ -646,7 +651,11 @@ class TorrentTooltip(Table):
             size=(WIDTH, HEIGHT), size_hint_align=FILL_BOTH
             )
 
-        l.text = "Pieces (scaled 1:%d)" % g.block_size
+        l.text = "".join((
+            "<font %s>" % (self.bold),
+            "Pieces (scaled 1:%d)" % (g.block_size),
+            "</>"
+            ))
 
         self.pack(g, 1, i, 1, 1)
         g.show()
@@ -662,7 +671,10 @@ class TorrentTooltip(Table):
             conv, attr_name = items[i][1:]
             v = getattr(s, attr_name)
             if conv:
-                v = conv(v)
+                if conv == datetime.fromtimestamp and v == 0:
+                    v = "N/A"
+                else:
+                    v = conv(v)
             l.text = str(v)
 
         num_pieces = s.num_pieces

-- 


Reply via email to