mirror of
https://github.com/wownero/wowlet.git
synced 2026-11-13 11:44:00 +01:00
wizard: allow setting subaddress lookahead
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
// 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;
|
||||
}
|
||||
Reference in New Issue
Block a user