connect(ui->actionRefresh_tabs, &QAction::triggered, [this]{m_ctx->refreshModels();});
connect(ui->actionRescan_spent, &QAction::triggered, this, &MainWindow::rescanSpent);
connect(ui->actionWallet_cache_debug, &QAction::triggered, this, &MainWindow::showWalletCacheDebugDialog);
- connect(ui->actionChange_restore_height, &QAction::triggered, this, &MainWindow::showRestoreHeightDialog);
// [Wallet] -> [Advanced] -> [Export]
connect(ui->actionExportOutputs, &QAction::triggered, this, &MainWindow::exportOutputs);
connect(m_ctx.get(), &AppContext::deviceButtonPressed, this, &MainWindow::onDeviceButtonPressed);
connect(m_ctx.get(), &AppContext::initiateTransaction, this, &MainWindow::onInitiateTransaction);
connect(m_ctx.get(), &AppContext::endTransaction, this, &MainWindow::onEndTransaction);
- connect(m_ctx.get(), &AppContext::customRestoreHeightSet, this, &MainWindow::onCustomRestoreHeightSet);
connect(m_ctx.get(), &AppContext::keysCorrupted, this, &MainWindow::onKeysCorrupted);
connect(m_ctx.get(), &AppContext::selectedInputsChanged, this, &MainWindow::onSelectedInputsChanged);
m_statusBtnPassword->setIcon(icon);
}
-void MainWindow::showRestoreHeightDialog() {
- // settings custom restore height is only available for 25 word seeds
- auto seedLength = m_ctx->wallet->seedLength();
- if (seedLength == 14 || seedLength == 16) { // TODO: update this warning (import tx, delete cache, restore from seed)
- const auto msg = "This wallet has a mnemonic seed with an embedded restore height.";
- QMessageBox::warning(this, "Cannot set custom restore height", msg);
- return;
- }
-
- RestoreHeightDialog dialog{this, m_ctx->wallet->getWalletCreationHeight()};
- if (dialog.exec() == QDialog::Accepted) {
- int restoreHeight = dialog.getHeight();
- m_ctx->onSetRestoreHeight(restoreHeight);
- }
-}
-
void MainWindow::showKeysDialog() {
if (!this->verifyPassword()) {
return;
}
}
-void MainWindow::onCustomRestoreHeightSet(int height) {
- auto msg = QString("The restore height for this wallet has been set to %1. "
- "Please re-open the wallet. Feather will now quit.").arg(height);
- QMessageBox::information(this, "Cannot set custom restore height", msg);
- this->menuQuitClicked();
-}
-
void MainWindow::onKeysCorrupted() {
if (!m_criticalWarningShown) {
m_criticalWarningShown = true;
#include "dialog/PasswordChangeDialog.h"
#include "dialog/KeysDialog.h"
#include "dialog/AboutDialog.h"
-#include "dialog/RestoreHeightDialog.h"
#include "dialog/SplashDialog.h"
#include "libwalletqt/Wallet.h"
#include "model/SubaddressModel.h"
void onSignedHashesReceived(QNetworkReply *reply, const QString &platformTag, const QString &version);
void onInitiateTransaction();
void onEndTransaction();
- void onCustomRestoreHeightSet(int height);
void onKeysCorrupted();
void onSelectedInputsChanged(const QStringList &selectedInputs);
void onViewOnBlockExplorer(const QString &txid);
void onResendTransaction(const QString &txid);
void importContacts();
- void showRestoreHeightDialog();
void importTransaction();
void onDeviceError(const QString &error);
void onDeviceButtonRequest(quint64 code);
<addaction name="actionRescan_spent"/>
<addaction name="actionWallet_cache_debug"/>
<addaction name="separator"/>
- <addaction name="actionChange_restore_height"/>
<addaction name="menuExport"/>
<addaction name="menuImport"/>
</widget>
qDebug() << "Changed privacyLevel to " << privacyLevel;
}
-void AppContext::onSetRestoreHeight(quint64 height){
- auto seedLength = this->wallet->seedLength();
- if (seedLength == 14 || seedLength == 16) {
- const auto msg = "This wallet has a mnemonic seed with an embedded restore height.";
- emit setRestoreHeightError(msg);
- return;
- }
-
- this->wallet->setWalletCreationHeight(height);
- this->wallet->setPassword(this->wallet->getPassword()); // trigger .keys write
-
- // nuke wallet cache
- const auto fn = this->wallet->cachePath();
- WalletManager::clearWalletCache(fn);
-
- emit customRestoreHeightSet(height);
-}
-
void AppContext::stopTimers() {
m_storeTimer.stop();
}
void onCancelTransaction(PendingTransaction *tx, const QVector<QString> &address);
void onSweepOutputs(const QVector<QString> &keyImages, QString address, bool churn, int outputs);
void onCreateTransactionError(const QString &msg);
- void onSetRestoreHeight(quint64 height);
void onMultiBroadcast(PendingTransaction *tx);
void onDeviceButtonRequest(quint64 code);
void onDeviceButtonPressed();
void createTransactionError(QString message);
void createTransactionCancelled(const QVector<QString> &address, quint64 amount);
void createTransactionSuccess(PendingTransaction *tx, const QVector<QString> &address);
- void setRestoreHeightError(const QString &msg);
- void customRestoreHeightSet(int height);
void initiateTransaction();
void endTransaction();
void deviceButtonRequest(quint64 code);
+++ /dev/null
-// SPDX-License-Identifier: BSD-3-Clause
-// SPDX-FileCopyrightText: 2020-2022 The Monero Project
-
-#include "RestoreHeightDialog.h"
-
-#include <QLabel>
-#include <QVBoxLayout>
-#include <QDialogButtonBox>
-
-RestoreHeightDialog::RestoreHeightDialog(QWidget *parent, quint64 currentRestoreHeight)
- : WindowModalDialog(parent)
- , m_restoreHeightWidget(new RestoreHeightWidget(this))
-{
- auto *layout = new QVBoxLayout(this);
-
- auto *label = new QLabel(this);
- label->setText("Enter a wallet creation date or restore height.");
-
- auto *buttonBox = new QDialogButtonBox(this);
- buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
-
- layout->addWidget(label);
- layout->addWidget(m_restoreHeightWidget);
- layout->addWidget(buttonBox);
-
- this->setLayout(layout);
-
- if (currentRestoreHeight) {
- m_restoreHeightWidget->setHeight(currentRestoreHeight);
- }
-
- connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
- connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
-
- this->adjustSize();
-}
-
-int RestoreHeightDialog::getHeight() {
- return m_restoreHeightWidget->getHeight();
-}
\ No newline at end of file
+++ /dev/null
-// SPDX-License-Identifier: BSD-3-Clause
-// SPDX-FileCopyrightText: 2020-2022 The Monero Project
-
-#ifndef FEATHER_RESTOREHEIGHTDIALOG_H
-#define FEATHER_RESTOREHEIGHTDIALOG_H
-
-#include <QDialog>
-
-#include "components.h"
-#include "widgets/RestoreHeightWidget.h"
-
-class RestoreHeightDialog : public WindowModalDialog
-{
-Q_OBJECT
-
-public:
- explicit RestoreHeightDialog(QWidget *parent = nullptr, quint64 currentRestoreHeight = 0);
- int getHeight();
-
-private:
- RestoreHeightWidget *m_restoreHeightWidget;
-};
-
-
-#endif //FEATHER_RESTOREHEIGHTDIALOG_H