multisig wizard: use sliders
This commit is contained in:
parent
7a1af24eda
commit
dabeae9f95
|
@ -352,32 +352,39 @@ class InstallWizard(QDialog, MessageBoxMixin, WizardBase):
|
||||||
|
|
||||||
def query_multisig(self, action):
|
def query_multisig(self, action):
|
||||||
cw = CosignWidget(2, 2)
|
cw = CosignWidget(2, 2)
|
||||||
m_edit = QSpinBox()
|
m_edit = QSlider(Qt.Horizontal, self)
|
||||||
n_edit = QSpinBox()
|
n_edit = QSlider(Qt.Horizontal, self)
|
||||||
m_edit.setValue(2)
|
|
||||||
n_edit.setValue(2)
|
|
||||||
n_edit.setMinimum(2)
|
n_edit.setMinimum(2)
|
||||||
n_edit.setMaximum(15)
|
n_edit.setMaximum(15)
|
||||||
m_edit.setMinimum(1)
|
m_edit.setMinimum(1)
|
||||||
m_edit.setMaximum(2)
|
m_edit.setMaximum(2)
|
||||||
n_edit.valueChanged.connect(m_edit.setMaximum)
|
n_edit.setValue(2)
|
||||||
|
m_edit.setValue(2)
|
||||||
|
|
||||||
n_edit.valueChanged.connect(cw.set_n)
|
n_label = QLabel()
|
||||||
m_edit.valueChanged.connect(cw.set_m)
|
m_label = QLabel()
|
||||||
|
grid = QGridLayout()
|
||||||
hbox = QHBoxLayout()
|
grid.addWidget(n_label, 0, 0)
|
||||||
hbox.addWidget(QLabel(_('Require')))
|
grid.addWidget(n_edit, 0, 1)
|
||||||
hbox.addWidget(m_edit)
|
grid.addWidget(m_label, 1, 0)
|
||||||
hbox.addWidget(QLabel(_('of')))
|
grid.addWidget(m_edit, 1, 1)
|
||||||
hbox.addWidget(n_edit)
|
def on_m(m):
|
||||||
hbox.addWidget(QLabel(_('signatures')))
|
m_label.setText(_('Require %d signatures')%m)
|
||||||
hbox.addStretch(1)
|
cw.set_m(m)
|
||||||
|
def on_n(n):
|
||||||
|
n_label.setText(_('From %d cosigners')%n)
|
||||||
|
cw.set_n(n)
|
||||||
|
m_edit.setMaximum(n)
|
||||||
|
n_edit.valueChanged.connect(on_n)
|
||||||
|
m_edit.valueChanged.connect(on_m)
|
||||||
|
on_n(2)
|
||||||
|
on_m(2)
|
||||||
|
|
||||||
vbox = QVBoxLayout()
|
vbox = QVBoxLayout()
|
||||||
vbox.addWidget(cw)
|
vbox.addWidget(cw)
|
||||||
vbox.addWidget(WWLabel(_("Choose the number of signatures needed "
|
vbox.addWidget(WWLabel(_("Choose the number of signatures needed "
|
||||||
"to unlock funds in your wallet:")))
|
"to unlock funds in your wallet:")))
|
||||||
vbox.addLayout(hbox)
|
vbox.addLayout(grid)
|
||||||
self.set_main_layout(vbox, _("Multi-Signature Wallet"))
|
self.set_main_layout(vbox, _("Multi-Signature Wallet"))
|
||||||
m = int(m_edit.value())
|
m = int(m_edit.value())
|
||||||
n = int(n_edit.value())
|
n = int(n_edit.value())
|
||||||
|
|
Loading…
Reference in New Issue