выравненивание текста по левому краю
[novacoin.git] / src / qt / mintingtablemodel.cpp
index 139116c..1144770 100644 (file)
 extern double GetDifficulty(const CBlockIndex* blockindex);
 
 static int column_alignments[] = {
-    Qt::AlignCenter|Qt::AlignVCenter,
-    Qt::AlignCenter|Qt::AlignVCenter,
-    Qt::AlignCenter|Qt::AlignVCenter,
-    Qt::AlignCenter|Qt::AlignVCenter,
-    Qt::AlignCenter|Qt::AlignVCenter,
-    Qt::AlignCenter|Qt::AlignVCenter,
-    Qt::AlignCenter|Qt::AlignVCenter
+    Qt::AlignLeft|Qt::AlignVCenter,
+    Qt::AlignLeft|Qt::AlignVCenter,
+    Qt::AlignLeft|Qt::AlignVCenter,
+    Qt::AlignLeft|Qt::AlignVCenter,
+    Qt::AlignLeft|Qt::AlignVCenter,
+    Qt::AlignLeft|Qt::AlignVCenter,
+    Qt::AlignLeft|Qt::AlignVCenter
 };
 
 struct TxLessThan
@@ -367,10 +367,9 @@ QString MintingTableModel::lookupAddress(const std::string &address, bool toolti
 QString MintingTableModel::formatTxPoSReward(KernelRecord *wtx) const
 {
     QString posReward;
-    const CBlockIndex *p = GetLastBlockIndex(pindexBest, true);
-    double difficulty = GetDifficulty(p);
-    posReward += QString(QObject::tr("from  %1 NVC to %2 NVC")).arg(QString::number(wtx->getPoSReward(difficulty, 0),'f', 6), 
-                 QString::number(wtx->getPoSReward(difficulty, mintingInterval),'f', 6)); 
+    int nBits = GetLastBlockIndex(pindexBest, true)->nBits;
+    posReward += QString(QObject::tr("from  %1 to %2")).arg(BitcoinUnits::formatWithUnit(walletModel->getOptionsModel()->getDisplayUnit(), wtx->getPoSReward(nBits, 0)), 
+        BitcoinUnits::formatWithUnit(walletModel->getOptionsModel()->getDisplayUnit(), wtx->getPoSReward(nBits, mintingInterval))); 
     return posReward;
 }
 
@@ -413,7 +412,7 @@ QString MintingTableModel::formatTxAge(const KernelRecord *wtx) const
 
 QString MintingTableModel::formatTxBalance(const KernelRecord *wtx) const
 {
-    return BitcoinUnits::format(walletModel->getOptionsModel()->getDisplayUnit(), wtx->nValue);
+    return BitcoinUnits::formatWithUnit(walletModel->getOptionsModel()->getDisplayUnit(), wtx->nValue);
 }
 
 QVariant MintingTableModel::headerData(int section, Qt::Orientation orientation, int role) const
@@ -464,4 +463,3 @@ QModelIndex MintingTableModel::index(int row, int column, const QModelIndex &par
         return QModelIndex();
     }
 }
-