author | allenforsythe <allenforsythe> | 2003-05-28 11:49:47 (UTC) |
---|---|---|
committer | allenforsythe <allenforsythe> | 2003-05-28 11:49:47 (UTC) |
commit | 52047fd3d3f30509d65834747c3a0c5c6760dc01 (patch) (unidiff) | |
tree | 136945c2ffff2434ba1e3c8959b5335f5016e8f8 /noncore/apps/qashmoney/accountdisplay.cpp | |
parent | 7c85b3e98921afa74c7c6a90da4dfd54631c89c5 (diff) | |
download | opie-52047fd3d3f30509d65834747c3a0c5c6760dc01.zip opie-52047fd3d3f30509d65834747c3a0c5c6760dc01.tar.gz opie-52047fd3d3f30509d65834747c3a0c5c6760dc01.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'noncore/apps/qashmoney/accountdisplay.cpp') (more/less context) (ignore whitespace changes)
-rwxr-xr-x | noncore/apps/qashmoney/accountdisplay.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/noncore/apps/qashmoney/accountdisplay.cpp b/noncore/apps/qashmoney/accountdisplay.cpp index b2c0838..64f4ea8 100755 --- a/noncore/apps/qashmoney/accountdisplay.cpp +++ b/noncore/apps/qashmoney/accountdisplay.cpp | |||
@@ -1,7 +1,8 @@ | |||
1 | #include <qdatetime.h> | 1 | #include <qdatetime.h> |
2 | #include <qmessagebox.h> | 2 | #include <qmessagebox.h> |
3 | #include <qheader.h> | 3 | #include <qheader.h> |
4 | #include <iostream.h> | ||
4 | 5 | ||
5 | #include "accountdisplay.h" | 6 | #include "accountdisplay.h" |
6 | #include "newaccount.h" | 7 | #include "newaccount.h" |
7 | #include "transaction.h" | 8 | #include "transaction.h" |
@@ -44,12 +45,13 @@ AccountDisplay::AccountDisplay ( QWidget *parent ) : QWidget ( parent ) | |||
44 | listview->setRootIsDecorated ( TRUE ); | 45 | listview->setRootIsDecorated ( TRUE ); |
45 | listview->setMultiSelection ( FALSE ); | 46 | listview->setMultiSelection ( FALSE ); |
46 | connect ( listview, SIGNAL ( expanded ( QListViewItem * ) ), this, SLOT ( setAccountExpanded ( QListViewItem * ) ) ); | 47 | connect ( listview, SIGNAL ( expanded ( QListViewItem * ) ), this, SLOT ( setAccountExpanded ( QListViewItem * ) ) ); |
47 | connect ( listview, SIGNAL ( collapsed ( QListViewItem * ) ), this, SLOT ( setAccountCollapsed ( QListViewItem * ) ) ); | 48 | connect ( listview, SIGNAL ( collapsed ( QListViewItem * ) ), this, SLOT ( setAccountCollapsed ( QListViewItem * ) ) ); |
48 | 49 | ||
49 | listview->header()->setTracking ( FALSE ); | 50 | listview->header()->setTracking ( FALSE ); |
50 | connect ( listview->header(), SIGNAL ( sizeChange ( int, int, int ) ), this, SLOT ( saveColumnSize ( int, int, int ) ) ); | 51 | connect ( listview->header(), SIGNAL ( sizeChange ( int, int, int ) ), this, SLOT ( saveColumnSize ( int, int, int ) ) ); |
51 | 52 | connect ( listview->header(), SIGNAL ( clicked ( int ) ), this, SLOT ( saveSortingPreference ( int ) ) ); | |
53 | |||
52 | layout = new QVBoxLayout ( this, 2, 5 ); | 54 | layout = new QVBoxLayout ( this, 2, 5 ); |
53 | layout->addWidget ( firstline ); | 55 | layout->addWidget ( firstline ); |
54 | layout->addWidget ( listview ); | 56 | layout->addWidget ( listview ); |
55 | } | 57 | } |
@@ -267,16 +269,14 @@ void AccountDisplay::getTransferAccounts ( QListViewItem * item ) | |||
267 | { | 269 | { |
268 | // set the cleared integer if the checkbox is checked | 270 | // set the cleared integer if the checkbox is checked |
269 | if ( td->clearedcheckbox->isChecked() == TRUE ) | 271 | if ( td->clearedcheckbox->isChecked() == TRUE ) |
270 | cleared = 1; | 272 | cleared = 1; |
271 | 273 | cout << "Year from transferdialog = " << td->getYear() << endl; | |
272 | // add the transfer with a new date if its been edited or use the default date | 274 | // add the transfer with a new date if its been edited or use the default date |
273 | if ( td->getDateEdited () == TRUE ) | 275 | if ( td->getDateEdited () == TRUE ) |
274 | transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, | 276 | transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), td->getDay(), td->getMonth(), td->getYear(), td->amount->text().toFloat(), cleared ); |
275 | account->getParentAccountID ( secondaccountid ), td->getDay(), td->getMonth(), td->getYear(), td->amount->text().toFloat(), cleared ); | ||
276 | else | 277 | else |
277 | transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, | 278 | transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), defaultday, defaultmonth, defaultyear, td->amount->text().toFloat(), cleared ); |
278 | account->getParentAccountID ( secondaccountid ), defaultday, defaultmonth, defaultyear, td->amount->text().toFloat(), cleared ); | ||
279 | 279 | ||
280 | // update account balances of both accounts and parents if necessary | 280 | // update account balances of both accounts and parents if necessary |
281 | account->updateAccountBalance ( firstaccountid ); | 281 | account->updateAccountBalance ( firstaccountid ); |
282 | if ( account->getParentAccountID ( firstaccountid ) != -1 ) | 282 | if ( account->getParentAccountID ( firstaccountid ) != -1 ) |
@@ -346,8 +346,13 @@ void AccountDisplay::saveColumnSize ( int column, int oldsize, int newsize ) | |||
346 | } | 346 | } |
347 | 347 | ||
348 | } | 348 | } |
349 | 349 | ||
350 | void AccountDisplay::saveSortingPreference ( int column ) | ||
351 | { | ||
352 | preferences->changeSortingPreference ( 1, column ); | ||
353 | } | ||
354 | |||
350 | int AccountDisplay::getIDColumn () | 355 | int AccountDisplay::getIDColumn () |
351 | { | 356 | { |
352 | int counter; | 357 | int counter; |
353 | int columns = listview->columns(); | 358 | int columns = listview->columns(); |