From 0935a0f0b7ba3e53cba0914db8efbeb0960b77cb Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Mon, 14 Oct 2013 16:08:00 -0300 Subject: Always display first run wizard on first run. * Display the wizard only the first time or if we don't have any provider configured. * Remove unused proper provider setting. * If we have a working provider (as a pinned one), the wizard won't show automatically after being displayed the first time. * If we cancel the first time wizard and we have a configured provider (like the pinned one) the app will not close. --- src/leap/bitmask/gui/mainwindow.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/leap/bitmask/gui') diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index 69545751..bb5c4e64 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -365,7 +365,12 @@ class MainWindow(QtGui.QMainWindow): """ if self._wizard_firstrun: self._settings.set_properprovider(False) - self.quit() + providers = self._settings.get_configured_providers() + has_provider_on_disk = len(providers) != 0 + if not has_provider_on_disk: + # if we don't have any provider configured (included a pinned + # one) we can't use the application, so quit. + self.quit() else: self._finish_init() @@ -393,6 +398,7 @@ class MainWindow(QtGui.QMainWindow): if IS_MAC: self._wizard.raise_() self._wizard.finished.connect(self._wizard_finished) + self._settings.set_skip_first_run(True) def _wizard_finished(self): """ @@ -783,8 +789,8 @@ class MainWindow(QtGui.QMainWindow): """ providers = self._settings.get_configured_providers() has_provider_on_disk = len(providers) != 0 - is_proper_provider = self._settings.get_properprovider() - return not (has_provider_on_disk and is_proper_provider) + skip_first_run = self._settings.get_skip_first_run() + return not (has_provider_on_disk and skip_first_run) def _download_provider_config(self): """ -- cgit v1.2.3