| 398 | } |
| 399 | |
| 400 | void RestoreWalletActivity::restore(const fs::path& backup_file, const std::string& wallet_name) |
| 401 | { |
| 402 | QString name = QString::fromStdString(wallet_name); |
| 403 | |
| 404 | showProgressDialog( |
| 405 | //: Title of progress window which is displayed when wallets are being restored. |
| 406 | tr("Restore Wallet"), |
| 407 | /*: Descriptive text of the restore wallets progress window which indicates to |
| 408 | the user that wallets are currently being restored.*/ |
| 409 | tr("Restoring Wallet <b>%1</b>…").arg(name.toHtmlEscaped())); |
| 410 | |
| 411 | QTimer::singleShot(0, worker(), [this, backup_file, wallet_name] { |
| 412 | auto wallet{node().walletLoader().restoreWallet(backup_file, wallet_name, m_warning_message, /*load_after_restore=*/true)}; |
| 413 | |
| 414 | if (wallet) { |
| 415 | m_wallet_model = m_wallet_controller->getOrCreateWallet(std::move(*wallet)); |
| 416 | } else { |
| 417 | m_error_message = util::ErrorString(wallet); |
| 418 | } |
| 419 | |
| 420 | QTimer::singleShot(0, this, &RestoreWalletActivity::finish); |
| 421 | }); |
| 422 | } |
| 423 | |
| 424 | void RestoreWalletActivity::finish() |
| 425 | { |
no test coverage detected