[tor-commits] [arm/master] fix: graph panel can overlap after reconnect

atagar at torproject.org atagar at torproject.org
Tue Jul 12 21:36:33 UTC 2011


commit 4793494447312e0ef1bbb33c2d82948362b129b9
Author: Damian Johnson <atagar at torproject.org>
Date:   Tue Jul 12 09:40:48 2011 -0700

    fix: graph panel can overlap after reconnect
    
    If having accounting stats changes from one tor instance to the next then the
    graph panel's size can change, causing overlap with the log panel for a few
    seconds.
---
 src/cli/graphing/bandwidthStats.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/cli/graphing/bandwidthStats.py b/src/cli/graphing/bandwidthStats.py
index 642790d..f1891f9 100644
--- a/src/cli/graphing/bandwidthStats.py
+++ b/src/cli/graphing/bandwidthStats.py
@@ -6,6 +6,8 @@ stats if they're set.
 import time
 import curses
 
+import cli.controller
+
 from cli.graphing import graphPanel
 from util import log, sysTools, torTools, uiTools
 
@@ -87,7 +89,13 @@ class BandwidthStats(graphPanel.GraphStats):
     self.new_desc_event(None) # updates title params
     
     if eventType in (torTools.State.INIT, torTools.State.RESET) and self._config["features.graph.bw.accounting.show"]:
-      self.isAccounting = conn.getInfo('accounting/enabled') == '1'
+      isAccountingEnabled = conn.getInfo('accounting/enabled') == '1'
+      
+      if isAccountingEnabled != self.isAccounting:
+        self.isAccounting = isAccountingEnabled
+        
+        # redraws the whole screen since our height changed
+        cli.controller.getController().requestRedraw(True)
     
     # redraws to reflect changes (this especially noticeable when we have
     # accounting and shut down since it then gives notice of the shutdown)





More information about the tor-commits mailing list