mirror of
https://github.com/feather-wallet/feather.git
synced 2024-11-17 09:47:36 +00:00
Wizard: handle 0 restore height
This commit is contained in:
parent
3eb9412dc7
commit
588b38b3a0
1 changed files with 4 additions and 8 deletions
|
@ -29,9 +29,6 @@ PageSetRestoreHeight::PageSetRestoreHeight(WizardFields *fields, QWidget *parent
|
||||||
ui->warningIcon->setPixmap(pixmap2.scaledToWidth(32, Qt::SmoothTransformation));
|
ui->warningIcon->setPixmap(pixmap2.scaledToWidth(32, Qt::SmoothTransformation));
|
||||||
ui->infoIcon->setPixmap(pixmap2.scaledToWidth(32, Qt::SmoothTransformation));
|
ui->infoIcon->setPixmap(pixmap2.scaledToWidth(32, Qt::SmoothTransformation));
|
||||||
|
|
||||||
ui->frame_scanWarning->hide();
|
|
||||||
ui->frame_walletAgeWarning->hide();
|
|
||||||
|
|
||||||
connect(ui->line_creationDate, &QLineEdit::textEdited, [this]{
|
connect(ui->line_creationDate, &QLineEdit::textEdited, [this]{
|
||||||
this->onCreationDateEdited();
|
this->onCreationDateEdited();
|
||||||
this->completeChanged();
|
this->completeChanged();
|
||||||
|
@ -46,6 +43,8 @@ void PageSetRestoreHeight::initializePage() {
|
||||||
this->setTitle("Restore height");
|
this->setTitle("Restore height");
|
||||||
ui->line_creationDate->setText("");
|
ui->line_creationDate->setText("");
|
||||||
ui->line_restoreHeight->setText("");
|
ui->line_restoreHeight->setText("");
|
||||||
|
ui->frame_scanWarning->hide();
|
||||||
|
ui->frame_walletAgeWarning->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PageSetRestoreHeight::onCreationDateEdited() {
|
void PageSetRestoreHeight::onCreationDateEdited() {
|
||||||
|
@ -71,10 +70,7 @@ void PageSetRestoreHeight::onCreationDateEdited() {
|
||||||
void PageSetRestoreHeight::onRestoreHeightEdited() {
|
void PageSetRestoreHeight::onRestoreHeightEdited() {
|
||||||
int restoreHeight = ui->line_restoreHeight->text().toInt();
|
int restoreHeight = ui->line_restoreHeight->text().toInt();
|
||||||
if (restoreHeight == 0) {
|
if (restoreHeight == 0) {
|
||||||
ui->frame_walletAgeWarning->hide();
|
restoreHeight = 1;
|
||||||
ui->frame_scanWarning->hide();
|
|
||||||
ui->line_creationDate->setText("");
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QDateTime date = appData()->restoreHeights[constants::networkType]->heightToDate(restoreHeight);
|
QDateTime date = appData()->restoreHeights[constants::networkType]->heightToDate(restoreHeight);
|
||||||
|
@ -96,7 +92,7 @@ void PageSetRestoreHeight::showWalletAgeWarning(const QDateTime &date) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PageSetRestoreHeight::validatePage() {
|
bool PageSetRestoreHeight::validatePage() {
|
||||||
m_fields->restoreHeight = ui->line_restoreHeight->text().toInt();
|
m_fields->restoreHeight = std::max(1, ui->line_restoreHeight->text().toInt());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue