mirror of
https://github.com/feather-wallet/feather.git
synced 2024-11-17 01:37:53 +00:00
Enter password to open seed, keys dialog
This commit is contained in:
parent
2b2107b32d
commit
e2a591baed
2 changed files with 25 additions and 0 deletions
|
@ -701,6 +701,10 @@ void MainWindow::showSeedDialog() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this->verifyPassword()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SeedDialog dialog{m_ctx, this};
|
SeedDialog dialog{m_ctx, this};
|
||||||
dialog.exec();
|
dialog.exec();
|
||||||
}
|
}
|
||||||
|
@ -772,6 +776,10 @@ void MainWindow::showRestoreHeightDialog() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::showKeysDialog() {
|
void MainWindow::showKeysDialog() {
|
||||||
|
if (!this->verifyPassword()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
KeysDialog dialog{m_ctx, this};
|
KeysDialog dialog{m_ctx, this};
|
||||||
dialog.exec();
|
dialog.exec();
|
||||||
}
|
}
|
||||||
|
@ -1557,6 +1565,22 @@ void MainWindow::updateRecentlyOpenedMenu() {
|
||||||
ui->menuRecently_open->addAction(m_clearRecentlyOpenAction);
|
ui->menuRecently_open->addAction(m_clearRecentlyOpenAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MainWindow::verifyPassword() {
|
||||||
|
bool ok;
|
||||||
|
while (true) {
|
||||||
|
QString password = QInputDialog::getText(this, "Enter password", "Please enter your password:", QLineEdit::EchoMode::Password, "", &ok);
|
||||||
|
if (!ok) { // Dialog cancelled
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (password != m_ctx->wallet->getPassword()) {
|
||||||
|
QMessageBox::warning(this, "Error", "Incorrect password");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::toggleSearchbar(bool visible) {
|
void MainWindow::toggleSearchbar(bool visible) {
|
||||||
config()->set(Config::showSearchbar, visible);
|
config()->set(Config::showSearchbar, visible);
|
||||||
|
|
||||||
|
|
|
@ -212,6 +212,7 @@ private:
|
||||||
void addToRecentlyOpened(const QString &filename);
|
void addToRecentlyOpened(const QString &filename);
|
||||||
void updateRecentlyOpenedMenu();
|
void updateRecentlyOpenedMenu();
|
||||||
void updateWidgetIcons();
|
void updateWidgetIcons();
|
||||||
|
bool verifyPassword();
|
||||||
|
|
||||||
QIcon hardwareDevicePairedIcon();
|
QIcon hardwareDevicePairedIcon();
|
||||||
QIcon hardwareDeviceUnpairedIcon();
|
QIcon hardwareDeviceUnpairedIcon();
|
||||||
|
|
Loading…
Reference in a new issue