Rename labels to fee labels
This commit is contained in:
@@ -178,9 +178,9 @@ class Plugin(TimelockRecoveryPlugin):
|
|||||||
plan_dialog.resize(800, plan_dialog.height())
|
plan_dialog.resize(800, plan_dialog.height())
|
||||||
fee_policy = FeePolicy('eta:1')
|
fee_policy = FeePolicy('eta:1')
|
||||||
create_cancel_cb = QCheckBox('', checked=False)
|
create_cancel_cb = QCheckBox('', checked=False)
|
||||||
alert_tx_label = QLabel('')
|
alert_tx_fee_label = QLabel('')
|
||||||
recovery_tx_label = QLabel('')
|
recovery_tx_fee_label = QLabel('')
|
||||||
cancellation_tx_label = QLabel('')
|
cancellation_tx_fee_label = QLabel('')
|
||||||
|
|
||||||
if not context.get_alert_address():
|
if not context.get_alert_address():
|
||||||
plan_dialog.show_error(''.join([
|
plan_dialog.show_error(''.join([
|
||||||
@@ -231,14 +231,14 @@ class Plugin(TimelockRecoveryPlugin):
|
|||||||
try:
|
try:
|
||||||
context.alert_tx = context.make_unsigned_alert_tx(fee_policy)
|
context.alert_tx = context.make_unsigned_alert_tx(fee_policy)
|
||||||
assert all(tx_input.is_segwit() for tx_input in context.alert_tx.inputs())
|
assert all(tx_input.is_segwit() for tx_input in context.alert_tx.inputs())
|
||||||
alert_tx_label.setText(_("Fee: {}").format(self.config.format_amount_and_units(context.alert_tx.get_fee())))
|
alert_tx_fee_label.setText(_("Fee: {}").format(self.config.format_amount_and_units(context.alert_tx.get_fee())))
|
||||||
context.recovery_tx = context.make_unsigned_recovery_tx(fee_policy)
|
context.recovery_tx = context.make_unsigned_recovery_tx(fee_policy)
|
||||||
assert all(tx_input.is_segwit() for tx_input in context.recovery_tx.inputs())
|
assert all(tx_input.is_segwit() for tx_input in context.recovery_tx.inputs())
|
||||||
recovery_tx_label.setText(_("Fee: {}").format(self.config.format_amount_and_units(context.recovery_tx.get_fee())))
|
recovery_tx_fee_label.setText(_("Fee: {}").format(self.config.format_amount_and_units(context.recovery_tx.get_fee())))
|
||||||
if create_cancel_cb.isChecked():
|
if create_cancel_cb.isChecked():
|
||||||
context.cancellation_tx = context.make_unsigned_cancellation_tx(fee_policy)
|
context.cancellation_tx = context.make_unsigned_cancellation_tx(fee_policy)
|
||||||
assert all(tx_input.is_segwit() for tx_input in context.cancellation_tx.inputs())
|
assert all(tx_input.is_segwit() for tx_input in context.cancellation_tx.inputs())
|
||||||
cancellation_tx_label.setText(_("Fee: {}").format(self.config.format_amount_and_units(context.cancellation_tx.get_fee())))
|
cancellation_tx_fee_label.setText(_("Fee: {}").format(self.config.format_amount_and_units(context.cancellation_tx.get_fee())))
|
||||||
else:
|
else:
|
||||||
context.cancellation_tx = None
|
context.cancellation_tx = None
|
||||||
except NotEnoughFunds:
|
except NotEnoughFunds:
|
||||||
@@ -322,14 +322,14 @@ class Plugin(TimelockRecoveryPlugin):
|
|||||||
grid_row += 1
|
grid_row += 1
|
||||||
|
|
||||||
plan_grid.addWidget(QLabel('Alert transaction'), grid_row, 0)
|
plan_grid.addWidget(QLabel('Alert transaction'), grid_row, 0)
|
||||||
plan_grid.addWidget(alert_tx_label, grid_row, 1, 1, 3)
|
plan_grid.addWidget(alert_tx_fee_label, grid_row, 1, 1, 3)
|
||||||
view_alert_tx_button = QPushButton(_('View'))
|
view_alert_tx_button = QPushButton(_('View'))
|
||||||
view_alert_tx_button.clicked.connect(lambda: context.main_window.show_transaction(context.alert_tx, show_sign_button=False, show_broadcast_button=False))
|
view_alert_tx_button.clicked.connect(lambda: context.main_window.show_transaction(context.alert_tx, show_sign_button=False, show_broadcast_button=False))
|
||||||
plan_grid.addWidget(view_alert_tx_button, grid_row, 4)
|
plan_grid.addWidget(view_alert_tx_button, grid_row, 4)
|
||||||
grid_row += 1
|
grid_row += 1
|
||||||
|
|
||||||
plan_grid.addWidget(QLabel('Recovery transaction'), grid_row, 0)
|
plan_grid.addWidget(QLabel('Recovery transaction'), grid_row, 0)
|
||||||
plan_grid.addWidget(recovery_tx_label, grid_row, 1, 1, 3)
|
plan_grid.addWidget(recovery_tx_fee_label, grid_row, 1, 1, 3)
|
||||||
view_recovery_tx_button = QPushButton(_('View'))
|
view_recovery_tx_button = QPushButton(_('View'))
|
||||||
view_recovery_tx_button.clicked.connect(lambda: context.main_window.show_transaction(context.recovery_tx, show_sign_button=False, show_broadcast_button=False))
|
view_recovery_tx_button.clicked.connect(lambda: context.main_window.show_transaction(context.recovery_tx, show_sign_button=False, show_broadcast_button=False))
|
||||||
plan_grid.addWidget(view_recovery_tx_button, grid_row, 4)
|
plan_grid.addWidget(view_recovery_tx_button, grid_row, 4)
|
||||||
@@ -337,7 +337,7 @@ class Plugin(TimelockRecoveryPlugin):
|
|||||||
|
|
||||||
cancellation_label = QLabel('Cancellation transaction')
|
cancellation_label = QLabel('Cancellation transaction')
|
||||||
plan_grid.addWidget(cancellation_label, grid_row, 0)
|
plan_grid.addWidget(cancellation_label, grid_row, 0)
|
||||||
plan_grid.addWidget(cancellation_tx_label, grid_row, 1, 1, 3)
|
plan_grid.addWidget(cancellation_tx_fee_label, grid_row, 1, 1, 3)
|
||||||
view_cancellation_tx_button = QPushButton(_('View'))
|
view_cancellation_tx_button = QPushButton(_('View'))
|
||||||
view_cancellation_tx_button.clicked.connect(lambda: context.main_window.show_transaction(context.cancellation_tx, show_sign_button=False, show_broadcast_button=False))
|
view_cancellation_tx_button.clicked.connect(lambda: context.main_window.show_transaction(context.cancellation_tx, show_sign_button=False, show_broadcast_button=False))
|
||||||
plan_grid.addWidget(view_cancellation_tx_button, grid_row, 4)
|
plan_grid.addWidget(view_cancellation_tx_button, grid_row, 4)
|
||||||
@@ -349,7 +349,7 @@ class Plugin(TimelockRecoveryPlugin):
|
|||||||
|
|
||||||
def on_cb_change(x):
|
def on_cb_change(x):
|
||||||
cancellation_label.setVisible(x)
|
cancellation_label.setVisible(x)
|
||||||
cancellation_tx_label.setVisible(x)
|
cancellation_tx_fee_label.setVisible(x)
|
||||||
view_cancellation_tx_button.setVisible(x)
|
view_cancellation_tx_button.setVisible(x)
|
||||||
update_transactions()
|
update_transactions()
|
||||||
create_cancel_cb.stateChanged.connect(on_cb_change)
|
create_cancel_cb.stateChanged.connect(on_cb_change)
|
||||||
|
|||||||
Reference in New Issue
Block a user