summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-06-06 13:07:33 -0300
committerTomás Touceda <chiiph@leap.se>2014-06-06 13:07:33 -0300
commit889e76dd32a4699239fe719d414afee2dbe199bc (patch)
tree6535b3383f66056a2a99f2ef83a897ea2e9da63a /src/leap/bitmask/gui
parent1665242fc75bc34ded0afcd36fe22e4dce2efe08 (diff)
parent57aa4d51e37228333e56e98d9af3bfe7b278e2d1 (diff)
Merge remote-tracking branch 'refs/remotes/kali/feature/vpn_exit_icon' into develop
Diffstat (limited to 'src/leap/bitmask/gui')
-rw-r--r--src/leap/bitmask/gui/eip_status.py24
-rw-r--r--src/leap/bitmask/gui/mainwindow.py1
-rw-r--r--src/leap/bitmask/gui/ui/eip_status.ui21
3 files changed, 39 insertions, 7 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)
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index c61b7dc9..3ef994b1 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 892f0f00..7216bb0a 100644
--- a/src/leap/bitmask/gui/ui/eip_status.ui
+++ b/src/leap/bitmask/gui/ui/eip_status.ui
@@ -28,7 +28,7 @@
<property name="verticalSpacing">
<number>0</number>
</property>
- <item row="0" column="3">
+ <item row="0" column="4">
<widget class="QPushButton" name="btnEipStartStop">
<property name="text">
<string>Turn On</string>
@@ -51,7 +51,7 @@
</property>
</widget>
</item>
- <item row="3" column="1">
+ <item row="3" column="2">
<widget class="QLabel" name="lblEIPStatus">
<property name="maximumSize">
<size>
@@ -70,7 +70,7 @@
</property>
</widget>
</item>
- <item row="0" column="1">
+ <item row="0" column="2">
<widget class="QLabel" name="lblEIPMessage">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
@@ -86,7 +86,7 @@
</property>
</widget>
</item>
- <item row="0" column="4">
+ <item row="0" column="5">
<widget class="QLabel" name="lblVPNStatusIcon">
<property name="maximumSize">
<size>
@@ -105,7 +105,7 @@
</property>
</widget>
</item>
- <item row="1" column="1">
+ <item row="1" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -118,7 +118,7 @@
</property>
</spacer>
</item>
- <item row="2" column="1" colspan="4">
+ <item row="2" column="2" colspan="4">
<widget class="QWidget" name="eip_bandwidth" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
@@ -239,13 +239,20 @@
</layout>
</widget>
</item>
- <item row="0" column="2">
+ <item row="0" column="3">
<widget class="QPushButton" name="btnFwDown">
<property name="text">
<string>Turn Off</string>
</property>
</widget>
</item>
+ <item row="0" column="1">
+ <widget class="QLabel" name="lblGatewayCountryCode">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
</layout>