bool confirmed = index.data(TransactionTableModel::ConfirmedRole).toBool();
QVariant value = index.data(Qt::ForegroundRole);
QColor foreground = option.palette.color(QPalette::Text);
+#if QT_VERSION < 0x050000
if(qVariantCanConvert<QColor>(value))
+#else
+ if(value.canConvert(QMetaType::QColor))
+#endif
{
foreground = qvariant_cast<QColor>(value);
}
bool showWatchOnly = watchOnly != 0;
ui->labelBalanceWatchOnly->setVisible(showWatchOnly);
ui->labelBalanceWatchOnlyText->setVisible(showWatchOnly);
+
+}
+
+// show/hide watch-only labels
+void OverviewPage::updateWatchOnlyLabels(bool showWatchOnly)
+{
+ ui->labelBalanceWatchOnly->setVisible(showWatchOnly);
+ ui->labelBalanceWatchOnlyText->setVisible(showWatchOnly);
}
void OverviewPage::setNumTransactions(int count)
ui->listTransactions->setModelColumn(TransactionTableModel::ToAddress);
// Keep up to date with wallet
- qint64 nTotal=0, nWatchOnly=0;
- model->getBalance(nTotal, nWatchOnly);
- setBalance(nTotal, nWatchOnly, model->getStake(), model->getUnconfirmedBalance(), model->getImmatureBalance());
+ setBalance(model->getBalance(), model->getBalanceWatchOnly(), model->getStake(), model->getUnconfirmedBalance(), model->getImmatureBalance());
connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64, qint64, qint64)));
setNumTransactions(model->getNumTransactions());
connect(model, SIGNAL(numTransactionsChanged(int)), this, SLOT(setNumTransactions(int)));
connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
+
+ updateWatchOnlyLabels(model->haveWatchOnly());
+ connect(model, SIGNAL(notifyWatchonlyChanged(bool)), this, SLOT(updateWatchOnlyLabels(bool)));
}
// update the display unit, to not use the default ("BTC")