diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-03-11 16:07:13 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-03-11 16:07:13 -0300 |
commit | 1580197229ce01ebdc6a655d2f5b67ca4b32da88 (patch) | |
tree | 4738c442e590671780cb99eddd3a21e53679b223 /src/leap/gui/mainwindow.py | |
parent | 99e644bf4d941dfa430d21dba9ac99f138f5f7cc (diff) |
Auto login after the first run wizard if registered a new user
Also add pyxdg as a dep
Diffstat (limited to 'src/leap/gui/mainwindow.py')
-rw-r--r-- | src/leap/gui/mainwindow.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py index 4e6bb5fe..78ff9101 100644 --- a/src/leap/gui/mainwindow.py +++ b/src/leap/gui/mainwindow.py @@ -198,9 +198,14 @@ class MainWindow(QtGui.QMainWindow): self.show() if self._wizard: possible_username = self._wizard.get_username() + possible_password = self._wizard.get_password() if possible_username is not None: self.ui.lnUser.setText(possible_username) self._focus_password() + if possible_password is not None: + self.ui.lnPassword.setText(possible_password) + self.ui.chkRemember.setChecked(True) + self._login() self._wizard = None else: settings = QtCore.QSettings() @@ -214,7 +219,8 @@ class MainWindow(QtGui.QMainWindow): saved_password = keyring.get_password(self.KEYRING_KEY, saved_user .encode("utf8")) - self.ui.lnPassword.setText(saved_password.decode("utf8")) + if saved_password is not None: + self.ui.lnPassword.setText(saved_password.decode("utf8")) # Only automatically login if there is a saved user self.ui.chkAutoLogin.setChecked(auto_login) |