qt tx dialog: allow blanking feerate

Previously it was impossible to rm the last character in feerate_edit.
e.g. if you held down "backspace", we would keep refilling the field as soon
as it became empty.
This commit is contained in:
SomberNight 2019-11-19 20:13:16 +01:00
parent 13b858ab26
commit 710e9621b5
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9

View file

@ -579,6 +579,9 @@ class BaseTxDialog(QDialog, MessageBoxMixin):
def on_finalize(self):
pass # overridden in subclass
def update_fee_fields(self):
pass # overridden in subclass
class TxDetailLabel(QLabel):
def __init__(self, *, word_wrap=None):
@ -752,7 +755,7 @@ class PreviewTxDialog(BaseTxDialog, TxEditor):
displayed_feerate = self.feerate_e.get_amount()
if displayed_feerate is not None:
displayed_feerate = quantize_feerate(displayed_feerate)
else:
elif self.fee_slider.is_active():
# fallback to actual fee
displayed_feerate = quantize_feerate(fee / size) if fee is not None else None
self.feerate_e.setAmount(displayed_feerate)
@ -770,7 +773,7 @@ class PreviewTxDialog(BaseTxDialog, TxEditor):
self.feerate_e.setAmount(displayed_feerate)
# show/hide fee rounding icon
feerounding = (fee - displayed_fee) if fee else 0
feerounding = (fee - displayed_fee) if (fee and displayed_fee is not None) else 0
self.set_feerounding_text(int(feerounding))
self.feerounding_icon.setToolTip(self.feerounding_text)
self.feerounding_icon.setVisible(abs(feerounding) >= 1)