def load_theme(self): """Load theme retrieved from wallet file.""" try: theme_prefix, theme_path = self.themes[self.theme_name] except KeyError: util.print_error("Theme not found!", self.theme_name) return QDir.setCurrent(os.path.join(theme_prefix, theme_path)) with open(rsrc("style.css")) as style_file: qApp.setStyleSheet(style_file.read())
def ready(self): if self.state == self.READY: return self.state = self.READY self.window.activate() def update_balance(self): conf_balance, unconf_balance = self.g.wallet.get_balance() balance = D(conf_balance + unconf_balance) self.window.set_balances(balance) def update_completions(self): completions = [] for addr, label in self.g.wallet.labels.items(): if addr in self.g.wallet.addressbook: completions.append("%s <%s>" % (label, addr)) self.window.update_completions(completions) def update_history(self): tx_history = self.g.wallet.get_tx_history() self.window.update_history(tx_history) if __name__ == "__main__": app = QApplication(sys.argv) with open(rsrc("style.css")) as style_file: app.setStyleSheet(style_file.read()) mini = MiniWindow() sys.exit(app.exec_())