-
Notifications
You must be signed in to change notification settings - Fork 328
Switch RPCConsole wallet selection to the one most recently opened/restored/created #696
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
Switch RPCConsole wallet selection to the one most recently opened/restored/created #696
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
|
Is there any guidance on what to do in cases of (almost certainly) spurious CI test failures? The test failed here: gui/test/functional/p2p_invalid_messages.py Lines 90 to 92 in 9887fc7
It seems this behavior is expected in very rare cases. I imagine that asking for a manual CI restart is preferred over (say) force pushing an empty amended commit? |
Restarted. |
|
Concept ACK. |
src/qt/rpcconsole.h
Outdated
| #ifdef ENABLE_WALLET | ||
| void addWallet(WalletModel* const walletModel); | ||
| void removeWallet(WalletModel* const walletModel); | ||
| void SetCurrentWallet(WalletModel* const wallet_model); |
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.
-
Should it be declared as a slot?
-
In the
qtsubdirectory we usually follow Qt's naming convention. Mind renaming please
| void SetCurrentWallet(WalletModel* const wallet_model); | |
| void setCurrentWallet(WalletModel* const wallet_model); |
?
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.
The const has no effect here.
src/qt/rpcconsole.cpp
Outdated
| } | ||
| } | ||
|
|
||
| void RPCConsole::SetCurrentWallet(WalletModel* const wallet_model) |
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 const? The parameter of all connected signals is WalletModel* wallet_model, right?
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 the pointer that's const here. Seems pretty reasonable, though it only has a net effect of preventing accidentally changing wallet_model in this method.
|
cc @john-moffett still working on this? |
luke-jr
left a comment
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.
utACK 5781f45, after method renamed to setCurrentWallet
|
ping @john-moffett :) |
If a user opens multiple wallets in the GUI from the menu bar, the last one opened is the active one in the main window. However, For the RPC Console window, the _first_ one opened is active. This can be confusing, as wallet RPC commands may be sent to a wallet the user didn't intend. This commit makes the RPC Console switch to the wallet opened from the menu bar.
5781f45 to
99c0eb9
Compare
luke-jr
left a comment
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.
utACK 99c0eb9
hebasto
left a comment
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.
ACK 99c0eb9, tested on Ubuntu 23.04.
If a user opens multiple wallets in the GUI from the menu bar, the last one opened is the active one in the main window. However, For the RPC Console window, the first one opened is active. This can be confusing, as wallet RPC commands may be sent to a wallet the user didn't intend.
This PR makes the RPC Console switch to the wallet just opened / restored / created from the menu bar, which is how the main GUI now works.
Similar to #665 and specifically requested in a comment.