Fabcoin Core  0.16.2
P2P Digital Currency
overviewpage.cpp
Go to the documentation of this file.
1 // Copyright (c) 2011-2017 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <overviewpage.h>
6 #include <ui_overviewpage.h>
7 
8 #include <fabcoinunits.h>
9 #include <clientmodel.h>
10 #include <guiconstants.h>
11 #include <guiutil.h>
12 #include <optionsmodel.h>
13 #include <platformstyle.h>
14 #include <transactionfilterproxy.h>
15 #include <transactiontablemodel.h>
16 #include <walletmodel.h>
17 #include <tokenitemmodel.h>
18 #include <wallet/wallet.h>
19 #include <transactiondescdialog.h>
20 #include <styleSheet.h>
21 
22 #include <QAbstractItemDelegate>
23 #include <QPainter>
24 #include <QMessageBox>
25 #include <QTimer>
26 
27 #include <QStandardItem>
28 #include <QStandardItemModel>
29 #include <QSortFilterProxyModel>
30 
31 #define NUM_ITEMS 5
32 #define TOKEN_SIZE 40
33 #define MARGIN 5
34 #define SYMBOL_WIDTH 80
35 
36 #define TX_SIZE 40
37 #define DECORATION_SIZE 20
38 #define DATE_WIDTH 110
39 #define TYPE_WIDTH 140
40 #define AMOUNT_WIDTH 205
41 
42 class TxViewDelegate : public QAbstractItemDelegate
43 {
44  Q_OBJECT
45 public:
46  TxViewDelegate(const PlatformStyle *_platformStyle, QObject *parent=nullptr):
47  QAbstractItemDelegate(parent), unit(FabcoinUnits::FAB),
48  platformStyle(_platformStyle)
49  {
50 
51  }
52 
53  inline void paint(QPainter *painter, const QStyleOptionViewItem &option,
54  const QModelIndex &index ) const
55  {
56  painter->save();
57 
58  QDateTime date = index.data(TransactionTableModel::DateRole).toDateTime();
59  QIcon icon = qvariant_cast<QIcon>(index.data(TransactionTableModel::RawDecorationRole));
60  QString address = index.data(Qt::DisplayRole).toString();
61  qint64 amount = index.data(TransactionTableModel::AmountRole).toLongLong();
62  bool confirmed = index.data(TransactionTableModel::ConfirmedRole).toBool();
63 
64  QModelIndex ind = index.model()->index(index.row(), TransactionTableModel::Type, index.parent());
65  QString typeString = ind.data(Qt::DisplayRole).toString();
66 
67  QRect mainRect = option.rect;
68  QColor txColor = index.row() % 2 ? QColor("#393939") : QColor("#2e2e2e");
69  painter->fillRect(mainRect, txColor);
70 
71  QPen pen;
72  pen.setWidth(2);
73  pen.setColor(QColor("#009ee5"));
74  painter->setPen(pen);
75  bool selected = option.state & QStyle::State_Selected;
76  if(selected)
77  {
78  painter->drawRect(mainRect.x()+1, mainRect.y()+1, mainRect.width()-2, mainRect.height()-2);
79  }
80 
81  QColor foreground("#dedede");
82  painter->setPen(foreground);
83 
84  QRect dateRect(mainRect.left() + MARGIN, mainRect.top(), DATE_WIDTH, TX_SIZE);
85  painter->drawText(dateRect, Qt::AlignLeft|Qt::AlignVCenter, GUIUtil::dateTimeStr(date));
86 
87  int topMargin = (TX_SIZE - DECORATION_SIZE) / 2;
88  QRect decorationRect(dateRect.topRight() + QPoint(MARGIN, topMargin), QSize(DECORATION_SIZE, DECORATION_SIZE));
89  icon.paint(painter, decorationRect);
90 
91  QRect typeRect(decorationRect.right() + MARGIN, mainRect.top(), TYPE_WIDTH, TX_SIZE);
92  painter->drawText(typeRect, Qt::AlignLeft|Qt::AlignVCenter, typeString);
93 
94  bool watchOnly = index.data(TransactionTableModel::WatchonlyRole).toBool();
95 
96  if (watchOnly)
97  {
98  QIcon iconWatchonly = qvariant_cast<QIcon>(index.data(TransactionTableModel::WatchonlyDecorationRole));
99  QRect watchonlyRect(typeRect.right() + MARGIN, mainRect.top() + topMargin, DECORATION_SIZE, DECORATION_SIZE);
100  iconWatchonly.paint(painter, watchonlyRect);
101  }
102 
103  int addressMargin = watchOnly ? MARGIN + 20 : MARGIN;
104  int addressWidth = mainRect.width() - DATE_WIDTH - DECORATION_SIZE - TYPE_WIDTH - AMOUNT_WIDTH - 5*MARGIN;
105  addressWidth = watchOnly ? addressWidth - 20 : addressWidth;
106 
107  QFont addressFont = option.font;
108  addressFont.setPointSizeF(addressFont.pointSizeF() * 0.95);
109  painter->setFont(addressFont);
110 
111  QFontMetrics fmName(painter->font());
112  QString clippedAddress = fmName.elidedText(address, Qt::ElideRight, addressWidth);
113 
114  QRect addressRect(typeRect.right() + addressMargin, mainRect.top(), addressWidth, TX_SIZE);
115  painter->drawText(addressRect, Qt::AlignLeft|Qt::AlignVCenter, clippedAddress);
116 
117  QFont amountFont = option.font;
118  amountFont.setBold(true);
119  painter->setFont(amountFont);
120 
121  if(amount < 0)
122  {
123  foreground = COLOR_NEGATIVE;
124  }
125  else if(!confirmed)
126  {
127  foreground = COLOR_UNCONFIRMED;
128  }
129  else
130  {
131  foreground = QColor("#ffffff");
132  }
133  painter->setPen(foreground);
134 
135  QString amountText = FabcoinUnits::formatWithUnit(unit, amount, true, FabcoinUnits::separatorAlways);
136  if(!confirmed)
137  {
138  amountText = QString("[") + amountText + QString("]");
139  }
140 
141  QRect amountRect(addressRect.right() + MARGIN, addressRect.top(), AMOUNT_WIDTH, TX_SIZE);
142  painter->drawText(amountRect, Qt::AlignRight|Qt::AlignVCenter, amountText);
143 
144  painter->restore();
145  }
146 
147  inline QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
148  {
149  return QSize(TX_SIZE, TX_SIZE);
150  }
151 
152  int unit;
154 
155 };
156 
157 class TknViewDelegate : public QAbstractItemDelegate
158 {
159 public:
160  TknViewDelegate(const PlatformStyle *_platformStyle, QObject *parent) :
161  QAbstractItemDelegate(parent),
162  platformStyle(_platformStyle)
163  {}
164 
165  void paint(QPainter *painter, const QStyleOptionViewItem &option,
166  const QModelIndex &index) const
167  {
168  painter->save();
169 
170  QString tokenSymbol = index.data(TokenItemModel::SymbolRole).toString();
171  QString tokenBalance = index.data(TokenItemModel::BalanceRole).toString();
172 
173  QRect mainRect = option.rect;
174  mainRect.setWidth(option.rect.width());
175 
176  painter->fillRect(mainRect, QColor("#383938"));
177 
178  QRect hLineRect(mainRect.left(), mainRect.bottom(), mainRect.width(), 1);
179  painter->fillRect(hLineRect, QColor("#2e2e2e"));
180 
181  QColor foreground("#dedede");
182  painter->setPen(foreground);
183 
184  QFont font = option.font;
185 
186  QFontMetrics fmName(font);
187  QString clippedSymbol = fmName.elidedText(tokenSymbol, Qt::ElideRight, SYMBOL_WIDTH);
188 
189  QRect symbolRect(mainRect.left() + MARGIN, mainRect.top(), SYMBOL_WIDTH, mainRect.height());
190  painter->drawText(symbolRect, Qt::AlignLeft|Qt::AlignVCenter, clippedSymbol);
191 
192  int balanceWidth = mainRect.width() - symbolRect.width() - 3 * MARGIN;
193  QRect balanceRect(symbolRect.right() + MARGIN, symbolRect.top(), balanceWidth, mainRect.height());
194  painter->drawText(balanceRect, Qt::AlignRight|Qt::AlignVCenter, tokenBalance);
195 
196  painter->restore();
197  }
198 
199  QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
200  {
201  QFont font = option.font;
202 
203  QString balanceString = index.data(TokenItemModel::BalanceRole).toString();
204  QFontMetrics fm(font);
205  int balanceWidth = fm.width(balanceString);
206 
207  int width = SYMBOL_WIDTH + balanceWidth + 3*MARGIN;
208  return QSize(width, TOKEN_SIZE);
209  }
210 
212 };
213 
214 #include <overviewpage.moc>
215 
217  QWidget(parent),
218  ui(new Ui::OverviewPage),
219  clientModel(0),
220  walletModel(0),
221  currentBalance(-1),
222  currentUnconfirmedBalance(-1),
223  currentImmatureBalance(-1),
224  currentStake(-1),
225  currentWatchOnlyBalance(-1),
226  currentWatchUnconfBalance(-1),
227  currentWatchImmatureBalance(-1),
228  currentWatchOnlyStake(-1),
229  txdelegate(new TxViewDelegate(platformStyle, this)),
230  tkndelegate(new TknViewDelegate(platformStyle, this))
231 {
232  ui->setupUi(this);
233 
234  // Set stylesheet
235  SetObjectStyleSheet(ui->labelWalletStatus, StyleSheetNames::ButtonTransparent);
236  SetObjectStyleSheet(ui->labelTokenStatus, StyleSheetNames::ButtonTransparent);
237  SetObjectStyleSheet(ui->labelTransactionsStatus, StyleSheetNames::ButtonTransparent);
238 
239  if (!platformStyle->getImagesOnButtons()) {
240  ui->buttonAddToken->setIcon(QIcon());
241  } else {
242  ui->buttonAddToken->setIcon(platformStyle->MultiStatesIcon(":/icons/add", PlatformStyle::PushButton));
243  }
244 
245  // use a MultiStatesIcon for the "out of sync warning" icon
246  QIcon icon = platformStyle->MultiStatesIcon(":/icons/warning", PlatformStyle::PushButton);
247  ui->labelTransactionsStatus->setIcon(icon);
248  ui->labelWalletStatus->setIcon(icon);
249  ui->labelTokenStatus->setIcon(icon);
250 
251  QFont font = ui->labelTotal->font();
252  font.setPointSizeF(font.pointSizeF() * 1.5);
253  ui->labelTotal->setFont(font);
254 
255  QFont fontWatch = ui->labelWatchTotal->font();
256  fontWatch.setPointSizeF(fontWatch.pointSizeF() * 1.5);
257  ui->labelWatchTotal->setFont(fontWatch);
258 
259  ui->labelDate->setFixedWidth(DATE_WIDTH);
260  ui->labelType->setFixedWidth(TYPE_WIDTH);
261  ui->labelAmount->setFixedWidth(AMOUNT_WIDTH);
262 
263  // Recent transactions
264  ui->listTransactions->setItemDelegate(txdelegate);
265  ui->listTransactions->setIconSize(QSize(DECORATION_SIZE, DECORATION_SIZE));
266  ui->listTransactions->setMinimumHeight(NUM_ITEMS * (TX_SIZE + 2));
267  ui->listTransactions->setMinimumWidth(590);
268  ui->listTransactions->setAttribute(Qt::WA_MacShowFocusRect, false);
269  ui->listTransactions->setSelectionBehavior(QAbstractItemView::SelectRows);
270 
271  connect(ui->listTransactions, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(showDetails()));
272 
273  // Token list
274  ui->listTokens->setItemDelegate(tkndelegate);
275  ui->listTokens->setAttribute(Qt::WA_MacShowFocusRect, false);
276 
277  // start with displaying the "out of sync" warnings
278  showOutOfSyncWarning(true);
279  connect(ui->labelWalletStatus, SIGNAL(clicked()), this, SLOT(handleOutOfSyncWarningClicks()));
280  connect(ui->labelTokenStatus, SIGNAL(clicked()), this, SLOT(handleOutOfSyncWarningClicks()));
281  connect(ui->labelTransactionsStatus, SIGNAL(clicked()), this, SLOT(handleOutOfSyncWarningClicks()));
282 }
283 
285 {
286  Q_EMIT outOfSyncWarningClicked();
287 }
288 
290 {
291  delete ui;
292 }
293 
294 void OverviewPage::setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, const CAmount& stake, const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance, const CAmount& watchOnlyStake)
295 {
296  int unit = walletModel->getOptionsModel()->getDisplayUnit();
298  currentUnconfirmedBalance = unconfirmedBalance;
299  currentImmatureBalance = immatureBalance;
300  currentStake = stake;
301  currentWatchOnlyBalance = watchOnlyBalance;
302  currentWatchUnconfBalance = watchUnconfBalance;
303  currentWatchImmatureBalance = watchImmatureBalance;
304  currentWatchOnlyStake = watchOnlyStake;
306  ui->labelUnconfirmed->setText(FabcoinUnits::formatWithUnit(unit, unconfirmedBalance, false, FabcoinUnits::separatorAlways));
307  ui->labelImmature->setText(FabcoinUnits::formatWithUnit(unit, immatureBalance, false, FabcoinUnits::separatorAlways));
309  ui->labelTotal->setText(FabcoinUnits::formatWithUnit(unit, balance + unconfirmedBalance + immatureBalance + stake, false, FabcoinUnits::separatorAlways));
310  ui->labelWatchAvailable->setText(FabcoinUnits::formatWithUnit(unit, watchOnlyBalance, false, FabcoinUnits::separatorAlways));
311  ui->labelWatchPending->setText(FabcoinUnits::formatWithUnit(unit, watchUnconfBalance, false, FabcoinUnits::separatorAlways));
312  ui->labelWatchImmature->setText(FabcoinUnits::formatWithUnit(unit, watchImmatureBalance, false, FabcoinUnits::separatorAlways));
313  ui->labelWatchStake->setText(FabcoinUnits::formatWithUnit(unit, watchOnlyStake, false, FabcoinUnits::separatorAlways));
314  ui->labelWatchTotal->setText(FabcoinUnits::formatWithUnit(unit, watchOnlyBalance + watchUnconfBalance + watchImmatureBalance + watchOnlyStake, false, FabcoinUnits::separatorAlways));
315 
316  // only show immature (newly mined) balance if it's non-zero, so as not to complicate things
317  // for the non-mining users
318  bool showImmature = immatureBalance != 0;
319  bool showStake = stake != 0;
320  bool showWatchOnlyImmature = watchImmatureBalance != 0;
321  bool showWatchOnlyStake = watchOnlyStake != 0;
322 
323  // for symmetry reasons also show immature label when the watch-only one is shown
324  ui->labelImmature->setVisible(showImmature || showWatchOnlyImmature);
325  ui->labelImmatureText->setVisible(showImmature || showWatchOnlyImmature);
326  ui->labelWatchImmature->setVisible(showWatchOnlyImmature); // show watch-only immature balance
327  ui->labelStake->setVisible(showStake || showWatchOnlyStake);
328  ui->labelStakeText->setVisible(showStake || showWatchOnlyStake);
329  ui->labelWatchStake->setVisible(showWatchOnlyStake); // show watch-only stake balance
330 }
331 
333 {
334  if(walletModel)
335  {
336  std::vector<CTokenInfo> invalidTokens = walletModel->getInvalidTokens();
337  if(invalidTokens.size() > 0)
338  {
339  QString message;
340  for(CTokenInfo& tokenInfo : invalidTokens)
341  {
342  QString symbol = QString::fromStdString(tokenInfo.strTokenSymbol);
343  QString address = QString::fromStdString(tokenInfo.strSenderAddress);
344  message += tr("The %1 address \"%2\" is not yours, please change it to new one.\n").arg(symbol, address);
345  }
346  QMessageBox::warning(this, tr("Invalid token address"), message);
347  }
348  }
349 }
350 
351 // show/hide watch-only labels
352 void OverviewPage::updateWatchOnlyLabels(bool showWatchOnly)
353 {
354  ui->labelSpendable->setVisible(showWatchOnly); // show spendable label (only when watch-only is active)
355  ui->labelWatchonly->setVisible(showWatchOnly); // show watch-only label
356  ui->labelWatchAvailable->setVisible(showWatchOnly); // show watch-only available balance
357  ui->labelWatchPending->setVisible(showWatchOnly); // show watch-only pending balance
358  ui->labelWatchTotal->setVisible(showWatchOnly); // show watch-only total balance
359 
360  if (!showWatchOnly)
361  {
362  ui->labelWatchImmature->hide();
363  ui->labelWatchStake->hide();
364  }
365 }
366 
368 {
369  this->clientModel = model;
370  if(model)
371  {
372  // Show warning if this is a prerelease version
373  connect(model, SIGNAL(alertsChanged(QString)), this, SLOT(updateAlerts(QString)));
375  }
376 }
377 
379 {
380  this->walletModel = model;
381  if(model && model->getOptionsModel())
382  {
383  // Set up transaction list
384  filter.reset(new TransactionFilterProxy());
385  filter->setSourceModel(model->getTransactionTableModel());
386  filter->setLimit(NUM_ITEMS);
387  filter->setDynamicSortFilter(true);
388  filter->setSortRole(Qt::EditRole);
389  filter->setShowInactive(false);
390  filter->sort(TransactionTableModel::Date, Qt::DescendingOrder);
391 
392  ui->listTransactions->setModel(filter.get());
394 
395  // Keep up to date with wallet
396  setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance(), model->getStake(),
399 
400  connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
401 
403  connect(model, SIGNAL(notifyWatchonlyChanged(bool)), this, SLOT(updateWatchOnlyLabels(bool)));
404  }
405 
406  if(model && model->getTokenItemModel())
407  {
408  // Sort tokens by name
409  QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
410  TokenItemModel* tokenModel = model->getTokenItemModel();
411  proxyModel->setSourceModel(tokenModel);
412  proxyModel->sort(0, Qt::AscendingOrder);
413 
414  // Set tokens model
415  ui->listTokens->setModel(proxyModel);
416  }
417 
418  // update the display unit, to not use the default ("FAB")
420 
421  // check for presence of invalid tokens
422  QTimer::singleShot(500, this, SLOT(checkForInvalidTokens()));
423 }
424 
426 {
428  {
429  if(currentBalance != -1)
432 
433  // Update txdelegate->unit with the current unit
435 
436  ui->listTransactions->update();
437  }
438 }
439 
440 void OverviewPage::updateAlerts(const QString &warnings)
441 {
442  this->ui->labelAlerts->setVisible(!warnings.isEmpty());
443  this->ui->labelAlerts->setText(warnings);
444 }
445 
447 {
448  ui->labelWalletStatus->setVisible(fShow);
449  ui->labelTransactionsStatus->setVisible(fShow);
450  ui->labelTokenStatus->setVisible(fShow);
451 }
452 
454 {
455  Q_EMIT addTokenClicked();
456 }
457 
459 {
460  Q_EMIT showMoreClicked();
461 }
462 
464 {
465  if(!ui->listTransactions->selectionModel())
466  return;
467  QModelIndexList selection = ui->listTransactions->selectionModel()->selectedRows();
468  if(!selection.isEmpty())
469  {
470  TransactionDescDialog *dlg = new TransactionDescDialog(selection.at(0));
471  dlg->setAttribute(Qt::WA_DeleteOnClose);
472  dlg->show();
473  }
474 }
QLabel * labelSpendable
#define TX_SIZE
QLabel * labelUnconfirmed
#define SetObjectStyleSheet(object, name)
Definition: styleSheet.h:10
#define AMOUNT_WIDTH
void showDetails()
void setWalletModel(WalletModel *walletModel)
void updateAlerts(const QString &warnings)
#define DECORATION_SIZE
struct evm_uint256be balance(struct evm_env *env, struct evm_uint160be address)
Definition: capi.c:7
CAmount currentBalance
Definition: overviewpage.h:56
Dialog showing transaction details.
QLabel * labelWatchStake
std::unique_ptr< TransactionFilterProxy > filter
Definition: overviewpage.h:67
QPushButton * buttonAddToken
QString dateTimeStr(const QDateTime &date)
Definition: guiutil.cpp:80
QLabel * labelImmature
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
TxViewDelegate(const PlatformStyle *_platformStyle, QObject *parent=nullptr)
CAmount currentWatchOnlyBalance
Definition: overviewpage.h:60
TxViewDelegate * txdelegate
Definition: overviewpage.h:65
const PlatformStyle * platformStyle
WalletModel * walletModel
Definition: overviewpage.h:55
QListView * listTokens
CAmount currentUnconfirmedBalance
Definition: overviewpage.h:57
CAmount getUnconfirmedBalance() const
QString getStatusBarWarnings() const
Return warnings to be displayed in status bar.
CAmount currentWatchOnlyStake
Definition: overviewpage.h:63
QLabel * labelAlerts
void outOfSyncWarningClicked()
#define DATE_WIDTH
static QString formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string (with unit)
int64_t CAmount
Amount in lius (Can be negative)
Definition: amount.h:15
#define SYMBOL_WIDTH
#define TYPE_WIDTH
CAmount currentWatchUnconfBalance
Definition: overviewpage.h:61
CAmount getWatchBalance() const
CAmount currentStake
Definition: overviewpage.h:59
QLabel * labelWatchPending
#define NUM_ITEMS
void updateWatchOnlyLabels(bool showWatchOnly)
QToolButton * labelTransactionsStatus
TokenItemModel * getTokenItemModel()
void checkForInvalidTokens()
#define MARGIN
QLabel * labelAmount
Date and time this transaction was created.
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
TransactionTableModel * getTransactionTableModel()
int getDisplayUnit()
Definition: optionsmodel.h:70
#define COLOR_UNCONFIRMED
Definition: guiconstants.h:20
Model for Fabcoin network client.
Definition: clientmodel.h:38
QLabel * labelWatchTotal
ClientModel * clientModel
Definition: overviewpage.h:54
std::vector< CTokenInfo > getInvalidTokens()
void on_showMoreButton_clicked()
QLabel * labelImmatureText
CAmount getWatchImmatureBalance() const
OverviewPage(const PlatformStyle *platformStyle, QWidget *parent=0)
const PlatformStyle * platformStyle
QLabel * labelStakeText
void showOutOfSyncWarning(bool fShow)
#define TOKEN_SIZE
CAmount getStake() const
Definition: walletmodel.cpp:95
TknViewDelegate(const PlatformStyle *_platformStyle, QObject *parent)
QLabel * labelWatchAvailable
Filter the transaction list according to pre-specified rules.
QIcon MultiStatesIcon(const QString &resourcename, StateType type=NavBar, QColor color=Qt::white, QColor colorAlt=0x2d2d2d) const
Get multi-states icon.
QToolButton * labelTokenStatus
void updateDisplayUnit()
Interface to Fabcoin wallet from Qt view code.
Definition: walletmodel.h:103
CAmount getWatchStake() const
QToolButton * labelWalletStatus
CAmount currentWatchImmatureBalance
Definition: overviewpage.h:62
CAmount currentImmatureBalance
Definition: overviewpage.h:58
bool haveWatchOnly() const
void setClientModel(ClientModel *clientModel)
QLabel * labelWatchImmature
TknViewDelegate * tkndelegate
Definition: overviewpage.h:66
CAmount getImmatureBalance() const
bool getImagesOnButtons() const
Definition: platformstyle.h:21
QListView * listTransactions
void handleOutOfSyncWarningClicks()
struct evm_uint160be address(struct evm_env *env)
Definition: capi.c:13
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Fabcoin unit definitions.
Definition: fabcoinunits.h:49
CAmount getWatchUnconfirmedBalance() const
Overview ("home") page widget.
Definition: overviewpage.h:29
Ui::OverviewPage * ui
Definition: overviewpage.h:53
QLabel * labelWatchonly
void setupUi(QWidget *OverviewPage)
#define COLOR_NEGATIVE
Definition: guiconstants.h:22
void on_buttonAddToken_clicked()
void setBalance(const CAmount &balance, const CAmount &unconfirmedBalance, const CAmount &immatureBalance, const CAmount &stake, const CAmount &watchOnlyBalance, const CAmount &watchUnconfBalance, const CAmount &watchImmatureBalance, const CAmount &watchOnlyStake)
CAmount getBalance(const CCoinControl *coinControl=nullptr) const
Definition: walletmodel.cpp:86
OptionsModel * getOptionsModel()
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
QLabel * labelBalance