diff options
author | Philip Kaufmann <phil.kaufmann@t-online.de> | 2012-06-09 15:41:21 +0200 |
---|---|---|
committer | Philip Kaufmann <phil.kaufmann@t-online.de> | 2012-06-17 15:20:42 +0200 |
commit | e0873dafc57980caffd1cdff597b4317d9cdcea6 (patch) | |
tree | 6e1e779a8a3fe54a8bd4a5eef2ba02c873d8f308 /src/qt/overviewpage.cpp | |
parent | fab7858a350d4650686b3aa07bd6277ce7c9685f (diff) |
add the slot updateDisplayUnit() to overviewpage, sendcoinsdialog, sendcoinsentry and connect it to displayUnitChanged() - this ensures all fields in the GUI, who use a display unit are imediately updated, when the user changes this setting in the optionsdialog / ensure used fields init with the current set display unit
Diffstat (limited to 'src/qt/overviewpage.cpp')
-rw-r--r-- | src/qt/overviewpage.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 35d48581e3..07be9c520a 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -152,7 +152,7 @@ void OverviewPage::setNumTransactions(int count) void OverviewPage::setModel(WalletModel *model) { this->model = model; - if(model) + if(model && model->getOptionsModel()) { // Set up transaction list filter = new TransactionFilterProxy(); @@ -172,19 +172,25 @@ void OverviewPage::setModel(WalletModel *model) setNumTransactions(model->getNumTransactions()); connect(model, SIGNAL(numTransactionsChanged(int)), this, SLOT(setNumTransactions(int))); - connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(displayUnitChanged())); + connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); } + + // update the display unit, to not use the default ("BTC") + updateDisplayUnit(); } -void OverviewPage::displayUnitChanged() +void OverviewPage::updateDisplayUnit() { - if(!model || !model->getOptionsModel()) - return; - if(currentBalance != -1) - setBalance(currentBalance, currentUnconfirmedBalance, currentImmatureBalance); + if(model && model->getOptionsModel()) + { + if(currentBalance != -1) + setBalance(currentBalance, currentUnconfirmedBalance, currentImmatureBalance); - txdelegate->unit = model->getOptionsModel()->getDisplayUnit(); - ui->listTransactions->update(); + // Update txdelegate->unit with the current unit + txdelegate->unit = model->getOptionsModel()->getDisplayUnit(); + + ui->listTransactions->update(); + } } void OverviewPage::showOutOfSyncWarning(bool fShow) |