summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-09-16 17:07:12 -0700
committerelijah <elijah@riseup.net>2014-09-19 14:23:14 -0700
commit1d331478a431047bf59fc6249a93e127450bff24 (patch)
treebb874a80e2a574d5663d439c33123ce04742610c /src/leap
parentc29b1dd9345e01e761b9891728ecd0b8d964a02d (diff)
single pref win: clean up vpn pref error displaying & don't show dummy gateways in case of error.
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/bitmask/gui/preferences_vpn_page.py31
-rw-r--r--src/leap/bitmask/gui/ui/preferences_vpn_page.ui20
2 files changed, 5 insertions, 46 deletions
diff --git a/src/leap/bitmask/gui/preferences_vpn_page.py b/src/leap/bitmask/gui/preferences_vpn_page.py
index e3417f89..f3fa1ecc 100644
--- a/src/leap/bitmask/gui/preferences_vpn_page.py
+++ b/src/leap/bitmask/gui/preferences_vpn_page.py
@@ -21,9 +21,9 @@ from PySide import QtCore, QtGui
from ui_preferences_vpn_page import Ui_PreferencesVpnPage
from leap.bitmask.config.leapsettings import LeapSettings
+from leap.bitmask.gui.flashable import Flashable
-
-class PreferencesVpnPage(QtGui.QWidget):
+class PreferencesVpnPage(QtGui.QWidget, Flashable):
"""
Page in the preferences window that shows VPN settings
@@ -50,6 +50,7 @@ class PreferencesVpnPage(QtGui.QWidget):
self.ui = Ui_PreferencesVpnPage()
self.ui.setupUi(self)
self.ui.flash_label.setVisible(False)
+ self.hide_flash()
# Connections
self.ui.gateways_list.clicked.connect(self._save_selected_gateway)
@@ -62,28 +63,6 @@ class PreferencesVpnPage(QtGui.QWidget):
# Trigger update
self.app.backend.eip_get_gateways_list(domain=self.account.domain)
- def _flash_error(self, message):
- """
- Sets string for the flash message.
-
- :param message: the text to be displayed
- :type message: str
- """
- message = "<font color='red'><b>%s</b></font>" % (message,)
- self.ui.flash_label.setVisible(True)
- self.ui.flash_label.setText(message)
-
- # def _flash_success(self, message):
- # """
- # Sets string for the flash message.
- #
- # :param message: the text to be displayed
- # :type message: str
- # """
- # message = "<font color='green'><b>%s</b></font>" % (message,)
- # self.ui.flash_label.setVisible(True)
- # self.ui.flash_label.setText(message)
-
@QtCore.Slot(str)
def _save_selected_gateway(self, index):
"""
@@ -145,7 +124,7 @@ class PreferencesVpnPage(QtGui.QWidget):
An error has occurred retrieving the gateway list
so we inform the user.
"""
- self._flash_error(
+ self.flash_error(
self.tr("Error loading configuration file."))
self.ui.gateways_list.setEnabled(False)
@@ -158,6 +137,6 @@ class PreferencesVpnPage(QtGui.QWidget):
The requested provider in not initialized yet, so we give the user an
error msg.
"""
- self._flash_error(
+ self.flash_error(
self.tr("This is an uninitialized provider, please log in first."))
self.ui.gateways_list.setEnabled(False)
diff --git a/src/leap/bitmask/gui/ui/preferences_vpn_page.ui b/src/leap/bitmask/gui/ui/preferences_vpn_page.ui
index 85a0dc60..1bf3a060 100644
--- a/src/leap/bitmask/gui/ui/preferences_vpn_page.ui
+++ b/src/leap/bitmask/gui/ui/preferences_vpn_page.ui
@@ -36,26 +36,6 @@
</item>
<item>
<widget class="QListWidget" name="gateways_list">
- <item>
- <property name="text">
- <string>New Item</string>
- </property>
- <property name="icon">
- <iconset>
- <normalon>:/images/countries/us.png</normalon>
- </iconset>
- </property>
- </item>
- <item>
- <property name="text">
- <string>New Item</string>
- </property>
- <property name="icon">
- <iconset>
- <normalon>:/images/countries/br.png</normalon>
- </iconset>
- </property>
- </item>
</widget>
</item>
<item>