def handle_login(self): if not self.main_controller.bitshares_instance: if not self.connect_to_bitshares(): return wallet_controller = WalletController(self.main_controller.bitshares_instance) if wallet_controller.wallet_created(): unlock_view = UnlockWalletView(wallet_controller) else: unlock_view = CreateWalletView(wallet_controller) if unlock_view.exec_(): # Hide button once successful wallet creation / login self.unlock_wallet_button.hide() self.add_worker_button.show() # Load worker widgets from config file workers = self.config.workers_data for worker_name in workers: self.add_worker_widget(worker_name) # Limit the max amount of workers so that the performance isn't greatly affected if self.num_of_workers >= self.max_workers: self.add_worker_button.setEnabled(False) break # Dispatcher polls for events from the workers that are used to change the ui self.dispatcher = ThreadDispatcher(self) self.dispatcher.start() self.status_bar.showMessage("ver {} - Node delay: - ms".format(__version__)) self.status_bar_updater = Thread(target=self._update_statusbar_message) self.status_bar_updater.start()
def __init__(self, sys_argv): super(App, self).__init__(sys_argv) config = MainController.load_config() bitshares_instance = BitShares(config['node']) # Wallet unlock unlock_ctrl = WalletController(bitshares_instance) if unlock_ctrl.wallet_created(): unlock_view = UnlockWalletView(unlock_ctrl) else: unlock_view = CreateWalletView(unlock_ctrl) if unlock_view.exec_(): bitshares_instance = unlock_ctrl.bitshares self.main_ctrl = MainController(bitshares_instance) self.main_view = MainView(self.main_ctrl) self.main_view.show() else: sys.exit()