use QSpinBox
This commit is contained in:
parent
54f3c9f35b
commit
7ffce2ba06
|
@ -2517,25 +2517,25 @@ class ElectrumWindow(QMainWindow):
|
||||||
grid = QGridLayout()
|
grid = QGridLayout()
|
||||||
grid.setColumnStretch(0,1)
|
grid.setColumnStretch(0,1)
|
||||||
|
|
||||||
nz_label = QLabel(_('Display zeros') + ':')
|
nz_label = QLabel(_('Zeros after decimal point') + ':')
|
||||||
grid.addWidget(nz_label, 0, 0)
|
grid.addWidget(nz_label, 0, 0)
|
||||||
nz_e = AmountEdit(None,True)
|
nz = QSpinBox()
|
||||||
nz_e.setText("%d"% self.num_zeros)
|
nz.setMinimum(0)
|
||||||
grid.addWidget(nz_e, 0, 1)
|
nz.setMaximum(self.decimal_point)
|
||||||
|
nz.setValue(self.num_zeros)
|
||||||
|
grid.addWidget(nz, 0, 1)
|
||||||
msg = _('Number of zeros displayed after the decimal point. For example, if this is set to 2, "1." will be displayed as "1.00"')
|
msg = _('Number of zeros displayed after the decimal point. For example, if this is set to 2, "1." will be displayed as "1.00"')
|
||||||
grid.addWidget(HelpButton(msg), 0, 2)
|
grid.addWidget(HelpButton(msg), 0, 2)
|
||||||
if not self.config.is_modifiable('num_zeros'):
|
if not self.config.is_modifiable('num_zeros'):
|
||||||
for w in [nz_e, nz_label]: w.setEnabled(False)
|
for w in [nz, nz_label]: w.setEnabled(False)
|
||||||
def on_nz():
|
def on_nz():
|
||||||
nz = nz_e.get_amount()
|
value = nz.value()
|
||||||
if nz>8:
|
if self.num_zeros != value:
|
||||||
nz = 8
|
self.num_zeros = value
|
||||||
if self.num_zeros != nz:
|
|
||||||
self.num_zeros = nz
|
|
||||||
self.config.set_key('num_zeros', nz, True)
|
self.config.set_key('num_zeros', nz, True)
|
||||||
self.update_history_tab()
|
self.update_history_tab()
|
||||||
self.update_address_tab()
|
self.update_address_tab()
|
||||||
nz_e.editingFinished.connect(on_nz)
|
nz.valueChanged.connect(on_nz)
|
||||||
|
|
||||||
lang_label = QLabel(_('Language') + ':')
|
lang_label = QLabel(_('Language') + ':')
|
||||||
grid.addWidget(lang_label, 1, 0)
|
grid.addWidget(lang_label, 1, 0)
|
||||||
|
|
Loading…
Reference in New Issue