[tor-commits] [arm/master] Display circuit lines appropriately.
atagar at torproject.org
atagar at torproject.org
Fri Jul 15 01:07:02 UTC 2011
commit d3ebb46af66d04be2f78905e8ea6d18c07ce6b52
Author: Kamran Riaz Khan <krkhan at inspirated.com>
Date: Mon Jul 11 01:04:11 2011 +0500
Display circuit lines appropriately.
---
src/gui/connections/circEntry.py | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/gui/connections/circEntry.py b/src/gui/connections/circEntry.py
index b3aa29a..11876f8 100644
--- a/src/gui/connections/circEntry.py
+++ b/src/gui/connections/circEntry.py
@@ -4,37 +4,39 @@ Connection panel entries for client circuits.
import time
-from cli.connections import circEntry
-from util import gtkTools
+from cli.connections import circEntry, entries
+from gui.connections import connEntry
+from util import gtkTools, uiTools
class CircEntry(circEntry.CircEntry):
@classmethod
def convertToGui(self, instance):
instance.__class__ = self
-class CircHeaderLine(circEntry.CircHeaderLine):
+class CircHeaderLine(circEntry.CircHeaderLine, connEntry.ConnectionLine):
@classmethod
def convertToGui(self, instance):
instance.__class__ = self
def getListingRow(self, listingType):
- local = "%s:%s" % (self.local.ipAddr, self.local.port)
- foreign = "%s:%s" % (self.foreign.ipAddr, self.foreign.port)
- timeLabel = "%d s" % (time.time() - self.startTime)
+ row = connEntry.ConnectionLine.getListingRow(self, listingType)
theme = gtkTools.Theme()
+ return row[:-1] + (theme.colors['active'],)
- return (local, foreign, timeLabel, self.baseType, theme.colors['active'])
-
-class CircLine(circEntry.CircLine):
+class CircLine(circEntry.CircLine, connEntry.ConnectionLine):
@classmethod
def convertToGui(self, instance):
instance.__class__ = self
def getListingRow(self, listingType):
- local = "%s:%s" % (self.local.ipAddr, self.local.port)
- foreign = "%s:%s" % (self.foreign.ipAddr, self.foreign.port)
- timeLabel = "%d s" % (time.time() - self.startTime)
+ dst, etc = "", ""
+
+ if listingType == entries.ListingType.IP_ADDRESS:
+ dst = self.getDestinationLabel(100, includeLocale=True)
+ etc = self.foreign.getNickname()
+
+ timeLabel = uiTools.getTimeLabel(time.time() - self.startTime)
theme = gtkTools.Theme()
- return (local, foreign, timeLabel, self.baseType, theme.colors['normal'])
+ return (dst, etc, timeLabel, self.getType(), theme.colors['insensitive'])
More information about the tor-commits
mailing list