minor language/text updates
[novacoin.git] / src / qt / transactionview.cpp
index 6b314f4..a3407e8 100644 (file)
@@ -23,8 +23,10 @@ TransactionView::TransactionView(QWidget *parent) :
     transactionView(0)
 {
     // Build filter row
+    setContentsMargins(0,0,0,0);
+
     QHBoxLayout *hlayout = new QHBoxLayout();
-    hlayout->setContentsMargins(QMargins(0,0,0,0));
+    hlayout->setContentsMargins(0,0,0,0);
     hlayout->setSpacing(0);
 
     hlayout->addSpacing(23);
@@ -36,6 +38,7 @@ TransactionView::TransactionView(QWidget *parent) :
     dateWidget->addItem(tr("Today"), Today);
     dateWidget->addItem(tr("This week"), ThisWeek);
     dateWidget->addItem(tr("This month"), ThisMonth);
+    dateWidget->addItem(tr("Last month"), LastMonth);
     dateWidget->addItem(tr("This year"), ThisYear);
     dateWidget->addItem(tr("Range..."), Range);
     hlayout->addWidget(dateWidget);
@@ -50,23 +53,29 @@ TransactionView::TransactionView(QWidget *parent) :
     typeWidget->addItem(tr("Sent to"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) |
                                   TransactionFilterProxy::TYPE(TransactionRecord::SendToIP));
     typeWidget->addItem(tr("To yourself"), TransactionFilterProxy::TYPE(TransactionRecord::SendToSelf));
-    typeWidget->addItem(tr("Generated"), TransactionFilterProxy::TYPE(TransactionRecord::Generated));
+    typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(TransactionRecord::Generated));
     typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other));
 
     hlayout->addWidget(typeWidget);
 
     addressWidget = new QLineEdit(this);
+#if QT_VERSION >= 0x040700
     addressWidget->setPlaceholderText("Enter address or label to search");
+#endif
     hlayout->addWidget(addressWidget);
 
     amountWidget = new QLineEdit(this);
+#if QT_VERSION >= 0x040700
     amountWidget->setPlaceholderText("Min amount");
-    amountWidget->setMaximumWidth(79);
-    amountWidget->setMinimumWidth(79);
+#endif
+    amountWidget->setMaximumWidth(100);
+    amountWidget->setMinimumWidth(100);
     amountWidget->setValidator(new QDoubleValidator(0, 1e20, 8, this));
     hlayout->addWidget(amountWidget);
 
     QVBoxLayout *vlayout = new QVBoxLayout(this);
+    vlayout->setContentsMargins(0,0,0,0);
+    vlayout->setSpacing(0);
 
     QTableView *view = new QTableView(this);
     vlayout->addLayout(hlayout);
@@ -115,7 +124,7 @@ void TransactionView::setModel(TransactionTableModel *model)
     transactionView->horizontalHeader()->setResizeMode(
             TransactionTableModel::ToAddress, QHeaderView::Stretch);
     transactionView->horizontalHeader()->resizeSection(
-            TransactionTableModel::Amount, 79);
+            TransactionTableModel::Amount, 100);
 
 }
 
@@ -147,6 +156,11 @@ void TransactionView::chooseDate(int idx)
                 QDateTime(QDate(current.year(), current.month(), 1)),
                 TransactionFilterProxy::MAX_DATE);
         break;
+    case LastMonth:
+        transactionProxyModel->setDateRange(
+                QDateTime(QDate(current.year(), current.month()-1, 1)),
+                QDateTime(QDate(current.year(), current.month(), 1)));
+        break;
     case ThisYear:
         transactionProxyModel->setDateRange(
                 QDateTime(QDate(current.year(), 1, 1)),
@@ -172,7 +186,7 @@ void TransactionView::changedPrefix(const QString &prefix)
 
 void TransactionView::changedAmount(const QString &amount)
 {
-    qint64 amount_parsed;
+    qint64 amount_parsed = 0;
     if(GUIUtil::parseMoney(amount, &amount_parsed))
     {
         transactionProxyModel->setMinAmount(amount_parsed);