summaryrefslogtreecommitdiff
path: root/noncore/apps/qashmoney/qashmoney.cpp
Unidiff
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
@@ -16,6 +16,7 @@ QashMoney::QashMoney () : QWidget ()
16 { 16 {
17 preferences->addPreferences(); 17 preferences->addPreferences();
18 preferences->initializeColumnPreferences (); 18 preferences->initializeColumnPreferences ();
19 preferences->initializeSortingPreferences ();
19 20
20 // set the text in the upper part of the frame 21 // set the text in the upper part of the frame
21 setCaption ( tr ( "QashMoney" ) ); 22 setCaption ( tr ( "QashMoney" ) );
@@ -153,7 +154,7 @@ void QashMoney::changeTabDisplay ()
153 transaction->displayTransactions ( transactiondisplay->listview, accountid, children, displaytext, newdate ); 154 transaction->displayTransactions ( transactiondisplay->listview, accountid, children, displaytext, newdate );
154 155
155 // display transfers 156 // display transfers
156 transfer->displayTransfers ( transactiondisplay->listview, accountid, children ); 157 transfer->displayTransfers ( transactiondisplay->listview, accountid, children, newdate );
157 158
158 // open a new preferences object and resize the transaction display columns 159 // open a new preferences object and resize the transaction display columns
159 // each column will have a different size based on whether we are looking at a child 160 // each column will have a different size based on whether we are looking at a child
@@ -179,6 +180,12 @@ void QashMoney::changeTabDisplay ()
179 transactiondisplay->listview->setColumnWidthMode ( 4, QListView::Manual ); 180 transactiondisplay->listview->setColumnWidthMode ( 4, QListView::Manual );
180 } 181 }
181 182
183 // pull the column sorting preference from the preferences table, and configure the listview accordingly
184 int column = 0;
185 int direction = 0;
186 preferences->getSortingPreference ( 2, &column, &direction );
187 transactiondisplay->listview->setSorting ( column, direction );
188
182 // show the window 189 // show the window
183 transactiondisplay->show(); 190 transactiondisplay->show();
184 // hide the account display and define accountid 191 // hide the account display and define accountid
@@ -197,6 +204,12 @@ void QashMoney::changeTabDisplay ()
197 accountdisplay->listview->setColumnWidth ( 0, preferences->getColumnPreference ( 1 ) ); 204 accountdisplay->listview->setColumnWidth ( 0, preferences->getColumnPreference ( 1 ) );
198 accountdisplay->listview->setColumnWidth ( 1, preferences->getColumnPreference ( 2 ) ); 205 accountdisplay->listview->setColumnWidth ( 1, preferences->getColumnPreference ( 2 ) );
199 206
207 // set sorting preference on account display columns
208 int column = 0;
209 int direction = 0;
210 preferences->getSortingPreference ( 1, &column, &direction );
211 accountdisplay->listview->setSorting ( column, direction );
212
200 // display the accounts 213 // display the accounts
201 if ( account->getNumberOfAccounts() != 0 ) 214 if ( account->getNumberOfAccounts() != 0 )
202 account->displayAccounts ( accountdisplay->listview ); 215 account->displayAccounts ( accountdisplay->listview );
@@ -262,7 +275,7 @@ void QashMoney::displayDatePreferencesDialog ()
262 transaction->displayTransactions ( transactiondisplay->listview, accountid, children, displaytext, newdate ); 275 transaction->displayTransactions ( transactiondisplay->listview, accountid, children, displaytext, newdate );
263 276
264 if ( transfer->getNumberOfTransfers() != 0 ) 277 if ( transfer->getNumberOfTransfers() != 0 )
265 transfer->displayTransfers ( transactiondisplay->listview, accountid, children ); 278 transfer->displayTransfers ( transactiondisplay->listview, accountid, children, newdate );
266 } 279 }
267 else if ( accountdisplay->isVisible() ) 280 else if ( accountdisplay->isVisible() )
268 { 281 {
@@ -300,7 +313,7 @@ void QashMoney::displayTransactionPreferencesDialog ()
300 transaction->displayTransactions ( transactiondisplay->listview, accountid, children, displaytext, newdate ); 313 transaction->displayTransactions ( transactiondisplay->listview, accountid, children, displaytext, newdate );
301 314
302 if ( transfer->getNumberOfTransfers() != 0 ) 315 if ( transfer->getNumberOfTransfers() != 0 )
303 transfer->displayTransfers ( transactiondisplay->listview, accountid, children ); 316 transfer->displayTransfers ( transactiondisplay->listview, accountid, children, newdate );
304 } 317 }
305 else 318 else
306 { 319 {
@@ -385,6 +398,6 @@ void QashMoney::setTransactionDisplayDate ()
385 } 398 }
386 } 399 }
387 else 400 else
388 newdate = QDate ( 1, 1, 1000 ); 401 newdate = QDate ( 1900, 1, 1 );
389 } 402 }
390 403