-Subproject commit 7f9d4b9b21d776551dd3809bfc4f9e11d7c7b933
+Subproject commit 18bdad879d9f25f35f065354aedf1236e6b0a60b
// ######################## WALLET CREATION ########################
void WindowManager::tryCreateWallet(Seed seed, const QString &path, const QString &password, const QString &seedLanguage,
- const QString &seedOffset) {
+ const QString &seedOffset, const QString &subaddressLookahead) {
if(Utils::fileExists(path)) {
auto err = QString("Failed to write wallet to path: \"%1\"; file already exists.").arg(path);
this->handleWalletError(err);
Wallet *wallet = nullptr;
if (seed.type == Seed::Type::POLYSEED || seed.type == Seed::Type::TEVADOR) {
- wallet = m_walletManager->createDeterministicWalletFromSpendKey(path, password, seed.language, constants::networkType, seed.spendKey, seed.restoreHeight, constants::kdfRounds, seedOffset);
+ wallet = m_walletManager->createDeterministicWalletFromSpendKey(path, password, seed.language, constants::networkType, seed.spendKey, seed.restoreHeight, constants::kdfRounds, seedOffset, subaddressLookahead);
}
else if (seed.type == Seed::Type::MONERO) {
wallet = m_walletManager->recoveryWallet(path, password, seed.mnemonic.join(" "), seedOffset, constants::networkType, seed.restoreHeight, constants::kdfRounds);
this->onWalletOpened(wallet);
}
-void WindowManager::tryCreateWalletFromDevice(const QString &path, const QString &password, const QString &deviceName, int restoreHeight)
+void WindowManager::tryCreateWalletFromDevice(const QString &path, const QString &password, const QString &deviceName, int restoreHeight, const QString &subaddressLookahead)
{
if (Utils::fileExists(path)) {
auto err = QString("Failed to write wallet to path: \"%1\"; file already exists.").arg(path);
}
m_openingWallet = true;
- m_walletManager->createWalletFromDeviceAsync(path, password, constants::networkType, deviceName, restoreHeight);
+ m_walletManager->createWalletFromDeviceAsync(path, password, constants::networkType, deviceName, restoreHeight, subaddressLookahead);
}
void WindowManager::tryCreateWalletFromKeys(const QString &path, const QString &password, const QString &address,
- const QString &viewkey, const QString &spendkey, quint64 restoreHeight) {
+ const QString &viewkey, const QString &spendkey, quint64 restoreHeight, const QString &subaddressLookahead) {
if (Utils::fileExists(path)) {
auto err = QString("Failed to write wallet to path: \"%1\"; file already exists.").arg(path);
this->handleWalletError(err);
return;
}
- Wallet *wallet = m_walletManager->createWalletFromKeys(path, password, constants::seedLanguage, constants::networkType, address, viewkey, spendkey, restoreHeight);
+ Wallet *wallet = m_walletManager->createWalletFromKeys(path, password, constants::seedLanguage, constants::networkType, address, viewkey, spendkey, restoreHeight, constants::kdfRounds, subaddressLookahead);
m_openingWallet = true;
m_walletManager->walletOpened(wallet);
}
void onWalletPassphraseNeeded(bool on_device);
private:
- void tryCreateWallet(Seed seed, const QString &path, const QString &password, const QString &seedLanguage, const QString &seedOffset);
- void tryCreateWalletFromDevice(const QString &path, const QString &password, const QString &deviceName, int restoreHeight);
- void tryCreateWalletFromKeys(const QString &path, const QString &password, const QString &address, const QString &viewkey, const QString &spendkey, quint64 restoreHeight);
+ void tryCreateWallet(Seed seed, const QString &path, const QString &password, const QString &seedLanguage, const QString &seedOffset, const QString &subaddressLookahead);
+ void tryCreateWalletFromDevice(const QString &path, const QString &password, const QString &deviceName, int restoreHeight, const QString &subaddressLookahead);
+ void tryCreateWalletFromKeys(const QString &path, const QString &password, const QString &address, const QString &viewkey, const QString &spendkey, quint64 restoreHeight, const QString &subaddressLookahead);
bool autoOpenWallet();
ui->label_netType->setText(Utils::QtEnumToString(m_ctx->wallet->nettype()));
ui->label_seedType->setText(QString("%1 word").arg(m_ctx->wallet->seedLength()));
ui->label_viewOnly->setText(m_ctx->wallet->viewOnly() ? "True" : "False");
+ ui->label_subaddressLookahead->setText(m_ctx->wallet->getSubaddressLookahead());
ui->label_keysFile->setText(m_ctx->wallet->keysPath());
ui->label_cacheFile->setText(m_ctx->wallet->cachePath());
ui->label_cacheSize->setText(QString("%1 MB").arg(QString::number(cache.size() / 1e6, 'f', 2)));
</property>
</widget>
</item>
- <item row="4" column="0">
+ <item row="5" column="0">
<widget class="HelpLabel" name="label_keysFileLabel">
<property name="text">
<string>Keys file:</string>
</property>
</widget>
</item>
- <item row="4" column="1">
+ <item row="5" column="1">
<widget class="QLabel" name="label_keysFile">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
- <item row="6" column="0">
+ <item row="7" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Cache size:</string>
</property>
</widget>
</item>
- <item row="6" column="1">
+ <item row="7" column="1">
<widget class="QLabel" name="label_cacheSize">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
- <item row="5" column="0">
+ <item row="6" column="0">
<widget class="HelpLabel" name="label_cacheFileLabel">
<property name="text">
<string>Cache file:</string>
</property>
</widget>
</item>
- <item row="5" column="1">
+ <item row="6" column="1">
<widget class="QLabel" name="label_cacheFile">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Lookahead:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QLabel" name="label_subaddressLookahead">
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
<item>
});
}
+QString Wallet::getSubaddressLookahead() const
+{
+ auto lookahead = m_walletImpl->getSubaddressLookahead();
+
+ return QString("%1:%2").arg(QString::number(lookahead.first), QString::number(lookahead.second));
+}
+
bool Wallet::refreshHeights()
{
// daemonHeight and targetHeight will be 0 if call to get_info fails
QString getSubaddressLabel(quint32 accountIndex, quint32 addressIndex) const;
void setSubaddressLabel(quint32 accountIndex, quint32 addressIndex, const QString &label);
void deviceShowAddressAsync(quint32 accountIndex, quint32 addressIndex, const QString &paymentId);
+ QString getSubaddressLookahead() const;
//! hw-device backed wallets
bool isHwBacked() const;
}
-Wallet *WalletManager::recoveryWallet(const QString &path, const QString &password, const QString &seed, const QString &seed_offset, NetworkType::Type nettype, quint64 restoreHeight, quint64 kdfRounds)
+Wallet *WalletManager::recoveryWallet(const QString &path, const QString &password, const QString &seed, const QString &seed_offset, NetworkType::Type nettype, quint64 restoreHeight, quint64 kdfRounds, const QString &subaddressLookahead)
{
QMutexLocker locker(&m_mutex);
Wallet *WalletManager::createWalletFromKeys(const QString &path, const QString &password, const QString &language,
NetworkType::Type nettype, const QString &address, const QString &viewkey,
- const QString &spendkey, quint64 restoreHeight, quint64 kdfRounds)
+ const QString &spendkey, quint64 restoreHeight, quint64 kdfRounds, const QString &subaddressLookahead)
{
QMutexLocker locker(&m_mutex);
Monero::Wallet * w = m_pimpl->createWalletFromKeys(path.toStdString(), password.toStdString(), language.toStdString(), static_cast<Monero::NetworkType>(nettype), restoreHeight,
- address.toStdString(), viewkey.toStdString(), spendkey.toStdString(), kdfRounds);
+ address.toStdString(), viewkey.toStdString(), spendkey.toStdString(), kdfRounds, subaddressLookahead.toStdString());
return new Wallet(w);
}
Wallet *WalletManager::createDeterministicWalletFromSpendKey(const QString &path, const QString &password, const QString &language, NetworkType::Type nettype,
- const QString &spendkey, quint64 restoreHeight, quint64 kdfRounds, const QString &offset_passphrase)
+ const QString &spendkey, quint64 restoreHeight, quint64 kdfRounds, const QString &offset_passphrase,
+ const QString &subaddressLookahead)
{
QMutexLocker locker(&m_mutex);
Monero::Wallet * w = m_pimpl->createDeterministicWalletFromSpendKey(path.toStdString(), password.toStdString(), language.toStdString(), static_cast<Monero::NetworkType>(nettype), restoreHeight,
- spendkey.toStdString(), kdfRounds, offset_passphrase.toStdString());
+ spendkey.toStdString(), kdfRounds, offset_passphrase.toStdString(), subaddressLookahead.toStdString());
return new Wallet(w);
}
void openWalletAsync(const QString &path, const QString &password, NetworkType::Type nettype = NetworkType::MAINNET, quint64 kdfRounds = 1, const QString &ringDatabasePath = "");
Wallet * recoveryWallet(const QString &path, const QString &password, const QString &seed, const QString &seed_offset,
- NetworkType::Type nettype = NetworkType::MAINNET, quint64 restoreHeight = 0, quint64 kdfRounds = 1);
+ NetworkType::Type nettype = NetworkType::MAINNET, quint64 restoreHeight = 0, quint64 kdfRounds = 1, const QString &subaddressLookahead = "");
Wallet * createWalletFromKeys(const QString &path,
const QString &password,
const QString &viewkey,
const QString &spendkey = "",
quint64 restoreHeight = 0,
- quint64 kdfRounds = 1);
+ quint64 kdfRounds = 1,
+ const QString &subaddressLookahead = ""
+ );
Wallet * createDeterministicWalletFromSpendKey(const QString &path,
const QString &password,
const QString &spendkey,
quint64 restoreHeight,
quint64 kdfRounds,
- const QString &offset_passphrase = "");
+ const QString &offset_passphrase = "",
+ const QString &subaddressLookahead = "");
Wallet * createWalletFromDevice(const QString &path,
const QString &password,
#include "ui_PageHardwareDevice.h"
#include "WalletWizard.h"
+#include <QCheckBox>
+#include <QDialogButtonBox>
#include <QMessageBox>
+#include <QPushButton>
PageHardwareDevice::PageHardwareDevice(WizardFields *fields, QWidget *parent)
: QWizardPage(parent)
ui->combo_deviceType->addItem("Ledger Nano S (PLUS) / X", DeviceType::LEDGER);
ui->combo_deviceType->addItem("Trezor Model T", DeviceType::TREZOR);
+
+ connect(ui->btnOptions, &QPushButton::clicked, this, &PageHardwareDevice::onOptionsClicked);
}
void PageHardwareDevice::initializePage() {
}
int PageHardwareDevice::nextId() const {
- if (ui->radioNewWallet->isChecked())
- return WalletWizard::Page_WalletFile;
- if (ui->radioRestoreWallet->isChecked())
+ if (m_fields->showSetRestoreHeightPage) {
return WalletWizard::Page_SetRestoreHeight;
- return 0;
+ }
+
+ return WalletWizard::Page_WalletFile;
}
bool PageHardwareDevice::validatePage() {
m_fields->deviceType = static_cast<DeviceType>(ui->combo_deviceType->currentData().toInt());
+ m_fields->showSetRestoreHeightPage = ui->radioRestoreWallet->isChecked();
return true;
}
bool PageHardwareDevice::isComplete() const {
return true;
+}
+
+void PageHardwareDevice::onOptionsClicked() {
+ QDialog dialog(this);
+ dialog.setWindowTitle("Options");
+
+ QVBoxLayout layout;
+ QCheckBox check_subaddressLookahead("Set subaddress lookahead");
+ check_subaddressLookahead.setChecked(m_fields->showSetSubaddressLookaheadPage);
+
+ layout.addWidget(&check_subaddressLookahead);
+ QDialogButtonBox buttons(QDialogButtonBox::Ok);
+ layout.addWidget(&buttons);
+ dialog.setLayout(&layout);
+ connect(&buttons, &QDialogButtonBox::accepted, [&dialog]{
+ dialog.close();
+ });
+ dialog.exec();
+
+ m_fields->showSetSubaddressLookaheadPage = check_subaddressLookahead.isChecked();
}
\ No newline at end of file
bool isComplete() const override;
private:
+ void onOptionsClicked();
+
Ui::PageHardwareDevice *ui;
WizardFields *m_fields;
};
<rect>
<x>0</x>
<y>0</y>
- <width>558</width>
- <height>431</height>
+ <width>968</width>
+ <height>630</height>
</rect>
</property>
<property name="windowTitle">
</property>
</spacer>
</item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QPushButton" name="btnOptions">
+ <property name="text">
+ <string>Options</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<resources/>
}
bool PageMenu::validatePage() {
+ m_fields->clearFields();
+
if (ui->radioCreate->isChecked()) {
m_fields->mode = WizardMode::CreateWallet;
m_fields->modeText = "Create wallet";
ui->frame_scanWarning->hide();
ui->frame_walletAgeWarning->hide();
- if (m_fields->seedCreationDateOverridden) {
+ if (m_fields->showSetRestoreHeightPage && m_fields->mode == WizardMode::RestoreFromSeed) {
auto creationDate = QDateTime::fromSecsSinceEpoch(m_fields->seed.time);
ui->line_creationDate->setText(creationDate.toString("yyyy-MM-dd"));
this->onCreationDateEdited();
}
int PageSetRestoreHeight::nextId() const {
+ if (m_fields->showSetSeedPassphrasePage) {
+ return WalletWizard::Page_SetSeedPassphrase;
+ }
+
+ if (m_fields->showSetSubaddressLookaheadPage) {
+ return WalletWizard::Page_SetSubaddressLookahead;
+ }
+
return WalletWizard::Page_WalletFile;
}
}
int PageSetSeedPassphrase::nextId() const {
+ if (m_fields->showSetSubaddressLookaheadPage) {
+ return WalletWizard::Page_SetSubaddressLookahead;
+ }
+
return WalletWizard::Page_WalletFile;
}
\ No newline at end of file
--- /dev/null
+// SPDX-License-Identifier: BSD-3-Clause
+// SPDX-FileCopyrightText: 2020-2023 The Monero Project
+
+#include "PageSetSubaddressLookahead.h"
+#include "ui_PageSetSubaddressLookahead.h"
+#include "WalletWizard.h"
+
+#include <QIntValidator>
+
+PageSetSubaddressLookahead::PageSetSubaddressLookahead(WizardFields *fields, QWidget *parent)
+ : QWizardPage(parent)
+ , ui(new Ui::PageSetSubaddressLookahead)
+ , m_fields(fields)
+{
+ ui->setupUi(this);
+
+ // uint32_t can go up to 4294967294, but this isn't realistic
+ auto indexValidator = new QIntValidator(1, 2147483647, this);
+
+ ui->line_major->setValidator(indexValidator);
+ ui->line_minor->setValidator(indexValidator);
+
+ this->setTitle("Subaddress Lookahead");
+}
+
+void PageSetSubaddressLookahead::initializePage() {
+ if (m_fields->mode == WizardMode::CreateWalletFromDevice) {
+ ui->line_major->setText("5");
+ ui->line_minor->setText("20");
+ } else {
+ ui->line_major->setText("50");
+ ui->line_minor->setText("200");
+ }
+}
+
+bool PageSetSubaddressLookahead::validatePage() {
+ m_fields->subaddressLookahead = QString("%1:%2").arg(ui->line_major->text(), ui->line_minor->text());
+ return true;
+}
+
+int PageSetSubaddressLookahead::nextId() const {
+ return WalletWizard::Page_WalletFile;
+}
\ No newline at end of file
// SPDX-License-Identifier: BSD-3-Clause
// SPDX-FileCopyrightText: 2020-2023 The Monero Project
-#ifndef FEATHER_PAGEHARDWAREDEVICE_H
-#define FEATHER_PAGEHARDWAREDEVICE_H
+#ifndef FEATHER_PAGESETSUBADDRESSLOOKAHEAD_H
+#define FEATHER_PAGESETSUBADDRESSLOOKAHEAD_H
-#include <QLabel>
#include <QWizardPage>
#include <QWidget>
-#include <QDir>
#include "appcontext.h"
#include "WalletWizard.h"
namespace Ui {
- class PageHardwareDevice;
+ class PageSetSubaddressLookahead;
}
-class PageHardwareDevice : public QWizardPage
+class PageSetSubaddressLookahead : public QWizardPage
{
Q_OBJECT
public:
- explicit PageHardwareDevice(WizardFields *fields, QWidget *parent = nullptr);
+ explicit PageSetSubaddressLookahead(WizardFields *fields, QWidget *parent = nullptr);
void initializePage() override;
bool validatePage() override;
int nextId() const override;
- bool isComplete() const override;
private:
- Ui::PageHardwareDevice *ui;
+ Ui::PageSetSubaddressLookahead *ui;
+
WizardFields *m_fields;
};
-#endif //FEATHER_PAGEHARDWAREDEVICE_H
+#endif //FEATHER_PAGESETSUBADDRESSLOOKAHEAD_H
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PageSetSubaddressLookahead</class>
+ <widget class="QWizardPage" name="PageSetSubaddressLookahead">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>568</width>
+ <height>341</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>WizardPage</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Major (account)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Minor (subaddress)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="line_major"/>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="line_minor"/>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
#include "PageWalletRestoreKeys.h"
#include "ui_PageWalletRestoreKeys.h"
+#include <QCheckBox>
+#include <QDialogButtonBox>
#include <QPlainTextEdit>
+#include <QPushButton>
#include "WalletWizard.h"
#include "constants.h"
} else if (constants::networkType == NetworkType::Type::STAGENET) {
ui->line_address->setPlaceholderText("5...");
}
+
+ connect(ui->btnOptions, &QPushButton::clicked, this, &PageWalletRestoreKeys::onOptionsClicked);
}
void PageWalletRestoreKeys::initializePage() {
m_fields->secretSpendKey = spendkey;
return true;
}
+
+void PageWalletRestoreKeys::onOptionsClicked() {
+ QDialog dialog(this);
+ dialog.setWindowTitle("Options");
+
+ QVBoxLayout layout;
+ QCheckBox check_subaddressLookahead("Set subaddress lookahead");
+ check_subaddressLookahead.setChecked(m_fields->showSetSubaddressLookaheadPage);
+
+ layout.addWidget(&check_subaddressLookahead);
+ QDialogButtonBox buttons(QDialogButtonBox::Ok);
+ layout.addWidget(&buttons);
+ dialog.setLayout(&layout);
+ connect(&buttons, &QDialogButtonBox::accepted, [&dialog]{
+ dialog.close();
+ });
+ dialog.exec();
+
+ m_fields->showSetSubaddressLookaheadPage = check_subaddressLookahead.isChecked();
+}
\ No newline at end of file
int nextId() const override;
private:
+ void onOptionsClicked();
+
Ui::PageWalletRestoreKeys *ui;
WizardFields *m_fields;
};
</property>
</spacer>
</item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QPushButton" name="btnOptions">
+ <property name="text">
+ <string>Options</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<resources/>
#include "PageWalletRestoreSeed.h"
#include "ui_PageWalletRestoreSeed.h"
+#include <QCheckBox>
+#include <QDialogButtonBox>
#include <QPlainTextEdit>
+#include <QPushButton>
#include <QMessageBox>
#include <monero_seed/wordlist.hpp> // tevador 14 word
connect(ui->seedBtnGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked), this, &PageWalletRestoreSeed::onSeedTypeToggled);
connect(ui->combo_seedLanguage, &QComboBox::currentTextChanged, this, &PageWalletRestoreSeed::onSeedLanguageChanged);
+ connect(ui->btnOptions, &QPushButton::clicked, this, &PageWalletRestoreSeed::onOptionsClicked);
}
m_fields->seedType = Seed::Type::POLYSEED;
ui->seedEdit->setPlaceholderText("Enter 16 word seed..");
ui->group_seedLanguage->hide();
- ui->check_overrideCreationDate->setVisible(true);
}
if (ui->radio14->isChecked()) {
m_mode = &m_tevador;
m_fields->seedType = Seed::Type::TEVADOR;
ui->seedEdit->setPlaceholderText("Enter 14 word seed..");
ui->group_seedLanguage->hide();
- ui->check_overrideCreationDate->setVisible(true);
}
else if (ui->radio25->isChecked()) {
m_mode = &m_legacy;
m_fields->seedType = Seed::Type::MONERO;
ui->seedEdit->setPlaceholderText("Enter 25 word seed..");
ui->group_seedLanguage->show();
- ui->check_overrideCreationDate->setVisible(false);
}
ui->label_errorString->hide();
}
int PageWalletRestoreSeed::nextId() const {
- if (m_mode == &m_legacy || ui->check_overrideCreationDate->isChecked()) {
+ if (m_mode == &m_legacy || m_fields->showSetRestoreHeightPage) {
return WalletWizard::Page_SetRestoreHeight;
}
+ if (m_fields->showSetSeedPassphrasePage) {
+ return WalletWizard::Page_SetSeedPassphrase;
+ }
+
+ if (m_fields->showSetSubaddressLookaheadPage) {
+ return WalletWizard::Page_SetSubaddressLookahead;
+ }
+
return WalletWizard::Page_WalletFile;
}
ui->seedEdit->setText("");
ui->seedEdit->setStyleSheet("");
ui->label_errorString->hide();
- ui->line_seedOffset->setText("");
- ui->check_overrideCreationDate->setVisible(false);
- ui->check_overrideCreationDate->setChecked(false);
ui->radio16->isChecked();
this->onSeedTypeToggled();
}
}
m_fields->seed = _seed;
- m_fields->seedOffsetPassphrase = ui->line_seedOffset->text();
- m_fields->seedCreationDateOverridden = ui->check_overrideCreationDate->isChecked();
return true;
}
+
+void PageWalletRestoreSeed::onOptionsClicked() {
+ QDialog dialog(this);
+ dialog.setWindowTitle("Options");
+
+ QVBoxLayout layout;
+ QCheckBox check_overrideCreationDate("Override embedded wallet creation date");
+ check_overrideCreationDate.setChecked(m_fields->showSetRestoreHeightPage);
+
+ QCheckBox check_setSeedPasshprase("Extend this seed with a passphrase");
+ check_setSeedPasshprase.setChecked(m_fields->showSetSeedPassphrasePage);
+
+ QCheckBox check_subaddressLookahead("Set subaddress lookahead");
+ check_subaddressLookahead.setChecked(m_fields->showSetSubaddressLookaheadPage);
+
+ layout.addWidget(&check_overrideCreationDate);
+ layout.addWidget(&check_setSeedPasshprase);
+ layout.addWidget(&check_subaddressLookahead);
+ QDialogButtonBox buttons(QDialogButtonBox::Ok);
+ layout.addWidget(&buttons);
+ dialog.setLayout(&layout);
+ connect(&buttons, &QDialogButtonBox::accepted, [&dialog]{
+ dialog.close();
+ });
+ dialog.exec();
+
+ m_fields->showSetRestoreHeightPage = check_overrideCreationDate.isChecked();
+ m_fields->showSetSeedPassphrasePage = check_setSeedPasshprase.isChecked();
+ m_fields->showSetSubaddressLookaheadPage = check_subaddressLookahead.isChecked();
+}
\ No newline at end of file
void onSeedTypeToggled();
void onSeedLanguageChanged(const QString &language);
+ void onOptionsClicked();
Ui::PageWalletRestoreSeed *ui;
WizardFields *m_fields;
</property>
</spacer>
</item>
- <item>
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>Seed offset passphrase:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="line_seedOffset">
- <property name="echoMode">
- <enum>QLineEdit::Normal</enum>
- </property>
- <property name="placeholderText">
- <string>Leave blank if in doubt</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="check_overrideCreationDate">
- <property name="text">
- <string>Override embedded wallet creation date</string>
- </property>
- </widget>
- </item>
<item>
<widget class="QLabel" name="label_errorString">
<property name="text">
</property>
</spacer>
</item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QPushButton" name="btnOptions">
+ <property name="text">
+ <string>Options</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<customwidgets>
void PageWalletSeed::onOptionsClicked() {
QDialog dialog(this);
+ dialog.setWindowTitle("Options");
QVBoxLayout layout;
QCheckBox checkbox("Extend this seed with a passphrase");
- checkbox.setChecked(m_fields->seedOffsetPassphraseEnabled);
+ checkbox.setChecked(m_fields->showSetSeedPassphrasePage);
layout.addWidget(&checkbox);
QDialogButtonBox buttons(QDialogButtonBox::Ok);
layout.addWidget(&buttons);
dialog.close();
});
dialog.exec();
- m_fields->seedOffsetPassphraseEnabled = checkbox.isChecked();
+ m_fields->showSetSeedPassphrasePage = checkbox.isChecked();
}
int PageWalletSeed::nextId() const {
- if (m_fields->seedOffsetPassphraseEnabled) {
+ if (m_fields->showSetSeedPassphrasePage) {
return WalletWizard::Page_SetSeedPassphrase;
}
return WalletWizard::Page_WalletFile;
<item>
<widget class="QLabel" name="label_14">
<property name="text">
- <string><html><head/><body><p>Feather recently switched to a new seed scheme called <span style=" font-weight:600;">Polyseed</span>.</p></body></html></string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_12">
- <property name="text">
- <string>For more information visit: docs.featherwallet.org/guides/seed-scheme</string>
+ <string><html><head/><body><p>Feather uses <span style=" font-weight:600;">Polyseed</span>. For more information visit: docs.featherwallet.org/guides/seed-scheme</p></body></html></string>
</property>
<property name="wordWrap">
<bool>true</bool>
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
- <string>Generate</string>
+ <string>Generate new</string>
</property>
</widget>
</item>
#include "PageSetPassword.h"
#include "PageSetRestoreHeight.h"
#include "PageSetSeedPassphrase.h"
+#include "PageSetSubaddressLookahead.h"
#include "PageHardwareDevice.h"
#include "PageNetworkTor.h"
#include "PageNetworkWebsocket.h"
auto createWalletSeed = new PageWalletSeed(&m_wizardFields, this);
auto walletSetPasswordPage = new PageSetPassword(&m_wizardFields, this);
auto walletSetSeedPassphrasePage = new PageSetSeedPassphrase(&m_wizardFields, this);
+ auto walletSetSubaddressLookaheadPage = new PageSetSubaddressLookahead(&m_wizardFields, this);
setPage(Page_Menu, menuPage);
setPage(Page_WalletFile, createWallet);
setPage(Page_OpenWallet, openWalletPage);
setPage(Page_SetRestoreHeight, new PageSetRestoreHeight(&m_wizardFields, this));
setPage(Page_HardwareDevice, new PageHardwareDevice(&m_wizardFields, this));
setPage(Page_SetSeedPassphrase, walletSetSeedPassphrasePage);
+ setPage(Page_SetSubaddressLookahead, walletSetSubaddressLookaheadPage);
setStartId(Page_Menu);
deviceName = "Trezor";
}
- emit createWalletFromDevice(walletPath, m_wizardFields.password, deviceName, restoreHeight);
+ emit createWalletFromDevice(walletPath, m_wizardFields.password, deviceName, restoreHeight, m_wizardFields.subaddressLookahead);
return;
}
m_wizardFields.address,
m_wizardFields.secretViewKey,
m_wizardFields.secretSpendKey,
- m_wizardFields.restoreHeight);
+ m_wizardFields.restoreHeight,
+ m_wizardFields.subaddressLookahead);
return;
}
m_wizardFields.seed.restoreHeight = currentBlockHeight;
}
- if (m_wizardFields.mode == WizardMode::RestoreFromSeed && (m_wizardFields.seedType == Seed::Type::MONERO || m_wizardFields.seedCreationDateOverridden)) {
+ if (m_wizardFields.mode == WizardMode::RestoreFromSeed && (m_wizardFields.seedType == Seed::Type::MONERO || m_wizardFields.showSetRestoreHeightPage)) {
m_wizardFields.seed.setRestoreHeight(m_wizardFields.restoreHeight);
}
- emit createWallet(m_wizardFields.seed, walletPath, m_wizardFields.password, m_wizardFields.seedLanguage, m_wizardFields.seedOffsetPassphrase);
+ emit createWallet(m_wizardFields.seed, walletPath, m_wizardFields.password, m_wizardFields.seedLanguage, m_wizardFields.seedOffsetPassphrase, m_wizardFields.subaddressLookahead);
}
\ No newline at end of file
QString walletName;
QString walletDir;
Seed seed;
- bool seedOffsetPassphraseEnabled = false;
- bool seedCreationDateOverridden = false;
+ bool showSetSeedPassphrasePage = false;
+ bool showSetRestoreHeightPage = false;
+ bool showSetSubaddressLookaheadPage = false;
QString seedOffsetPassphrase;
QString seedLanguage = constants::seedLanguage;
QString password;
int restoreHeight = 0;
Seed::Type seedType;
DeviceType deviceType;
+ QString subaddressLookahead;
+
+ void clearFields() {
+ showSetSeedPassphrasePage = false;
+ showSetRestoreHeightPage = false;
+ showSetSubaddressLookaheadPage = false;
+ seedOffsetPassphrase = "";
+ password = "";
+ address = "";
+ secretViewKey = "";
+ secretSpendKey = "";
+ restoreHeight = 0;
+ subaddressLookahead = "";
+ }
WizardFields(): deviceType(DeviceType::LEDGER), mode(WizardMode::CreateWallet),
- seedType(Seed::POLYSEED), seedOffsetPassphraseEnabled(false), restoreHeight(0) {}
+ seedType(Seed::POLYSEED), restoreHeight(0) {}
};
class WalletWizard : public QWizard
public:
enum Page {
- Page_Menu,
+ Page_Menu = 0,
Page_WalletFile,
Page_CreateWalletSeed,
Page_SetSeedPassphrase,
Page_SetPasswordPage,
+ Page_SetSubaddressLookahead,
Page_OpenWallet,
Page_Network,
Page_WalletRestoreSeed,
void openWallet(QString path, QString password);
void defaultWalletDirChanged(QString walletDir);
- void createWalletFromDevice(const QString &path, const QString &password, const QString &deviceName, int restoreHeight);
- void createWalletFromKeys(const QString &path, const QString &password, const QString &address, const QString &viewkey, const QString &spendkey, quint64 restoreHeight, bool deterministic = false);
- void createWallet(Seed seed, const QString &path, const QString &password, const QString &seedLanguage, const QString &seedOffset = "");
+ void createWalletFromDevice(const QString &path, const QString &password, const QString &deviceName, int restoreHeight, const QString &subaddressLookahead);
+ void createWalletFromKeys(const QString &path, const QString &password, const QString &address, const QString &viewkey, const QString &spendkey, quint64 restoreHeight, const QString subaddressLookahead = "");
+ void createWallet(Seed seed, const QString &path, const QString &password, const QString &seedLanguage, const QString &seedOffset = "", const QString &subaddressLookahead = "");
private slots:
void onCreateWallet();