summaryrefslogtreecommitdiff
path: root/src/leap/baseapp/leap_app.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2013-01-30 06:52:59 +0900
committerkali <kali@leap.se>2013-01-30 06:52:59 +0900
commit570f84756b3d1f689a172a3ff0c55abf6a60b9dd (patch)
tree0f262acacf35743664c6408edbafe6ba6f119d14 /src/leap/baseapp/leap_app.py
parente60abdcb796ad9e2c44e9b37d3a68e7f159c035c (diff)
parent10a2303fe2d21999bce56940daecb78576f5b741 (diff)
Merge branch 'pre-release-0.2.0' into release-0.2.0
This merge contains today's state of develop branch, minus soledad and email components.
Diffstat (limited to 'src/leap/baseapp/leap_app.py')
-rw-r--r--src/leap/baseapp/leap_app.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/leap/baseapp/leap_app.py b/src/leap/baseapp/leap_app.py
index 6ffb08a8..4d3aebd6 100644
--- a/src/leap/baseapp/leap_app.py
+++ b/src/leap/baseapp/leap_app.py
@@ -52,7 +52,7 @@ class MainWindowMixin(object):
self.firstRunWizardAct = QtGui.QAction(
"&First run wizard...", self,
- triggered=self.launch_first_run_wizard)
+ triggered=self.stop_connection_and_launch_first_run_wizard)
self.aboutAct = QtGui.QAction("&About", self, triggered=self.about)
#self.aboutQtAct = QtGui.QAction("About &Qt", self,
@@ -74,16 +74,21 @@ class MainWindowMixin(object):
self.menuBar().addMenu(self.settingsMenu)
self.menuBar().addMenu(self.helpMenu)
- def launch_first_run_wizard(self):
+ def stop_connection_and_launch_first_run_wizard(self):
settings = QtCore.QSettings()
settings.setValue('FirstRunWizardDone', False)
logger.debug('should run first run wizard again...')
- from leap.gui.firstrunwizard import FirstRunWizard
- wizard = FirstRunWizard(
- parent=self,
- success_cb=self.initReady.emit)
- wizard.show()
+ status = self.conductor.get_icon_name()
+ if status != "disconnected":
+ self.start_or_stopVPN()
+
+ self.launch_first_run_wizard()
+ #from leap.gui.firstrunwizard import FirstRunWizard
+ #wizard = FirstRunWizard(
+ #parent=self,
+ #success_cb=self.initReady.emit)
+ #wizard.show()
def set_app_icon(self):
icon = QtGui.QIcon(APP_LOGO)
@@ -127,8 +132,8 @@ class MainWindowMixin(object):
"context menu of the system tray entry.")
self.hide()
event.ignore()
- if self.debugmode:
- self.cleanupAndQuit()
+ return
+ self.cleanupAndQuit()
def cleanupAndQuit(self):
"""
@@ -143,6 +148,6 @@ class MainWindowMixin(object):
# in conductor
# XXX send signal instead?
logger.info('Shutting down')
- self.conductor.cleanup()
+ self.conductor.disconnect(shutdown=True)
logger.info('Exiting. Bye.')
QtGui.qApp.quit()