def _name_multisig_account(self): dialog = WindowModalDialog(None, "Create Multisig Account") vbox = QVBoxLayout() label = QLabel( _( "Enter a descriptive name for your multisig account.\nYou should later be able to use the name to uniquely identify this multisig account" ) ) hl = QHBoxLayout() hl.addWidget(label) name = QLineEdit() name.setMaxLength(30) name.resize(200, 40) he = QHBoxLayout() he.addWidget(name) okButton = OkButton(dialog) hlb = QHBoxLayout() hlb.addWidget(okButton) hlb.addStretch(2) vbox.addLayout(hl) vbox.addLayout(he) vbox.addLayout(hlb) dialog.setLayout(vbox) dialog.exec_() return name.text().strip()
def pin_dialog(self, msg, show_strength): # Needed e.g. when resetting a device self.clear_dialog() dialog = WindowModalDialog(self.top_level_window(), _("Enter PIN")) matrix = self.pin_matrix_widget_class(show_strength) vbox = QVBoxLayout() vbox.addWidget(QLabel(msg)) vbox.addWidget(matrix) vbox.addLayout(Buttons(CancelButton(dialog), OkButton(dialog))) dialog.setLayout(vbox) dialog.exec_() self.response = str(matrix.get_value()) self.done.set()
def passphrase_dialog(self, msg, confirm): # If confirm is true, require the user to enter the passphrase twice parent = self.top_level_window() d = WindowModalDialog(parent, _("Enter Passphrase")) if confirm: OK_button = OkButton(d) playout = PasswordLayout(msg=msg, kind=PW_PASSPHRASE, OK_button=OK_button) vbox = QVBoxLayout() vbox.addLayout(playout.layout()) vbox.addLayout(Buttons(CancelButton(d), OK_button)) d.setLayout(vbox) passphrase = playout.new_password() if d.exec_() else None else: pw = PasswordLineEdit() pw.setMinimumWidth(200) vbox = QVBoxLayout() vbox.addWidget(WWLabel(msg)) vbox.addWidget(pw) vbox.addLayout(Buttons(CancelButton(d), OkButton(d))) d.setLayout(vbox) passphrase = pw.text() if d.exec_() else None self.passphrase = passphrase self.done.set()