Skip to content

Conversation

@john-moffett
Copy link
Contributor

@john-moffett john-moffett commented Jan 10, 2023

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.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 10, 2023

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.

@john-moffett
Copy link
Contributor Author

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

# If this assert fails, we've hit an unlikely race
# where the test framework sent a message in between the two halves
assert_equal(middle, before + cut_pos)

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?

@hebasto
Copy link
Member

hebasto commented Jan 15, 2023

I imagine that asking for a manual CI restart is preferred

Restarted.

@hebasto
Copy link
Member

hebasto commented Jan 15, 2023

Concept ACK.

@hebasto hebasto added the UX All about "how to get things done" label Jan 15, 2023
#ifdef ENABLE_WALLET
void addWallet(WalletModel* const walletModel);
void removeWallet(WalletModel* const walletModel);
void SetCurrentWallet(WalletModel* const wallet_model);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Should it be declared as a slot?

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

Suggested change
void SetCurrentWallet(WalletModel* const wallet_model);
void setCurrentWallet(WalletModel* const wallet_model);

?

Copy link
Member

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.

}
}

void RPCConsole::SetCurrentWallet(WalletModel* const wallet_model)
Copy link
Member

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?

Copy link
Member

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.

@jarolrod
Copy link
Contributor

jarolrod commented May 2, 2023

cc @john-moffett still working on this?

Copy link
Member

@luke-jr luke-jr left a 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

@hebasto
Copy link
Member

hebasto commented Jul 3, 2023

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.
@john-moffett john-moffett force-pushed the 2023_01_SwitchRPCConsoleToOpenedWallet branch from 5781f45 to 99c0eb9 Compare July 3, 2023 16:10
@john-moffett
Copy link
Contributor Author

Thanks for pings, @hebasto and @jarolrod. Apologies for the delay. I've renamed the method and moved the declaration to the Q_SLOTS section.

Copy link
Member

@luke-jr luke-jr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 99c0eb9

Copy link
Member

@hebasto hebasto left a 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.

@hebasto hebasto merged commit c71a96c into bitcoin-core:master Jul 4, 2023
@DrahtBot DrahtBot removed the CI failed label Jul 4, 2023
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jul 4, 2023
@bitcoin-core bitcoin-core locked and limited conversation to collaborators Jul 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

UX All about "how to get things done"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants