Transaction list: less terse tooltip
[novacoin.git] / src / qt / transactiontablemodel.cpp
index 65e1632..2477a1e 100644 (file)
@@ -208,7 +208,7 @@ TransactionTableModel::TransactionTableModel(CWallet* wallet, WalletModel *paren
         walletModel(parent),
         priv(new TransactionTablePriv(wallet, this))
 {
-    columns << tr("Status") << tr("Date") << tr("Type") << tr("Address") << tr("Amount");
+    columns << QString() << tr("Date") << tr("Type") << tr("Address") << tr("Amount");
 
     priv->refreshWallet();
 
@@ -278,7 +278,7 @@ QVariant TransactionTableModel::formatTxStatus(const TransactionRecord *wtx) con
         status = tr("Offline (%1 confirmations)").arg(wtx->status.depth);
         break;
     case TransactionStatus::Unconfirmed:
-        status = tr("Unconfirmed (%1/%2 confirmations)").arg(wtx->status.depth).arg(TransactionRecord::NumConfirmations);
+        status = tr("Unconfirmed (%1 of %2 confirmations required)").arg(wtx->status.depth).arg(TransactionRecord::NumConfirmations);
         break;
     case TransactionStatus::HaveConfirmations:
         status = tr("Confirmed (%1 confirmations)").arg(wtx->status.depth);
@@ -286,11 +286,11 @@ QVariant TransactionTableModel::formatTxStatus(const TransactionRecord *wtx) con
     }
     if(wtx->type == TransactionRecord::Generated)
     {
-        status += "\n";
+        status += "\n\n";
         switch(wtx->status.maturity)
         {
         case TransactionStatus::Immature:
-            status += tr("Generation matures in %n more blocks", "",
+            status += tr("Mined balance will be available in %n more blocks", "",
                            wtx->status.matures_in);
             break;
         case TransactionStatus::Mature:
@@ -320,7 +320,7 @@ QVariant TransactionTableModel::formatTxDate(const TransactionRecord *wtx) const
 }
 
 /* Look up address in address book, if found return
-     address[0:12]... (label)
+     address (label)
    otherwise just return address
  */
 QString TransactionTableModel::lookupAddress(const std::string &address) const
@@ -333,7 +333,7 @@ QString TransactionTableModel::lookupAddress(const std::string &address) const
     }
     else
     {
-        description = label + QString(" (") + QString::fromStdString(address.substr(0,12)) + QString("...)");
+        description = label + QString(" (") + QString::fromStdString(address) + QString(")");
     }
     return description;
 }
@@ -360,7 +360,7 @@ QVariant TransactionTableModel::formatTxType(const TransactionRecord *wtx) const
         description = tr("Payment to yourself");
         break;
     case TransactionRecord::Generated:
-        description = tr("Generated");
+        description = tr("Mined");
         break;
     }
     return QVariant(description);
@@ -394,12 +394,15 @@ QVariant TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx)
     return QVariant(description);
 }
 
-QVariant TransactionTableModel::formatTxAmount(const TransactionRecord *wtx) const
+QVariant TransactionTableModel::formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed) const
 {
     QString str = QString::fromStdString(FormatMoney(wtx->credit + wtx->debit));
-    if(!wtx->status.confirmed || wtx->status.maturity != TransactionStatus::Mature)
+    if(showUnconfirmed)
     {
-        str = QString("[") + str + QString("]");
+        if(!wtx->status.confirmed || wtx->status.maturity != TransactionStatus::Mature)
+        {
+            str = QString("[") + str + QString("]");
+        }
     }
     return QVariant(str);
 }
@@ -541,6 +544,18 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const
     {
         return llabs(rec->credit + rec->debit);
     }
+    else if (role == TxIDRole)
+    {
+        return QString::fromStdString(rec->getTxID());
+    }
+    else if (role == ConfirmedRole)
+    {
+        return rec->status.status == TransactionStatus::HaveConfirmations;
+    }
+    else if (role == FormattedAmountRole)
+    {
+        return formatTxAmount(rec, false);
+    }
     return QVariant();
 }