mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-20 16:48:39 +02:00
Trezor: add passphrase support
This commit is contained in:
@@ -377,6 +377,7 @@ void MainWindow::initWalletContext() {
|
||||
// Wallet
|
||||
connect(m_ctx->wallet, &Wallet::connectionStatusChanged, this, &MainWindow::onConnectionStatusChanged);
|
||||
connect(m_ctx->wallet, &Wallet::currentSubaddressAccountChanged, this, &MainWindow::updateTitle);
|
||||
connect(m_ctx->wallet, &Wallet::walletPassphraseNeeded, this, &MainWindow::onWalletPassphraseNeeded);
|
||||
}
|
||||
|
||||
void MainWindow::menuToggleTabVisible(const QString &key){
|
||||
@@ -1190,6 +1191,25 @@ void MainWindow::onDeviceButtonPressed() {
|
||||
m_splashDialog->hide();
|
||||
}
|
||||
|
||||
void MainWindow::onWalletPassphraseNeeded(bool on_device) {
|
||||
auto button = QMessageBox::question(nullptr, "Wallet Passphrase Needed", "Enter passphrase on hardware wallet?\n\n"
|
||||
"It is recommended to enter passphrase on "
|
||||
"the hardware wallet for better security.",
|
||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
|
||||
if (button == QMessageBox::Yes) {
|
||||
m_ctx->wallet->onPassphraseEntered("", true, false);
|
||||
return;
|
||||
}
|
||||
|
||||
bool ok;
|
||||
QString passphrase = QInputDialog::getText(nullptr, "Wallet Passphrase Needed", "Enter passphrase:", QLineEdit::EchoMode::Password, "", &ok);
|
||||
if (ok) {
|
||||
m_ctx->wallet->onPassphraseEntered(passphrase, false, false);
|
||||
} else {
|
||||
m_ctx->wallet->onPassphraseEntered(passphrase, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::updateNetStats() {
|
||||
if (!m_ctx->wallet || m_ctx->wallet->connectionStatus() == Wallet::ConnectionStatus_Disconnected
|
||||
|| m_ctx->wallet->connectionStatus() == Wallet::ConnectionStatus_Synchronized)
|
||||
|
||||
Reference in New Issue
Block a user