mirror of
https://github.com/feather-wallet/feather.git
synced 2024-12-22 11:39:25 +00:00
history: add option to show full txid
This commit is contained in:
parent
7e19d52788
commit
0ba22ea05b
5 changed files with 26 additions and 1 deletions
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "TransactionHistoryProxyModel.h"
|
||||
#include "utils/Utils.h"
|
||||
#include "utils/config.h"
|
||||
|
||||
#include <QHeaderView>
|
||||
#include <QMenu>
|
||||
|
@ -56,6 +57,10 @@ void HistoryView::setHistoryModel(TransactionHistoryProxyModel *model) {
|
|||
}
|
||||
connect(m_columnActions, &QActionGroup::triggered, this, &HistoryView::toggleColumnVisibility);
|
||||
|
||||
m_headerMenu->addSeparator();
|
||||
auto action = m_headerMenu->addAction("Show full txid", this, &HistoryView::showFullTxid);
|
||||
action->setCheckable(true);
|
||||
action->setChecked(conf()->get(Config::historyShowFullTxid).toBool());
|
||||
m_headerMenu->addSeparator();
|
||||
m_headerMenu->addAction(tr("Fit to window"), this, &HistoryView::fitColumnsToWindow);
|
||||
m_headerMenu->addAction(tr("Fit to contents"), this, &HistoryView::fitColumnsToContents);
|
||||
|
@ -154,6 +159,16 @@ void HistoryView::toggleColumnVisibility(QAction* action)
|
|||
action->setChecked(true);
|
||||
}
|
||||
|
||||
void HistoryView::showFullTxid(bool enabled) {
|
||||
conf()->set(Config::historyShowFullTxid, enabled);
|
||||
this->reset();
|
||||
|
||||
|
||||
if (!enabled) {
|
||||
this->resizeColumnToContents(TransactionHistoryModel::TxID);
|
||||
}
|
||||
}
|
||||
|
||||
void HistoryView::fitColumnsToWindow()
|
||||
{
|
||||
header()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
|
|
|
@ -27,6 +27,7 @@ public:
|
|||
private slots:
|
||||
void showHeaderMenu(const QPoint& position);
|
||||
void toggleColumnVisibility(QAction* action);
|
||||
void showFullTxid(bool enabled);
|
||||
void fitColumnsToWindow();
|
||||
void fitColumnsToContents();
|
||||
void resetViewToDefaults();
|
||||
|
|
|
@ -163,6 +163,9 @@ QVariant TransactionHistoryModel::parseTransactionInfo(const TransactionRow &tIn
|
|||
return amount;
|
||||
}
|
||||
case Column::TxID: {
|
||||
if (conf()->get(Config::historyShowFullTxid).toBool()) {
|
||||
return tInfo.hash();
|
||||
}
|
||||
return Utils::displayAddress(tInfo.hash(), 1);
|
||||
}
|
||||
case Column::FiatAmount:
|
||||
|
|
|
@ -46,6 +46,9 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
|
|||
{Config::enabledTabs, {QS("enabledTabs"), QStringList{"Home", "History", "Send", "Receive", "Calc"}}},
|
||||
{Config::showSearchbar,{QS("showSearchbar"), true}},
|
||||
|
||||
// History
|
||||
{Config::historyShowFullTxid, {QS("historyShowFullTxid"), false}},
|
||||
|
||||
// Receive
|
||||
{Config::showUsedAddresses,{QS("showUsedAddresses"), false}},
|
||||
{Config::showHiddenAddresses,{QS("showHiddenAddresses"), false}},
|
||||
|
|
|
@ -48,7 +48,10 @@ public:
|
|||
// Tabs
|
||||
enabledTabs,
|
||||
showSearchbar,
|
||||
|
||||
|
||||
// History
|
||||
historyShowFullTxid,
|
||||
|
||||
// Receive
|
||||
showUsedAddresses,
|
||||
showHiddenAddresses,
|
||||
|
|
Loading…
Reference in a new issue