ui->label_walletHeight->setText(QString::number(m_wallet->blockChainHeight()));
ui->label_daemonHeight->setText(QString::number(m_wallet->daemonBlockChainHeight()));
ui->label_targetHeight->setText(QString::number(m_wallet->daemonBlockChainTargetHeight()));
- QDateTime restoreDate = appData()->restoreHeights[constants::networkType]->heightToDate(m_wallet->getWalletCreationHeight());
- ui->label_restoreHeight->setText(QString("%1 (%2)").arg(QString::number(m_wallet->getWalletCreationHeight()), restoreDate.toString("yyyy-MM-dd")));
+ ui->label_restoreHeight->setText(Utils::formatRestoreHeight(m_wallet->getWalletCreationHeight()));
ui->label_synchronized->setText(m_wallet->isSynchronized() ? "True" : "False");
auto node = m_nodes->connection();
#include "KeysDialog.h"
#include "ui_KeysDialog.h"
+#include "utils/Utils.h"
+
KeysDialog::KeysDialog(Wallet *wallet, QWidget *parent)
: WindowModalDialog(parent)
, ui(new Ui::KeysDialog)
QString unavailable = "Unavailable: Key is stored on hardware device";
- ui->label_restoreHeight->setText(QString::number(wallet->getWalletCreationHeight()));
+ ui->label_restoreHeight->setText(Utils::formatRestoreHeight(wallet->getWalletCreationHeight()));
ui->label_primaryAddress->setText(wallet->address(0, 0));
ui->label_secretSpendKey->setText(wallet->isHwBacked() ? unavailable : wallet->getSecretSpendKey());
ui->label_secretViewKey->setText(wallet->getSecretViewKey());
// SPDX-FileCopyrightText: The Monero Project
#include "SeedDialog.h"
+
+#include "Utils.h"
#include "ui_SeedDialog.h"
#include "constants.h"
ui->setupUi(this);
ui->label_seedIcon->setPixmap(QPixmap(":/assets/images/seed.png").scaledToWidth(64, Qt::SmoothTransformation));
- ui->label_restoreHeight->setText(QString::number(m_wallet->getWalletCreationHeight()));
+ ui->label_restoreHeight->setText(Utils::formatRestoreHeight(m_wallet->getWalletCreationHeight()));
if (m_wallet->getSeedLanguage().isEmpty()) {
qDebug() << "No seed language set, using default";
{
ui->setupUi(this);
- ui->label_restoreHeight->setText(QString::number(m_wallet->getWalletCreationHeight()));
+ ui->label_restoreHeight->setText(Utils::formatRestoreHeight(wallet->getWalletCreationHeight()));
ui->label_primaryAddress->setText(m_wallet->address(0, 0));
ui->label_secretViewKey->setText(m_wallet->getSecretViewKey());
#include "config-feather.h"
#include "constants.h"
#include "networktype.h"
+#include "utils/AppData.h"
#include "utils/ColorScheme.h"
#include "utils/config.h"
#include "utils/os/tails.h"
return "Synchronized";
}
+QString formatRestoreHeight(quint64 height) {
+ const QDateTime restoreDate = appData()->restoreHeights[constants::networkType]->heightToDate(height);
+ return QString("%1 (%2)").arg(QString::number(height), restoreDate.toString("yyyy-MM-dd"));
+}
+
QString getVersion() {
QString version = QString("%1").arg(FEATHER_VERSION);
#ifdef OFFICIAL_BUILD
void clearLayout(QLayout *layout, bool deleteWidgets = true);
QString formatSyncStatus(quint64 height, quint64 target, bool daemonSync = false);
+ QString formatRestoreHeight(quint64 height);
QString getVersion();
}