diff --git a/src/appcontext.cpp b/src/appcontext.cpp index e2826a3..16ecef3 100644 --- a/src/appcontext.cpp +++ b/src/appcontext.cpp @@ -317,7 +317,7 @@ void AppContext::onWalletOpened(Wallet *wallet) { emit walletOpenedError(errMsg); } else { this->walletClose(false); - emit walletOpenPasswordNeeded(this->walletPassword.isEmpty()); + emit walletOpenPasswordNeeded(this->walletPassword.isEmpty(), wallet->path()); } return; } diff --git a/src/appcontext.h b/src/appcontext.h index dd9057c..47df6f5 100644 --- a/src/appcontext.h +++ b/src/appcontext.h @@ -147,7 +147,7 @@ signals: void walletCreatedError(const QString &msg); void walletCreated(Wallet *wallet); void walletOpenedError(QString msg); - void walletOpenPasswordNeeded(bool invalidPassword); + void walletOpenPasswordNeeded(bool invalidPassword, QString path); void transactionCommitted(bool status, PendingTransaction *tx, const QStringList& txid); void createTransactionError(QString message); void createTransactionCancelled(QString address, double amount); diff --git a/src/cli.cpp b/src/cli.cpp index db2d4ba..a149e16 100644 --- a/src/cli.cpp +++ b/src/cli.cpp @@ -58,7 +58,7 @@ void CLI::onWalletOpenedError(const QString &err) { return this->finishedError(err); } -void CLI::onWalletOpenPasswordRequired(bool invalidPassword) { +void CLI::onWalletOpenPasswordRequired(bool invalidPassword, const QString &path) { if(mode == CLIMode::CLIModeExportContacts || mode == CLIMode::CLIModeExportTxHistory) return this->finishedError("invalid password"); diff --git a/src/cli.h b/src/cli.h index 5398c31..597c557 100644 --- a/src/cli.h +++ b/src/cli.h @@ -26,7 +26,7 @@ public slots: //libwalletqt void onWalletOpened(); void onWalletOpenedError(const QString& err); - void onWalletOpenPasswordRequired(bool invalidPassword); + void onWalletOpenPasswordRequired(bool invalidPassword, const QString &path); private: AppContext *ctx; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ba72029..ab7c73f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -547,12 +547,13 @@ void MainWindow::onWalletCreatedError(const QString &err) { this->showWizard(WalletWizard::Page_CreateWallet); } -void MainWindow::onWalletOpenPasswordRequired(bool invalidPassword) { +void MainWindow::onWalletOpenPasswordRequired(bool invalidPassword, const QString &path) { + QFileInfo fileInfo(path); QInputDialog passwordDialog(this); passwordDialog.setInputMode(QInputDialog::TextInput); passwordDialog.setTextEchoMode(QLineEdit::Password); passwordDialog.setWindowTitle("Password required"); - passwordDialog.setLabelText("Please enter wallet password."); + passwordDialog.setLabelText(QString("Please enter %1 wallet password.").arg(fileInfo.fileName())); passwordDialog.resize(300, 100); if(!(bool)passwordDialog.exec()) return this->showWizard(WalletWizard::Page_OpenWallet); diff --git a/src/mainwindow.h b/src/mainwindow.h index dafd4f8..4333367 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -96,7 +96,7 @@ public slots: void onWalletCreated(Wallet *wallet); void menuWalletCloseClicked(); void menuWalletOpenClicked(); - void onWalletOpenPasswordRequired(bool invalidPassword); + void onWalletOpenPasswordRequired(bool invalidPassword, const QString &path); void onViewOnBlockExplorer(const QString &txid); void onAddContact(const QString &address, const QString &name); void importContacts();