mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-12 05:34:57 +01:00
Merge bitcoin-core/gui#738: Add menu option to migrate a wallet
48aae2cffegui: Add File > Migrate Wallet (Andrew Chow)577be889cdgui: Optionally return passphrase after unlocking (Andrew Chow)5b3a85b4c6interfaces, wallet: Expose migrate wallet (Andrew Chow) Pull request description: GUI users need to be able to migrate wallets without going to the RPC console. ACKs for top commit: jarolrod: ACK48aae2cffepablomartin4btc: tACK48aae2cffehebasto: ACK48aae2cffeTree-SHA512: 2d02b1e85e7d6cfbf503f417f150cdaa0c63822942e9a6fe28c0ad3e7f40a957bb01a375c909a60432dc600e84574881aa446c7ec983b56f0bb23f07ef15de54
This commit is contained in:
@@ -359,6 +359,10 @@ void BitcoinGUI::createActions()
|
||||
m_close_all_wallets_action = new QAction(tr("Close All Wallets…"), this);
|
||||
m_close_all_wallets_action->setStatusTip(tr("Close all wallets"));
|
||||
|
||||
m_migrate_wallet_action = new QAction(tr("Migrate Wallet"), this);
|
||||
m_migrate_wallet_action->setEnabled(false);
|
||||
m_migrate_wallet_action->setStatusTip(tr("Migrate a wallet"));
|
||||
|
||||
showHelpMessageAction = new QAction(tr("&Command-line options"), this);
|
||||
showHelpMessageAction->setMenuRole(QAction::NoRole);
|
||||
showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Bitcoin command-line options").arg(PACKAGE_NAME));
|
||||
@@ -459,6 +463,11 @@ void BitcoinGUI::createActions()
|
||||
connect(m_close_all_wallets_action, &QAction::triggered, [this] {
|
||||
m_wallet_controller->closeAllWallets(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());
|
||||
});
|
||||
connect(m_mask_values_action, &QAction::toggled, this, &BitcoinGUI::setPrivacy);
|
||||
connect(m_mask_values_action, &QAction::toggled, this, &BitcoinGUI::enableHistoryAction);
|
||||
}
|
||||
@@ -486,6 +495,7 @@ void BitcoinGUI::createMenuBar()
|
||||
file->addAction(m_open_wallet_action);
|
||||
file->addAction(m_close_wallet_action);
|
||||
file->addAction(m_close_all_wallets_action);
|
||||
file->addAction(m_migrate_wallet_action);
|
||||
file->addSeparator();
|
||||
file->addAction(backupWalletAction);
|
||||
file->addAction(m_restore_wallet_action);
|
||||
@@ -770,6 +780,7 @@ void BitcoinGUI::setCurrentWallet(WalletModel* wallet_model)
|
||||
}
|
||||
}
|
||||
updateWindowTitle();
|
||||
m_migrate_wallet_action->setEnabled(wallet_model->wallet().isLegacy());
|
||||
}
|
||||
|
||||
void BitcoinGUI::setCurrentWalletBySelectorIndex(int index)
|
||||
@@ -803,6 +814,7 @@ void BitcoinGUI::setWalletActionsEnabled(bool enabled)
|
||||
openAction->setEnabled(enabled);
|
||||
m_close_wallet_action->setEnabled(enabled);
|
||||
m_close_all_wallets_action->setEnabled(enabled);
|
||||
m_migrate_wallet_action->setEnabled(enabled);
|
||||
}
|
||||
|
||||
void BitcoinGUI::createTrayIcon()
|
||||
|
||||
Reference in New Issue
Block a user