mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
gui: provide wallet controller context to wallet actions
Addressing potential crashes during shutdown. The most noticeable one can be triggered by hovering over the wallet list as the app shuts down.
This commit is contained in:
parent
78b7e95518
commit
7066e8996d
1 changed files with 6 additions and 6 deletions
|
@ -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, [this] {
|
||||
connect(m_open_wallet_menu, &QMenu::aboutToShow, m_wallet_controller, [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, [this, path] {
|
||||
connect(action, &QAction::triggered, m_wallet_controller, [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, [this] {
|
||||
connect(m_restore_wallet_action, &QAction::triggered, m_wallet_controller, [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, [this] {
|
||||
connect(m_close_wallet_action, &QAction::triggered, m_wallet_controller, [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, [this] {
|
||||
connect(m_close_all_wallets_action, &QAction::triggered, m_wallet_controller, [this] {
|
||||
m_wallet_controller->closeAllWallets(this);
|
||||
});
|
||||
connect(m_migrate_wallet_action, &QAction::triggered, [this] {
|
||||
connect(m_migrate_wallet_action, &QAction::triggered, m_wallet_controller, [this] {
|
||||
auto activity = new MigrateWalletActivity(m_wallet_controller, this);
|
||||
connect(activity, &MigrateWalletActivity::migrated, this, &BitcoinGUI::setCurrentWallet);
|
||||
activity->migrate(walletFrame->currentWalletModel());
|
||||
|
|
Loading…
Add table
Reference in a new issue