summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui/eip_status.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/gui/eip_status.py')
-rw-r--r--src/leap/bitmask/gui/eip_status.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/leap/bitmask/gui/eip_status.py b/src/leap/bitmask/gui/eip_status.py
index dcd7ef42..8b9f2d44 100644
--- a/src/leap/bitmask/gui/eip_status.py
+++ b/src/leap/bitmask/gui/eip_status.py
@@ -24,6 +24,7 @@ from functools import partial
from PySide import QtCore, QtGui
+from leap.bitmask.config import flags
from leap.bitmask.services import get_service_display_name, EIP_SERVICE
from leap.bitmask.platform_init import IS_LINUX
from leap.bitmask.util.averages import RateMovingAverage
@@ -420,6 +421,7 @@ class EIPStatusWidget(QtGui.QWidget):
Sets the state of the widget to how it should look after EIP
has stopped
"""
+ self.set_country_code("")
self._reset_traffic_rates()
self.ui.eip_bandwidth.hide()
@@ -585,6 +587,25 @@ class EIPStatusWidget(QtGui.QWidget):
self.tr("Routing traffic through: <b>{0}</b>").format(
provider))
+ ccode = flags.CURRENT_VPN_COUNTRY
+ if ccode is not None:
+ self.set_country_code(ccode)
+
+ def set_country_code(self, code):
+ """
+ Set the pixmap of the given country code
+
+ :param code: the country code
+ :type code: str
+ """
+ if code is not None and len(code) == 2:
+ img = ":/images/countries/%s.png" % (code.lower(),)
+ else:
+ img = None
+ cc = self.ui.lblGatewayCountryCode
+ cc.setPixmap(QtGui.QPixmap(img))
+ cc.setToolTip(code)
+
def aborted(self):
"""
Notify the state machine that EIP was aborted for some reason.
@@ -707,3 +728,6 @@ class EIPStatusWidget(QtGui.QWidget):
"""
self.set_eip_status("", error=error)
self.set_eip_status_icon("error")
+
+import eipstatus_rc
+assert(eipstatus_rc)