1
0

TxEditor: make trigger_update not private, call it on rbf combo changed.

This commit is contained in:
ThomasV
2023-02-09 11:29:10 +01:00
parent a740a8a004
commit 13222c479c
2 changed files with 5 additions and 8 deletions

View File

@@ -77,7 +77,7 @@ class TxEditor(WindowModalDialog):
self.is_preview = False self.is_preview = False
self.locktime_e = LockTimeEdit(self) self.locktime_e = LockTimeEdit(self)
self.locktime_e.valueEdited.connect(self._trigger_update) self.locktime_e.valueEdited.connect(self.trigger_update)
self.locktime_label = QLabel(_("LockTime") + ": ") self.locktime_label = QLabel(_("LockTime") + ": ")
self.io_widget = TxInOutWidget(self.main_window, self.wallet) self.io_widget = TxInOutWidget(self.main_window, self.wallet)
self.create_fee_controls() self.create_fee_controls()
@@ -212,7 +212,7 @@ class TxEditor(WindowModalDialog):
self.fee_slider.setFixedWidth(200) self.fee_slider.setFixedWidth(200)
self.fee_target.setFixedSize(self.feerate_e.sizeHint()) self.fee_target.setFixedSize(self.feerate_e.sizeHint())
def _trigger_update(self): def trigger_update(self):
# set tx to None so that the ok button is disabled while we compute the new tx # set tx to None so that the ok button is disabled while we compute the new tx
self.tx = None self.tx = None
self.update() self.update()
@@ -229,7 +229,7 @@ class TxEditor(WindowModalDialog):
self.fee_e.setModified(False) self.fee_e.setModified(False)
self.update_fee_target() self.update_fee_target()
self.update_feerate_label() self.update_feerate_label()
self._trigger_update() self.trigger_update()
def on_fee_or_feerate(self, edit_changed, editing_finished): def on_fee_or_feerate(self, edit_changed, editing_finished):
edit_other = self.feerate_e if edit_changed == self.fee_e else self.fee_e edit_other = self.feerate_e if edit_changed == self.fee_e else self.fee_e
@@ -243,7 +243,7 @@ class TxEditor(WindowModalDialog):
# freeze the correct fee setting (this) # freeze the correct fee setting (this)
edit_other.setModified(False) edit_other.setModified(False)
self.fee_slider.deactivate() self.fee_slider.deactivate()
self._trigger_update() self.trigger_update()
def is_send_fee_frozen(self): def is_send_fee_frozen(self):
return self.fee_e.isVisible() and self.fee_e.isModified() \ return self.fee_e.isVisible() and self.fee_e.isModified() \
@@ -477,9 +477,6 @@ class TxEditor(WindowModalDialog):
assert fee is not None assert fee is not None
self.fee_label.setText(self.main_window.config.format_amount_and_units(fee)) self.fee_label.setText(self.main_window.config.format_amount_and_units(fee))
fee_rate = fee // tx.estimated_size()
#self.feerate_label.setText(self.main_window.format_amount(fee_rate))
self.update_extra_fees() self.update_extra_fees()
amount = tx.output_value() if self.output_value == '!' else self.output_value amount = tx.output_value() if self.output_value == '!' else self.output_value

View File

@@ -64,7 +64,7 @@ class _BaseRBFDialog(TxEditor):
self.method_label = QLabel(_('Method') + ':') self.method_label = QLabel(_('Method') + ':')
self.method_combo = QComboBox() self.method_combo = QComboBox()
self.method_combo.addItems([_('Preserve payment'), _('Decrease payment')]) self.method_combo.addItems([_('Preserve payment'), _('Decrease payment')])
self.method_combo.currentIndexChanged.connect(self.update) self.method_combo.currentIndexChanged.connect(self.trigger_update)
old_size_label = TxSizeLabel() old_size_label = TxSizeLabel()
old_size_label.setAlignment(Qt.AlignCenter) old_size_label.setAlignment(Qt.AlignCenter)
old_size_label.setAmount(self.old_tx_size) old_size_label.setAmount(self.old_tx_size)