summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui/preferences_vpn_page.py
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-04-18 23:44:12 -0700
committerKali Kaneko <kali@leap.se>2016-04-19 12:00:23 -0400
commit229f803235ae9b9a71313d11071c7a0fbea0a681 (patch)
treefada7035628c90757b6b0cd7cf34182d1b6269fc /src/leap/bitmask/gui/preferences_vpn_page.py
parentc6db8a1f9ba7b6fc9dd117c0a699f4dfd339a375 (diff)
[feature] add email panel to preferences
Diffstat (limited to 'src/leap/bitmask/gui/preferences_vpn_page.py')
-rw-r--r--src/leap/bitmask/gui/preferences_vpn_page.py31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/leap/bitmask/gui/preferences_vpn_page.py b/src/leap/bitmask/gui/preferences_vpn_page.py
index 5b5c9604..fc15340f 100644
--- a/src/leap/bitmask/gui/preferences_vpn_page.py
+++ b/src/leap/bitmask/gui/preferences_vpn_page.py
@@ -22,9 +22,9 @@ from leap.bitmask.gui.ui_preferences_vpn_page import Ui_PreferencesVpnPage
from leap.bitmask.config.leapsettings import LeapSettings
from leap.bitmask.gui.flashable import Flashable
+from leap.bitmask.gui.preferences_page import PreferencesPage
-
-class PreferencesVpnPage(QtGui.QWidget, Flashable):
+class PreferencesVpnPage(PreferencesPage, Flashable):
"""
Page in the preferences window that shows VPN settings
@@ -41,19 +41,24 @@ class PreferencesVpnPage(QtGui.QWidget, Flashable):
:param app: shared App instance
:type app: App
"""
- QtGui.QWidget.__init__(self, parent)
+ PreferencesPage.__init__(self, parent, account, app)
self.AUTOMATIC_GATEWAY_LABEL = self.tr("Automatic")
- self.account = account
- self.app = app
-
# Load UI
self.ui = Ui_PreferencesVpnPage()
self.ui.setupUi(self)
self.ui.flash_label.setVisible(False)
self.hide_flash()
- # Connections
+ self.setup_connections()
+
+ # Trigger update
+ self.app.backend.eip_get_gateways_list(domain=self.account.domain)
+
+ def setup_connections(self):
+ """
+ connect signals
+ """
self.ui.gateways_list.clicked.connect(self._save_selected_gateway)
sig = self.app.signaler
sig.eip_get_gateways_list.connect(self._update_gateways_list)
@@ -61,8 +66,16 @@ class PreferencesVpnPage(QtGui.QWidget, Flashable):
sig.eip_uninitialized_provider.connect(
self._gateways_list_uninitialized)
- # Trigger update
- self.app.backend.eip_get_gateways_list(domain=self.account.domain)
+ def teardown_connections(self):
+ """
+ disconnect signals
+ """
+ self.ui.gateways_list.clicked.disconnect(self._save_selected_gateway)
+ sig = self.app.signaler
+ sig.eip_get_gateways_list.disconnect(self._update_gateways_list)
+ sig.eip_get_gateways_list_error.disconnect(self._gateways_list_error)
+ sig.eip_uninitialized_provider.disconnect(
+ self._gateways_list_uninitialized)
def _save_selected_gateway(self, index):
"""