From 57aa4d51e37228333e56e98d9af3bfe7b278e2d1 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 5 Jun 2014 16:38:56 -0500 Subject: add icons for the vpn exit nodes --- src/leap/bitmask/gui/eip_status.py | 24 ++++++++++++++++++++++++ src/leap/bitmask/gui/mainwindow.py | 1 + src/leap/bitmask/gui/ui/eip_status.ui | 21 ++++++++++++++------- 3 files changed, 39 insertions(+), 7 deletions(-) (limited to 'src/leap/bitmask/gui') diff --git a/src/leap/bitmask/gui/eip_status.py b/src/leap/bitmask/gui/eip_status.py index 280ce79e..69ef2616 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 @@ -416,6 +417,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() @@ -582,6 +584,25 @@ class EIPStatusWidget(QtGui.QWidget): self.tr("Routing traffic through: {0}").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. @@ -704,3 +725,6 @@ class EIPStatusWidget(QtGui.QWidget): """ self.set_eip_status("", error=error) self.set_eip_status_icon("error") + +import eipstatus_rc +assert(eipstatus_rc) diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index a3b81fde..c22c8892 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -1465,6 +1465,7 @@ class MainWindow(QtGui.QMainWindow): self._already_started_eip = True # check for connectivity + # we might want to leave a little time here... self._check_name_resolution(domain) def _check_name_resolution(self, domain): diff --git a/src/leap/bitmask/gui/ui/eip_status.ui b/src/leap/bitmask/gui/ui/eip_status.ui index 01d6b371..ee24ca71 100644 --- a/src/leap/bitmask/gui/ui/eip_status.ui +++ b/src/leap/bitmask/gui/ui/eip_status.ui @@ -28,7 +28,7 @@ 0 - + Turn On @@ -51,7 +51,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -105,7 +105,7 @@ - + Qt::Horizontal @@ -118,7 +118,7 @@ - + @@ -239,13 +239,20 @@ - + Allow unencrypted traffic + + + + + + + -- cgit v1.2.3