Merge c71a96c431 into merged_master (Bitcoin PR bitcoin-core/gui#696)

This commit is contained in:
Byron Hambly 2025-06-30 15:47:22 +02:00
commit 332804b98e
3 changed files with 13 additions and 0 deletions

View file

@ -408,6 +408,7 @@ void BitcoinGUI::createActions()
connect(action, &QAction::triggered, [this, path] {
auto activity = new OpenWalletActivity(m_wallet_controller, this);
connect(activity, &OpenWalletActivity::opened, this, &BitcoinGUI::setCurrentWallet, Qt::QueuedConnection);
connect(activity, &OpenWalletActivity::opened, rpcConsole, &RPCConsole::setCurrentWallet, Qt::QueuedConnection);
activity->open(path);
});
}
@ -437,6 +438,7 @@ void BitcoinGUI::createActions()
auto activity = new RestoreWalletActivity(m_wallet_controller, this);
connect(activity, &RestoreWalletActivity::restored, this, &BitcoinGUI::setCurrentWallet, Qt::QueuedConnection);
connect(activity, &RestoreWalletActivity::restored, rpcConsole, &RPCConsole::setCurrentWallet, Qt::QueuedConnection);
auto backup_file_path = fs::PathFromString(backup_file.toStdString());
activity->restore(backup_file_path, wallet_name.toStdString());
@ -447,6 +449,7 @@ void BitcoinGUI::createActions()
connect(m_create_wallet_action, &QAction::triggered, [this] {
auto activity = new CreateWalletActivity(m_wallet_controller, this);
connect(activity, &CreateWalletActivity::created, this, &BitcoinGUI::setCurrentWallet);
connect(activity, &CreateWalletActivity::created, rpcConsole, &RPCConsole::setCurrentWallet);
activity->create();
});
connect(m_close_all_wallets_action, &QAction::triggered, [this] {

View file

@ -801,6 +801,12 @@ void RPCConsole::removeWallet(WalletModel * const walletModel)
ui->WalletSelectorLabel->setVisible(false);
}
}
void RPCConsole::setCurrentWallet(WalletModel* const wallet_model)
{
QVariant data = QVariant::fromValue(wallet_model);
ui->WalletSelector->setCurrentIndex(ui->WalletSelector->findData(data));
}
#endif
static QString categoryClass(int category)

View file

@ -136,6 +136,10 @@ public Q_SLOTS:
void unbanSelectedNode();
/** set which tab has the focus (is visible) */
void setTabFocus(enum TabTypes tabType);
#ifdef ENABLE_WALLET
/** Set the current (ie - active) wallet */
void setCurrentWallet(WalletModel* const wallet_model);
#endif // ENABLE_WALLET
private:
struct TranslatedStrings {