HomePhabricator

gui: replace some QDialog::exec() with safer QDialog::show() calls

Description

gui: replace some QDialog::exec() with safer QDialog::show() calls

Summary:
Relevant part of the PR description (core-gui#336):

blocking QDialog::exec() calls are replaced with safer QDialog::show(), except for SendConfirmationDialog as that change is not trivial
The QDialog::open() was not used because the actual modality mode (application modal or window modal) of a dialog depends on whether it has a parent.

This PR does not change behavior, and all touched dialogs are still application modal.
As a follow up, a design research could suggest to make some dialogs window modal.

qt: Add GUIUtil::ShowModalDialogAndDeleteOnClose

https://github.com/bitcoin-core/gui/pull/336/commits/13f618818dc57673ac0287ad8b28ceb450efb374

qt, refactor: Keep OptionsDialog in the main event loop

https://github.com/bitcoin-core/gui/pull/336/commits/7830cd0b35f315570d744f4d2719104c08b33ff1

qt, refactor: Keep CoinControlDialog in the main event loop

https://github.com/bitcoin-core/gui/pull/336/commits/59f7ba4fd7a9e4bc73d784ee74d5b777da9cc436

qt, refactor: Keep EditAddressDialog in the main event loop

https://github.com/bitcoin-core/gui/pull/336/commits/6f6fde30e7601185a8f6052b3bf1770407fcc14b

qt, refactor: Keep AskPassphraseDialog in the main event loop

https://github.com/bitcoin-core/gui/pull/336/commits/7fa91e831227e556bd8a7ae3da64bd59d4f30d5f

qt: Revert 7fa91e831227e556bd8a7ae3da64bd59d4f30d5f partially

The AskPassphraseDialog modal dialog must be synchronous here as
expected in the WalletModel::requestUnlock() function.

Fixed an introduced regression.

https://github.com/bitcoin-core/gui/pull/509/commits/5d7666b15164a16aaf3af49af8f73ff4bd392f6a

qt, refactor: Keep HelpMessageDialog in the main event loop

https://github.com/bitcoin-core/gui/pull/336/commits/332dea2852d9c68f900ed1f0be99b6cea79c7457

scripted-diff: Rename ShowModalDialogAndDeleteOnClose

-BEGIN VERIFY SCRIPT-
sed -i 's/ShowModalDialogAndDeleteOnClose/ShowModalDialogAsynchronously/' -- $(git grep -l -e "ShowModalDialogAndDeleteOnClose")
-END VERIFY SCRIPT-

It is important to highlight that a modal dialog is showed
asynchronously as there are cases when the synchronous QDialog::exec()
is required.

https://github.com/bitcoin-core/gui/pull/509/commits/f730bd7d580502ae3c3b5953ada3724b59f5cd9b

This is a partial backport of core-gui#336 and core-gui#509

Depends on D18146

Test Plan:
ninja all check-all

run bitcoin-qt, check that wallet gets locked again after each send (regression fixed by the core-gui#509 commit)

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D18149

Details

Provenance
Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>Authored on Jun 7 2021, 15:00
PiRKCommitted on May 26 2025, 13:35
PiRKPushed on May 26 2025, 13:35
Reviewer
Restricted Project
Differential Revision
D18149: gui: replace some QDialog::exec() with safer QDialog::show() calls
Parents
rABC076cec51f98f: qt: don't pass config to BitcoinApplication::requestShutdown
Branches
Unknown
Tags
Unknown