summaryrefslogtreecommitdiff
path: root/src/leap/gui
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2013-07-25 11:41:15 +0200
committerKali Kaneko <kali@leap.se>2013-07-25 11:41:15 +0200
commitdb18ad67d4149b5f5a6f68db1f52abd91f6f9373 (patch)
treeee1c14a0fa56f00ac0509f8ff4b143879681d7bb /src/leap/gui
parentae88e706d9d43136a9d851b391efd3922d1a8667 (diff)
reset rates when disconnecting
Diffstat (limited to 'src/leap/gui')
-rw-r--r--src/leap/gui/statuspanel.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/leap/gui/statuspanel.py b/src/leap/gui/statuspanel.py
index ac0f5162..3e0377f9 100644
--- a/src/leap/gui/statuspanel.py
+++ b/src/leap/gui/statuspanel.py
@@ -126,6 +126,16 @@ class StatusPanelWidget(QtGui.QWidget):
self._up_rate = RateMovingAverage()
self._down_rate = RateMovingAverage()
+ def _reset_traffic_rates(self):
+ """
+ Resets up and download rates, and cleans up the labels.
+ """
+ self._up_rate.reset()
+ self._down_rate.reset()
+ zeroed = {VPNManager.TUNTAP_WRITE_KEY: 0,
+ VPNManager.TUNTAP_READ_KEY: 0}
+ self.update_vpn_status(zeroed)
+
def _update_traffic_rates(self, up, down):
"""
Updates up and download rates.
@@ -286,6 +296,7 @@ class StatusPanelWidget(QtGui.QWidget):
Sets the state of the widget to how it should look after EIP
has stopped
"""
+ self._reset_traffic_rates()
self.ui.btnEipStartStop.setText(self.tr("Turn ON"))
self.ui.btnEipStartStop.disconnect(self)
self.ui.btnEipStartStop.clicked.connect(