| 345 | } |
| 346 | |
| 347 | void OpenWalletActivity::open(const std::string& path) |
| 348 | { |
| 349 | QString name = GUIUtil::WalletDisplayName(path); |
| 350 | |
| 351 | showProgressDialog( |
| 352 | //: Title of window indicating the progress of opening of a wallet. |
| 353 | tr("Open Wallet"), |
| 354 | /*: Descriptive text of the open wallet progress window which indicates |
| 355 | to the user which wallet is currently being opened. */ |
| 356 | tr("Opening Wallet <b>%1</b>…").arg(name.toHtmlEscaped())); |
| 357 | |
| 358 | QTimer::singleShot(0, worker(), [this, path] { |
| 359 | auto wallet{node().walletLoader().loadWallet(path, m_warning_message)}; |
| 360 | |
| 361 | if (wallet) { |
| 362 | m_wallet_model = m_wallet_controller->getOrCreateWallet(std::move(*wallet)); |
| 363 | } else { |
| 364 | m_error_message = util::ErrorString(wallet); |
| 365 | } |
| 366 | |
| 367 | QTimer::singleShot(0, this, &OpenWalletActivity::finish); |
| 368 | }); |
| 369 | } |
| 370 | |
| 371 | LoadWalletsActivity::LoadWalletsActivity(WalletController* wallet_controller, QWidget* parent_widget) |
| 372 | : WalletControllerActivity(wallet_controller, parent_widget) |
no test coverage detected