Merge pull request 'PasswordDialog: Show wallet name' (#103) from mrdeveloper/feather:password-dialog-show-wallet-name into master

Reviewed-on: https://git.wownero.com/feather/feather/pulls/103
Reviewed-by: tobtoht <tobtoht@noreply.gitgud.wownero.nl>
This commit is contained in:
mrdeveloper 2020-10-21 10:26:33 +00:00
commit 23000c6e60
6 changed files with 8 additions and 7 deletions

View file

@ -317,7 +317,7 @@ void AppContext::onWalletOpened(Wallet *wallet) {
emit walletOpenedError(errMsg); emit walletOpenedError(errMsg);
} else { } else {
this->walletClose(false); this->walletClose(false);
emit walletOpenPasswordNeeded(this->walletPassword.isEmpty()); emit walletOpenPasswordNeeded(this->walletPassword.isEmpty(), wallet->path());
} }
return; return;
} }

View file

@ -147,7 +147,7 @@ signals:
void walletCreatedError(const QString &msg); void walletCreatedError(const QString &msg);
void walletCreated(Wallet *wallet); void walletCreated(Wallet *wallet);
void walletOpenedError(QString msg); void walletOpenedError(QString msg);
void walletOpenPasswordNeeded(bool invalidPassword); void walletOpenPasswordNeeded(bool invalidPassword, QString path);
void transactionCommitted(bool status, PendingTransaction *tx, const QStringList& txid); void transactionCommitted(bool status, PendingTransaction *tx, const QStringList& txid);
void createTransactionError(QString message); void createTransactionError(QString message);
void createTransactionCancelled(QString address, double amount); void createTransactionCancelled(QString address, double amount);

View file

@ -58,7 +58,7 @@ void CLI::onWalletOpenedError(const QString &err) {
return this->finishedError(err); return this->finishedError(err);
} }
void CLI::onWalletOpenPasswordRequired(bool invalidPassword) { void CLI::onWalletOpenPasswordRequired(bool invalidPassword, const QString &path) {
if(mode == CLIMode::CLIModeExportContacts || if(mode == CLIMode::CLIModeExportContacts ||
mode == CLIMode::CLIModeExportTxHistory) mode == CLIMode::CLIModeExportTxHistory)
return this->finishedError("invalid password"); return this->finishedError("invalid password");

View file

@ -26,7 +26,7 @@ public slots:
//libwalletqt //libwalletqt
void onWalletOpened(); void onWalletOpened();
void onWalletOpenedError(const QString& err); void onWalletOpenedError(const QString& err);
void onWalletOpenPasswordRequired(bool invalidPassword); void onWalletOpenPasswordRequired(bool invalidPassword, const QString &path);
private: private:
AppContext *ctx; AppContext *ctx;

View file

@ -547,12 +547,13 @@ void MainWindow::onWalletCreatedError(const QString &err) {
this->showWizard(WalletWizard::Page_CreateWallet); this->showWizard(WalletWizard::Page_CreateWallet);
} }
void MainWindow::onWalletOpenPasswordRequired(bool invalidPassword) { void MainWindow::onWalletOpenPasswordRequired(bool invalidPassword, const QString &path) {
QFileInfo fileInfo(path);
QInputDialog passwordDialog(this); QInputDialog passwordDialog(this);
passwordDialog.setInputMode(QInputDialog::TextInput); passwordDialog.setInputMode(QInputDialog::TextInput);
passwordDialog.setTextEchoMode(QLineEdit::Password); passwordDialog.setTextEchoMode(QLineEdit::Password);
passwordDialog.setWindowTitle("Password required"); 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); passwordDialog.resize(300, 100);
if(!(bool)passwordDialog.exec()) if(!(bool)passwordDialog.exec())
return this->showWizard(WalletWizard::Page_OpenWallet); return this->showWizard(WalletWizard::Page_OpenWallet);

View file

@ -96,7 +96,7 @@ public slots:
void onWalletCreated(Wallet *wallet); void onWalletCreated(Wallet *wallet);
void menuWalletCloseClicked(); void menuWalletCloseClicked();
void menuWalletOpenClicked(); void menuWalletOpenClicked();
void onWalletOpenPasswordRequired(bool invalidPassword); void onWalletOpenPasswordRequired(bool invalidPassword, const QString &path);
void onViewOnBlockExplorer(const QString &txid); void onViewOnBlockExplorer(const QString &txid);
void onAddContact(const QString &address, const QString &name); void onAddContact(const QString &address, const QString &name);
void importContacts(); void importContacts();