5#include <qt/forms/ui_overviewpage.h>
18#include <QAbstractItemDelegate>
19#include <QApplication>
21#include <QStatusTipEvent>
23#define DECORATION_SIZE 54
32 QObject *parent =
nullptr)
33 : QAbstractItemDelegate(parent), unit(
BitcoinUnits::base),
53 icon = platformStyle->SingleColorIcon(
icon);
58 QString address = index.data(Qt::DisplayRole).toString();
65 QVariant value = index.data(Qt::ForegroundRole);
67 if (value.canConvert<
QBrush>()) {
117#include <qt/overviewpage.moc>
132 icon.addPixmap(
icon.pixmap(
QSize(64, 64), QIcon::Normal), QIcon::Disabled);
133 ui->labelTransactionsStatus->setIcon(
icon);
134 ui->labelWalletStatus->setIcon(
icon);
140 ui->listTransactions->setAttribute(Qt::WA_MacShowFocusRect,
false);
142 connect(
ui->listTransactions, &QListView::clicked,
this,
147 connect(
ui->labelWalletStatus, &QPushButton::clicked,
this,
149 connect(
ui->labelTransactionsStatus, &QPushButton::clicked,
this,
172 m_privacy ?
tr(
"Privacy mode activated for the Overview tab. To unmask "
173 "the values, uncheck Settings->Mask values.")
177 QApplication::sendEvent(
this, &event);
193 unit,
balances.unconfirmed_watch_only_balance,
196 unit,
balances.immature_watch_only_balance,
201 balances.unconfirmed_watch_only_balance +
202 balances.immature_watch_only_balance,
223 unit,
balances.unconfirmed_watch_only_balance,
226 unit,
balances.immature_watch_only_balance,
231 balances.unconfirmed_watch_only_balance +
232 balances.immature_watch_only_balance,
263 ui->labelWatchImmature->setVisible(
283 ui->labelWatchImmature->hide();
304 filter->setDynamicSortFilter(
true);
305 filter->setSortRole(Qt::EditRole);
306 filter->setShowInactive(
false);
309 ui->listTransactions->setModel(
filter.get());
345 ui->listTransactions->update();
350 this->
ui->labelAlerts->setVisible(!warnings.isEmpty());
351 this->
ui->labelAlerts->setText(warnings);
355 ui->labelWalletStatus->setVisible(
fShow);
356 ui->labelTransactionsStatus->setVisible(
fShow);
static constexpr Amount SATOSHI
Bitcoin unit definitions.
static QString formatWithUnit(int unit, const Amount amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD)
Format as string (with unit)
static QString formatWithPrivacy(int unit, const Amount &amount, SeparatorStyle separators, bool privacy)
Format as string (with unit) of fixed length to preserve privacy, if it is set.
Model for Bitcoin network client.
QString getStatusBarWarnings() const
Return warnings to be displayed in status bar.
void alertsChanged(const QString &warnings)
int getDisplayUnit() const
void displayUnitChanged(int unit)
Overview ("home") page widget.
interfaces::WalletBalances m_balances
void setWalletModel(WalletModel *walletModel)
void updateAlerts(const QString &warnings)
void updateWatchOnlyLabels(bool showWatchOnly)
void setClientModel(ClientModel *clientModel)
WalletModel * walletModel
void handleTransactionClicked(const QModelIndex &index)
void transactionClicked(const QModelIndex &index)
void handleOutOfSyncWarningClicks()
OverviewPage(const PlatformStyle *platformStyle, QWidget *parent=nullptr)
std::unique_ptr< TransactionFilterProxy > filter
void outOfSyncWarningClicked()
void showOutOfSyncWarning(bool fShow)
ClientModel * clientModel
void setBalance(const interfaces::WalletBalances &balances)
TxViewDelegate * txdelegate
void setPrivacy(bool privacy)
Filter the transaction list according to pre-specified rules.
@ DateRole
Date and time this transaction was created.
@ RawDecorationRole
Unprocessed icon.
@ WatchonlyDecorationRole
Watch-only icon.
@ WatchonlyRole
Watch-only boolean.
@ AmountRole
Net amount of transaction.
@ ConfirmedRole
Is transaction confirmed?
TxViewDelegate(const PlatformStyle *_platformStyle, QObject *parent=nullptr)
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
const PlatformStyle * platformStyle
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Interface to Bitcoin wallet from Qt view code.
void notifyWatchonlyChanged(bool fHaveWatchonly)
OptionsModel * getOptionsModel()
interfaces::Wallet & wallet() const
void balanceChanged(const interfaces::WalletBalances &balances)
TransactionTableModel * getTransactionTableModel()
Interface for accessing a wallet.
virtual bool isLegacy()=0
Return whether is a legacy wallet.
virtual bool privateKeysDisabled()=0
#define COLOR_UNCONFIRMED
QString dateTimeStr(const QDateTime &date)
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
static constexpr Amount zero() noexcept
static constexpr Amount satoshi() noexcept
Collection of wallet balances.