mirror of
https://github.com/feather-wallet/feather.git
synced 2025-04-16 18:01:54 +00:00
always display restore dates next to restore heights
This commit is contained in:
parent
8f3205d632
commit
e55afe9429
6 changed files with 15 additions and 5 deletions
|
@ -53,8 +53,7 @@ void DebugInfoDialog::updateInfo() {
|
|||
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();
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#include "KeysDialog.h"
|
||||
#include "ui_KeysDialog.h"
|
||||
|
||||
#include "utils/Utils.h"
|
||||
|
||||
KeysDialog::KeysDialog(Wallet *wallet, QWidget *parent)
|
||||
: WindowModalDialog(parent)
|
||||
, ui(new Ui::KeysDialog)
|
||||
|
@ -12,7 +14,7 @@ KeysDialog::KeysDialog(Wallet *wallet, QWidget *parent)
|
|||
|
||||
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());
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// SPDX-FileCopyrightText: The Monero Project
|
||||
|
||||
#include "SeedDialog.h"
|
||||
|
||||
#include "Utils.h"
|
||||
#include "ui_SeedDialog.h"
|
||||
|
||||
#include "constants.h"
|
||||
|
@ -14,7 +16,7 @@ SeedDialog::SeedDialog(Wallet *wallet, QWidget *parent)
|
|||
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";
|
||||
|
|
|
@ -20,7 +20,7 @@ ViewOnlyDialog::ViewOnlyDialog(Wallet *wallet, QWidget *parent)
|
|||
{
|
||||
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());
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#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"
|
||||
|
@ -695,6 +696,11 @@ QString formatSyncStatus(quint64 height, quint64 target, bool daemonSync) {
|
|||
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
|
||||
|
|
|
@ -119,6 +119,7 @@ namespace Utils
|
|||
void clearLayout(QLayout *layout, bool deleteWidgets = true);
|
||||
|
||||
QString formatSyncStatus(quint64 height, quint64 target, bool daemonSync = false);
|
||||
QString formatRestoreHeight(quint64 height);
|
||||
|
||||
QString getVersion();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue