aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoinunits.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/bitcoinunits.cpp')
-rw-r--r--src/qt/bitcoinunits.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp
index cf635e1941..089abd862c 100644
--- a/src/qt/bitcoinunits.cpp
+++ b/src/qt/bitcoinunits.cpp
@@ -34,6 +34,17 @@ bool BitcoinUnits::valid(int unit)
}
}
+QString BitcoinUnits::id(int unit)
+{
+ switch(unit)
+ {
+ case BTC: return QString("btc");
+ case mBTC: return QString("mbtc");
+ case uBTC: return QString("ubtc");
+ default: return QString("???");
+ }
+}
+
QString BitcoinUnits::name(int unit)
{
switch(unit)
@@ -188,6 +199,16 @@ bool BitcoinUnits::parse(int unit, const QString &value, qint64 *val_out)
return ok;
}
+QString BitcoinUnits::getAmountColumnTitle(int unit)
+{
+ QString amountTitle = QObject::tr("Amount");
+ if (BitcoinUnits::valid(unit))
+ {
+ amountTitle += " ("+BitcoinUnits::name(unit) + ")";
+ }
+ return amountTitle;
+}
+
int BitcoinUnits::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);