def start_new_window(self, path, uri): '''Raises the window for the wallet if it is open. Otherwise opens the wallet and creates a new window for it.''' for w in self.windows: if w.wallet.storage.path == path: w.bring_to_top() break else: try: wallet = self.daemon.load_wallet(path, None) except BaseException as e: d = QMessageBox(QMessageBox.Warning, _('Error'), 'Cannot load wallet:\n' + str(e)) d.exec_() return if not wallet: storage = WalletStorage(path) wizard = InstallWizard(self.config, self.app, self.plugins, storage) wallet = wizard.run_and_get_wallet() wizard.terminate() if not wallet: return wallet.start_threads(self.daemon.network) self.daemon.add_wallet(wallet) w = self.create_window_for_wallet(wallet) if uri: w.pay_to_URI(uri) return w
def init_network(self): # Show network dialog if config does not exist if self.daemon.network: if self.config.get('auto_connect') is None: wizard = InstallWizard(self.config, self.app, self.plugins, None) wizard.init_network(self.daemon.network) wizard.terminate()
def start_new_window(self, path, uri): '''Raises the window for the wallet if it is open. Otherwise opens the wallet and creates a new window for it.''' for w in self.windows: if w.wallet.storage.path == path: w.bring_to_top() break else: wallet = self.daemon.load_wallet(path, None) if not wallet: storage = WalletStorage(path) wizard = InstallWizard(self.config, self.app, self.plugins, storage) wallet = wizard.run_and_get_wallet() wizard.terminate() if not wallet: return wallet.start_threads(self.daemon.network) self.daemon.add_wallet(wallet) w = self.create_window_for_wallet(wallet) if uri: w.pay_to_URI(uri) return w