From 83a069d1f627afc0cf2c8c81e3a8d6b2ae500928 Mon Sep 17 00:00:00 2001 From: mailchuck Date: Fri, 2 Oct 2015 15:05:47 +0200 Subject: [PATCH] Migration Wizard - Not fully working yet - show this wizard and connection confirmation dialog before showing the main window, and don't open main window until these two have finished or were canceled --- src/bitmessageqt/__init__.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 47e41cbe..c95d7579 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1627,6 +1627,13 @@ class MyForm(QtGui.QMainWindow): else: self.click_actionSettings() + def showMigrationWizard(self, level): + self.migrationWizardInstance = Ui_MigrationWizard(["a"]) + if self.migrationWizardInstance.exec_(): + pass + else: + pass + def changeEvent(self, event): if event.type() == QtCore.QEvent.LanguageChange: self.ui.retranslateUi(self) @@ -4148,12 +4155,20 @@ def run(): app.setStyleSheet("QStatusBar::item { border: 0px solid black }") myapp = MyForm() - if not shared.config.getboolean('bitmessagesettings', 'startintray'): - myapp.show() - myapp.appIndicatorInit(app) myapp.ubuntuMessagingMenuInit() myapp.notifierInit() if shared.safeConfigGetBoolean('bitmessagesettings', 'dontconnect'): myapp.showConnectDialog() # ask the user if we may connect + + try: + if shared.config.get('bitmessagesettings', 'mailchuck') < 1: + myapp.showMigrationWizard(shared.config.get('bitmessagesettings', 'mailchuck')) + except: + myapp.showMigrationWizard(0) + + # only show after wizards and connect dialogs have completed + if not shared.config.getboolean('bitmessagesettings', 'startintray'): + myapp.show() + sys.exit(app.exec_())