MCPcopy Create free account
hub / github.com/ElementsProject/elements / TransactionView

Method TransactionView

src/qt/transactionview.cpp:43–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41#include <QVBoxLayout>
42
43TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *parent)
44 : QWidget(parent), m_platform_style{platformStyle}
45{
46 // Build filter row
47 setContentsMargins(0,0,0,0);
48
49 QHBoxLayout *hlayout = new QHBoxLayout();
50 hlayout->setContentsMargins(0,0,0,0);
51
52 if (platformStyle->getUseExtraSpacing()) {
53 hlayout->setSpacing(5);
54 hlayout->addSpacing(26);
55 } else {
56 hlayout->setSpacing(0);
57 hlayout->addSpacing(23);
58 }
59
60 watchOnlyWidget = new QComboBox(this);
61 watchOnlyWidget->setFixedWidth(24);
62 watchOnlyWidget->addItem("", TransactionFilterProxy::WatchOnlyFilter_All);
63 watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_plus"), "", TransactionFilterProxy::WatchOnlyFilter_Yes);
64 watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_minus"), "", TransactionFilterProxy::WatchOnlyFilter_No);
65 hlayout->addWidget(watchOnlyWidget);
66
67 dateWidget = new QComboBox(this);
68 if (platformStyle->getUseExtraSpacing()) {
69 dateWidget->setFixedWidth(121);
70 } else {
71 dateWidget->setFixedWidth(120);
72 }
73 dateWidget->addItem(tr("All"), All);
74 dateWidget->addItem(tr("Today"), Today);
75 dateWidget->addItem(tr("This week"), ThisWeek);
76 dateWidget->addItem(tr("This month"), ThisMonth);
77 dateWidget->addItem(tr("Last month"), LastMonth);
78 dateWidget->addItem(tr("This year"), ThisYear);
79 dateWidget->addItem(tr("Range…"), Range);
80 hlayout->addWidget(dateWidget);
81
82 typeWidget = new QComboBox(this);
83 if (platformStyle->getUseExtraSpacing()) {
84 typeWidget->setFixedWidth(121);
85 } else {
86 typeWidget->setFixedWidth(120);
87 }
88
89 typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES);
90 typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) |
91 TransactionFilterProxy::TYPE(TransactionRecord::RecvFromOther));
92 typeWidget->addItem(tr("Sent to"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) |
93 TransactionFilterProxy::TYPE(TransactionRecord::SendToOther));
94 typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(TransactionRecord::Generated));
95 typeWidget->addItem(tr("Fee"), TransactionFilterProxy::TYPE(TransactionRecord::Fee));
96 typeWidget->addItem(tr("Issuance"), TransactionFilterProxy::TYPE(TransactionRecord::IssuedAsset));
97 typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other));
98
99 hlayout->addWidget(typeWidget);
100

Callers

nothing calls this directly

Calls 4

ExceptionSafeConnectFunction · 0.85
getUseExtraSpacingMethod · 0.80
SingleColorIconMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected