From 48a96f677669c924910807b7abe6de52d1db0952 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Wed, 31 Jan 2024 12:52:01 +0000 Subject: [PATCH] qml wizard: run navmap[view]['accept'] handler a final time on finish For example, see https://github.com/spesmilo/electrum/blob/061c8211281d6c0b50166e4075656ce0fb2c89f5/electrum/plugins/trustedcoin/trustedcoin.py#L624 Even if navmap[view]['last'] is True, we still want the navmap[view]['accept'] handler to run. fixes https://github.com/spesmilo/electrum/issues/8861 --- Note that an analogous issue does not exist for the desktop qt gui, see https://github.com/spesmilo/electrum/blob/061c8211281d6c0b50166e4075656ce0fb2c89f5/electrum/gui/qt/wizard/wizard.py#L206 There, wizard.resolve_next is called regardless of is_last. --- electrum/gui/qml/components/wizard/Wizard.qml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/electrum/gui/qml/components/wizard/Wizard.qml b/electrum/gui/qml/components/wizard/Wizard.qml index f2be0a642..3c1c335f7 100644 --- a/electrum/gui/qml/components/wizard/Wizard.qml +++ b/electrum/gui/qml/components/wizard/Wizard.qml @@ -134,6 +134,10 @@ ElDialog { function finish() { currentItem.accept() _setWizardData(pages.contentChildren[currentIndex].wizard_data) + // run wizard.resolve_next() a final time, so that the navmap[view]['accept'] handler can run (if any) + var newview = wiz.submit(wizard_data) + _setWizardData(newview.wizard_data) + // finish wizard wizard.doAccept() }