0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

Merge bitcoin-core/gui#770: Revert "gui: provide wallet controller context to wallet actions"

f09bfab4af Revert "gui: provide wallet controller context to wallet actions" (Hennadii Stepanov)

Pull request description:

  The commit 7066e8996d from https://github.com/bitcoin-core/gui/pull/765 breaks "Open Wallet", "Close Wallet" and "Close All Wallets" items in the File menu (at least on Ubuntu 23.10 + Wayland).

  Reverting it to avoid this regression in the 26.0 release.

ACKs for top commit:
  furszy:
    ACK f09bfab4 for including it in v26.
  jarolrod:
    ACK f09bfab4af

Tree-SHA512: fedc621c8e9bf84a263b0c28da53225febe0267d0123830a6192297f38e40726e1613e003b634215e7d16791ba6eab52fb4baab3da9637f6660b6ae1ae98462b
This commit is contained in:
Hennadii Stepanov 2023-10-23 15:09:52 +01:00
commit 565c55119b
No known key found for this signature in database
GPG key ID: 410108112E7EA81F

View file

@ -392,7 +392,7 @@ void BitcoinGUI::createActions()
connect(usedSendingAddressesAction, &QAction::triggered, walletFrame, &WalletFrame::usedSendingAddresses);
connect(usedReceivingAddressesAction, &QAction::triggered, walletFrame, &WalletFrame::usedReceivingAddresses);
connect(openAction, &QAction::triggered, this, &BitcoinGUI::openClicked);
connect(m_open_wallet_menu, &QMenu::aboutToShow, m_wallet_controller, [this] {
connect(m_open_wallet_menu, &QMenu::aboutToShow, [this] {
m_open_wallet_menu->clear();
for (const std::pair<const std::string, bool>& i : m_wallet_controller->listWalletDir()) {
const std::string& path = i.first;
@ -409,7 +409,7 @@ void BitcoinGUI::createActions()
continue;
}
connect(action, &QAction::triggered, m_wallet_controller, [this, path] {
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);
@ -421,7 +421,7 @@ void BitcoinGUI::createActions()
action->setEnabled(false);
}
});
connect(m_restore_wallet_action, &QAction::triggered, m_wallet_controller, [this] {
connect(m_restore_wallet_action, &QAction::triggered, [this] {
//: Name of the wallet data file format.
QString name_data_file = tr("Wallet Data");
@ -447,14 +447,14 @@ void BitcoinGUI::createActions()
auto backup_file_path = fs::PathFromString(backup_file.toStdString());
activity->restore(backup_file_path, wallet_name.toStdString());
});
connect(m_close_wallet_action, &QAction::triggered, m_wallet_controller, [this] {
connect(m_close_wallet_action, &QAction::triggered, [this] {
m_wallet_controller->closeWallet(walletFrame->currentWalletModel(), this);
});
connect(m_create_wallet_action, &QAction::triggered, this, &BitcoinGUI::createWallet);
connect(m_close_all_wallets_action, &QAction::triggered, m_wallet_controller, [this] {
connect(m_close_all_wallets_action, &QAction::triggered, [this] {
m_wallet_controller->closeAllWallets(this);
});
connect(m_migrate_wallet_action, &QAction::triggered, m_wallet_controller, [this] {
connect(m_migrate_wallet_action, &QAction::triggered, [this] {
auto activity = new MigrateWalletActivity(m_wallet_controller, this);
connect(activity, &MigrateWalletActivity::migrated, this, &BitcoinGUI::setCurrentWallet);
activity->migrate(walletFrame->currentWalletModel());