diff options
author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-08-15 15:25:43 -0300 |
---|---|---|
committer | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-08-23 11:25:02 -0300 |
commit | 7001408dd893b5e8302c4ff8a0dfe63f50e283fa (patch) | |
tree | a7f32424306e95c5f0d6d2a88846cdcb2bb1526a /src/leap/bitmask/gui/mainwindow.py | |
parent | ef5a03b68c53fef55447d30744c7c1a1086b20fc (diff) |
Add preferences panel.
Diffstat (limited to 'src/leap/bitmask/gui/mainwindow.py')
-rw-r--r-- | src/leap/bitmask/gui/mainwindow.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index 17275983..5447d993 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -33,6 +33,7 @@ from leap.bitmask.config.leapsettings import LeapSettings from leap.bitmask.config.providerconfig import ProviderConfig from leap.bitmask.crypto.srpauth import SRPAuth from leap.bitmask.gui.loggerwindow import LoggerWindow +from leap.bitmask.gui.preferenceswindow import PreferencesWindow from leap.bitmask.gui.wizard import Wizard from leap.bitmask.gui.login import LoginWidget from leap.bitmask.gui.statuspanel import StatusPanelWidget @@ -162,6 +163,7 @@ class MainWindow(QtGui.QMainWindow): self._launch_wizard) self.ui.btnShowLog.clicked.connect(self._show_logger_window) + self.ui.btnPreferences.clicked.connect(self._show_preferences) self._status_panel = StatusPanelWidget( self.ui.stackedWidget.widget(self.EIP_STATUS_INDEX)) @@ -292,6 +294,7 @@ class MainWindow(QtGui.QMainWindow): self._wizard_firstrun = False self._logger_window = None + self._preferences_window = None self._bypass_checks = bypass_checks @@ -403,6 +406,21 @@ class MainWindow(QtGui.QMainWindow): self._logger_window.finished.connect(self._uncheck_logger_button) + def _show_preferences(self): + """ + SLOT + TRIGGERS: + self.ui.action_show_preferences.triggered + self.ui.btnPreferences.clicked + + Displays the preferences window. + """ + preferences = self._preferences_window + if preferences is None: + preferences = PreferencesWindow(self, self._srp_auth) + + preferences.show() + def _uncheck_logger_button(self): """ SLOT @@ -925,6 +943,7 @@ class MainWindow(QtGui.QMainWindow): # panel QtCore.QTimer.singleShot(1000, self._switch_to_status) self._login_defer = None + self.ui.btnPreferences.setEnabled(True) else: self._login_widget.set_enabled(True) @@ -1399,6 +1418,7 @@ class MainWindow(QtGui.QMainWindow): self._login_widget.set_password("") self._login_widget.set_enabled(True) self._login_widget.set_status("") + self.ui.btnPreferences.setEnabled(False) def _intermediate_stage(self, data): """ |