mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-09 02:59:31 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user