summaryrefslogtreecommitdiff
path: root/noncore/apps/checkbook/checkbook.cpp
Unidiff
Diffstat (limited to 'noncore/apps/checkbook/checkbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/checkbook/checkbook.cpp91
1 files changed, 75 insertions, 16 deletions
diff --git a/noncore/apps/checkbook/checkbook.cpp b/noncore/apps/checkbook/checkbook.cpp
index c53e889..a42c824 100644
--- a/noncore/apps/checkbook/checkbook.cpp
+++ b/noncore/apps/checkbook/checkbook.cpp
@@ -40,31 +40,33 @@
40#include <qpe/qpeapplication.h> 40#include <qpe/qpeapplication.h>
41#include <qpe/qpemessagebox.h> 41#include <qpe/qpemessagebox.h>
42#include <qpe/resource.h> 42#include <qpe/resource.h>
43 43
44#include <qcheckbox.h> 44#include <qcheckbox.h>
45#include <qcombobox.h> 45#include <qcombobox.h>
46#include <qlabel.h> 46#include <qlabel.h>
47#include <qlayout.h> 47#include <qlayout.h>
48#include <qlineedit.h> 48#include <qlineedit.h>
49#include <qmultilineedit.h> 49#include <qmultilineedit.h>
50#include <qpushbutton.h> 50#include <qpushbutton.h>
51#include <qwhatsthis.h> 51#include <qwhatsthis.h>
52#include <qpopupmenu.h>
52 53
53#define COL_ID 0 54#define COL_ID 0
54#define COL_NUM 1 55#define COL_SORTDATE 1
55#define COL_DATE 2 56#define COL_NUM 2
56#define COL_DESC 3 57#define COL_DATE 3
57#define COL_AMOUNT 4 58#define COL_DESC 4
58#define COL_BAL 5 59#define COL_AMOUNT 5
60#define COL_BAL 6
59 61
60// --- Checkbook -------------------------------------------------------------- 62// --- Checkbook --------------------------------------------------------------
61Checkbook::Checkbook( QWidget *parent, CBInfo *i, Cfg *cfg ) 63Checkbook::Checkbook( QWidget *parent, CBInfo *i, Cfg *cfg )
62 : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) 64 : QDialog( parent, 0, TRUE, WStyle_ContextHelp )
63{ 65{
64 info = i; 66 info = i;
65 _pCfg=cfg; 67 _pCfg=cfg;
66 68
67 // Title bar 69 // Title bar
68 if ( info->name() != "" ) 70 if ( info->name() != "" )
69 { 71 {
70 QString tempstr = info->name(); 72 QString tempstr = info->name();
@@ -215,38 +217,43 @@ QWidget *Checkbook::initTransactions()
215 layout->addMultiCellWidget( _cbSortType, 0, 0, 1, 2 ); 217 layout->addMultiCellWidget( _cbSortType, 0, 0, 1, 2 );
216 connect( _cbSortType, SIGNAL( activated(const QString &) ), this, SLOT( slotSortChanged( const QString & ) ) ); 218 connect( _cbSortType, SIGNAL( activated(const QString &) ), this, SLOT( slotSortChanged( const QString & ) ) );
217 219
218 // Table 220 // Table
219 tranTable = new QListView( control ); 221 tranTable = new QListView( control );
220 QFont fnt(QPEApplication::font()); 222 QFont fnt(QPEApplication::font());
221 fnt.setPointSize( fnt.pointSize()-1 ); 223 fnt.setPointSize( fnt.pointSize()-1 );
222 tranTable->setFont( fnt ); 224 tranTable->setFont( fnt );
223 QWhatsThis::add( tranTable, tr( "This is a listing of all transactions entered for this checkbook.\n\nTo sort entries by a specific field, click on the column name." ) ); 225 QWhatsThis::add( tranTable, tr( "This is a listing of all transactions entered for this checkbook.\n\nTo sort entries by a specific field, click on the column name." ) );
224 tranTable->addColumn( tr( "Id" ) ); 226 tranTable->addColumn( tr( "Id" ) );
225 tranTable->setColumnWidthMode( COL_ID, QListView::Manual ); 227 tranTable->setColumnWidthMode( COL_ID, QListView::Manual );
226 tranTable->setColumnWidth( COL_ID, 0); 228 tranTable->setColumnWidth( COL_ID, 0);
229 tranTable->addColumn( tr( "SortDate" ) );
230 tranTable->setColumnWidthMode( COL_SORTDATE, QListView::Manual );
231 tranTable->setColumnWidth( COL_SORTDATE, 0);
227 tranTable->addColumn( tr( "Num" ) ); 232 tranTable->addColumn( tr( "Num" ) );
228 tranTable->addColumn( tr( "Date" ) ); 233 tranTable->addColumn( tr( "Date" ) );
229 //tranTable->addColumn( tr( "Cleared" ) ); 234 //tranTable->addColumn( tr( "Cleared" ) );
230 tranTable->addColumn( tr( "Description" ) ); 235 tranTable->addColumn( tr( "Description" ) );
231 int column = tranTable->addColumn( tr( "Amount" ) ); 236 int column = tranTable->addColumn( tr( "Amount" ) );
232 tranTable->setColumnAlignment( column, Qt::AlignRight ); 237 tranTable->setColumnAlignment( column, Qt::AlignRight );
233 column=tranTable->addColumn( tr("Balance") ); 238 column=tranTable->addColumn( tr("Balance") );
234 tranTable->setColumnAlignment( column, Qt::AlignRight ); 239 tranTable->setColumnAlignment( column, Qt::AlignRight );
235 tranTable->setAllColumnsShowFocus( TRUE ); 240 tranTable->setAllColumnsShowFocus( TRUE );
236 tranTable->setSorting( -1 ); 241 tranTable->setSorting( -1 );
237 layout->addMultiCellWidget( tranTable, 1, 1, 0, 2 ); 242 layout->addMultiCellWidget( tranTable, 1, 1, 0, 2 );
238 QPEApplication::setStylusOperation( tranTable->viewport(), QPEApplication::RightOnHold ); 243 QPEApplication::setStylusOperation( tranTable->viewport(), QPEApplication::RightOnHold );
239 connect( tranTable, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), 244 connect( tranTable, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ),
240 this, SLOT( slotEditTran() ) ); 245 this, SLOT( slotMenuTran(QListViewItem *, const QPoint &) ) );
246 connect( tranTable, SIGNAL( doubleClicked( QListViewItem * ) ),
247 this, SLOT( slotEditTran() ) );
241 _sortCol=COL_ID; 248 _sortCol=COL_ID;
242 249
243 // Buttons 250 // Buttons
244 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), control ); 251 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), control );
245 QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) ); 252 QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) );
246 connect( btn, SIGNAL( clicked() ), this, SLOT( slotNewTran() ) ); 253 connect( btn, SIGNAL( clicked() ), this, SLOT( slotNewTran() ) );
247 layout->addWidget( btn, 2, 0 ); 254 layout->addWidget( btn, 2, 0 );
248 255
249 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), control ); 256 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), control );
250 QWhatsThis::add( btn, tr( "Select a transaction and then click here to edit it." ) ); 257 QWhatsThis::add( btn, tr( "Select a transaction and then click here to edit it." ) );
251 connect( btn, SIGNAL( clicked() ), this, SLOT( slotEditTran() ) ); 258 connect( btn, SIGNAL( clicked() ), this, SLOT( slotEditTran() ) );
252 layout->addWidget( btn, 2, 1 ); 259 layout->addWidget( btn, 2, 1 );
@@ -327,46 +334,47 @@ void Checkbook::loadCheckbook()
327 334
328 // Load transactions 335 // Load transactions
329 float amount; 336 float amount;
330 QString stramount; 337 QString stramount;
331 for ( TranInfo *tran = tranList->first(); tran; tran = tranList->next() ) 338 for ( TranInfo *tran = tranList->first(); tran; tran = tranList->next() )
332 { 339 {
333 amount = tran->amount(); 340 amount = tran->amount();
334 if ( tran->withdrawal() ) 341 if ( tran->withdrawal() )
335 { 342 {
336 amount *= -1; 343 amount *= -1;
337 } 344 }
338 stramount.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), amount ); 345 stramount.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), amount );
339 ( void ) new CBListItem( tran, tranTable, tran->getIdStr(), tran->number(), tran->datestr(), tran->desc(), stramount ); 346 ( void ) new CBListItem( tran, tranTable, tran->getIdStr(), tran->datestr(false), tran->number(), tran->datestr(true), tran->desc(), stramount );
340 } 347 }
341 348
342 // set sort order 349 // set sort order
343 bool bOk=false; 350 bool bOk=false;
344 for(int i=0; i<_cbSortType->count(); i++) { 351 for(int i=0; i<_cbSortType->count(); i++) {
345 if( _cbSortType->text(i)==info->getSortOrder() ) { 352 if( _cbSortType->text(i)==info->getSortOrder() ) {
346 _cbSortType->setCurrentItem(i); 353 _cbSortType->setCurrentItem(i);
347 slotSortChanged( info->getSortOrder() ); 354 slotSortChanged( info->getSortOrder() );
348 bOk=true; 355 bOk=true;
349 break; 356 break;
350 } 357 }
351 } 358 }
352 if( !bOk ) { 359 if( !bOk ) {
353 _cbSortType->setCurrentItem(0); 360 _cbSortType->setCurrentItem(0);
354 slotSortChanged( _cbSortType->currentText() ); 361 slotSortChanged( _cbSortType->currentText() );
355 } 362 }
356 363
357 // calc running balance 364 // calc running balance
358 adjustBalance(); 365 adjustBalance();
359} 366}
360 367
368
361// --- adjustBalance ---------------------------------------------------------- 369// --- adjustBalance ----------------------------------------------------------
362void Checkbook::adjustBalance() 370void Checkbook::adjustBalance()
363{ 371{
364 // update running balance in register 372 // update running balance in register
365 QString sRunning; 373 QString sRunning;
366 float bal=info->startingBalance(); 374 float bal=info->startingBalance();
367 for(CBListItem *item=(CBListItem *)tranTable->firstChild(); item; item=(CBListItem *)item->nextSibling() ) { 375 for(CBListItem *item=(CBListItem *)tranTable->firstChild(); item; item=(CBListItem *)item->nextSibling() ) {
368 TranInfo *tran=item->getTranInfo(); 376 TranInfo *tran=item->getTranInfo();
369 bal=bal + (tran->withdrawal() ? -1 : 1)*tran->amount() - tran->fee(); 377 bal=bal + (tran->withdrawal() ? -1 : 1)*tran->amount() - tran->fee();
370 sRunning.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), bal ); 378 sRunning.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), bal );
371 item->setText( COL_BAL, sRunning); 379 item->setText( COL_BAL, sRunning);
372 } 380 }
@@ -387,24 +395,25 @@ void Checkbook::accept()
387 info->setName( nameEdit->text() ); 395 info->setName( nameEdit->text() );
388 info->setType( typeList->currentText() ); 396 info->setType( typeList->currentText() );
389 info->setBank( bankEdit->text() ); 397 info->setBank( bankEdit->text() );
390 info->setAccount( acctNumEdit->text() ); 398 info->setAccount( acctNumEdit->text() );
391 info->setPin( pinNumEdit->text() ); 399 info->setPin( pinNumEdit->text() );
392 bool ok; 400 bool ok;
393 info->setStartingBalance( balanceEdit->text().toFloat( &ok ) ); 401 info->setStartingBalance( balanceEdit->text().toFloat( &ok ) );
394 info->setNotes( notesEdit->text() ); 402 info->setNotes( notesEdit->text() );
395 403
396 QDialog::accept(); 404 QDialog::accept();
397} 405}
398 406
407// --- slotPasswordClicked ----------------------------------------------------
399void Checkbook::slotPasswordClicked() 408void Checkbook::slotPasswordClicked()
400{ 409{
401 if ( info->password().isNull() && passwordCB->isChecked() ) 410 if ( info->password().isNull() && passwordCB->isChecked() )
402 { 411 {
403 Password *pw = new Password( this, tr( "Enter password" ), tr( "Please enter your password:" ) ); 412 Password *pw = new Password( this, tr( "Enter password" ), tr( "Please enter your password:" ) );
404 if ( pw->exec() != QDialog::Accepted ) 413 if ( pw->exec() != QDialog::Accepted )
405 { 414 {
406 passwordCB->setChecked( FALSE ); 415 passwordCB->setChecked( FALSE );
407 delete pw; 416 delete pw;
408 return; 417 return;
409 } 418 }
410 info->setPassword( pw->password ); 419 info->setPassword( pw->password );
@@ -455,92 +464,140 @@ void Checkbook::slotNameChanged( const QString &newname )
455} 464}
456 465
457 466
458// ---slotStartingBalanceChanged ---------------------------------------------- 467// ---slotStartingBalanceChanged ----------------------------------------------
459void Checkbook::slotStartingBalanceChanged( const QString &newbalance ) 468void Checkbook::slotStartingBalanceChanged( const QString &newbalance )
460{ 469{
461 bool ok; 470 bool ok;
462 info->setStartingBalance( newbalance.toFloat( &ok ) ); 471 info->setStartingBalance( newbalance.toFloat( &ok ) );
463 adjustBalance(); 472 adjustBalance();
464} 473}
465 474
466 475
476// --- slotNewTran ------------------------------------------------------------
467void Checkbook::slotNewTran() 477void Checkbook::slotNewTran()
468{ 478{
469 TranInfo *traninfo = new TranInfo( info->getNextNumber() ); 479 TranInfo *traninfo = new TranInfo( info->getNextNumber() );
470 if( !_dLastNew.isNull() ) 480 if( !_dLastNew.isNull() )
471 traninfo->setDate(_dLastNew); 481 traninfo->setDate(_dLastNew);
472 482
473 Transaction *currtran = new Transaction( this, info->name(), 483 Transaction *currtran = new Transaction( this, true, info->name(),
474 traninfo, 484 traninfo,
475 _pCfg ); 485 _pCfg );
476 currtran->showMaximized(); 486 currtran->showMaximized();
477 if ( currtran->exec() == QDialog::Accepted ) 487 if ( currtran->exec() == QDialog::Accepted )
478 { 488 {
479 // Add to transaction list 489 // Add to transaction list
480 info->addTransaction( traninfo ); 490 info->addTransaction( traninfo );
481 491
482 // Add to transaction table 492 // Add to transaction table
483 float amount; 493 float amount;
484 QString stramount; 494 QString stramount;
485 amount = (traninfo->withdrawal() ? -1 : 1)*traninfo->amount(); 495 amount = (traninfo->withdrawal() ? -1 : 1)*traninfo->amount();
486 stramount.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), amount ); 496 stramount.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), amount );
487 ( void ) new CBListItem( traninfo, tranTable, traninfo->getIdStr(), 497 ( void ) new CBListItem( traninfo, tranTable, traninfo->getIdStr(), traninfo->datestr(false),
488 traninfo->number(), traninfo->datestr(), traninfo->desc(), 498 traninfo->number(), traninfo->datestr(true), traninfo->desc(),
489 stramount ); 499 stramount );
490 resort(); 500 resort();
491 adjustBalance(); 501 adjustBalance();
492 502
493 // save last date 503 // save last date
494 _dLastNew = traninfo->date(); 504 _dLastNew = traninfo->date();
505
506 // save description in list of payees, if not in there
507 QStringList *pLst=&_pCfg->getPayees();
508 if( _pCfg->getSavePayees() && pLst->contains(traninfo->desc())==0 ) {
509 pLst->append( traninfo->desc() );
510 pLst->sort();
511 _pCfg->setDirty(true);
512 }
495 } 513 }
496 else 514 else
497 { 515 {
498 delete traninfo; 516 delete traninfo;
499 } 517 }
500} 518}
501 519
520
521// --- slotEditTran -----------------------------------------------------------
502void Checkbook::slotEditTran() 522void Checkbook::slotEditTran()
503{ 523{
504 QListViewItem *curritem = tranTable->currentItem(); 524 QListViewItem *curritem = tranTable->currentItem();
505 if ( !curritem ) 525 if ( !curritem )
506 return; 526 return;
507 527
508 TranInfo *traninfo=info->findTransaction( curritem->text(COL_ID) ); 528 TranInfo *traninfo=info->findTransaction( curritem->text(COL_ID) );
509 529
510 Transaction *currtran = new Transaction( this, info->name(), 530 Transaction *currtran = new Transaction( this, false, info->name(),
511 traninfo, 531 traninfo,
512 _pCfg ); 532 _pCfg );
513 currtran->showMaximized(); 533 currtran->showMaximized();
514 if ( currtran->exec() == QDialog::Accepted ) 534 if ( currtran->exec() == QDialog::Accepted )
515 { 535 {
516 curritem->setText( COL_NUM, traninfo->number() ); 536 curritem->setText( COL_NUM, traninfo->number() );
517 curritem->setText( COL_DATE, traninfo->datestr() ); 537 curritem->setText( COL_SORTDATE, traninfo->datestr(false) );
538 curritem->setText( COL_DATE, traninfo->datestr(true) );
518 curritem->setText( COL_DESC, traninfo->desc() ); 539 curritem->setText( COL_DESC, traninfo->desc() );
519 540
520 float amount = traninfo->amount(); 541 float amount = traninfo->amount();
521 if ( traninfo->withdrawal() ) 542 if ( traninfo->withdrawal() )
522 { 543 {
523 amount *= -1; 544 amount *= -1;
524 } 545 }
525 QString stramount; 546 QString stramount;
526 stramount.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), amount ); 547 stramount.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), amount );
527 curritem->setText( COL_AMOUNT, stramount ); 548 curritem->setText( COL_AMOUNT, stramount );
528 resort(); 549 resort();
529 adjustBalance(); 550 adjustBalance();
551
552 // save description in list of payees, if not in there
553 QStringList *pLst=&_pCfg->getPayees();
554 if( _pCfg->getSavePayees() && pLst->contains(traninfo->desc())==0 ) {
555 pLst->append( traninfo->desc() );
556 pLst->sort();
557 _pCfg->setDirty(true);
558 }
530 } 559 }
531 560
532 delete currtran; 561 delete currtran;
533} 562}
534 563
564// --- slotMenuTran -----------------------------------------------------------
565void Checkbook::slotMenuTran(QListViewItem *item, const QPoint &pnt)
566{
567 // active item?
568 if( !item )
569 return;
570
571 // Display menu
572 QPopupMenu m;
573 m.insertItem( QWidget::tr( "Edit" ), 1 );
574 m.insertItem( QWidget::tr( "New" ), 2 );
575 m.insertItem( QWidget::tr( "Delete" ), 3 );
576 int r = m.exec( pnt );
577 switch(r) {
578 case 1:
579 slotEditTran();
580 break;
581 case 2:
582 slotNewTran();
583 break;
584 case 3:
585 slotDeleteTran();
586 break;
587 }
588}
589
590
591// --- slotDeleteTran ---------------------------------------------------------
535void Checkbook::slotDeleteTran() 592void Checkbook::slotDeleteTran()
536{ 593{
537 QListViewItem *curritem = tranTable->currentItem(); 594 QListViewItem *curritem = tranTable->currentItem();
538 if ( !curritem ) 595 if ( !curritem )
539 return; 596 return;
540 597
541 TranInfo *traninfo = info->findTransaction( curritem->text(COL_ID) ); 598 TranInfo *traninfo = info->findTransaction( curritem->text(COL_ID) );
542 599
543 if ( QPEMessageBox::confirmDelete ( this, tr( "Delete transaction" ), traninfo->desc() ) ) 600 if ( QPEMessageBox::confirmDelete ( this, tr( "Delete transaction" ), traninfo->desc() ) )
544 { 601 {
545 info->removeTransaction( traninfo ); 602 info->removeTransaction( traninfo );
546 delete curritem; 603 delete curritem;
@@ -582,25 +639,25 @@ void Checkbook::drawBalanceChart()
582 for ( TranInfo *tran = tranList->first(); tran; tran = tranList->next() ) 639 for ( TranInfo *tran = tranList->first(); tran; tran = tranList->next() )
583 { 640 {
584 i++; 641 i++;
585 balance -= tran->fee(); 642 balance -= tran->fee();
586 amount = tran->amount(); 643 amount = tran->amount();
587 if ( tran->withdrawal() ) 644 if ( tran->withdrawal() )
588 { 645 {
589 amount *= -1; 646 amount *= -1;
590 } 647 }
591 balance += amount; 648 balance += amount;
592 if ( i == 1 || i == count / 2 || i == count ) 649 if ( i == 1 || i == count / 2 || i == count )
593 { 650 {
594 label = tran->datestr(); 651 label = tran->datestr(true);
595 } 652 }
596 else 653 else
597 { 654 {
598 label = ""; 655 label = "";
599 } 656 }
600 list->append( new DataPointInfo( label, balance ) ); 657 list->append( new DataPointInfo( label, balance ) );
601 } 658 }
602 659
603 graphInfo = new GraphInfo( GraphInfo::BarChart, list ); 660 graphInfo = new GraphInfo( GraphInfo::BarChart, list );
604} 661}
605 662
606void Checkbook::drawCategoryChart( bool withdrawals ) 663void Checkbook::drawCategoryChart( bool withdrawals )
@@ -657,24 +714,25 @@ void CBListItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int
657 const QPixmap *pm = listView()->viewport()->backgroundPixmap(); 714 const QPixmap *pm = listView()->viewport()->backgroundPixmap();
658 if ( pm && !pm->isNull() ) 715 if ( pm && !pm->isNull() )
659 { 716 {
660 _cg.setBrush( QColorGroup::Base, QBrush( cg.base(), *pm ) ); 717 _cg.setBrush( QColorGroup::Base, QBrush( cg.base(), *pm ) );
661 p->setBrushOrigin( -listView()->contentsX(), -listView()->contentsY() ); 718 p->setBrushOrigin( -listView()->contentsX(), -listView()->contentsY() );
662 } 719 }
663 else if ( isAltBackground() ) 720 else if ( isAltBackground() )
664 _cg.setColor(QColorGroup::Base, cg.background() ); 721 _cg.setColor(QColorGroup::Base, cg.background() );
665 722
666 QListViewItem::paintCell(p, _cg, column, width, align); 723 QListViewItem::paintCell(p, _cg, column, width, align);
667} 724}
668 725
726// --- CBListItem::isAltBackground --------------------------------------------
669bool CBListItem::isAltBackground() 727bool CBListItem::isAltBackground()
670{ 728{
671 QListView *lv = static_cast<QListView *>( listView() ); 729 QListView *lv = static_cast<QListView *>( listView() );
672 if ( lv ) 730 if ( lv )
673 { 731 {
674 CBListItem *above = 0; 732 CBListItem *above = 0;
675 above = (CBListItem *)( itemAbove() ); 733 above = (CBListItem *)( itemAbove() );
676 m_known = above ? above->m_known : true; 734 m_known = above ? above->m_known : true;
677 if ( m_known ) 735 if ( m_known )
678 { 736 {
679 m_odd = above ? !above->m_odd : false; 737 m_odd = above ? !above->m_odd : false;
680 } 738 }
@@ -714,17 +772,18 @@ void Checkbook::slotTab(QWidget *tab)
714 info->setLastTab( tab->name() ); 772 info->setLastTab( tab->name() );
715} 773}
716 774
717 775
718// --- slotSortChanged --------------------------------------------------------- 776// --- slotSortChanged ---------------------------------------------------------
719void Checkbook::slotSortChanged( const QString &selc ) 777void Checkbook::slotSortChanged( const QString &selc )
720{ 778{
721 if( selc==tr("Entry Order") ) { 779 if( selc==tr("Entry Order") ) {
722 _sortCol=COL_ID; 780 _sortCol=COL_ID;
723 } else if( selc==tr("Number") ) { 781 } else if( selc==tr("Number") ) {
724 _sortCol=COL_NUM; 782 _sortCol=COL_NUM;
725 } else if( selc==tr("Date") ) { 783 } else if( selc==tr("Date") ) {
726 _sortCol=COL_DATE; 784 _sortCol=COL_SORTDATE;
727 } 785 }
728 info->setSortOrder( selc ); 786 info->setSortOrder( selc );
729 resort(); 787 resort();
730} 788}
789