mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Bitcoin-Qt: fixes for using display unit from options
- extend PaymentServer with setOptionsModel() and rework initNetManager() to make use of that - fix all other places in the code to use display unit from options and no hard-coded unit
This commit is contained in:
@@ -48,11 +48,12 @@ struct TxLessThan
|
||||
class TransactionTablePriv
|
||||
{
|
||||
public:
|
||||
TransactionTablePriv(CWallet *wallet, TransactionTableModel *parent):
|
||||
wallet(wallet),
|
||||
parent(parent)
|
||||
TransactionTablePriv(CWallet *wallet, TransactionTableModel *parent) :
|
||||
wallet(wallet),
|
||||
parent(parent)
|
||||
{
|
||||
}
|
||||
|
||||
CWallet *wallet;
|
||||
TransactionTableModel *parent;
|
||||
|
||||
@@ -200,19 +201,18 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
QString describe(TransactionRecord *rec)
|
||||
QString describe(TransactionRecord *rec, int unit)
|
||||
{
|
||||
{
|
||||
LOCK(wallet->cs_wallet);
|
||||
std::map<uint256, CWalletTx>::iterator mi = wallet->mapWallet.find(rec->hash);
|
||||
if(mi != wallet->mapWallet.end())
|
||||
{
|
||||
return TransactionDesc::toHTML(wallet, mi->second);
|
||||
return TransactionDesc::toHTML(wallet, mi->second, unit);
|
||||
}
|
||||
}
|
||||
return QString("");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
TransactionTableModel::TransactionTableModel(CWallet* wallet, WalletModel *parent):
|
||||
@@ -561,7 +561,7 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const
|
||||
case DateRole:
|
||||
return QDateTime::fromTime_t(static_cast<uint>(rec->time));
|
||||
case LongDescriptionRole:
|
||||
return priv->describe(rec);
|
||||
return priv->describe(rec, walletModel->getOptionsModel()->getDisplayUnit());
|
||||
case AddressRole:
|
||||
return QString::fromStdString(rec->address);
|
||||
case LabelRole:
|
||||
|
||||
Reference in New Issue
Block a user