diff options
-rw-r--r-- | src/leap/baseapp/mainwindow.py | 10 | ||||
-rwxr-xr-x | src/leap/gui/firstrun/wizard.py | 8 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/leap/baseapp/mainwindow.py b/src/leap/baseapp/mainwindow.py index bd29e608..918f1568 100644 --- a/src/leap/baseapp/mainwindow.py +++ b/src/leap/baseapp/mainwindow.py @@ -145,8 +145,16 @@ class LeapWindow(QtGui.QMainWindow, parent=self, eip_username=self.eip_username, start_eipconnection_signal=self.start_eipconnection, - eip_statuschange_signal=self.eipStatusChange) + eip_statuschange_signal=self.eipStatusChange, + quitcallback=self.onWizardCancel) wizard.show() + def onWizardCancel(self): + if not self.wizard_done: + logger.debug( + 'clicked on Cancel during first ' + 'run wizard. shutting down') + self.cleanupAndQuit() + def runchecks_and_eipconnect(self): self.initchecks.begin() diff --git a/src/leap/gui/firstrun/wizard.py b/src/leap/gui/firstrun/wizard.py index 7a3d6973..bbb48149 100755 --- a/src/leap/gui/firstrun/wizard.py +++ b/src/leap/gui/firstrun/wizard.py @@ -61,7 +61,8 @@ class FirstRunWizard(QtGui.QWizard): eipconfigchecker=eipchecks.EIPConfigChecker, start_eipconnection_signal=None, eip_statuschange_signal=None, - debug_server=None): + debug_server=None, + quitcallback=None): super(FirstRunWizard, self).__init__( parent, QtCore.Qt.WindowStaysOnTopHint) @@ -97,6 +98,11 @@ class FirstRunWizard(QtGui.QWizard): self.start_eipconnection_signal = start_eipconnection_signal self.eip_statuschange_signal = eip_statuschange_signal + if quitcallback is not None: + self.button( + QtGui.QWizard.CancelButton).clicked.connect( + quitcallback) + self.providerconfig = None # previously registered # if True, jumps to LogIn page. |