def show_xpub_dialog(self, xpub, run_next): msg = ' '.join([ _("Here is your master public key."), _("Please share it with your cosigners.") ]) vbox = QVBoxLayout() layout = SeedDisplayLayout(xpub, title=msg, sid='hot') vbox.addLayout(layout.layout()) self.set_main_layout(vbox, _('Master Public Key')) return None
def request_many(self, n, xpub_hot=None): vbox = QVBoxLayout() scroll = QScrollArea() scroll.setWidgetResizable(True) scroll.setFrameShape(QFrame.NoFrame) vbox.addWidget(scroll) w = QWidget() innerVbox = QVBoxLayout(w) scroll.setWidget(w) entries = [] if xpub_hot: layout = SeedDisplayLayout(xpub_hot, title=MSG_SHOW_MPK, sid='hot') else: layout = SeedInputLayout(title=MSG_ENTER_SEED_OR_MPK, sid='hot') entries.append(layout.seed_edit()) innerVbox.addLayout(layout.layout()) for i in range(n): msg = MSG_COSIGNER % (i + 1) if xpub_hot else MSG_ENTER_SEED_OR_MPK layout = SeedInputLayout(title=msg, sid='cold') innerVbox.addLayout(layout.layout()) entries.append(layout.seed_edit()) def get_texts(): return [clean_text(entry) for entry in entries] def set_enabled(): texts = get_texts() is_valid = Wallet.is_xpub if xpub_hot else Wallet.is_any all_valid = all(is_valid(text) for text in texts) if xpub_hot: texts.append(xpub_hot) has_dups = len(set(texts)) < len(texts) self.next_button.setEnabled(all_valid and not has_dups) for e in entries: e.textChanged.connect(set_enabled) self.set_main_layout(vbox, next_enabled=False) return get_texts()
def show_xpub_dialog(self, xpub, run_next): vbox = QVBoxLayout() layout = SeedDisplayLayout(xpub, title=_('Master Public Key'), sid='hot') vbox.addLayout(layout.layout()) self.set_main_layout(vbox, MSG_SHOW_MPK) return None
def show_xpub_dialog(self, xpub, run_next): vbox = QVBoxLayout() layout = SeedDisplayLayout(xpub, title=MSG_SHOW_MPK, sid='hot') vbox.addLayout(layout.layout()) self.set_main_layout(vbox, MSG_SHOW_MPK) return None