summaryrefslogtreecommitdiff
path: root/noncore/apps/qashmoney/accountdisplay.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/accountdisplay.cpp
parent7c85b3e98921afa74c7c6a90da4dfd54631c89c5 (diff)
downloadopie-52047fd3d3f30509d65834747c3a0c5c6760dc01.zip
opie-52047fd3d3f30509d65834747c3a0c5c6760dc01.tar.gz
opie-52047fd3d3f30509d65834747c3a0c5c6760dc01.tar.bz2
*** empty log message ***
Diffstat (limited to 'noncore/apps/qashmoney/accountdisplay.cpp') (more/less context) (show whitespace changes)
-rwxr-xr-xnoncore/apps/qashmoney/accountdisplay.cpp15
1 files changed, 10 insertions, 5 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,9 +1,10 @@
#include <qdatetime.h>
#include <qmessagebox.h>
#include <qheader.h>
+#include <iostream.h>
#include "accountdisplay.h"
#include "newaccount.h"
#include "transaction.h"
#include "transferdialog.h"
#include "preferences.h"
@@ -45,12 +46,13 @@ AccountDisplay::AccountDisplay ( QWidget *parent ) : QWidget ( parent )
listview->setMultiSelection ( FALSE );
connect ( listview, SIGNAL ( expanded ( QListViewItem * ) ), this, SLOT ( setAccountExpanded ( QListViewItem * ) ) );
connect ( listview, SIGNAL ( collapsed ( QListViewItem * ) ), this, SLOT ( setAccountCollapsed ( QListViewItem * ) ) );
listview->header()->setTracking ( FALSE );
connect ( listview->header(), SIGNAL ( sizeChange ( int, int, int ) ), this, SLOT ( saveColumnSize ( int, int, int ) ) );
+ connect ( listview->header(), SIGNAL ( clicked ( int ) ), this, SLOT ( saveSortingPreference ( int ) ) );
layout = new QVBoxLayout ( this, 2, 5 );
layout->addWidget ( firstline );
layout->addWidget ( listview );
}
@@ -265,20 +267,18 @@ void AccountDisplay::getTransferAccounts ( QListViewItem * item )
if ( td->exec() == QDialog::Accepted )
{
// set the cleared integer if the checkbox is checked
if ( td->clearedcheckbox->isChecked() == TRUE )
cleared = 1;
-
+ cout << "Year from transferdialog = " << td->getYear() << endl;
// add the transfer with a new date if its been edited or use the default date
if ( td->getDateEdited () == TRUE )
- transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid,
- account->getParentAccountID ( secondaccountid ), td->getDay(), td->getMonth(), td->getYear(), td->amount->text().toFloat(), cleared );
+ transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), td->getDay(), td->getMonth(), td->getYear(), td->amount->text().toFloat(), cleared );
else
- transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid,
- account->getParentAccountID ( secondaccountid ), defaultday, defaultmonth, defaultyear, td->amount->text().toFloat(), cleared );
+ transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), defaultday, defaultmonth, defaultyear, td->amount->text().toFloat(), cleared );
// update account balances of both accounts and parents if necessary
account->updateAccountBalance ( firstaccountid );
if ( account->getParentAccountID ( firstaccountid ) != -1 )
account->changeParentAccountBalance ( account->getParentAccountID ( firstaccountid ) );
account->updateAccountBalance ( secondaccountid );
@@ -344,12 +344,17 @@ void AccountDisplay::saveColumnSize ( int column, int oldsize, int newsize )
preferences->changeColumnPreference ( 12, newsize );
break;
}
}
+void AccountDisplay::saveSortingPreference ( int column )
+ {
+ preferences->changeSortingPreference ( 1, column );
+ }
+
int AccountDisplay::getIDColumn ()
{
int counter;
int columns = listview->columns();
for ( counter = 0; counter <= columns; counter++ )
if ( listview->header()->label ( counter ).length() == 0 )