extend generation descriptions
authorWladimir J. van der Laan <laanwj@gmail.com>
Fri, 27 May 2011 20:06:30 +0000 (22:06 +0200)
committerWladimir J. van der Laan <laanwj@gmail.com>
Fri, 27 May 2011 20:06:30 +0000 (22:06 +0200)
gui/include/transactionrecord.h
gui/src/transactionrecord.cpp
gui/src/transactiontablemodel.cpp

index 47eed05..646f87c 100644 (file)
@@ -17,7 +17,6 @@ public:
     {
         Immature,
         Mature,
-        MaturesIn,
         MaturesWarning, /* Will likely not mature because no nodes have confirmed */
         NotAccepted
     };
index 8126cc7..4024e25 100644 (file)
@@ -106,7 +106,6 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWalletTx
 
                     if (wtx.IsInMainChain())
                     {
-                        sub.status.maturity = TransactionStatus::MaturesIn;
                         sub.status.matures_in = wtx.GetBlocksToMaturity();
 
                         // Check if the block was requested by anyone
index 900cb6d..a5d8ffd 100644 (file)
@@ -184,8 +184,22 @@ QVariant TransactionTableModel::formatTxDescription(const TransactionRecord *wtx
         description = tr("Payment to yourself");
         break;
     case TransactionRecord::Generated:
-        /* TODO: more extensive description */
-        description = tr("Generated");
+        switch(wtx->status.maturity)
+        {
+        case TransactionStatus::Immature:
+            description = tr("Generated (matures in %n more blocks)", "",
+                           wtx->status.matures_in);
+            break;
+        case TransactionStatus::Mature:
+            description = tr("Generated");
+            break;
+        case TransactionStatus::MaturesWarning:
+            description = tr("Generated - Warning: This block was not received by any other nodes and will probably not be accepted!");
+            break;
+        case TransactionStatus::NotAccepted:
+            description = tr("Generated (not accepted)");
+            break;
+        }
         break;
     }
     return QVariant(description);