| 238 | } |
| 239 | |
| 240 | void CreateWalletActivity::createWallet() |
| 241 | { |
| 242 | showProgressDialog( |
| 243 | //: Title of window indicating the progress of creation of a new wallet. |
| 244 | tr("Create Wallet"), |
| 245 | /*: Descriptive text of the create wallet progress window which indicates |
| 246 | to the user which wallet is currently being created. */ |
| 247 | tr("Creating Wallet <b>%1</b>…").arg(m_create_wallet_dialog->walletName().toHtmlEscaped())); |
| 248 | |
| 249 | std::string name = m_create_wallet_dialog->walletName().toStdString(); |
| 250 | uint64_t flags = 0; |
| 251 | if (m_create_wallet_dialog->isDisablePrivateKeysChecked()) { |
| 252 | flags |= WALLET_FLAG_DISABLE_PRIVATE_KEYS; |
| 253 | } |
| 254 | if (m_create_wallet_dialog->isMakeBlankWalletChecked()) { |
| 255 | flags |= WALLET_FLAG_BLANK_WALLET; |
| 256 | } |
| 257 | if (m_create_wallet_dialog->isDescriptorWalletChecked()) { |
| 258 | flags |= WALLET_FLAG_DESCRIPTORS; |
| 259 | } |
| 260 | if (m_create_wallet_dialog->isExternalSignerChecked()) { |
| 261 | flags |= WALLET_FLAG_EXTERNAL_SIGNER; |
| 262 | } |
| 263 | |
| 264 | QTimer::singleShot(500ms, worker(), [this, name, flags] { |
| 265 | std::unique_ptr<interfaces::Wallet> wallet = node().walletLoader().createWallet(name, m_passphrase, flags, m_error_message, m_warning_message); |
| 266 | |
| 267 | if (wallet) m_wallet_model = m_wallet_controller->getOrCreateWallet(std::move(wallet)); |
| 268 | |
| 269 | QTimer::singleShot(500ms, this, &CreateWalletActivity::finish); |
| 270 | }); |
| 271 | } |
| 272 | |
| 273 | void CreateWalletActivity::finish() |
| 274 | { |
nothing calls this directly
no test coverage detected