gui: Show an error message if the restored wallet name is empty

The Restore Wallet dialog rejects wallet names that are empty, but was
doing so silently. This is confusing, we should be presenting an error
message to the user.
This commit is contained in:
Ava Chow
2026-01-12 15:40:01 -08:00
parent 796f18e559
commit dd904298c1

View File

@@ -452,7 +452,11 @@ void BitcoinGUI::createActions()
//: Label of the input field where the name of the wallet is entered.
QString label = tr("Wallet Name");
QString wallet_name = QInputDialog::getText(this, title, label, QLineEdit::Normal, "", &wallet_name_ok);
if (!wallet_name_ok || wallet_name.isEmpty()) return;
if (!wallet_name_ok) return;
if (wallet_name.isEmpty()) {
QMessageBox::critical(nullptr, tr("Invalid Wallet Name"), tr("Wallet name cannot be empty"));
return;
}
auto activity = new RestoreWalletActivity(m_wallet_controller, this);
connect(activity, &RestoreWalletActivity::restored, this, &BitcoinGUI::setCurrentWallet, Qt::QueuedConnection);