ui->warningIcon->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]{
this->onCreationDateEdited();
this->completeChanged();
this->setTitle("Restore height");
ui->line_creationDate->setText("");
ui->line_restoreHeight->setText("");
+ ui->frame_scanWarning->hide();
+ ui->frame_walletAgeWarning->hide();
}
void PageSetRestoreHeight::onCreationDateEdited() {
void PageSetRestoreHeight::onRestoreHeightEdited() {
int restoreHeight = ui->line_restoreHeight->text().toInt();
if (restoreHeight == 0) {
- ui->frame_walletAgeWarning->hide();
- ui->frame_scanWarning->hide();
- ui->line_creationDate->setText("");
- return;
+ restoreHeight = 1;
}
QDateTime date = appData()->restoreHeights[constants::networkType]->heightToDate(restoreHeight);
}
bool PageSetRestoreHeight::validatePage() {
- m_fields->restoreHeight = ui->line_restoreHeight->text().toInt();
+ m_fields->restoreHeight = std::max(1, ui->line_restoreHeight->text().toInt());
return true;
}