Ok to press Sign and not save as a file
It's ok to click the View button, then press Sign, and then close the window the signed transaction will be used by the on_closed callback
This commit is contained in:
@@ -1181,6 +1181,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
|
||||
self,
|
||||
tx: Transaction,
|
||||
*,
|
||||
prompt_if_complete_unsaved: bool = True,
|
||||
external_keypairs: Mapping[bytes, bytes] = None,
|
||||
invoice: Invoice = None,
|
||||
on_closed: Callable[[Optional[Transaction]], None] = None,
|
||||
@@ -1190,6 +1191,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
|
||||
show_transaction(
|
||||
tx,
|
||||
parent=self,
|
||||
prompt_if_complete_unsaved=prompt_if_complete_unsaved,
|
||||
external_keypairs=external_keypairs,
|
||||
invoice=invoice,
|
||||
on_closed=on_closed,
|
||||
|
||||
@@ -425,6 +425,7 @@ def show_transaction(
|
||||
*,
|
||||
parent: 'ElectrumWindow',
|
||||
prompt_if_unsaved: bool = False,
|
||||
prompt_if_complete_unsaved: bool = True,
|
||||
external_keypairs: Mapping[bytes, bytes] = None,
|
||||
invoice: 'Invoice' = None,
|
||||
on_closed: Callable[[Optional[Transaction]], None] = None,
|
||||
@@ -436,6 +437,7 @@ def show_transaction(
|
||||
tx,
|
||||
parent=parent,
|
||||
prompt_if_unsaved=prompt_if_unsaved,
|
||||
prompt_if_complete_unsaved=prompt_if_complete_unsaved,
|
||||
external_keypairs=external_keypairs,
|
||||
invoice=invoice,
|
||||
on_closed=on_closed,
|
||||
|
||||
@@ -356,7 +356,12 @@ class Plugin(TimelockRecoveryPlugin):
|
||||
context.add_input_info_to_recovery_tx()
|
||||
context.add_input_info_to_cancellation_tx()
|
||||
update_transactions()
|
||||
view_alert_tx_button.clicked.connect(lambda: context.main_window.show_transaction(context.alert_tx, show_broadcast_button=False, on_closed=on_alert_tx_closed))
|
||||
view_alert_tx_button.clicked.connect(lambda: context.main_window.show_transaction(
|
||||
context.alert_tx,
|
||||
prompt_if_complete_unsaved=False,
|
||||
show_broadcast_button=False,
|
||||
on_closed=on_alert_tx_closed
|
||||
))
|
||||
plan_grid.addWidget(view_alert_tx_button, grid_row, 4)
|
||||
grid_row += 1
|
||||
|
||||
@@ -368,7 +373,12 @@ class Plugin(TimelockRecoveryPlugin):
|
||||
if tx is not None and context.recovery_tx is not None and tx.txid() == context.recovery_tx.txid() and tx.is_complete():
|
||||
context.recovery_tx = tx
|
||||
update_transactions()
|
||||
view_recovery_tx_button.clicked.connect(lambda: context.main_window.show_transaction(context.recovery_tx, show_broadcast_button=False, on_closed=on_recovery_tx_closed))
|
||||
view_recovery_tx_button.clicked.connect(lambda: context.main_window.show_transaction(
|
||||
context.recovery_tx,
|
||||
prompt_if_complete_unsaved=False,
|
||||
show_broadcast_button=False,
|
||||
on_closed=on_recovery_tx_closed
|
||||
))
|
||||
plan_grid.addWidget(view_recovery_tx_button, grid_row, 4)
|
||||
grid_row += 1
|
||||
|
||||
@@ -381,7 +391,12 @@ class Plugin(TimelockRecoveryPlugin):
|
||||
if tx is not None and context.cancellation_tx is not None and tx.txid() == context.cancellation_tx.txid() and tx.is_complete():
|
||||
context.cancellation_tx = tx
|
||||
update_transactions()
|
||||
view_cancellation_tx_button.clicked.connect(lambda: context.main_window.show_transaction(context.cancellation_tx, show_broadcast_button=False, on_closed=on_cancellation_tx_closed))
|
||||
view_cancellation_tx_button.clicked.connect(lambda: context.main_window.show_transaction(
|
||||
context.cancellation_tx,
|
||||
prompt_if_complete_unsaved=False,
|
||||
show_broadcast_button=False,
|
||||
on_closed=on_cancellation_tx_closed
|
||||
))
|
||||
plan_grid.addWidget(view_cancellation_tx_button, grid_row, 4)
|
||||
grid_row += 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user