diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-07-01 20:28:11 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-07-01 20:28:11 +0200 |
commit | 05bae43c3ccad4959b8cc49db26449d409289118 (patch) | |
tree | ced451609dac30410a9e38b9e164ea53706894e2 /src/qt/transactionview.cpp | |
parent | b5384e93edff8218695c190a596cfb7a62dcb08f (diff) |
Add "last month" filter
Diffstat (limited to 'src/qt/transactionview.cpp')
-rw-r--r-- | src/qt/transactionview.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 84de157110..8763e10e7e 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -36,6 +36,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); @@ -147,6 +148,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 +178,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); |