RestoreHeightDialog: rework

This commit is contained in:
tobtoht
2021-05-25 02:26:28 +02:00
parent ba2b0ac550
commit 08d5fd26ff
12 changed files with 203 additions and 346 deletions
+40
View File
@@ -0,0 +1,40 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project.
#include "RestoreHeightDialog.h"
#include <QLabel>
#include <QVBoxLayout>
#include <QDialogButtonBox>
RestoreHeightDialog::RestoreHeightDialog(QWidget *parent, quint64 currentRestoreHeight)
: QDialog(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();
}