2021-01-25 16:38:04 +00:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
// Copyright (c) 2020-2021, The Monero Project.
|
|
|
|
|
|
|
|
#include "WalletCacheDebugDialog.h"
|
|
|
|
#include "ui_WalletCacheDebugDialog.h"
|
|
|
|
|
|
|
|
#include <QRadioButton>
|
|
|
|
|
2021-06-27 14:33:18 +00:00
|
|
|
#include "model/ModelUtils.h"
|
|
|
|
|
2021-05-18 15:59:18 +00:00
|
|
|
WalletCacheDebugDialog::WalletCacheDebugDialog(QSharedPointer<AppContext> ctx, QWidget *parent)
|
2021-01-25 16:38:04 +00:00
|
|
|
: QDialog(parent)
|
|
|
|
, ui(new Ui::WalletCacheDebugDialog)
|
2021-05-18 15:59:18 +00:00
|
|
|
, m_ctx(std::move(ctx))
|
2021-01-25 16:38:04 +00:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
2021-02-03 16:01:19 +00:00
|
|
|
ui->output->setFont(ModelUtils::getMonospaceFont());
|
|
|
|
|
2021-01-25 16:38:04 +00:00
|
|
|
connect(ui->m_blockchain, &QRadioButton::pressed, [this]{
|
2021-05-18 15:59:18 +00:00
|
|
|
this->setOutput(m_ctx->wallet->printBlockchain());
|
2021-01-25 16:38:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
connect(ui->m_transfers, &QRadioButton::pressed, [this]{
|
2021-05-18 15:59:18 +00:00
|
|
|
this->setOutput(m_ctx->wallet->printTransfers());
|
2021-01-25 16:38:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
connect(ui->m_unconfirmed_payments, &QRadioButton::pressed, [this]{
|
2021-05-18 15:59:18 +00:00
|
|
|
this->setOutput(m_ctx->wallet->printUnconfirmedPayments());
|
2021-01-25 16:38:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
connect(ui->m_confirmed_txs, &QRadioButton::pressed, [this]{
|
2021-05-18 15:59:18 +00:00
|
|
|
this->setOutput(m_ctx->wallet->printConfirmedTransferDetails());
|
2021-01-25 16:38:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
connect(ui->m_unconfirmed_txs, &QRadioButton::pressed, [this]{
|
2021-05-18 15:59:18 +00:00
|
|
|
this->setOutput(m_ctx->wallet->printUnconfirmedTransferDetails());
|
2021-01-25 16:38:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
connect(ui->m_payments, &QRadioButton::pressed, [this]{
|
2021-05-18 15:59:18 +00:00
|
|
|
this->setOutput(m_ctx->wallet->printPayments());
|
2021-01-25 16:38:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
connect(ui->m_pub_keys, &QRadioButton::pressed, [this]{
|
2021-05-18 15:59:18 +00:00
|
|
|
this->setOutput(m_ctx->wallet->printPubKeys());
|
2021-01-25 16:38:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
connect(ui->m_tx_notes, &QRadioButton::pressed, [this]{
|
2021-05-18 15:59:18 +00:00
|
|
|
this->setOutput(m_ctx->wallet->printTxNotes());
|
2021-01-25 16:38:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
connect(ui->m_subaddresses, &QRadioButton::pressed, [this]{
|
2021-05-18 15:59:18 +00:00
|
|
|
this->setOutput(m_ctx->wallet->printSubaddresses());
|
2021-01-25 16:38:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
connect(ui->m_subaddress_labels, &QRadioButton::pressed, [this]{
|
2021-05-18 15:59:18 +00:00
|
|
|
this->setOutput(m_ctx->wallet->printSubaddressLabels());
|
2021-01-25 16:38:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
connect(ui->m_additional_tx_keys, &QRadioButton::pressed, [this]{
|
2021-05-18 15:59:18 +00:00
|
|
|
this->setOutput(m_ctx->wallet->printAdditionalTxKeys());
|
2021-01-25 16:38:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
connect(ui->m_attributes, &QRadioButton::pressed, [this]{
|
2021-05-18 15:59:18 +00:00
|
|
|
this->setOutput(m_ctx->wallet->printAttributes());
|
2021-01-25 16:38:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
connect(ui->m_key_images, &QRadioButton::pressed, [this]{
|
2021-05-18 15:59:18 +00:00
|
|
|
this->setOutput(m_ctx->wallet->printKeyImages());
|
2021-01-25 16:38:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
connect(ui->m_account_tags, &QRadioButton::pressed, [this]{
|
2021-05-18 15:59:18 +00:00
|
|
|
this->setOutput(m_ctx->wallet->printAccountTags());
|
2021-01-25 16:38:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
connect(ui->m_tx_keys, &QRadioButton::pressed, [this]{
|
2021-05-18 15:59:18 +00:00
|
|
|
this->setOutput(m_ctx->wallet->printTxKeys());
|
2021-01-25 16:38:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
connect(ui->m_address_book, &QRadioButton::pressed, [this]{
|
2021-05-18 15:59:18 +00:00
|
|
|
this->setOutput(m_ctx->wallet->printAddressBook());
|
2021-01-25 16:38:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
connect(ui->m_scanned_pool_txs, &QRadioButton::pressed, [this]{
|
2021-05-18 15:59:18 +00:00
|
|
|
this->setOutput(m_ctx->wallet->printScannedPoolTxs());
|
2021-01-25 16:38:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
this->adjustSize();
|
|
|
|
}
|
|
|
|
|
|
|
|
void WalletCacheDebugDialog::setOutput(const QString &output) {
|
|
|
|
ui->output->setPlainText(output);
|
|
|
|
}
|
|
|
|
|
2021-06-27 12:13:05 +00:00
|
|
|
WalletCacheDebugDialog::~WalletCacheDebugDialog() = default;
|