Switch RPCConsole wallet selection to the one most recently opened/restored/created #696

pull john-moffett wants to merge 1 commits into bitcoin-core:master from john-moffett:2023_01_SwitchRPCConsoleToOpenedWallet changing 3 files +13 −0
  1. john-moffett commented at 9:02 pm on January 10, 2023: contributor

    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.

  2. DrahtBot commented at 9:02 pm on January 10, 2023: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK luke-jr, hebasto

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. john-moffett commented at 4:19 pm on January 11, 2023: contributor

    Is there any guidance on what to do in cases of (almost certainly) spurious CI test failures? The test failed here:

    https://github.com/bitcoin-core/gui/blob/9887fc789886b356efc6818783cabaab2b14481f/test/functional/p2p_invalid_messages.py#L90-L92

    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?

  4. hebasto commented at 8:31 pm on January 15, 2023: member

    I imagine that asking for a manual CI restart is preferred

    Restarted.

  5. hebasto commented at 8:32 pm on January 15, 2023: member
    Concept ACK.
  6. hebasto added the label UX on Jan 15, 2023
  7. in src/qt/rpcconsole.h:61 in 5781f45ff3 outdated
    57@@ -58,6 +58,7 @@ class RPCConsole: public QWidget
    58 #ifdef ENABLE_WALLET
    59     void addWallet(WalletModel* const walletModel);
    60     void removeWallet(WalletModel* const walletModel);
    61+    void SetCurrentWallet(WalletModel* const wallet_model);
    


    hebasto commented at 11:33 am on March 27, 2023:
    1. Should it be declared as a slot?

    2. In the qt subdirectory we usually follow Qt’s naming convention. Mind renaming please

    0    void setCurrentWallet(WalletModel* const wallet_model);
    

    ?


    luke-jr commented at 1:52 am on July 1, 2023:
    The const has no effect here.
  8. in src/qt/rpcconsole.cpp:802 in 5781f45ff3 outdated
    797@@ -798,6 +798,12 @@ void RPCConsole::removeWallet(WalletModel * const walletModel)
    798         ui->WalletSelectorLabel->setVisible(false);
    799     }
    800 }
    801+
    802+void RPCConsole::SetCurrentWallet(WalletModel* const wallet_model)
    


    hebasto commented at 11:39 am on March 27, 2023:
    Why const? The parameter of all connected signals is WalletModel* wallet_model, right?

    luke-jr commented at 1:52 am on July 1, 2023:
    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.
  9. jarolrod commented at 4:00 pm on May 2, 2023: member
    cc @john-moffett still working on this?
  10. DrahtBot added the label CI failed on Jun 10, 2023
  11. DrahtBot removed the label CI failed on Jun 19, 2023
  12. luke-jr changes_requested
  13. luke-jr commented at 9:01 pm on July 1, 2023: member
    utACK 5781f45ff32841a3b5d365f5683def34ff2c356e, after method renamed to setCurrentWallet
  14. hebasto commented at 2:52 pm on July 3, 2023: member
    ping @john-moffett :)
  15. Fix RPCConsole wallet selection
    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.
    99c0eb9701
  16. john-moffett force-pushed on Jul 3, 2023
  17. john-moffett commented at 4:11 pm on July 3, 2023: contributor
    Thanks for pings, @hebasto and @jarolrod. Apologies for the delay. I’ve renamed the method and moved the declaration to the Q_SLOTS section.
  18. DrahtBot added the label CI failed on Jul 3, 2023
  19. luke-jr approved
  20. luke-jr commented at 3:34 pm on July 4, 2023: member
    utACK 99c0eb9701e71f16aa360a420b7e4851d5b92510
  21. hebasto approved
  22. hebasto commented at 3:40 pm on July 4, 2023: member
    ACK 99c0eb9701e71f16aa360a420b7e4851d5b92510, tested on Ubuntu 23.04.
  23. hebasto merged this on Jul 4, 2023
  24. hebasto closed this on Jul 4, 2023

  25. DrahtBot removed the label CI failed on Jul 4, 2023
  26. sidhujag referenced this in commit d9f928166f on Jul 4, 2023
  27. bitcoin-core locked this on Jul 3, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 15:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me