summaryrefslogtreecommitdiff
path: root/src/leap/gui
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-03-11 17:23:08 -0300
committerTomás Touceda <chiiph@leap.se>2013-03-11 17:23:08 -0300
commit1371b450a3e4cd8bc1d8b50133eb4b7a8f1d9aad (patch)
tree5c0554d907ed6e209c4c8d5cea43d9159cad7bfd /src/leap/gui
parent815315bdfb26aaee16a8482f1708bf3868019fd6 (diff)
First run checks for a complete valid run of the wizard
Not just the files on disk
Diffstat (limited to 'src/leap/gui')
-rw-r--r--src/leap/gui/mainwindow.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py
index 8464d313..cf795a8e 100644
--- a/src/leap/gui/mainwindow.py
+++ b/src/leap/gui/mainwindow.py
@@ -54,6 +54,7 @@ class MainWindow(QtGui.QMainWindow):
WINDOWSTATE_KEY = "WindowState"
USER_KEY = "User"
AUTOLOGIN_KEY = "AutoLogin"
+ PROPER_PROVIDER = "ProperProvider"
# Keyring
KEYRING_KEY = "leap_client"
@@ -183,6 +184,8 @@ class MainWindow(QtGui.QMainWindow):
def _rejected_wizard(self):
if self._wizard_firstrun:
+ settings = QtCore.QSettings()
+ settings.setValue(self.PROPER_PROVIDER, False)
self.quit()
else:
self._finish_init()
@@ -194,9 +197,11 @@ class MainWindow(QtGui.QMainWindow):
self._wizard = None
def _finish_init(self):
+ settings = QtCore.QSettings()
self.ui.cmbProviders.addItems(self._configured_providers())
self._show_systray()
self.show()
+
if self._wizard:
possible_username = self._wizard.get_username()
possible_password = self._wizard.get_password()
@@ -208,8 +213,8 @@ class MainWindow(QtGui.QMainWindow):
self.ui.chkRemember.setChecked(True)
self._login()
self._wizard = None
+ settings.setValue(self.PROPER_PROVIDER, True)
else:
- settings = QtCore.QSettings()
saved_user = settings.value(self.USER_KEY, None)
auto_login = settings.value(self.AUTOLOGIN_KEY, "false") != "false"
@@ -305,7 +310,7 @@ class MainWindow(QtGui.QMainWindow):
def quit(self):
self._really_quit = True
if self._wizard:
- self._wizard.accept()
+ self._wizard.close()
self.close()
def changeEvent(self, e):
@@ -359,7 +364,11 @@ class MainWindow(QtGui.QMainWindow):
@rtype: bool
"""
- return len(self._configured_providers()) == 0
+ settings = QtCore.QSettings()
+ has_provider_on_disk = len(self._configured_providers()) != 0
+ is_proper_provider = settings.value(self.PROPER_PROVIDER,
+ "false") != "false"
+ return not (has_provider_on_disk and is_proper_provider)
def _focus_password(self):
"""