Beispiel #1
0
    def main(self, url):

        storage = WalletStorage(self.config)
        if not storage.file_exists:
            import installwizard
            wizard = installwizard.InstallWizard(self.config, self.network, storage)
            wallet = wizard.run()
            if not wallet: 
                exit()

        elif storage.get('wallet_type') in ['2of3'] and storage.get('seed') is None:
            import installwizard
            wizard = installwizard.InstallWizard(self.config, self.network, storage)
            wallet = wizard.run(action= 'create2of3')
            if not wallet: 
                exit()

        else:
            wallet = Wallet(storage)
            wallet.start_threads(self.network)
            
        self.main_window = w = ElectrumWindow(self.config, self.network)

        # plugins that need to change the GUI do it here
        run_hook('init')

        w.load_wallet(wallet)

        s = Timer()
        s.start()

        self.windows.append(w)
        if url: w.set_url(url)
        w.app = self.app
        w.connect_slots(s)
        w.update_wallet()

        self.app.exec_()

        wallet.stop_threads()