summaryrefslogtreecommitdiff
path: root/noncore/apps/qashmoney/qashmoney.cpp
authorallenforsythe <allenforsythe>2003-05-28 11:49:47 (UTC)
committer allenforsythe <allenforsythe>2003-05-28 11:49:47 (UTC)
commit52047fd3d3f30509d65834747c3a0c5c6760dc01 (patch) (side-by-side diff)
tree136945c2ffff2434ba1e3c8959b5335f5016e8f8 /noncore/apps/qashmoney/qashmoney.cpp
parent7c85b3e98921afa74c7c6a90da4dfd54631c89c5 (diff)
downloadopie-52047fd3d3f30509d65834747c3a0c5c6760dc01.zip
opie-52047fd3d3f30509d65834747c3a0c5c6760dc01.tar.gz
opie-52047fd3d3f30509d65834747c3a0c5c6760dc01.tar.bz2
*** empty log message ***
Diffstat (limited to 'noncore/apps/qashmoney/qashmoney.cpp') (more/less context) (show whitespace changes)
-rwxr-xr-xnoncore/apps/qashmoney/qashmoney.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/noncore/apps/qashmoney/qashmoney.cpp b/noncore/apps/qashmoney/qashmoney.cpp
index 83eea01..20e8d32 100755
--- a/noncore/apps/qashmoney/qashmoney.cpp
+++ b/noncore/apps/qashmoney/qashmoney.cpp
@@ -15,8 +15,9 @@ Memory *memory = new Memory ();
QashMoney::QashMoney () : QWidget ()
{
preferences->addPreferences();
preferences->initializeColumnPreferences ();
+ preferences->initializeSortingPreferences ();
// set the text in the upper part of the frame
setCaption ( tr ( "QashMoney" ) );
@@ -152,9 +153,9 @@ void QashMoney::changeTabDisplay ()
if ( transaction->getNumberOfTransactions() > 0 )
transaction->displayTransactions ( transactiondisplay->listview, accountid, children, displaytext, newdate );
// display transfers
- transfer->displayTransfers ( transactiondisplay->listview, accountid, children );
+ transfer->displayTransfers ( transactiondisplay->listview, accountid, children, newdate );
// open a new preferences object and resize the transaction display columns
// each column will have a different size based on whether we are looking at a child
// account or children through a parent
@@ -178,8 +179,14 @@ void QashMoney::changeTabDisplay ()
transactiondisplay->listview->setColumnWidth ( 4, preferences->getColumnPreference ( 9 ) ); // transaction account width
transactiondisplay->listview->setColumnWidthMode ( 4, QListView::Manual );
}
+ // pull the column sorting preference from the preferences table, and configure the listview accordingly
+ int column = 0;
+ int direction = 0;
+ preferences->getSortingPreference ( 2, &column, &direction );
+ transactiondisplay->listview->setSorting ( column, direction );
+
// show the window
transactiondisplay->show();
// hide the account display and define accountid
accountdisplay->hide();
@@ -196,8 +203,14 @@ void QashMoney::changeTabDisplay ()
// resize the account display columns
accountdisplay->listview->setColumnWidth ( 0, preferences->getColumnPreference ( 1 ) );
accountdisplay->listview->setColumnWidth ( 1, preferences->getColumnPreference ( 2 ) );
+ // set sorting preference on account display columns
+ int column = 0;
+ int direction = 0;
+ preferences->getSortingPreference ( 1, &column, &direction );
+ accountdisplay->listview->setSorting ( column, direction );
+
// display the accounts
if ( account->getNumberOfAccounts() != 0 )
account->displayAccounts ( accountdisplay->listview );
maintabs->setTabEnabled ( tab_2, FALSE );
@@ -261,9 +274,9 @@ void QashMoney::displayDatePreferencesDialog ()
if ( transaction->getNumberOfTransactions() > 0 )
transaction->displayTransactions ( transactiondisplay->listview, accountid, children, displaytext, newdate );
if ( transfer->getNumberOfTransfers() != 0 )
- transfer->displayTransfers ( transactiondisplay->listview, accountid, children );
+ transfer->displayTransfers ( transactiondisplay->listview, accountid, children, newdate );
}
else if ( accountdisplay->isVisible() )
{
accountdisplay->listview->clearSelection();
@@ -299,9 +312,9 @@ void QashMoney::displayTransactionPreferencesDialog ()
if ( transaction->getNumberOfTransactions() > 0 )
transaction->displayTransactions ( transactiondisplay->listview, accountid, children, displaytext, newdate );
if ( transfer->getNumberOfTransfers() != 0 )
- transfer->displayTransfers ( transactiondisplay->listview, accountid, children );
+ transfer->displayTransfers ( transactiondisplay->listview, accountid, children, newdate );
}
else
{
accountdisplay->listview->clearSelection();
@@ -384,7 +397,7 @@ void QashMoney::setTransactionDisplayDate ()
break;
}
}
else
- newdate = QDate ( 1, 1, 1000 );
+ newdate = QDate ( 1900, 1, 1 );
}