1
0

wizard: added derivation presets for bip44/49

This commit is contained in:
SomberNight
2017-12-27 17:01:47 +01:00
parent ffff09736a
commit c04ebe9571
2 changed files with 18 additions and 2 deletions

View File

@@ -462,7 +462,8 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
return clayout.selected_index()
@wizard_dialog
def line_dialog(self, run_next, title, message, default, test, warning=''):
def line_dialog(self, run_next, title, message, default, test, warning='',
presets=()):
vbox = QVBoxLayout()
vbox.addWidget(WWLabel(message))
line = QLineEdit()
@@ -472,6 +473,15 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
line.textEdited.connect(f)
vbox.addWidget(line)
vbox.addWidget(WWLabel(warning))
for preset in presets:
button = QPushButton(preset[0])
button.clicked.connect(lambda __, text=preset[1]: line.setText(text))
button.setMaximumWidth(150)
hbox = QHBoxLayout()
hbox.addWidget(button, Qt.AlignCenter)
vbox.addLayout(hbox)
self.exec_layout(vbox, title, next_enabled=test(default))
return ' '.join(line.text().split())