aboutsummaryrefslogtreecommitdiff
path: root/src/qt/sendcoinsentry.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2012-06-17 12:29:26 -0700
committerWladimir J. van der Laan <[email protected]>2012-06-17 12:29:26 -0700
commita54d2118be9be982d4ec40dd6c77e5a02708e4b0 (patch)
treedfcb7a4548a4c595e52742fcbe62f7255cbaf950 /src/qt/sendcoinsentry.cpp
parentMerge pull request #1451 from Diapolo/sendcoins (diff)
parentadd the slot updateDisplayUnit() to overviewpage, sendcoinsdialog, sendcoinse... (diff)
downloaddiscoin-a54d2118be9be982d4ec40dd6c77e5a02708e4b0.tar.xz
discoin-a54d2118be9be982d4ec40dd6c77e5a02708e4b0.zip
Merge pull request #1434 from Diapolo/GUI_fix_displayunit
GUI: init with correct display unit and update it, when user changes it via options dialog
Diffstat (limited to 'src/qt/sendcoinsentry.cpp')
-rw-r--r--src/qt/sendcoinsentry.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp
index 5960597c7..71891e79c 100644
--- a/src/qt/sendcoinsentry.cpp
+++ b/src/qt/sendcoinsentry.cpp
@@ -68,6 +68,10 @@ void SendCoinsEntry::on_payTo_textChanged(const QString &address)
void SendCoinsEntry::setModel(WalletModel *model)
{
this->model = model;
+
+ if(model && model->getOptionsModel())
+ connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
+
clear();
}
@@ -82,10 +86,8 @@ void SendCoinsEntry::clear()
ui->addAsLabel->clear();
ui->payAmount->clear();
ui->payTo->setFocus();
- if(model && model->getOptionsModel())
- {
- ui->payAmount->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
- }
+ // update the display unit, to not use the default ("BTC")
+ updateDisplayUnit();
}
void SendCoinsEntry::on_deleteButton_clicked()
@@ -160,3 +162,11 @@ void SendCoinsEntry::setFocus()
ui->payTo->setFocus();
}
+void SendCoinsEntry::updateDisplayUnit()
+{
+ if(model && model->getOptionsModel())
+ {
+ // Update payAmount with the current unit
+ ui->payAmount->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
+ }
+}