-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugfix: Call setWalletActionsEnabled(true) only for the first wallet #43
Conversation
friendly ping @achow101 @meshcollider @promag @Sjors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me why this fixes the problem. Wouldn't a better fix be to enable/disable that menu item depending on the wallet being selected?
if (m_wallet_selector->count() == 2) { | ||
if (m_wallet_selector->count() == 0) { | ||
setWalletActionsEnabled(true); | ||
} else if (m_wallet_selector->count() == 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this change from 2 to 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because m_wallet_selector->addItem()
is called after this code now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just add the count == 1
case in the old code?
Edit: if it's due to some other signal/slot then I'd say to refactor to remove that dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just add the
count == 1
case in the old code?
It would change wallet selector behavior, and it won't fix a bug due to the unconditional setWalletActionsEnabled(true)
call.
Edit: if it's due to some other signal/slot then I'd say to refactor to remove that dependency.
Not sure what do you mean. FWIW, moving this logic into setCurrentWalletBySelectorIndex()
or setCurrentWallet()
won't work as these methods do not know if a wallet has been added or removed.
This is exactly how it works with this PR :) Things are broken in master due to the unconditional call |
|
@achow101 When no wallets are open, and a new first wallet is added, the When any wallet is open already, and a non-first wallet is added, the In the second case the |
Tested ACK 20c9e03 - I could reproduce the issue on master and have verify that this PR fixes it. |
ACK 20c9e03 |
… only for the first wallet 20c9e03 gui: Call setWalletActionsEnabled(true) only for the first wallet (Hennadii Stepanov) Pull request description: On master (a787428) there is a bug: - open an encrypted wallet; please note that the "Encrypt Wallet..." menu item is disabled that is expected: ![Screenshot from 2020-08-03 12-38-37](https://user-images.githubusercontent.com/32963518/89169084-70060c80-d586-11ea-86b9-05ef38d08f41.png) - then open any other wallet; note that the "Encrypt Wallet..." menu item gets enabled that is wrong: ![Screenshot from 2020-08-03 12-42-36](https://user-images.githubusercontent.com/32963518/89169385-d68b2a80-d586-11ea-9813-a533a847e098.png) This PR fixes this bug. ACKs for top commit: jonasschnelli: Tested ACK 20c9e03 - I could reproduce the issue on master and have verify that this PR fixes it. achow101: ACK 20c9e03 Tree-SHA512: 2c9ab94bde8c4f413b0a95c05bf3a1a29f5910e0f99d6639a11dd77758c78af25b060b3fecd78117066ef15b113feb79870bc1347cc04289da915c00623e5787
b5ef9be675 Merge #1: Merge changes from upstream 9e7f512430 Merge remote-tracking branch 'origin/master' into bitcoin-fork 1f85030246 Add support for ARM64 darwin (#43) 3bb959c982 Remove unnecessary reinterpret_cast (#42) 2e97ab26b1 Fix (unused) ReadUint64LE for BE machines (#41) 47b40d2209 Bump dependencies. (#40) ba74185625 Move CI to Visual Studio 2019. efa301a7e5 Allow different C/C++ standards when this is used as a subproject. cc6d71465e CMake: Use configure_package_config_file() git-subtree-dir: src/crc32c git-subtree-split: b5ef9be6755a2e61e2988bb238f13d1c0ee1fa0a
Summary: > On master there is a bug: > - open an encrypted wallet; please note that the "Encrypt Wallet..." menu item is disabled that is expected > - then open any other wallet; note that the "Encrypt Wallet..." menu item gets enabled that is wrong > This PR fixes this bug. This is a backport of [[bitcoin-core/gui#43 | core-gui#43]] Test Plan: `ninja all check-all` Failed to reproduce the bug after this change. Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D10604
On master (a787428) there is a bug:
This PR fixes this bug.