From 1d331478a431047bf59fc6249a93e127450bff24 Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 16 Sep 2014 17:07:12 -0700 Subject: single pref win: clean up vpn pref error displaying & don't show dummy gateways in case of error. --- src/leap/bitmask/gui/preferences_vpn_page.py | 31 ++++--------------------- src/leap/bitmask/gui/ui/preferences_vpn_page.ui | 20 ---------------- 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 = "%s" % (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 = "%s" % (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 @@ - - - New Item - - - - :/images/countries/us.png - - - - - - New Item - - - - :/images/countries/br.png - - - -- cgit v1.2.3