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 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) except BaseException as e: QMessageBox.information(None, _('Error'), str(e), _('OK')) return if wallet is None: wizard = InstallWizard(self.config, self.app, self.plugins, path) wallet = wizard.run_and_get_wallet() 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 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) if not wallet: wizard = InstallWizard(self.config, self.app, self.plugins, path) wallet = wizard.run_and_get_wallet() 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 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() 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