author | zecke <zecke> | 2003-05-07 17:44:59 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-05-07 17:44:59 (UTC) |
commit | ac895871f93dce9734189daf9cb95dbbda605096 (patch) (unidiff) | |
tree | 18f34fcdeededd689ea9b7a3f8fd9d76d2e22282 | |
parent | 1cee00987d34729393fb9383d90babd39517cc68 (diff) | |
download | opie-ac895871f93dce9734189daf9cb95dbbda605096.zip opie-ac895871f93dce9734189daf9cb95dbbda605096.tar.gz opie-ac895871f93dce9734189daf9cb95dbbda605096.tar.bz2 |
one more
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index 77cbe17..c5cedc6 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp | |||
@@ -644,129 +644,129 @@ void MainWindow::slotEdit( int uid ) { | |||
644 | OTodo todo = m_todoMgr.event( uid ); | 644 | OTodo todo = m_todoMgr.event( uid ); |
645 | 645 | ||
646 | todo = currentEditor()->edit(this, todo ); | 646 | todo = currentEditor()->edit(this, todo ); |
647 | 647 | ||
648 | /* if completed */ | 648 | /* if completed */ |
649 | if ( currentEditor()->accepted() ) { | 649 | if ( currentEditor()->accepted() ) { |
650 | qWarning("Replacing now" ); | 650 | qWarning("Replacing now" ); |
651 | m_todoMgr.update( todo.uid(), todo ); | 651 | m_todoMgr.update( todo.uid(), todo ); |
652 | currentView()->replaceEvent( todo ); | 652 | currentView()->replaceEvent( todo ); |
653 | /* a Category might have changed */ | 653 | /* a Category might have changed */ |
654 | populateCategories(); | 654 | populateCategories(); |
655 | } | 655 | } |
656 | 656 | ||
657 | raiseCurrentView(); | 657 | raiseCurrentView(); |
658 | } | 658 | } |
659 | /* | 659 | /* |
660 | void MainWindow::slotUpdate1( int uid, const SmallTodo& ev) { | 660 | void MainWindow::slotUpdate1( int uid, const SmallTodo& ev) { |
661 | m_todoMgr.update( uid, ev ); | 661 | m_todoMgr.update( uid, ev ); |
662 | } | 662 | } |
663 | */ | 663 | */ |
664 | void MainWindow::updateTodo( const OTodo& ev) { | 664 | void MainWindow::updateTodo( const OTodo& ev) { |
665 | m_todoMgr.update( ev.uid() , ev ); | 665 | m_todoMgr.update( ev.uid() , ev ); |
666 | } | 666 | } |
667 | /* The view changed it's configuration | 667 | /* The view changed it's configuration |
668 | * update the view menu | 668 | * update the view menu |
669 | */ | 669 | */ |
670 | void MainWindow::slotUpdate3( QWidget* ) { | 670 | void MainWindow::slotUpdate3( QWidget* ) { |
671 | 671 | ||
672 | } | 672 | } |
673 | void MainWindow::updateList() { | 673 | void MainWindow::updateList() { |
674 | m_todoMgr.updateList(); | 674 | m_todoMgr.updateList(); |
675 | } | 675 | } |
676 | void MainWindow::setReadAhead( uint count ) { | 676 | void MainWindow::setReadAhead( uint count ) { |
677 | if (m_todoMgr.todoDB() ) | 677 | if (m_todoMgr.todoDB() ) |
678 | m_todoMgr.todoDB()->setReadAhead( count ); | 678 | m_todoMgr.todoDB()->setReadAhead( count ); |
679 | } | 679 | } |
680 | void MainWindow::slotQuickEntered() { | 680 | void MainWindow::slotQuickEntered() { |
681 | qWarning("entered"); | 681 | qWarning("entered"); |
682 | OTodo todo = quickEditor()->todo(); | 682 | OTodo todo = quickEditor()->todo(); |
683 | if (todo.isEmpty() ) | 683 | if (todo.isEmpty() ) |
684 | return; | 684 | return; |
685 | 685 | ||
686 | m_todoMgr.add( todo ); | 686 | m_todoMgr.add( todo ); |
687 | currentView()->addEvent( todo ); | 687 | currentView()->addEvent( todo ); |
688 | raiseCurrentView(); | 688 | raiseCurrentView(); |
689 | } | 689 | } |
690 | QuickEditBase* MainWindow::quickEditor() { | 690 | QuickEditBase* MainWindow::quickEditor() { |
691 | return m_curQuick; | 691 | return m_curQuick; |
692 | } | 692 | } |
693 | void MainWindow::slotComplete( int uid ) { | 693 | void MainWindow::slotComplete( int uid ) { |
694 | slotComplete( event(uid) ); | 694 | slotComplete( event(uid) ); |
695 | } | 695 | } |
696 | void MainWindow::slotComplete( const OTodo& todo ) { | 696 | void MainWindow::slotComplete( const OTodo& todo ) { |
697 | OTodo to = todo; | 697 | OTodo to = todo; |
698 | to.setCompleted( !to.isCompleted() ); | 698 | to.setCompleted( !to.isCompleted() ); |
699 | to.setCompletedDate( QDate::currentDate() ); | 699 | to.setCompletedDate( QDate::currentDate() ); |
700 | 700 | ||
701 | /* | 701 | /* |
702 | * if the item does recur | 702 | * if the item does recur |
703 | * we need to spin it off | 703 | * we need to spin it off |
704 | * and update the items duedate to the next | 704 | * and update the items duedate to the next |
705 | * possible recurrance of this item... | 705 | * possible recurrance of this item... |
706 | * the spinned off one will loose the | 706 | * the spinned off one will loose the |
707 | */ | 707 | */ |
708 | if ( to.recurrence().doesRecur() && to.isCompleted() ) { | 708 | if ( to.hasRecurrence() && to.isCompleted() ) { |
709 | OTodo to2( to ); | 709 | OTodo to2( to ); |
710 | 710 | ||
711 | /* the spinned off one won't recur anymore */ | 711 | /* the spinned off one won't recur anymore */ |
712 | to.setRecurrence( ORecur() ); | 712 | to.setRecurrence( ORecur() ); |
713 | 713 | ||
714 | ORecur rec = to2.recurrence(); | 714 | ORecur rec = to2.recurrence(); |
715 | rec.setStart( to.dueDate() ); | 715 | rec.setStart( to.dueDate() ); |
716 | to2.setRecurrence( rec ); | 716 | to2.setRecurrence( rec ); |
717 | /* | 717 | /* |
718 | * if there is a next occurence | 718 | * if there is a next occurence |
719 | * from the duedate of the last recurrance | 719 | * from the duedate of the last recurrance |
720 | */ | 720 | */ |
721 | QDate date; | 721 | QDate date; |
722 | if ( to2.recurrence().nextOcurrence( to2.dueDate().addDays(1), date ) ) { | 722 | if ( to2.recurrence().nextOcurrence( to2.dueDate().addDays(1), date ) ) { |
723 | QDate inval; | 723 | QDate inval; |
724 | /* generate a new uid for the old record */ | 724 | /* generate a new uid for the old record */ |
725 | to.setUid( 1 ); | 725 | to.setUid( 1 ); |
726 | 726 | ||
727 | /* add the old one cause it has a new UID here cause it was spin off */ | 727 | /* add the old one cause it has a new UID here cause it was spin off */ |
728 | m_todoMgr.add( to ); | 728 | m_todoMgr.add( to ); |
729 | 729 | ||
730 | /* | 730 | /* |
731 | * update the due date | 731 | * update the due date |
732 | * start date | 732 | * start date |
733 | * and complete date | 733 | * and complete date |
734 | */ | 734 | */ |
735 | to2.setDueDate( date ); | 735 | to2.setDueDate( date ); |
736 | to2.setStartDate( inval ); | 736 | to2.setStartDate( inval ); |
737 | to2.setCompletedDate( inval ); | 737 | to2.setCompletedDate( inval ); |
738 | to2.setCompleted( false ); | 738 | to2.setCompleted( false ); |
739 | updateTodo( to2 ); | 739 | updateTodo( to2 ); |
740 | }else | 740 | }else |
741 | updateTodo( to ); | 741 | updateTodo( to ); |
742 | }else | 742 | }else |
743 | updateTodo( to ); | 743 | updateTodo( to ); |
744 | 744 | ||
745 | currentView()->updateView(); | 745 | currentView()->updateView(); |
746 | raiseCurrentView(); | 746 | raiseCurrentView(); |
747 | } | 747 | } |
748 | void MainWindow::flush() { | 748 | void MainWindow::flush() { |
749 | slotFlush(); | 749 | slotFlush(); |
750 | } | 750 | } |
751 | void MainWindow::reload() { | 751 | void MainWindow::reload() { |
752 | slotReload(); | 752 | slotReload(); |
753 | } | 753 | } |
754 | int MainWindow::create() { | 754 | int MainWindow::create() { |
755 | int uid = 0; | 755 | int uid = 0; |
756 | if(m_syncing) { | 756 | if(m_syncing) { |
757 | QMessageBox::warning(this, QWidget::tr("Todo"), | 757 | QMessageBox::warning(this, QWidget::tr("Todo"), |
758 | QWidget::tr("Can not edit data, currently syncing")); | 758 | QWidget::tr("Can not edit data, currently syncing")); |
759 | return uid; | 759 | return uid; |
760 | } | 760 | } |
761 | 761 | ||
762 | 762 | ||
763 | OTodo todo = currentEditor()->newTodo( currentCatId(), | 763 | OTodo todo = currentEditor()->newTodo( currentCatId(), |
764 | this ); | 764 | this ); |
765 | 765 | ||
766 | if ( currentEditor()->accepted() ) { | 766 | if ( currentEditor()->accepted() ) { |
767 | //todo.assignUid(); | 767 | //todo.assignUid(); |
768 | uid = todo.uid(); | 768 | uid = todo.uid(); |
769 | m_todoMgr.add( todo ); | 769 | m_todoMgr.add( todo ); |
770 | currentView()->addEvent( todo ); | 770 | currentView()->addEvent( todo ); |
771 | 771 | ||
772 | 772 | ||