diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index d21d0d035..1e97d27cc 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -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, diff --git a/electrum/gui/qt/transaction_dialog.py b/electrum/gui/qt/transaction_dialog.py index c0a4f7435..1e0bbe2cc 100644 --- a/electrum/gui/qt/transaction_dialog.py +++ b/electrum/gui/qt/transaction_dialog.py @@ -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, diff --git a/electrum/plugins/timelock_recovery/qt.py b/electrum/plugins/timelock_recovery/qt.py index 0a32b18e2..79655c1c8 100644 --- a/electrum/plugins/timelock_recovery/qt.py +++ b/electrum/plugins/timelock_recovery/qt.py @@ -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