[tor-commits] r24529: {arm} Corrections for minor issues spotted while checking for pari (in arm/trunk/src: interface interface/connections util)
Damian Johnson
atagar1 at gmail.com
Sat Apr 2 01:35:16 UTC 2011
Author: atagar
Date: 2011-04-02 01:35:15 +0000 (Sat, 02 Apr 2011)
New Revision: 24529
Modified:
arm/trunk/src/interface/connections/connEntry.py
arm/trunk/src/interface/connections/connPanel.py
arm/trunk/src/interface/controller.py
arm/trunk/src/util/uiTools.py
Log:
Corrections for minor issues spotted while checking for parity with the old connection panel.
Modified: arm/trunk/src/interface/connections/connEntry.py
===================================================================
--- arm/trunk/src/interface/connections/connEntry.py 2011-04-01 19:15:59 UTC (rev 24528)
+++ arm/trunk/src/interface/connections/connEntry.py 2011-04-02 01:35:15 UTC (rev 24529)
@@ -335,6 +335,10 @@
connection or exit traffic.
"""
+ # This is used to scrub private information from the interface. Relaying
+ # etiquette (and wiretaping laws) say these are bad things to look at so
+ # DON'T CHANGE THIS UNLESS YOU HAVE A DAMN GOOD REASON!
+
myType = self.getType()
if myType == Category.INBOUND:
Modified: arm/trunk/src/interface/connections/connPanel.py
===================================================================
--- arm/trunk/src/interface/connections/connPanel.py 2011-04-01 19:15:59 UTC (rev 24528)
+++ arm/trunk/src/interface/connections/connPanel.py 2011-04-02 01:35:15 UTC (rev 24529)
@@ -28,7 +28,7 @@
"""
def __init__(self, stdscr, config=None):
- panel.Panel.__init__(self, stdscr, "connections", 0)
+ panel.Panel.__init__(self, stdscr, "conn", 0)
threading.Thread.__init__(self)
self.setDaemon(True)
Modified: arm/trunk/src/interface/controller.py
===================================================================
--- arm/trunk/src/interface/controller.py 2011-04-01 19:15:59 UTC (rev 24528)
+++ arm/trunk/src/interface/controller.py 2011-04-02 01:35:15 UTC (rev 24529)
@@ -1003,12 +1003,16 @@
popup.addfstr(2, 41, "<b>page down</b>: scroll down a page")
popup.addfstr(3, 2, "<b>enter</b>: edit configuration option")
- popup.addfstr(3, 41, "<b>w</b>: save current configuration")
+ popup.addfstr(3, 41, "<b>d</b>: raw consensus descriptor")
listingType = panels["conn2"]._listingType.lower()
popup.addfstr(4, 2, "<b>l</b>: listed identity (<b>%s</b>)" % listingType)
popup.addfstr(4, 41, "<b>s</b>: sort ordering")
+
+ resolverUtil = connections.getResolver("tor").overwriteResolver
+ if resolverUtil == None: resolverUtil = "auto"
+ popup.addfstr(5, 2, "<b>u</b>: resolving utility (<b>%s</b>)" % resolverUtil)
elif page == 3:
popup.addfstr(1, 2, "<b>up arrow</b>: scroll up a line")
popup.addfstr(1, 41, "<b>down arrow</b>: scroll down a line")
@@ -1512,7 +1516,7 @@
hostnames.setPaused(True)
panels["conn"].sortConnections()
- elif page == 1 and (key == ord('u') or key == ord('U')):
+ elif page in (1, 2) and (key == ord('u') or key == ord('U')):
# provides menu to pick identification resolving utility
options = ["auto"] + connections.Resolver.values()
Modified: arm/trunk/src/util/uiTools.py
===================================================================
--- arm/trunk/src/util/uiTools.py 2011-04-01 19:15:59 UTC (rev 24528)
+++ arm/trunk/src/util/uiTools.py 2011-04-02 01:35:15 UTC (rev 24529)
@@ -503,10 +503,16 @@
if self.isCursorEnabled:
self.getCursorSelection(content) # resets the cursor location
+ # makes sure the cursor is visible
if self.cursorLoc < self.scrollLoc:
self.scrollLoc = self.cursorLoc
elif self.cursorLoc > self.scrollLoc + pageHeight - 1:
self.scrollLoc = self.cursorLoc - pageHeight + 1
+
+ # checks if the bottom would run off the content (this could be the
+ # case when the content's size is dynamic and entries are removed)
+ if len(content) > pageHeight:
+ self.scrollLoc = min(self.scrollLoc, len(content) - pageHeight)
return self.scrollLoc
More information about the tor-commits
mailing list