}
return QVariant();
}
+
+QString BitcoinUnits::getAmountColumnTitle(int unit)
+{
+ QString amountTitle = QObject::tr("Amount");
+ if (BitcoinUnits::valid(unit))
+ {
+ amountTitle += " ("+BitcoinUnits::name(unit) + ")";
+ }
+ return amountTitle;
+}
\ No newline at end of file
static QString formatWithUnit(int unit, qint64 amount, bool plussign=false);
//! Parse string to coin amount
static bool parse(int unit, const QString &value, qint64 *val_out);
+ //! Gets title for amount column including current display unit if optionsModel reference available */
+ static QString getAmountColumnTitle(int unit);
///@}
//! @name AbstractListModel implementation
<context>
<name>QObject</name>
<message>
+ <source>Amount</source>
+ <translation>Количество</translation>
+ </message>
+ <message>
<source>NovaCoins</source>
<translation>NovaCoins</translation>
</message>
<source>Address</source>
<translation>Адрес</translation>
</message>
- <message>
- <location line="+0"/>
- <source>Amount</source>
- <translation>Количество</translation>
- </message>
<message numerus="yes">
<location line="+57"/>
<source>Open for %n block(s)</source>
priv(new TransactionTablePriv(wallet, this)),
cachedNumBlocks(0)
{
- columns << QString() << tr("Date") << tr("Type") << tr("Address") << tr("Amount");
+ columns << QString() << tr("Date") << tr("Type") << tr("Address") << BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit());
priv->refreshWallet();
delete priv;
}
+/** Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react. */
+void TransactionTableModel::updateAmountColumnTitle()
+{
+ columns[Amount] = BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit());
+ emit headerDataChanged(Qt::Horizontal,Amount,Amount);
+}
+
void TransactionTableModel::updateTransaction(const QString &hash, int status)
{
uint256 updated;
void TransactionTableModel::updateDisplayUnit()
{
+ updateAmountColumnTitle();
// emit dataChanged to update Amount column with the current unit
emit dataChanged(index(0, Amount), index(priv->size()-1, Amount));
}
void updateTransaction(const QString &hash, int status);
void updateConfirmations();
void updateDisplayUnit();
+ /** Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react. */
+ void updateAmountColumnTitle();
friend class TransactionTablePriv;
};
transactionView->horizontalHeader()->setSectionResizeMode(TransactionTableModel::ToAddress, QHeaderView::Stretch);
#endif
transactionView->horizontalHeader()->resizeSection(
- TransactionTableModel::Amount, 100);
+ TransactionTableModel::Amount, 120);
if (model->getOptionsModel() && fShoudAddThirdPartyURL)
{