summaryrefslogtreecommitdiff
path: root/noncore/apps/qashmoney/transactiondisplay.cpp
authorallenforsythe <allenforsythe>2003-05-16 20:08:38 (UTC)
committer allenforsythe <allenforsythe>2003-05-16 20:08:38 (UTC)
commite6ff2dbd2d128c3cf873e23f4df8006759b47079 (patch) (side-by-side diff)
treebb3c996b76c8937d871f642f0e32032848d32396 /noncore/apps/qashmoney/transactiondisplay.cpp
parent87051a7ba4834aed152bc09aad7f4935c9729ccb (diff)
downloadopie-e6ff2dbd2d128c3cf873e23f4df8006759b47079.zip
opie-e6ff2dbd2d128c3cf873e23f4df8006759b47079.tar.gz
opie-e6ff2dbd2d128c3cf873e23f4df8006759b47079.tar.bz2
Working on time frame for displaying cleared transactions. Not yet working.
Diffstat (limited to 'noncore/apps/qashmoney/transactiondisplay.cpp') (more/less context) (ignore whitespace changes)
-rwxr-xr-xnoncore/apps/qashmoney/transactiondisplay.cpp49
1 files changed, 43 insertions, 6 deletions
diff --git a/noncore/apps/qashmoney/transactiondisplay.cpp b/noncore/apps/qashmoney/transactiondisplay.cpp
index 14f5641..ae6223d 100755
--- a/noncore/apps/qashmoney/transactiondisplay.cpp
+++ b/noncore/apps/qashmoney/transactiondisplay.cpp
@@ -129,4 +129,5 @@ void TransactionDisplay::addTransaction ()
displaytext.prepend ( limitbox->text() );
+ setTransactionDisplayDate ();
if ( transaction->getNumberOfTransactions() > 0 )
- transaction->displayTransactions ( listview, accountid, children, displaytext );
+ transaction->displayTransactions ( listview, accountid, children, displaytext, displaydate );
@@ -367,4 +368,5 @@ void TransactionDisplay::updateAndDisplay ( int id )
displaytext.prepend ( limitbox->text() );
+ setTransactionDisplayDate ();
if ( transaction->getNumberOfTransactions() > 0 )
- transaction->displayTransactions ( listview, accountid, children, displaytext );
+ transaction->displayTransactions ( listview, accountid, children, displaytext, displaydate );
@@ -411,4 +413,5 @@ void TransactionDisplay::deleteTransaction ()
displaytext.prepend ( limitbox->text() );
+ setTransactionDisplayDate ();
if ( transaction->getNumberOfTransactions() > 0 )
- transaction->displayTransactions ( listview, accountid, children, displaytext );
+ transaction->displayTransactions ( listview, accountid, children, displaytext, displaydate );
@@ -442,4 +445,5 @@ void TransactionDisplay::deleteTransaction ()
displaytext.prepend ( limitbox->text() );
+ setTransactionDisplayDate ();
if ( transaction->getNumberOfTransactions() > 0 )
- transaction->displayTransactions ( listview, accountid, children, displaytext );
+ transaction->displayTransactions ( listview, accountid, children, displaytext, displaydate );
@@ -494,4 +498,5 @@ void TransactionDisplay::toggleTransaction ()
displaytext.prepend ( limitbox->text() );
+ setTransactionDisplayDate ();
if ( transaction->getNumberOfTransactions() > 0 )
- transaction->displayTransactions ( listview, accountid, children, displaytext );
+ transaction->displayTransactions ( listview, accountid, children, displaytext, displaydate );
@@ -553,3 +558,6 @@ void TransactionDisplay::limitDisplay ( const QString &text )
displaytext.prepend ( text );
- transaction->displayTransactions ( listview, accountid, children, displaytext );
+ setTransactionDisplayDate ();
+ if ( transaction->getNumberOfTransactions() > 0 )
+ transaction->displayTransactions ( listview, accountid, children, displaytext, displaydate );
+
if ( displaytext.length() == 1 || preferences->getPreference ( 6 ) == 1 )
@@ -586 +594,30 @@ void TransactionDisplay::showTransactionNotes ()
+void TransactionDisplay::setTransactionDisplayDate ()
+ {
+ // determine how many days of transactions to show
+ int limittype = preferences->getPreference ( 7 );
+ if ( limittype != 5 ) // set today's date if we are not showing all transactions
+ {
+ QDate today = QDate::currentDate ();
+ switch ( limittype ) // if we are not showing all transactions
+ {
+ case 0: // viewing two weeks
+ displaydate = today.addDays ( -14 );
+ break;
+ case 1: // viewing one month
+ displaydate = today.addDays ( -30 );
+ break;
+ case 2: // three months
+ displaydate = today.addDays ( -90 );
+ break;
+ case 3: // six months
+ displaydate = today.addDays ( -180 );
+ break;
+ case 4: // one year
+ displaydate = today.addDays ( -365 );
+ break;
+ }
+ }
+ else
+ displaydate = QDate ( 1, 1, 1000 );
+ }