|
|
|
@ -94,7 +94,9 @@ OverviewPage::OverviewPage(QWidget *parent) :
@@ -94,7 +94,9 @@ OverviewPage::OverviewPage(QWidget *parent) :
|
|
|
|
|
ui(new Ui::OverviewPage), |
|
|
|
|
currentBalance(-1), |
|
|
|
|
currentUnconfirmedBalance(-1), |
|
|
|
|
txdelegate(new TxViewDelegate()), filter(0) |
|
|
|
|
currentImmatureBalance(-1), |
|
|
|
|
txdelegate(new TxViewDelegate()), |
|
|
|
|
filter(0) |
|
|
|
|
{ |
|
|
|
|
ui->setupUi(this); |
|
|
|
|
|
|
|
|
@ -125,13 +127,21 @@ OverviewPage::~OverviewPage()
@@ -125,13 +127,21 @@ OverviewPage::~OverviewPage()
|
|
|
|
|
delete ui; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void OverviewPage::setBalance(qint64 balance, qint64 unconfirmedBalance) |
|
|
|
|
void OverviewPage::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance) |
|
|
|
|
{ |
|
|
|
|
int unit = model->getOptionsModel()->getDisplayUnit(); |
|
|
|
|
currentBalance = balance; |
|
|
|
|
currentUnconfirmedBalance = unconfirmedBalance; |
|
|
|
|
currentImmatureBalance = immatureBalance; |
|
|
|
|
ui->labelBalance->setText(BitcoinUnits::formatWithUnit(unit, balance)); |
|
|
|
|
ui->labelUnconfirmed->setText(BitcoinUnits::formatWithUnit(unit, unconfirmedBalance)); |
|
|
|
|
ui->labelImmature->setText(BitcoinUnits::formatWithUnit(unit, immatureBalance)); |
|
|
|
|
|
|
|
|
|
// only show immature (newly mined) balance if it's non-zero, so as not to complicate things
|
|
|
|
|
// for the non-mining users
|
|
|
|
|
bool showImmature = immatureBalance != 0; |
|
|
|
|
ui->labelImmature->setVisible(showImmature); |
|
|
|
|
ui->labelImmatureText->setVisible(showImmature); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void OverviewPage::setNumTransactions(int count) |
|
|
|
@ -156,8 +166,8 @@ void OverviewPage::setModel(WalletModel *model)
@@ -156,8 +166,8 @@ void OverviewPage::setModel(WalletModel *model)
|
|
|
|
|
ui->listTransactions->setModelColumn(TransactionTableModel::ToAddress); |
|
|
|
|
|
|
|
|
|
// Keep up to date with wallet
|
|
|
|
|
setBalance(model->getBalance(), model->getUnconfirmedBalance()); |
|
|
|
|
connect(model, SIGNAL(balanceChanged(qint64, qint64)), this, SLOT(setBalance(qint64, qint64))); |
|
|
|
|
setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance()); |
|
|
|
|
connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64))); |
|
|
|
|
|
|
|
|
|
setNumTransactions(model->getNumTransactions()); |
|
|
|
|
connect(model, SIGNAL(numTransactionsChanged(int)), this, SLOT(setNumTransactions(int))); |
|
|
|
@ -171,7 +181,7 @@ void OverviewPage::displayUnitChanged()
@@ -171,7 +181,7 @@ void OverviewPage::displayUnitChanged()
|
|
|
|
|
if(!model || !model->getOptionsModel()) |
|
|
|
|
return; |
|
|
|
|
if(currentBalance != -1) |
|
|
|
|
setBalance(currentBalance, currentUnconfirmedBalance); |
|
|
|
|
setBalance(currentBalance, currentUnconfirmedBalance, currentImmatureBalance); |
|
|
|
|
|
|
|
|
|
txdelegate->unit = model->getOptionsModel()->getDisplayUnit(); |
|
|
|
|
ui->listTransactions->update(); |
|
|
|
|