author | drw <drw> | 2004-02-25 16:32:24 (UTC) |
---|---|---|
committer | drw <drw> | 2004-02-25 16:32:24 (UTC) |
commit | bea97f98bfb31994425908e7ce982b2450696706 (patch) (unidiff) | |
tree | 2f2bc2f55d4656b7c63a06cdce6bc35346d9388f | |
parent | f84a46fce6c1b7702ec1eaebd40e363b67253649 (diff) | |
download | opie-bea97f98bfb31994425908e7ce982b2450696706.zip opie-bea97f98bfb31994425908e7ce982b2450696706.tar.gz opie-bea97f98bfb31994425908e7ce982b2450696706.tar.bz2 |
Todo: libopie->libopie2
33 files changed, 237 insertions, 224 deletions
diff --git a/core/pim/todo/config.in b/core/pim/todo/config.in index 0b6af4c..45c4558 100644 --- a/core/pim/todo/config.in +++ b/core/pim/todo/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config TODO | 1 | config TODO |
2 | boolean "opie-todo (a Todo-list manager)" | 2 | boolean "opie-todo (a Todo-list manager)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI && LIBOPIE2PIM |
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index fc189bd..0613f2c 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp | |||
@@ -27,8 +27,22 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <unistd.h> | 29 | #include <unistd.h> |
30 | 30 | ||
31 | #include <opie2/opimrecurrence.h> | ||
32 | #include <opie2/opimnotifymanager.h> | ||
33 | #include <opie2/otodoaccessvcal.h> | ||
34 | #include <opie2/oapplicationfactory.h> | ||
35 | |||
36 | #include <qpe/applnk.h> | ||
37 | #include <qpe/config.h> | ||
38 | #include <qpe/ir.h> | ||
39 | #include <qpe/resource.h> | ||
40 | #include <qpe/qpemessagebox.h> | ||
41 | #include <qpe/alarmserver.h> | ||
42 | #include <qpe/timestring.h> | ||
43 | #include <qpe/qpeapplication.h> | ||
44 | |||
31 | #include <qmenubar.h> | 45 | #include <qmenubar.h> |
32 | #include <qmessagebox.h> | 46 | #include <qmessagebox.h> |
33 | #include <qtoolbar.h> | 47 | #include <qtoolbar.h> |
34 | #include <qpopupmenu.h> | 48 | #include <qpopupmenu.h> |
@@ -40,24 +54,8 @@ | |||
40 | #include <qlayout.h> | 54 | #include <qlayout.h> |
41 | #include <qlineedit.h> | 55 | #include <qlineedit.h> |
42 | #include <qwhatsthis.h> | 56 | #include <qwhatsthis.h> |
43 | 57 | ||
44 | #include <qpe/applnk.h> | ||
45 | #include <qpe/config.h> | ||
46 | #include <qpe/ir.h> | ||
47 | #include <qpe/resource.h> | ||
48 | #include <qpe/qpemessagebox.h> | ||
49 | #include <qpe/alarmserver.h> | ||
50 | #include <qpe/timestring.h> | ||
51 | #include <qpe/qpeapplication.h> | ||
52 | |||
53 | #include <opie/orecur.h> | ||
54 | #include <opie/opimnotifymanager.h> | ||
55 | #include <opie/otodoaccessvcal.h> | ||
56 | #include <opie/owidgetstack.h> | ||
57 | |||
58 | #include <opie/oapplicationfactory.h> | ||
59 | |||
60 | #include "quickeditimpl.h" | 58 | #include "quickeditimpl.h" |
61 | #include "todotemplatemanager.h" | 59 | #include "todotemplatemanager.h" |
62 | #include "templateeditor.h" | 60 | #include "templateeditor.h" |
63 | #include "tableview.h" | 61 | #include "tableview.h" |
@@ -309,12 +307,12 @@ QPopupMenu* MainWindow::edit() { | |||
309 | } | 307 | } |
310 | QToolBar* MainWindow::toolbar() { | 308 | QToolBar* MainWindow::toolbar() { |
311 | return m_tool; | 309 | return m_tool; |
312 | } | 310 | } |
313 | OTodoAccess::List MainWindow::list()const { | 311 | OPimTodoAccess::List MainWindow::list()const { |
314 | return m_todoMgr.list(); | 312 | return m_todoMgr.list(); |
315 | } | 313 | } |
316 | OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) { | 314 | OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) { |
317 | int cat = 0; | 315 | int cat = 0; |
318 | if ( m_curCat != QWidget::tr("All Categories") ) | 316 | if ( m_curCat != QWidget::tr("All Categories") ) |
319 | cat = currentCatId(); | 317 | cat = currentCatId(); |
320 | if ( m_curCat == QWidget::tr("Unfiled") ) | 318 | if ( m_curCat == QWidget::tr("Unfiled") ) |
@@ -330,9 +328,9 @@ OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) { | |||
330 | filter |= 2; | 328 | filter |= 2; |
331 | 329 | ||
332 | return m_todoMgr.sorted( asc, sortOrder, filter, cat ); | 330 | return m_todoMgr.sorted( asc, sortOrder, filter, cat ); |
333 | } | 331 | } |
334 | OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) { | 332 | OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) { |
335 | int cat = 0; | 333 | int cat = 0; |
336 | if ( m_curCat != QWidget::tr("All Categories") ) | 334 | if ( m_curCat != QWidget::tr("All Categories") ) |
337 | cat = currentCatId(); | 335 | cat = currentCatId(); |
338 | 336 | ||
@@ -340,9 +338,9 @@ OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) { | |||
340 | cat = -1; | 338 | cat = -1; |
341 | 339 | ||
342 | return m_todoMgr.sorted(asc, sortOrder, addFilter, cat ); | 340 | return m_todoMgr.sorted(asc, sortOrder, addFilter, cat ); |
343 | } | 341 | } |
344 | OTodo MainWindow::event( int uid ) { | 342 | OPimTodo MainWindow::event( int uid ) { |
345 | return m_todoMgr.event( uid ); | 343 | return m_todoMgr.event( uid ); |
346 | } | 344 | } |
347 | bool MainWindow::isSyncing()const { | 345 | bool MainWindow::isSyncing()const { |
348 | return m_syncing; | 346 | return m_syncing; |
@@ -432,16 +430,16 @@ void MainWindow::populateTemplates() { | |||
432 | */ | 430 | */ |
433 | void MainWindow::slotNewFromTemplate( int id ) { | 431 | void MainWindow::slotNewFromTemplate( int id ) { |
434 | QString name = m_template->text( id ); | 432 | QString name = m_template->text( id ); |
435 | 433 | ||
436 | OTodo event = templateManager()->templateEvent( name ); | 434 | OPimTodo event = templateManager()->templateEvent( name ); |
437 | event = currentEditor()->edit(this, | 435 | event = currentEditor()->edit(this, |
438 | event ); | 436 | event ); |
439 | 437 | ||
440 | if ( currentEditor()->accepted() ) { | 438 | if ( currentEditor()->accepted() ) { |
441 | /* assign new todo */ | 439 | /* assign new todo */ |
442 | event.setUid( 1 ); | 440 | event.setUid( 1 ); |
443 | handleAlarms( OTodo(), event ); | 441 | handleAlarms( OPimTodo(), event ); |
444 | m_todoMgr.add( event ); | 442 | m_todoMgr.add( event ); |
445 | currentView()->addEvent( event ); | 443 | currentView()->addEvent( event ); |
446 | 444 | ||
447 | populateCategories(); | 445 | populateCategories(); |
@@ -456,9 +454,9 @@ void MainWindow::slotDuplicate() { | |||
456 | QMessageBox::warning(this, QWidget::tr("Todo"), | 454 | QMessageBox::warning(this, QWidget::tr("Todo"), |
457 | QWidget::tr("Data can not be edited, currently syncing")); | 455 | QWidget::tr("Data can not be edited, currently syncing")); |
458 | return; | 456 | return; |
459 | } | 457 | } |
460 | OTodo ev = m_todoMgr.event( currentView()->current() ); | 458 | OPimTodo ev = m_todoMgr.event( currentView()->current() ); |
461 | /* let's generate a new uid */ | 459 | /* let's generate a new uid */ |
462 | ev.setUid(1); | 460 | ev.setUid(1); |
463 | m_todoMgr.add( ev ); | 461 | m_todoMgr.add( ev ); |
464 | 462 | ||
@@ -477,9 +475,9 @@ void MainWindow::slotDelete() { | |||
477 | QString strName = currentView()->currentRepresentation(); | 475 | QString strName = currentView()->currentRepresentation(); |
478 | if (!QPEMessageBox::confirmDelete(this, QWidget::tr("Todo"), strName ) ) | 476 | if (!QPEMessageBox::confirmDelete(this, QWidget::tr("Todo"), strName ) ) |
479 | return; | 477 | return; |
480 | 478 | ||
481 | handleAlarms( m_todoMgr.event( currentView()->current() ), OTodo() ); | 479 | handleAlarms( m_todoMgr.event( currentView()->current() ), OPimTodo() ); |
482 | m_todoMgr.remove( currentView()->current() ); | 480 | m_todoMgr.remove( currentView()->current() ); |
483 | currentView()->removeEvent( currentView()->current() ); | 481 | currentView()->removeEvent( currentView()->current() ); |
484 | raiseCurrentView(); | 482 | raiseCurrentView(); |
485 | } | 483 | } |
@@ -489,13 +487,13 @@ void MainWindow::slotDelete(int uid ) { | |||
489 | QMessageBox::warning(this, QWidget::tr("Todo"), | 487 | QMessageBox::warning(this, QWidget::tr("Todo"), |
490 | QWidget::tr("Data can not be edited, currently syncing")); | 488 | QWidget::tr("Data can not be edited, currently syncing")); |
491 | return; | 489 | return; |
492 | } | 490 | } |
493 | OTodo to = m_todoMgr.event(uid); | 491 | OPimTodo to = m_todoMgr.event(uid); |
494 | if (!QPEMessageBox::confirmDelete(this, QWidget::tr("Todo"), to.toShortText() ) ) | 492 | if (!QPEMessageBox::confirmDelete(this, QWidget::tr("Todo"), to.toShortText() ) ) |
495 | return; | 493 | return; |
496 | 494 | ||
497 | handleAlarms(to, OTodo() ); | 495 | handleAlarms(to, OPimTodo() ); |
498 | m_todoMgr.remove( to.uid() ); | 496 | m_todoMgr.remove( to.uid() ); |
499 | currentView()->removeEvent( to.uid() ); | 497 | currentView()->removeEvent( to.uid() ); |
500 | raiseCurrentView(); | 498 | raiseCurrentView(); |
501 | } | 499 | } |
@@ -596,22 +594,22 @@ void MainWindow::beamDone( Ir* ir) { | |||
596 | delete ir; | 594 | delete ir; |
597 | ::unlink( beamfile ); | 595 | ::unlink( beamfile ); |
598 | } | 596 | } |
599 | void MainWindow::receiveFile( const QString& filename ) { | 597 | void MainWindow::receiveFile( const QString& filename ) { |
600 | OTodoAccessVCal* cal = new OTodoAccessVCal(filename ); | 598 | OPimTodoAccessVCal* cal = new OPimTodoAccessVCal(filename ); |
601 | 599 | ||
602 | OTodoAccess acc( cal ); | 600 | OPimTodoAccess acc( cal ); |
603 | acc.load(); | 601 | acc.load(); |
604 | OTodoAccess::List list = acc.allRecords(); | 602 | OPimTodoAccess::List list = acc.allRecords(); |
605 | 603 | ||
606 | if (list.count()){ | 604 | if (list.count()){ |
607 | 605 | ||
608 | QString message = QWidget::tr("<P>%1 new tasks arrived.<p>Would you like to add them to your Todolist?").arg(list.count() ); | 606 | QString message = QWidget::tr("<P>%1 new tasks arrived.<p>Would you like to add them to your Todolist?").arg(list.count() ); |
609 | 607 | ||
610 | if ( QMessageBox::information(this, QWidget::tr("New Tasks"), | 608 | if ( QMessageBox::information(this, QWidget::tr("New Tasks"), |
611 | message, QMessageBox::Ok, | 609 | message, QMessageBox::Ok, |
612 | QMessageBox::Cancel ) == QMessageBox::Ok ) { | 610 | QMessageBox::Cancel ) == QMessageBox::Ok ) { |
613 | OTodoAccess::List::Iterator it; | 611 | OPimTodoAccess::List::Iterator it; |
614 | for ( it = list.begin(); it != list.end(); ++it ) | 612 | for ( it = list.begin(); it != list.end(); ++it ) |
615 | m_todoMgr.add( (*it) ); | 613 | m_todoMgr.add( (*it) ); |
616 | 614 | ||
617 | currentView()->updateView(); | 615 | currentView()->updateView(); |
@@ -707,11 +705,11 @@ void MainWindow::slotEdit( int uid ) { | |||
707 | QWidget::tr("Data can't be edited, currently syncing")); | 705 | QWidget::tr("Data can't be edited, currently syncing")); |
708 | return; | 706 | return; |
709 | } | 707 | } |
710 | 708 | ||
711 | OTodo old_todo = m_todoMgr.event( uid ); | 709 | OPimTodo old_todo = m_todoMgr.event( uid ); |
712 | 710 | ||
713 | OTodo todo = currentEditor()->edit(this, old_todo ); | 711 | OPimTodo todo = currentEditor()->edit(this, old_todo ); |
714 | 712 | ||
715 | /* if completed */ | 713 | /* if completed */ |
716 | if ( currentEditor()->accepted() ) { | 714 | if ( currentEditor()->accepted() ) { |
717 | handleAlarms( old_todo, todo ); | 715 | handleAlarms( old_todo, todo ); |
@@ -727,9 +725,9 @@ void MainWindow::slotEdit( int uid ) { | |||
727 | void MainWindow::slotUpdate1( int uid, const SmallTodo& ev) { | 725 | void MainWindow::slotUpdate1( int uid, const SmallTodo& ev) { |
728 | m_todoMgr.update( uid, ev ); | 726 | m_todoMgr.update( uid, ev ); |
729 | } | 727 | } |
730 | */ | 728 | */ |
731 | void MainWindow::updateTodo( const OTodo& ev) { | 729 | void MainWindow::updateTodo( const OPimTodo& ev) { |
732 | m_todoMgr.update( ev.uid() , ev ); | 730 | m_todoMgr.update( ev.uid() , ev ); |
733 | } | 731 | } |
734 | /* The view changed it's configuration | 732 | /* The view changed it's configuration |
735 | * update the view menu | 733 | * update the view menu |
@@ -745,9 +743,9 @@ void MainWindow::setReadAhead( uint count ) { | |||
745 | m_todoMgr.todoDB()->setReadAhead( count ); | 743 | m_todoMgr.todoDB()->setReadAhead( count ); |
746 | } | 744 | } |
747 | void MainWindow::slotQuickEntered() { | 745 | void MainWindow::slotQuickEntered() { |
748 | qWarning("entered"); | 746 | qWarning("entered"); |
749 | OTodo todo = quickEditor()->todo(); | 747 | OPimTodo todo = quickEditor()->todo(); |
750 | if (todo.isEmpty() ) | 748 | if (todo.isEmpty() ) |
751 | return; | 749 | return; |
752 | 750 | ||
753 | m_todoMgr.add( todo ); | 751 | m_todoMgr.add( todo ); |
@@ -759,10 +757,10 @@ QuickEditBase* MainWindow::quickEditor() { | |||
759 | } | 757 | } |
760 | void MainWindow::slotComplete( int uid ) { | 758 | void MainWindow::slotComplete( int uid ) { |
761 | slotComplete( event(uid) ); | 759 | slotComplete( event(uid) ); |
762 | } | 760 | } |
763 | void MainWindow::slotComplete( const OTodo& todo ) { | 761 | void MainWindow::slotComplete( const OPimTodo& todo ) { |
764 | OTodo to = todo; | 762 | OPimTodo to = todo; |
765 | to.setCompleted( !to.isCompleted() ); | 763 | to.setCompleted( !to.isCompleted() ); |
766 | to.setCompletedDate( QDate::currentDate() ); | 764 | to.setCompletedDate( QDate::currentDate() ); |
767 | 765 | ||
768 | /* | 766 | /* |
@@ -776,14 +774,14 @@ void MainWindow::slotComplete( const OTodo& todo ) { | |||
776 | * new one and add this diff to start, completed and alarm dates | 774 | * new one and add this diff to start, completed and alarm dates |
777 | * -zecke | 775 | * -zecke |
778 | */ | 776 | */ |
779 | if ( to.hasRecurrence() && to.isCompleted() ) { | 777 | if ( to.hasRecurrence() && to.isCompleted() ) { |
780 | OTodo to2( to ); | 778 | OPimTodo to2( to ); |
781 | 779 | ||
782 | /* the spinned off one won't recur anymore */ | 780 | /* the spinned off one won't recur anymore */ |
783 | to.setRecurrence( ORecur() ); | 781 | to.setRecurrence( OPimRecurrence() ); |
784 | 782 | ||
785 | ORecur rec = to2.recurrence(); | 783 | OPimRecurrence rec = to2.recurrence(); |
786 | rec.setStart( to.dueDate() ); | 784 | rec.setStart( to.dueDate() ); |
787 | to2.setRecurrence( rec ); | 785 | to2.setRecurrence( rec ); |
788 | /* | 786 | /* |
789 | * if there is a next occurence | 787 | * if there is a next occurence |
@@ -824,9 +822,9 @@ void MainWindow::slotComplete( const OTodo& todo ) { | |||
824 | al.setDateTime( al.dateTime().addDays( dayDiff ) ); | 822 | al.setDateTime( al.dateTime().addDays( dayDiff ) ); |
825 | als.append( al ); | 823 | als.append( al ); |
826 | } | 824 | } |
827 | to2.notifiers().setAlarms( als ); | 825 | to2.notifiers().setAlarms( als ); |
828 | handleAlarms( OTodo(), todo ); | 826 | handleAlarms( OPimTodo(), todo ); |
829 | } | 827 | } |
830 | to2.setCompletedDate( inval ); | 828 | to2.setCompletedDate( inval ); |
831 | to2.setCompleted( false ); | 829 | to2.setCompleted( false ); |
832 | 830 | ||
@@ -854,15 +852,15 @@ int MainWindow::create() { | |||
854 | } | 852 | } |
855 | m_todoMgr.load(); | 853 | m_todoMgr.load(); |
856 | 854 | ||
857 | 855 | ||
858 | OTodo todo = currentEditor()->newTodo( currentCatId(), | 856 | OPimTodo todo = currentEditor()->newTodo( currentCatId(), |
859 | this ); | 857 | this ); |
860 | 858 | ||
861 | if ( currentEditor()->accepted() ) { | 859 | if ( currentEditor()->accepted() ) { |
862 | //todo.assignUid(); | 860 | //todo.assignUid(); |
863 | uid = todo.uid(); | 861 | uid = todo.uid(); |
864 | handleAlarms( OTodo(), todo ); | 862 | handleAlarms( OPimTodo(), todo ); |
865 | m_todoMgr.add( todo ); | 863 | m_todoMgr.add( todo ); |
866 | currentView()->addEvent( todo ); | 864 | currentView()->addEvent( todo ); |
867 | 865 | ||
868 | 866 | ||
@@ -879,9 +877,9 @@ int MainWindow::create() { | |||
879 | bool MainWindow::remove( int uid ) { | 877 | bool MainWindow::remove( int uid ) { |
880 | if (m_syncing) return false; | 878 | if (m_syncing) return false; |
881 | 879 | ||
882 | /* argh need to get the whole OEvent... to disable alarms -zecke */ | 880 | /* argh need to get the whole OEvent... to disable alarms -zecke */ |
883 | handleAlarms( OTodo(), m_todoMgr.event( uid ) ); | 881 | handleAlarms( OPimTodo(), m_todoMgr.event( uid ) ); |
884 | 882 | ||
885 | return m_todoMgr.remove( uid ); | 883 | return m_todoMgr.remove( uid ); |
886 | } | 884 | } |
887 | void MainWindow::beam( int uid) { | 885 | void MainWindow::beam( int uid) { |
@@ -889,11 +887,11 @@ void MainWindow::beam( int uid) { | |||
889 | 887 | ||
890 | ::unlink( beamfile ); | 888 | ::unlink( beamfile ); |
891 | m_todoMgr.load(); | 889 | m_todoMgr.load(); |
892 | 890 | ||
893 | OTodo todo = event( uid ); | 891 | OPimTodo todo = event( uid ); |
894 | OTodoAccessVCal* cal = new OTodoAccessVCal(QString::fromLatin1(beamfile) ); | 892 | OPimTodoAccessVCal* cal = new OPimTodoAccessVCal(QString::fromLatin1(beamfile) ); |
895 | OTodoAccess acc( cal ); | 893 | OPimTodoAccess acc( cal ); |
896 | acc.load(); | 894 | acc.load(); |
897 | acc.add( todo ); | 895 | acc.add( todo ); |
898 | acc.save(); | 896 | acc.save(); |
899 | Ir* ir = new Ir(this ); | 897 | Ir* ir = new Ir(this ); |
@@ -912,12 +910,12 @@ void MainWindow::edit( int uid ) { | |||
912 | m_todoMgr.load(); | 910 | m_todoMgr.load(); |
913 | slotEdit( uid ); | 911 | slotEdit( uid ); |
914 | } | 912 | } |
915 | void MainWindow::add( const OPimRecord& rec) { | 913 | void MainWindow::add( const OPimRecord& rec) { |
916 | if ( rec.rtti() != OTodo::rtti() ) return; | 914 | if ( rec.rtti() != OPimTodo::rtti() ) return; |
917 | m_todoMgr.load(); // might not be loaded | 915 | m_todoMgr.load(); // might not be loaded |
918 | 916 | ||
919 | const OTodo& todo = static_cast<const OTodo&>(rec); | 917 | const OPimTodo& todo = static_cast<const OPimTodo&>(rec); |
920 | 918 | ||
921 | m_todoMgr.add(todo ); | 919 | m_todoMgr.add(todo ); |
922 | currentView()->addEvent( todo ); | 920 | currentView()->addEvent( todo ); |
923 | 921 | ||
@@ -968,9 +966,9 @@ namespace { | |||
968 | } | 966 | } |
969 | } | 967 | } |
970 | } | 968 | } |
971 | 969 | ||
972 | void MainWindow::handleAlarms( const OTodo& oldTodo, const OTodo& newTodo) { | 970 | void MainWindow::handleAlarms( const OPimTodo& oldTodo, const OPimTodo& newTodo) { |
973 | /* | 971 | /* |
974 | * if oldTodo is not empty and has notifiers we need to find the deleted ones | 972 | * if oldTodo is not empty and has notifiers we need to find the deleted ones |
975 | */ | 973 | */ |
976 | if(!oldTodo.isEmpty() && oldTodo.hasNotifiers() ) { | 974 | if(!oldTodo.isEmpty() && oldTodo.hasNotifiers() ) { |
@@ -996,9 +994,9 @@ void MainWindow::handleAlarms( const OTodo& oldTodo, const OTodo& newTodo) { | |||
996 | /* we might have not loaded the db */ | 994 | /* we might have not loaded the db */ |
997 | void MainWindow::doAlarm( const QDateTime& dt, int uid ) { | 995 | void MainWindow::doAlarm( const QDateTime& dt, int uid ) { |
998 | m_todoMgr.load(); | 996 | m_todoMgr.load(); |
999 | 997 | ||
1000 | OTodo todo = m_todoMgr.event( uid ); | 998 | OPimTodo todo = m_todoMgr.event( uid ); |
1001 | if (!todo.hasNotifiers() ) return; | 999 | if (!todo.hasNotifiers() ) return; |
1002 | 1000 | ||
1003 | /* | 1001 | /* |
1004 | * let's find the right alarm and find out if silent | 1002 | * let's find the right alarm and find out if silent |
diff --git a/core/pim/todo/mainwindow.h b/core/pim/todo/mainwindow.h index fd0e1bd..6a7296b 100644 --- a/core/pim/todo/mainwindow.h +++ b/core/pim/todo/mainwindow.h | |||
@@ -30,11 +30,12 @@ | |||
30 | #define TODO_MAIN_WINDOW_H | 30 | #define TODO_MAIN_WINDOW_H |
31 | 31 | ||
32 | #include <qlist.h> | 32 | #include <qlist.h> |
33 | 33 | ||
34 | #include <opie/otodoaccess.h> | 34 | #include <opie2/otodoaccess.h> |
35 | #include <opie/otodo.h> | 35 | #include <opie2/opimtodo.h> |
36 | #include <opie/opimmainwindow.h> | 36 | #include <opie2/opimmainwindow.h> |
37 | #include <opie2/owidgetstack.h> | ||
37 | 38 | ||
38 | #include "smalltodo.h" | 39 | #include "smalltodo.h" |
39 | #include "todoview.h" | 40 | #include "todoview.h" |
40 | #include "quickedit.h" | 41 | #include "quickedit.h" |
@@ -43,13 +44,14 @@ | |||
43 | class QPopupMenu; | 44 | class QPopupMenu; |
44 | class QMenuBar; | 45 | class QMenuBar; |
45 | class QToolBar; | 46 | class QToolBar; |
46 | class QAction; | 47 | class QAction; |
47 | class OWidgetStack; | ||
48 | class Ir; | 48 | class Ir; |
49 | class QVBox; | 49 | class QVBox; |
50 | class QLineEdit; | 50 | class QLineEdit; |
51 | 51 | ||
52 | using namespace Opie; | ||
53 | |||
52 | namespace Todo { | 54 | namespace Todo { |
53 | typedef TodoView View; | 55 | typedef TodoView View; |
54 | class TemplateManager; | 56 | class TemplateManager; |
55 | class Editor; | 57 | class Editor; |
@@ -68,21 +70,21 @@ namespace Todo { | |||
68 | MainWindow( QWidget *parent = 0, | 70 | MainWindow( QWidget *parent = 0, |
69 | const char* name = 0, WFlags fl = 0 ); | 71 | const char* name = 0, WFlags fl = 0 ); |
70 | ~MainWindow(); | 72 | ~MainWindow(); |
71 | 73 | ||
72 | /** return a context menu for an OTodo */ | 74 | /** return a context menu for an OPimTodo */ |
73 | QPopupMenu* contextMenu(int uid, bool doesRecur = FALSE ); | 75 | QPopupMenu* contextMenu(int uid, bool doesRecur = FALSE ); |
74 | QPopupMenu* options(); | 76 | QPopupMenu* options(); |
75 | QPopupMenu* edit(); | 77 | QPopupMenu* edit(); |
76 | QToolBar* toolbar(); | 78 | QToolBar* toolbar(); |
77 | 79 | ||
78 | 80 | ||
79 | void updateList(); | 81 | void updateList(); |
80 | OTodoAccess::List list()const; | 82 | OPimTodoAccess::List list()const; |
81 | OTodoAccess::List sorted( bool asc, int sortOrder ); | 83 | OPimTodoAccess::List sorted( bool asc, int sortOrder ); |
82 | OTodoAccess::List sorted( bool asc, int sortOrder, int addFilter ); | 84 | OPimTodoAccess::List sorted( bool asc, int sortOrder, int addFilter ); |
83 | 85 | ||
84 | OTodo event(int uid ); | 86 | OPimTodo event(int uid ); |
85 | 87 | ||
86 | bool isSyncing()const; | 88 | bool isSyncing()const; |
87 | bool showCompleted()const; | 89 | bool showCompleted()const; |
88 | bool showDeadline()const; | 90 | bool showDeadline()const; |
@@ -92,9 +94,9 @@ namespace Todo { | |||
92 | int currentCatId(); | 94 | int currentCatId(); |
93 | TemplateManager* templateManager(); | 95 | TemplateManager* templateManager(); |
94 | QuickEditBase* quickEditor(); | 96 | QuickEditBase* quickEditor(); |
95 | 97 | ||
96 | void updateTodo( const OTodo& ); | 98 | void updateTodo( const OPimTodo& ); |
97 | void populateTemplates(); | 99 | void populateTemplates(); |
98 | Editor* currentEditor(); | 100 | Editor* currentEditor(); |
99 | void setReadAhead(uint count ); | 101 | void setReadAhead(uint count ); |
100 | private slots: | 102 | private slots: |
@@ -107,9 +109,9 @@ private slots: | |||
107 | void closeEvent( QCloseEvent* e ); | 109 | void closeEvent( QCloseEvent* e ); |
108 | 110 | ||
109 | private: | 111 | private: |
110 | /* handle setting and removing alarms */ | 112 | /* handle setting and removing alarms */ |
111 | void handleAlarms( const OTodo& oldTodo, const OTodo& newTodo ); | 113 | void handleAlarms( const OPimTodo& oldTodo, const OPimTodo& newTodo ); |
112 | void receiveFile( const QString& filename ); | 114 | void receiveFile( const QString& filename ); |
113 | void connectBase( ViewBase* ); | 115 | void connectBase( ViewBase* ); |
114 | void initUI(); | 116 | void initUI(); |
115 | void initActions(); | 117 | void initActions(); |
@@ -164,9 +166,9 @@ private slots: | |||
164 | void slotShow(int); | 166 | void slotShow(int); |
165 | void slotEdit(int); | 167 | void slotEdit(int); |
166 | void slotUpdate3( QWidget* ); | 168 | void slotUpdate3( QWidget* ); |
167 | void slotComplete( int uid ); | 169 | void slotComplete( int uid ); |
168 | void slotComplete( const OTodo& ev ); | 170 | void slotComplete( const OPimTodo& ev ); |
169 | void slotNewFromTemplate(int id ); | 171 | void slotNewFromTemplate(int id ); |
170 | void slotNew(); | 172 | void slotNew(); |
171 | void slotDuplicate(); | 173 | void slotDuplicate(); |
172 | 174 | ||
diff --git a/core/pim/todo/opie-todo.control b/core/pim/todo/opie-todo.control index 8ad50b2..3a65c04 100644 --- a/core/pim/todo/opie-todo.control +++ b/core/pim/todo/opie-todo.control | |||
@@ -3,8 +3,8 @@ Files: plugins/application/libtodolist.so* bin/todolist apps/1Pim/todo.desktop | |||
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/pim | 4 | Section: opie/pim |
5 | Maintainer: Holger 'zecke' Freyther <zecke@handhelds.org> | 5 | Maintainer: Holger 'zecke' Freyther <zecke@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Depends: task-opie-minimal, libopie1, opie-pics | 7 | Depends: task-opie-minimal, libopiecore2, libopieui2, libopiepim2, opie-pics |
8 | Description: Todo list manager | 8 | Description: Todo list manager |
9 | A Todo list manager for the Opie environment. | 9 | A Todo list manager for the Opie environment. |
10 | Version: $QPE_VERSION$EXTRAVERSION | 10 | Version: $QPE_VERSION$EXTRAVERSION |
diff --git a/core/pim/todo/otaskeditor.cpp b/core/pim/todo/otaskeditor.cpp index 1ed20b4..ab1ce94 100644 --- a/core/pim/todo/otaskeditor.cpp +++ b/core/pim/todo/otaskeditor.cpp | |||
@@ -1,8 +1,6 @@ | |||
1 | #include <qlayout.h> | 1 | #include <qlayout.h> |
2 | 2 | ||
3 | #include <opie/orecurrancewidget.h> | ||
4 | |||
5 | #include "taskeditoroverview.h" | 3 | #include "taskeditoroverview.h" |
6 | #include "taskeditorstatus.h" | 4 | #include "taskeditorstatus.h" |
7 | #include "taskeditoralarms.h" | 5 | #include "taskeditoralarms.h" |
8 | 6 | ||
@@ -12,42 +10,42 @@ OTaskEditor::OTaskEditor(int cur) | |||
12 | : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) { | 10 | : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) { |
13 | init(); | 11 | init(); |
14 | init( cur ); | 12 | init( cur ); |
15 | } | 13 | } |
16 | OTaskEditor::OTaskEditor( const OTodo& to) | 14 | OTaskEditor::OTaskEditor( const OPimTodo& to) |
17 | : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) { | 15 | : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) { |
18 | init(); | 16 | init(); |
19 | init( to ); | 17 | init( to ); |
20 | } | 18 | } |
21 | OTaskEditor::~OTaskEditor() { | 19 | OTaskEditor::~OTaskEditor() { |
22 | 20 | ||
23 | } | 21 | } |
24 | void OTaskEditor::init( int cur ) { | 22 | void OTaskEditor::init( int cur ) { |
25 | OTodo to; | 23 | OPimTodo to; |
26 | to.setUid( 1 ); // generate a new uid | 24 | to.setUid( 1 ); // generate a new uid |
27 | if ( cur != 0 ) | 25 | if ( cur != 0 ) |
28 | to.setCategories( cur ); | 26 | to.setCategories( cur ); |
29 | load(to); | 27 | load(to); |
30 | } | 28 | } |
31 | void OTaskEditor::init( const OTodo& to ) { | 29 | void OTaskEditor::init( const OPimTodo& to ) { |
32 | load( to ); | 30 | load( to ); |
33 | } | 31 | } |
34 | OTodo OTaskEditor::todo()const{ | 32 | OPimTodo OTaskEditor::todo()const{ |
35 | qWarning("saving!"); | 33 | qWarning("saving!"); |
36 | OTodo to ( m_todo ); | 34 | OPimTodo to ( m_todo ); |
37 | m_overView->save( to ); | 35 | m_overView->save( to ); |
38 | m_stat->save( to ); | 36 | m_stat->save( to ); |
39 | to.setRecurrence( m_rec->recurrence() ); | 37 | to.setRecurrence( m_rec->recurrence() ); |
40 | m_alarm->save( to ); | 38 | m_alarm->save( to ); |
41 | 39 | ||
42 | return to; | 40 | return to; |
43 | } | 41 | } |
44 | void OTaskEditor::load(const OTodo& to) { | 42 | void OTaskEditor::load(const OPimTodo& to) { |
45 | m_overView->load( to ); | 43 | m_overView->load( to ); |
46 | m_stat->load( to ); | 44 | m_stat->load( to ); |
47 | m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() ); | 45 | m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() ); |
48 | m_alarm->load( to ); | 46 | m_alarm->load( to ); |
49 | 47 | ||
50 | m_todo = to; | 48 | m_todo = to; |
51 | } | 49 | } |
52 | void OTaskEditor::init() { | 50 | void OTaskEditor::init() { |
53 | setCaption(tr("Task Editor") ); | 51 | setCaption(tr("Task Editor") ); |
@@ -74,9 +72,9 @@ void OTaskEditor::init() { | |||
74 | // QLabel* lbl = new QLabel( m_tab ); | 72 | // QLabel* lbl = new QLabel( m_tab ); |
75 | // lbl->setText( tr("X-Ref") ); | 73 | // lbl->setText( tr("X-Ref") ); |
76 | // m_tab->addTab( lbl, "todo/xref", tr("X-Ref") ); | 74 | // m_tab->addTab( lbl, "todo/xref", tr("X-Ref") ); |
77 | 75 | ||
78 | m_rec = new ORecurranceWidget( true, QDate::currentDate(), this ); | 76 | m_rec = new OPimRecurrenceWidget( true, QDate::currentDate(), this ); |
79 | m_tab->addTab( m_rec, "repeat", tr("Recurrence") ); | 77 | m_tab->addTab( m_rec, "repeat", tr("Recurrence") ); |
80 | 78 | ||
81 | 79 | ||
82 | /* signal and slots */ | 80 | /* signal and slots */ |
diff --git a/core/pim/todo/otaskeditor.h b/core/pim/todo/otaskeditor.h index 2daae52..7068df8 100644 --- a/core/pim/todo/otaskeditor.h +++ b/core/pim/todo/otaskeditor.h | |||
@@ -2,42 +2,42 @@ | |||
2 | #define OPIE_TASK_EDITOR_H | 2 | #define OPIE_TASK_EDITOR_H |
3 | 3 | ||
4 | #include <qdialog.h> | 4 | #include <qdialog.h> |
5 | 5 | ||
6 | #include <opie/otodo.h> | 6 | #include <opie2/opimtodo.h> |
7 | #include <opie/otabwidget.h> | 7 | #include <opie2/otabwidget.h> |
8 | #include <opie2/opimrecurrencewidget.h> | ||
8 | 9 | ||
9 | class TaskEditorOverView; | 10 | class TaskEditorOverView; |
10 | class TaskEditorStatus; | 11 | class TaskEditorStatus; |
11 | class TaskEditorAlarms; | 12 | class TaskEditorAlarms; |
12 | class ORecurranceWidget; | ||
13 | class QMultiLineEdit; | 13 | class QMultiLineEdit; |
14 | 14 | ||
15 | class OTaskEditor : public QDialog { | 15 | class OTaskEditor : public QDialog { |
16 | Q_OBJECT | 16 | Q_OBJECT |
17 | public: | 17 | public: |
18 | OTaskEditor(int cur); | 18 | OTaskEditor(int cur); |
19 | OTaskEditor( const OTodo& todo ); | 19 | OTaskEditor( const OPimTodo& todo ); |
20 | ~OTaskEditor(); | 20 | ~OTaskEditor(); |
21 | 21 | ||
22 | /* | 22 | /* |
23 | * same as the c'tor but this gives us the | 23 | * same as the c'tor but this gives us the |
24 | * power to 'preload' the dialog | 24 | * power to 'preload' the dialog |
25 | */ | 25 | */ |
26 | void init( int cur ); | 26 | void init( int cur ); |
27 | void init( const OTodo& todo ); | 27 | void init( const OPimTodo& todo ); |
28 | 28 | ||
29 | OTodo todo()const; | 29 | OPimTodo todo()const; |
30 | private: | 30 | private: |
31 | void load( const OTodo& ); | 31 | void load( const OPimTodo& ); |
32 | void init(); | 32 | void init(); |
33 | 33 | ||
34 | OTabWidget *m_tab; | 34 | OTabWidget *m_tab; |
35 | TaskEditorOverView *m_overView; | 35 | TaskEditorOverView *m_overView; |
36 | TaskEditorStatus *m_stat; | 36 | TaskEditorStatus *m_stat; |
37 | TaskEditorAlarms *m_alarm; | 37 | TaskEditorAlarms *m_alarm; |
38 | TaskEditorAlarms *m_remind; | 38 | TaskEditorAlarms *m_remind; |
39 | ORecurranceWidget *m_rec; | 39 | OPimRecurrenceWidget *m_rec; |
40 | OTodo m_todo; | 40 | OPimTodo m_todo; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | #endif | 43 | #endif |
diff --git a/core/pim/todo/quickedit.h b/core/pim/todo/quickedit.h index 5fe74fe..0c0c204 100644 --- a/core/pim/todo/quickedit.h +++ b/core/pim/todo/quickedit.h | |||
@@ -3,14 +3,16 @@ | |||
3 | 3 | ||
4 | #include <qsignal.h> | 4 | #include <qsignal.h> |
5 | #include <qwidget.h> | 5 | #include <qwidget.h> |
6 | 6 | ||
7 | #include <opie/otodo.h> | 7 | #include <opie2/opimtodo.h> |
8 | |||
9 | using Opie::OPimTodo; | ||
8 | 10 | ||
9 | namespace Todo{ | 11 | namespace Todo{ |
10 | class MainWindow; | 12 | class MainWindow; |
11 | struct QuickEditBase { | 13 | struct QuickEditBase { |
12 | virtual OTodo todo()const = 0l; | 14 | virtual OPimTodo todo()const = 0l; |
13 | virtual QSignal* signal() = 0l; | 15 | virtual QSignal* signal() = 0l; |
14 | virtual QWidget* widget() = 0l; | 16 | virtual QWidget* widget() = 0l; |
15 | }; | 17 | }; |
16 | /* | 18 | /* |
@@ -22,15 +24,15 @@ namespace Todo{ | |||
22 | * and have a protected method called emit | 24 | * and have a protected method called emit |
23 | */ | 25 | */ |
24 | /** | 26 | /** |
25 | * Quick edit is meant to quickly enter | 27 | * Quick edit is meant to quickly enter |
26 | * OTodos in a fast way | 28 | * OPimTodos in a fast way |
27 | */ | 29 | */ |
28 | class QuickEdit : public QuickEditBase{ | 30 | class QuickEdit : public QuickEditBase{ |
29 | public: | 31 | public: |
30 | QuickEdit(MainWindow* main ); | 32 | QuickEdit(MainWindow* main ); |
31 | virtual ~QuickEdit(); | 33 | virtual ~QuickEdit(); |
32 | //OTodo todo()const; | 34 | //OPimTodo todo()const; |
33 | QSignal* signal(); | 35 | QSignal* signal(); |
34 | //QWidget* widget(); | 36 | //QWidget* widget(); |
35 | protected: | 37 | protected: |
36 | MainWindow* mainWindow(); | 38 | MainWindow* mainWindow(); |
diff --git a/core/pim/todo/quickeditimpl.cpp b/core/pim/todo/quickeditimpl.cpp index 1863ef4..cd0684f 100644 --- a/core/pim/todo/quickeditimpl.cpp +++ b/core/pim/todo/quickeditimpl.cpp | |||
@@ -3,9 +3,9 @@ | |||
3 | #include <qwhatsthis.h> | 3 | #include <qwhatsthis.h> |
4 | 4 | ||
5 | #include <qpe/resource.h> | 5 | #include <qpe/resource.h> |
6 | 6 | ||
7 | #include <opie/oclickablelabel.h> | 7 | #include <opie2/oclickablelabel.h> |
8 | 8 | ||
9 | #include "mainwindow.h" | 9 | #include "mainwindow.h" |
10 | #include "quickeditimpl.h" | 10 | #include "quickeditimpl.h" |
11 | 11 | ||
@@ -61,16 +61,16 @@ QuickEditImpl::QuickEditImpl( QWidget* parent, bool visible ) | |||
61 | } | 61 | } |
62 | QuickEditImpl::~QuickEditImpl() { | 62 | QuickEditImpl::~QuickEditImpl() { |
63 | 63 | ||
64 | } | 64 | } |
65 | OTodo QuickEditImpl::todo()const { | 65 | OPimTodo QuickEditImpl::todo()const { |
66 | return m_todo; | 66 | return m_todo; |
67 | } | 67 | } |
68 | QWidget* QuickEditImpl::widget() { | 68 | QWidget* QuickEditImpl::widget() { |
69 | return this; | 69 | return this; |
70 | } | 70 | } |
71 | void QuickEditImpl::slotEnter() { | 71 | void QuickEditImpl::slotEnter() { |
72 | OTodo todo; | 72 | OPimTodo todo; |
73 | 73 | ||
74 | 74 | ||
75 | if (!m_edit->text().isEmpty() ) { | 75 | if (!m_edit->text().isEmpty() ) { |
76 | todo.setUid(1 ); // new uid | 76 | todo.setUid(1 ); // new uid |
diff --git a/core/pim/todo/quickeditimpl.h b/core/pim/todo/quickeditimpl.h index 89b94f8..d465dba 100644 --- a/core/pim/todo/quickeditimpl.h +++ b/core/pim/todo/quickeditimpl.h | |||
@@ -14,9 +14,9 @@ class QuickEditImpl : public QToolBar, public Todo::QuickEdit { | |||
14 | Q_OBJECT | 14 | Q_OBJECT |
15 | public: | 15 | public: |
16 | QuickEditImpl( QWidget* parent, bool visible); | 16 | QuickEditImpl( QWidget* parent, bool visible); |
17 | ~QuickEditImpl(); | 17 | ~QuickEditImpl(); |
18 | OTodo todo()const; | 18 | OPimTodo todo()const; |
19 | QWidget* widget(); | 19 | QWidget* widget(); |
20 | private slots: | 20 | private slots: |
21 | void slotEnter(); | 21 | void slotEnter(); |
22 | void slotPrio(); | 22 | void slotPrio(); |
@@ -29,9 +29,9 @@ private: | |||
29 | QLineEdit* m_edit; | 29 | QLineEdit* m_edit; |
30 | QLabel* m_enter; | 30 | QLabel* m_enter; |
31 | QLabel* m_more; | 31 | QLabel* m_more; |
32 | QPopupMenu* m_menu; | 32 | QPopupMenu* m_menu; |
33 | OTodo m_todo; | 33 | OPimTodo m_todo; |
34 | bool m_visible; | 34 | bool m_visible; |
35 | 35 | ||
36 | QPixmap priority1; | 36 | QPixmap priority1; |
37 | QPixmap priority3; | 37 | QPixmap priority3; |
diff --git a/core/pim/todo/smalltodo.h b/core/pim/todo/smalltodo.h index 952ed04..963218e 100644 --- a/core/pim/todo/smalltodo.h +++ b/core/pim/todo/smalltodo.h | |||
@@ -36,10 +36,10 @@ | |||
36 | 36 | ||
37 | namespace Todo { | 37 | namespace Todo { |
38 | /** | 38 | /** |
39 | * SmallTodo holds everything necessary | 39 | * SmallTodo holds everything necessary |
40 | * to represent a OTodo without holding | 40 | * to represent a OPimTodo without holding |
41 | * everything from a OTodo | 41 | * everything from a OPimTodo |
42 | */ | 42 | */ |
43 | class SmallTodo { | 43 | class SmallTodo { |
44 | public: | 44 | public: |
45 | SmallTodo(int uid = 0, | 45 | SmallTodo(int uid = 0, |
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp index d980a24..5bbf880 100644 --- a/core/pim/todo/tableview.cpp +++ b/core/pim/todo/tableview.cpp | |||
@@ -36,9 +36,9 @@ | |||
36 | 36 | ||
37 | #include <qpe/config.h> | 37 | #include <qpe/config.h> |
38 | #include <qpe/resource.h> | 38 | #include <qpe/resource.h> |
39 | 39 | ||
40 | #include <opie/orecur.h> | 40 | #include <opie2/opimrecurrence.h> |
41 | 41 | ||
42 | #include "mainwindow.h" | 42 | #include "mainwindow.h" |
43 | //#include "tableitems.h" | 43 | //#include "tableitems.h" |
44 | #include "tableview.h" | 44 | #include "tableview.h" |
@@ -183,9 +183,9 @@ int TableView::prev() { | |||
183 | return sorted().uidAt( currentRow() ); | 183 | return sorted().uidAt( currentRow() ); |
184 | 184 | ||
185 | } | 185 | } |
186 | QString TableView::currentRepresentation() { | 186 | QString TableView::currentRepresentation() { |
187 | OTodo to = sorted()[currentRow()]; | 187 | OPimTodo to = sorted()[currentRow()]; |
188 | return to.summary().isEmpty() ? to.description().left(20) : to.summary() ; | 188 | return to.summary().isEmpty() ? to.description().left(20) : to.summary() ; |
189 | } | 189 | } |
190 | /* show overdue */ | 190 | /* show overdue */ |
191 | void TableView::showOverDue( bool ) { | 191 | void TableView::showOverDue( bool ) { |
@@ -203,9 +203,9 @@ void TableView::updateView( ) { | |||
203 | * Calculate that screensize | 203 | * Calculate that screensize |
204 | */ | 204 | */ |
205 | todoWindow()->setReadAhead( 4 ); | 205 | todoWindow()->setReadAhead( 4 ); |
206 | sort(); | 206 | sort(); |
207 | OTodoAccess::List::Iterator it, end; | 207 | OPimTodoAccess::List::Iterator it, end; |
208 | it = sorted().begin(); | 208 | it = sorted().begin(); |
209 | end = sorted().end(); | 209 | end = sorted().end(); |
210 | 210 | ||
211 | qWarning("setTodos"); | 211 | qWarning("setTodos"); |
@@ -226,24 +226,24 @@ void TableView::updateView( ) { | |||
226 | 226 | ||
227 | m_enablePaint = true; | 227 | m_enablePaint = true; |
228 | // int el = time.elapsed(); | 228 | // int el = time.elapsed(); |
229 | } | 229 | } |
230 | void TableView::setTodo( int, const OTodo&) { | 230 | void TableView::setTodo( int, const OPimTodo&) { |
231 | sort(); | 231 | sort(); |
232 | 232 | ||
233 | /* repaint */ | 233 | /* repaint */ |
234 | repaint(); | 234 | repaint(); |
235 | } | 235 | } |
236 | void TableView::addEvent( const OTodo&) { | 236 | void TableView::addEvent( const OPimTodo&) { |
237 | 237 | ||
238 | /* fix problems of not showing the 'Haken' */ | 238 | /* fix problems of not showing the 'Haken' */ |
239 | updateView(); | 239 | updateView(); |
240 | } | 240 | } |
241 | /* | 241 | /* |
242 | * find the event | 242 | * find the event |
243 | * and then replace the complete row | 243 | * and then replace the complete row |
244 | */ | 244 | */ |
245 | void TableView::replaceEvent( const OTodo& ev) { | 245 | void TableView::replaceEvent( const OPimTodo& ev) { |
246 | addEvent( ev ); | 246 | addEvent( ev ); |
247 | } | 247 | } |
248 | /* | 248 | /* |
249 | * re aligning table can be slow too | 249 | * re aligning table can be slow too |
@@ -387,9 +387,9 @@ void TableView::paintCell(QPainter* p, int row, int col, const QRect& cr, bool | |||
387 | const QColorGroup &cg = colorGroup(); | 387 | const QColorGroup &cg = colorGroup(); |
388 | 388 | ||
389 | p->save(); | 389 | p->save(); |
390 | 390 | ||
391 | OTodo task = sorted()[row]; | 391 | OPimTodo task = sorted()[row]; |
392 | 392 | ||
393 | // TODO - give user option for grid or bars? | 393 | // TODO - give user option for grid or bars? |
394 | 394 | ||
395 | // Paint alternating background bars | 395 | // Paint alternating background bars |
@@ -496,9 +496,9 @@ void TableView::setCellContentFromEditor(int row, int col ) { | |||
496 | if ( col == 1 ) { | 496 | if ( col == 1 ) { |
497 | QWidget* wid = cellWidget(row, 1 ); | 497 | QWidget* wid = cellWidget(row, 1 ); |
498 | if ( wid->inherits("QComboBox") ) { | 498 | if ( wid->inherits("QComboBox") ) { |
499 | int pri = ((QComboBox*)wid)->currentItem() + 1; | 499 | int pri = ((QComboBox*)wid)->currentItem() + 1; |
500 | OTodo todo = sorted()[row]; | 500 | OPimTodo todo = sorted()[row]; |
501 | if ( todo.priority() != pri ) { | 501 | if ( todo.priority() != pri ) { |
502 | todo.setPriority( pri ); | 502 | todo.setPriority( pri ); |
503 | TodoView::update( todo.uid(), todo ); | 503 | TodoView::update( todo.uid(), todo ); |
504 | updateView(); | 504 | updateView(); |
@@ -507,9 +507,9 @@ void TableView::setCellContentFromEditor(int row, int col ) { | |||
507 | }else if ( col == 2) { | 507 | }else if ( col == 2) { |
508 | QWidget* wid = cellWidget(row, 2); | 508 | QWidget* wid = cellWidget(row, 2); |
509 | if ( wid->inherits("QLineEdit") ) { | 509 | if ( wid->inherits("QLineEdit") ) { |
510 | QString text = ((QLineEdit*)wid)->text(); | 510 | QString text = ((QLineEdit*)wid)->text(); |
511 | OTodo todo = sorted()[row]; | 511 | OPimTodo todo = sorted()[row]; |
512 | if ( todo.summary() != text ) { | 512 | if ( todo.summary() != text ) { |
513 | todo.setSummary( text ); | 513 | todo.setSummary( text ); |
514 | TodoView::update( todo.uid(), todo ); | 514 | TodoView::update( todo.uid(), todo ); |
515 | updateView(); | 515 | updateView(); |
diff --git a/core/pim/todo/tableview.h b/core/pim/todo/tableview.h index 528ddc9..7f78255 100644 --- a/core/pim/todo/tableview.h +++ b/core/pim/todo/tableview.h | |||
@@ -55,11 +55,11 @@ namespace Todo { | |||
55 | 55 | ||
56 | void clear(); | 56 | void clear(); |
57 | void showOverDue( bool ); | 57 | void showOverDue( bool ); |
58 | void updateView(); | 58 | void updateView(); |
59 | void setTodo( int uid, const OTodo& ); | 59 | void setTodo( int uid, const OPimTodo& ); |
60 | void addEvent( const OTodo& event ); | 60 | void addEvent( const OPimTodo& event ); |
61 | void replaceEvent( const OTodo& ); | 61 | void replaceEvent( const OPimTodo& ); |
62 | void removeEvent( int uid ); | 62 | void removeEvent( int uid ); |
63 | void setShowCompleted( bool ); | 63 | void setShowCompleted( bool ); |
64 | void setShowDeadline( bool ); | 64 | void setShowDeadline( bool ); |
65 | 65 | ||
@@ -71,9 +71,9 @@ namespace Todo { | |||
71 | /* | 71 | /* |
72 | * we do our drawing ourselves | 72 | * we do our drawing ourselves |
73 | * because we don't want to have | 73 | * because we don't want to have |
74 | * 40.000 QTableItems for 10.000 | 74 | * 40.000 QTableItems for 10.000 |
75 | * OTodos where we only show 10 at a time! | 75 | * OPimTodos where we only show 10 at a time! |
76 | */ | 76 | */ |
77 | void paintCell(QPainter* p, int row, int col, const QRect&, bool ); | 77 | void paintCell(QPainter* p, int row, int col, const QRect&, bool ); |
78 | private: | 78 | private: |
79 | /* reimplented for internal reasons */ | 79 | /* reimplented for internal reasons */ |
diff --git a/core/pim/todo/taskeditoralarms.cpp b/core/pim/todo/taskeditoralarms.cpp index bcc40fe..930c94e 100644 --- a/core/pim/todo/taskeditoralarms.cpp +++ b/core/pim/todo/taskeditoralarms.cpp | |||
@@ -27,11 +27,10 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "taskeditoralarms.h" | 29 | #include "taskeditoralarms.h" |
30 | 30 | ||
31 | #include <opie/otodo.h> | 31 | #include <opie2/opimnotifymanager.h> |
32 | #include <opie/opimnotifymanager.h> | 32 | #include <opie2/otimepicker.h> |
33 | #include <opie/otimepicker.h> | ||
34 | 33 | ||
35 | #include <qpe/datebookmonth.h> | 34 | #include <qpe/datebookmonth.h> |
36 | #include <qpe/resource.h> | 35 | #include <qpe/resource.h> |
37 | 36 | ||
@@ -121,9 +120,9 @@ void TaskEditorAlarms::slotDelete(){ | |||
121 | 120 | ||
122 | 121 | ||
123 | } | 122 | } |
124 | 123 | ||
125 | void TaskEditorAlarms::load( const OTodo& todo) { | 124 | void TaskEditorAlarms::load( const OPimTodo& todo) { |
126 | lstAlarms->clear(); | 125 | lstAlarms->clear(); |
127 | if (!todo.hasNotifiers() ) return; | 126 | if (!todo.hasNotifiers() ) return; |
128 | 127 | ||
129 | OPimNotifyManager::Alarms als = todo.notifiers().alarms(); | 128 | OPimNotifyManager::Alarms als = todo.notifiers().alarms(); |
@@ -135,9 +134,9 @@ void TaskEditorAlarms::load( const OTodo& todo) { | |||
135 | (void)new AlarmItem( lstAlarms, (*it) ); | 134 | (void)new AlarmItem( lstAlarms, (*it) ); |
136 | 135 | ||
137 | 136 | ||
138 | } | 137 | } |
139 | void TaskEditorAlarms::save( OTodo& todo ) { | 138 | void TaskEditorAlarms::save( OPimTodo& todo ) { |
140 | if (lstAlarms->childCount() <= 0 ) return; | 139 | if (lstAlarms->childCount() <= 0 ) return; |
141 | 140 | ||
142 | OPimNotifyManager::Alarms alarms; | 141 | OPimNotifyManager::Alarms alarms; |
143 | 142 | ||
diff --git a/core/pim/todo/taskeditoralarms.h b/core/pim/todo/taskeditoralarms.h index 0aa52cc..2379b0c 100644 --- a/core/pim/todo/taskeditoralarms.h +++ b/core/pim/todo/taskeditoralarms.h | |||
@@ -28,13 +28,16 @@ | |||
28 | 28 | ||
29 | #ifndef TASKEDITORALARMS_H | 29 | #ifndef TASKEDITORALARMS_H |
30 | #define TASKEDITORALARMS_H | 30 | #define TASKEDITORALARMS_H |
31 | 31 | ||
32 | #include <opie2/opimtodo.h> | ||
33 | |||
32 | #include <qwidget.h> | 34 | #include <qwidget.h> |
33 | 35 | ||
34 | class QListView; | 36 | class QListView; |
35 | class QListViewItem; | 37 | class QListViewItem; |
36 | class OTodo; | 38 | |
39 | using namespace Opie; | ||
37 | 40 | ||
38 | class AlarmItem; | 41 | class AlarmItem; |
39 | class DateBookMonth; | 42 | class DateBookMonth; |
40 | class TaskEditorAlarms : public QWidget | 43 | class TaskEditorAlarms : public QWidget |
@@ -47,10 +50,10 @@ public: | |||
47 | Reminders | 50 | Reminders |
48 | }; | 51 | }; |
49 | TaskEditorAlarms( QWidget* parent = 0, int type = Alarm, const char* name = 0, WFlags fl = 0 ); | 52 | TaskEditorAlarms( QWidget* parent = 0, int type = Alarm, const char* name = 0, WFlags fl = 0 ); |
50 | ~TaskEditorAlarms(); | 53 | ~TaskEditorAlarms(); |
51 | void load( const OTodo& ); | 54 | void load( const OPimTodo& ); |
52 | void save( OTodo& ); | 55 | void save( OPimTodo& ); |
53 | private: | 56 | private: |
54 | QPopupMenu* popup( int column ); | 57 | QPopupMenu* popup( int column ); |
55 | void inlineSetDate( AlarmItem*, const QPoint& p ); | 58 | void inlineSetDate( AlarmItem*, const QPoint& p ); |
56 | void inlineSetTime( AlarmItem*); | 59 | void inlineSetTime( AlarmItem*); |
diff --git a/core/pim/todo/taskeditoroverview.cpp b/core/pim/todo/taskeditoroverview.cpp index 415dcf2..294acb9 100644 --- a/core/pim/todo/taskeditoroverview.cpp +++ b/core/pim/todo/taskeditoroverview.cpp | |||
@@ -27,9 +27,9 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "taskeditoroverview.h" | 29 | #include "taskeditoroverview.h" |
30 | 30 | ||
31 | #include <opie/orecur.h> | 31 | //#include <opie2/opimrecurrence.h> |
32 | 32 | ||
33 | #include <qpe/categoryselect.h> | 33 | #include <qpe/categoryselect.h> |
34 | #include <qpe/datebookmonth.h> | 34 | #include <qpe/datebookmonth.h> |
35 | #include <qpe/resource.h> | 35 | #include <qpe/resource.h> |
@@ -126,9 +126,9 @@ TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFla | |||
126 | TaskEditorOverView::~TaskEditorOverView() | 126 | TaskEditorOverView::~TaskEditorOverView() |
127 | { | 127 | { |
128 | } | 128 | } |
129 | 129 | ||
130 | void TaskEditorOverView::load( const OTodo& todo ) | 130 | void TaskEditorOverView::load( const OPimTodo& todo ) |
131 | { | 131 | { |
132 | // Description | 132 | // Description |
133 | cmbDesc->insertItem( todo.summary(), 0 ); | 133 | cmbDesc->insertItem( todo.summary(), 0 ); |
134 | cmbDesc->setCurrentItem( 0 ); | 134 | cmbDesc->setCurrentItem( 0 ); |
@@ -147,9 +147,9 @@ void TaskEditorOverView::load( const OTodo& todo ) | |||
147 | mleNotes->setText( todo.description() ); | 147 | mleNotes->setText( todo.description() ); |
148 | 148 | ||
149 | } | 149 | } |
150 | 150 | ||
151 | void TaskEditorOverView::save( OTodo &todo ) | 151 | void TaskEditorOverView::save( OPimTodo &todo ) |
152 | { | 152 | { |
153 | // Description | 153 | // Description |
154 | todo.setSummary( cmbDesc->currentText() ); | 154 | todo.setSummary( cmbDesc->currentText() ); |
155 | 155 | ||
diff --git a/core/pim/todo/taskeditoroverview.h b/core/pim/todo/taskeditoroverview.h index d5f5125..89679f1 100644 --- a/core/pim/todo/taskeditoroverview.h +++ b/core/pim/todo/taskeditoroverview.h | |||
@@ -28,9 +28,9 @@ | |||
28 | 28 | ||
29 | #ifndef TASKEDITOROVERVIEW_H | 29 | #ifndef TASKEDITOROVERVIEW_H |
30 | #define TASKEDITOROVERVIEW_H | 30 | #define TASKEDITOROVERVIEW_H |
31 | 31 | ||
32 | #include <opie/otodo.h> | 32 | #include <opie2/opimtodo.h> |
33 | 33 | ||
34 | #include <qpixmap.h> | 34 | #include <qpixmap.h> |
35 | #include <qwidget.h> | 35 | #include <qwidget.h> |
36 | 36 | ||
@@ -38,10 +38,12 @@ class CategorySelect; | |||
38 | class QCheckBox; | 38 | class QCheckBox; |
39 | class QComboBox; | 39 | class QComboBox; |
40 | class QMultiLineEdit; | 40 | class QMultiLineEdit; |
41 | 41 | ||
42 | using namespace Opie; | ||
43 | |||
42 | class TaskEditorOverView : public QWidget | 44 | class TaskEditorOverView : public QWidget |
43 | { | 45 | { |
44 | Q_OBJECT | 46 | Q_OBJECT |
45 | 47 | ||
46 | public: | 48 | public: |
47 | TaskEditorOverView( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 49 | TaskEditorOverView( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
@@ -52,10 +54,10 @@ public: | |||
52 | CategorySelect *cmbCategory; | 54 | CategorySelect *cmbCategory; |
53 | QCheckBox *ckbRecurrence; | 55 | QCheckBox *ckbRecurrence; |
54 | QMultiLineEdit *mleNotes; | 56 | QMultiLineEdit *mleNotes; |
55 | 57 | ||
56 | void load( const OTodo & ); | 58 | void load( const OPimTodo & ); |
57 | void save( OTodo & ); | 59 | void save( OPimTodo & ); |
58 | 60 | ||
59 | signals: | 61 | signals: |
60 | void recurranceEnabled( bool ); | 62 | void recurranceEnabled( bool ); |
61 | 63 | ||
diff --git a/core/pim/todo/taskeditorstatus.cpp b/core/pim/todo/taskeditorstatus.cpp index 98e3cea..367dd58 100644 --- a/core/pim/todo/taskeditorstatus.cpp +++ b/core/pim/todo/taskeditorstatus.cpp | |||
@@ -27,11 +27,10 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "taskeditorstatus.h" | 29 | #include "taskeditorstatus.h" |
30 | 30 | ||
31 | #include <opie/otodo.h> | 31 | #include <opie2/opimmaintainer.h> |
32 | #include <opie/opimmaintainer.h> | 32 | #include <opie2/opimstate.h> |
33 | #include <opie/opimstate.h> | ||
34 | 33 | ||
35 | #include <qpe/datebookmonth.h> | 34 | #include <qpe/datebookmonth.h> |
36 | 35 | ||
37 | #include <qcheckbox.h> | 36 | #include <qcheckbox.h> |
@@ -170,9 +169,9 @@ TaskEditorStatus::TaskEditorStatus( QWidget* parent, const char* name, WFlags f | |||
170 | TaskEditorStatus::~TaskEditorStatus() | 169 | TaskEditorStatus::~TaskEditorStatus() |
171 | { | 170 | { |
172 | } | 171 | } |
173 | 172 | ||
174 | void TaskEditorStatus::load( const OTodo &todo ) | 173 | void TaskEditorStatus::load( const OPimTodo &todo ) |
175 | { | 174 | { |
176 | QDate date = QDate::currentDate(); | 175 | QDate date = QDate::currentDate(); |
177 | QString str = TimeString::longDateString( date ); | 176 | QString str = TimeString::longDateString( date ); |
178 | 177 | ||
@@ -222,9 +221,9 @@ void TaskEditorStatus::load( const OTodo &todo ) | |||
222 | #endif | 221 | #endif |
223 | // Maintainer - not implemented yet | 222 | // Maintainer - not implemented yet |
224 | } | 223 | } |
225 | 224 | ||
226 | void TaskEditorStatus::save( OTodo &todo ) | 225 | void TaskEditorStatus::save( OPimTodo &todo ) |
227 | { | 226 | { |
228 | QDate inval; | 227 | QDate inval; |
229 | 228 | ||
230 | // Status | 229 | // Status |
diff --git a/core/pim/todo/taskeditorstatus.h b/core/pim/todo/taskeditorstatus.h index 3544200..97129f0 100644 --- a/core/pim/todo/taskeditorstatus.h +++ b/core/pim/todo/taskeditorstatus.h | |||
@@ -28,27 +28,30 @@ | |||
28 | 28 | ||
29 | #ifndef TASKEDITORSTATUS_H | 29 | #ifndef TASKEDITORSTATUS_H |
30 | #define TASKEDITORSTATUS_H | 30 | #define TASKEDITORSTATUS_H |
31 | 31 | ||
32 | #include <opie2/opimtodo.h> | ||
33 | |||
32 | #include <qdatetime.h> | 34 | #include <qdatetime.h> |
33 | #include <qwidget.h> | 35 | #include <qwidget.h> |
34 | 36 | ||
35 | class DateBookMonth; | 37 | class DateBookMonth; |
36 | class OTodo; | ||
37 | class QCheckBox; | 38 | class QCheckBox; |
38 | class QComboBox; | 39 | class QComboBox; |
39 | class QLabel; | 40 | class QLabel; |
40 | class QPushButton; | 41 | class QPushButton; |
41 | class QToolButton; | 42 | class QToolButton; |
42 | 43 | ||
44 | using namespace Opie; | ||
45 | |||
43 | /** | 46 | /** |
44 | * This is the implementation of the Opie Task Editor Advanced tab | 47 | * This is the implementation of the Opie Task Editor Advanced tab |
45 | * it features the State! | 48 | * it features the State! |
46 | * MaintainerMode | 49 | * MaintainerMode |
47 | * Description | 50 | * Description |
48 | */ | 51 | */ |
49 | class TaskEditorStatus : public QWidget | 52 | class TaskEditorStatus : public QWidget |
50 | { | 53 | { |
51 | Q_OBJECT | 54 | Q_OBJECT |
52 | 55 | ||
53 | public: | 56 | public: |
54 | TaskEditorStatus( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 57 | TaskEditorStatus( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
@@ -67,16 +70,16 @@ public: | |||
67 | QComboBox *cmbProgress; | 70 | QComboBox *cmbProgress; |
68 | 71 | ||
69 | /* | 72 | /* |
70 | * I could have a struct which returns a QWidget* | 73 | * I could have a struct which returns a QWidget* |
71 | * load and save to a OTodo | 74 | * load and save to a OPimTodo |
72 | * and use multiple inheretence with all other widgets | 75 | * and use multiple inheretence with all other widgets |
73 | * and then simply iterate over the list of structs | 76 | * and then simply iterate over the list of structs |
74 | * this way I could easily have plugins for the whole editor.... | 77 | * this way I could easily have plugins for the whole editor.... |
75 | * but I do not do it -zecke | 78 | * but I do not do it -zecke |
76 | */ | 79 | */ |
77 | void load( const OTodo & ); | 80 | void load( const OPimTodo & ); |
78 | void save( OTodo & ); | 81 | void save( OPimTodo & ); |
79 | 82 | ||
80 | private: | 83 | private: |
81 | QDate m_start; | 84 | QDate m_start; |
82 | QDate m_comp; | 85 | QDate m_comp; |
diff --git a/core/pim/todo/templatedialogimpl.cpp b/core/pim/todo/templatedialogimpl.cpp index 63d8107..c9ad3d0 100644 --- a/core/pim/todo/templatedialogimpl.cpp +++ b/core/pim/todo/templatedialogimpl.cpp | |||
@@ -14,30 +14,30 @@ namespace { | |||
14 | class TemplateListItem : public QListViewItem { | 14 | class TemplateListItem : public QListViewItem { |
15 | public: | 15 | public: |
16 | TemplateListItem( QListView*, | 16 | TemplateListItem( QListView*, |
17 | const QString& name, | 17 | const QString& name, |
18 | const OTodo& ); | 18 | const OPimTodo& ); |
19 | ~TemplateListItem(); | 19 | ~TemplateListItem(); |
20 | 20 | ||
21 | OTodo event()const; | 21 | OPimTodo event()const; |
22 | QString text()const; | 22 | QString text()const; |
23 | void setText(const QString& str ); | 23 | void setText(const QString& str ); |
24 | void setEvent( const OTodo& ); | 24 | void setEvent( const OPimTodo& ); |
25 | private: | 25 | private: |
26 | QString m_name; | 26 | QString m_name; |
27 | OTodo m_ev; | 27 | OPimTodo m_ev; |
28 | }; | 28 | }; |
29 | 29 | ||
30 | /* implementation */ | 30 | /* implementation */ |
31 | TemplateListItem::TemplateListItem( QListView* view, | 31 | TemplateListItem::TemplateListItem( QListView* view, |
32 | const QString& text, | 32 | const QString& text, |
33 | const OTodo& ev ) | 33 | const OPimTodo& ev ) |
34 | : QListViewItem( view ), m_name( text ), m_ev( ev ) | 34 | : QListViewItem( view ), m_name( text ), m_ev( ev ) |
35 | { | 35 | { |
36 | QListViewItem::setText(0, m_name ); | 36 | QListViewItem::setText(0, m_name ); |
37 | } | 37 | } |
38 | TemplateListItem::~TemplateListItem() {} | 38 | TemplateListItem::~TemplateListItem() {} |
39 | OTodo TemplateListItem::event() const { | 39 | OPimTodo TemplateListItem::event() const { |
40 | return m_ev; | 40 | return m_ev; |
41 | } | 41 | } |
42 | QString TemplateListItem::text()const { | 42 | QString TemplateListItem::text()const { |
43 | return m_name; | 43 | return m_name; |
@@ -45,9 +45,9 @@ namespace { | |||
45 | void TemplateListItem::setText( const QString& str ) { | 45 | void TemplateListItem::setText( const QString& str ) { |
46 | QListViewItem::setText(0, str ); | 46 | QListViewItem::setText(0, str ); |
47 | m_name = str; | 47 | m_name = str; |
48 | } | 48 | } |
49 | void TemplateListItem::setEvent( const OTodo& ev) { | 49 | void TemplateListItem::setEvent( const OPimTodo& ev) { |
50 | m_ev = ev; | 50 | m_ev = ev; |
51 | } | 51 | } |
52 | } | 52 | } |
53 | 53 | ||
@@ -71,9 +71,9 @@ TemplateDialogImpl::~TemplateDialogImpl() { | |||
71 | 71 | ||
72 | } | 72 | } |
73 | void TemplateDialogImpl::slotAdd() { | 73 | void TemplateDialogImpl::slotAdd() { |
74 | QString str = QWidget::tr("New Template %1").arg( listView()->childCount() ); | 74 | QString str = QWidget::tr("New Template %1").arg( listView()->childCount() ); |
75 | OTodo ev; | 75 | OPimTodo ev; |
76 | m_man->addEvent(str, ev); | 76 | m_man->addEvent(str, ev); |
77 | new TemplateListItem( listView(), str, ev ); | 77 | new TemplateListItem( listView(), str, ev ); |
78 | } | 78 | } |
79 | void TemplateDialogImpl::slotRemove() { | 79 | void TemplateDialogImpl::slotRemove() { |
@@ -91,9 +91,9 @@ void TemplateDialogImpl::slotEdit() { | |||
91 | if ( !listView()->currentItem() ) | 91 | if ( !listView()->currentItem() ) |
92 | return; | 92 | return; |
93 | 93 | ||
94 | TemplateListItem* item = static_cast<TemplateListItem*>( listView()->currentItem() ); | 94 | TemplateListItem* item = static_cast<TemplateListItem*>( listView()->currentItem() ); |
95 | OTodo ev = m_win->currentEditor()->edit( m_win, item->event() ); | 95 | OPimTodo ev = m_win->currentEditor()->edit( m_win, item->event() ); |
96 | if ( m_win->currentEditor()->accepted() ) { | 96 | if ( m_win->currentEditor()->accepted() ) { |
97 | item->setEvent( ev ); | 97 | item->setEvent( ev ); |
98 | m_man->removeEvent( item->text() ); | 98 | m_man->removeEvent( item->text() ); |
99 | m_man->addEvent( item->text(), ev ); | 99 | m_man->addEvent( item->text(), ev ); |
diff --git a/core/pim/todo/templatedialogimpl.h b/core/pim/todo/templatedialogimpl.h index f366c9e..cc78521 100644 --- a/core/pim/todo/templatedialogimpl.h +++ b/core/pim/todo/templatedialogimpl.h | |||
@@ -2,9 +2,9 @@ | |||
2 | #define OPIE_TEMPLATE_DIALOG_IMPL_H | 2 | #define OPIE_TEMPLATE_DIALOG_IMPL_H |
3 | 3 | ||
4 | #include <qlistview.h> | 4 | #include <qlistview.h> |
5 | 5 | ||
6 | #include <opie/otodo.h> | 6 | #include <opie2/opimtodo.h> |
7 | 7 | ||
8 | #include "templatedialog.h" | 8 | #include "templatedialog.h" |
9 | 9 | ||
10 | 10 | ||
diff --git a/core/pim/todo/textviewshow.cpp b/core/pim/todo/textviewshow.cpp index 35ea74b..01e5810 100644 --- a/core/pim/todo/textviewshow.cpp +++ b/core/pim/todo/textviewshow.cpp | |||
@@ -10,9 +10,9 @@ TextViewShow::~TextViewShow() { | |||
10 | } | 10 | } |
11 | QString TextViewShow::type()const { | 11 | QString TextViewShow::type()const { |
12 | return QString::fromLatin1("TextViewShow"); | 12 | return QString::fromLatin1("TextViewShow"); |
13 | } | 13 | } |
14 | void TextViewShow::slotShow( const OTodo& ev ) { | 14 | void TextViewShow::slotShow( const OPimTodo& ev ) { |
15 | setText( ev.toRichText() ); | 15 | setText( ev.toRichText() ); |
16 | } | 16 | } |
17 | QWidget* TextViewShow::widget() { | 17 | QWidget* TextViewShow::widget() { |
18 | return this; | 18 | return this; |
diff --git a/core/pim/todo/textviewshow.h b/core/pim/todo/textviewshow.h index 498de81..cc31522 100644 --- a/core/pim/todo/textviewshow.h +++ b/core/pim/todo/textviewshow.h | |||
@@ -9,9 +9,9 @@ namespace Todo { | |||
9 | TextViewShow( QWidget* parent, MainWindow* ); | 9 | TextViewShow( QWidget* parent, MainWindow* ); |
10 | ~TextViewShow(); | 10 | ~TextViewShow(); |
11 | 11 | ||
12 | QString type()const; | 12 | QString type()const; |
13 | void slotShow( const OTodo& ev ); | 13 | void slotShow( const OPimTodo& ev ); |
14 | QWidget* widget(); | 14 | QWidget* widget(); |
15 | 15 | ||
16 | protected: | 16 | protected: |
17 | void keyPressEvent( QKeyEvent* ); | 17 | void keyPressEvent( QKeyEvent* ); |
diff --git a/core/pim/todo/todo.pro b/core/pim/todo/todo.pro index 51cfde7..9267082 100644 --- a/core/pim/todo/todo.pro +++ b/core/pim/todo/todo.pro | |||
@@ -43,7 +43,7 @@ SOURCES = smalltodo.cpp \ | |||
43 | 43 | ||
44 | TARGET = todolist | 44 | TARGET = todolist |
45 | INCLUDEPATH += $(OPIEDIR)/include | 45 | INCLUDEPATH += $(OPIEDIR)/include |
46 | DEPENDPATH+= $(OPIEDIR)/include | 46 | DEPENDPATH+= $(OPIEDIR)/include |
47 | LIBS += -lqpe -lopie | 47 | LIBS += -lqpe -lopiecore2 -lopieui2 -lopiepim2 |
48 | 48 | ||
49 | include ( $(OPIEDIR)/include.pro ) | 49 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/core/pim/todo/todoedit.h b/core/pim/todo/todoedit.h index 02800ca..4e89e93 100644 --- a/core/pim/todo/todoedit.h +++ b/core/pim/todo/todoedit.h | |||
@@ -1,17 +1,17 @@ | |||
1 | #ifndef OPIE_TODO_EDIT_H | 1 | #ifndef OPIE_TODO_EDIT_H |
2 | #define OPIE_TODO_EDIT_H | 2 | #define OPIE_TODO_EDIT_H |
3 | 3 | ||
4 | #include <opie/otodo.h> | 4 | #include <opie2/opimtodo.h> |
5 | 5 | ||
6 | namespace Todo { | 6 | namespace Todo { |
7 | class Edit { | 7 | class Edit { |
8 | public: | 8 | public: |
9 | Edit(); | 9 | Edit(); |
10 | virtual ~Edit(); | 10 | virtual ~Edit(); |
11 | 11 | ||
12 | ToDoEvent newEvent( const OTodo& ) = 0; | 12 | ToDoEvent newEvent( const OPimTodo& ) = 0; |
13 | ToDoEvent editEvent( const OTodo& ) = 0; | 13 | ToDoEvent editEvent( const OPimTodo& ) = 0; |
14 | }; | 14 | }; |
15 | }; | 15 | }; |
16 | 16 | ||
17 | #endif | 17 | #endif |
diff --git a/core/pim/todo/todoeditor.cpp b/core/pim/todo/todoeditor.cpp index 78aedd6..879d809 100644 --- a/core/pim/todo/todoeditor.cpp +++ b/core/pim/todo/todoeditor.cpp | |||
@@ -13,9 +13,9 @@ Editor::Editor() { | |||
13 | Editor::~Editor() { | 13 | Editor::~Editor() { |
14 | delete m_self; | 14 | delete m_self; |
15 | m_self = 0; | 15 | m_self = 0; |
16 | } | 16 | } |
17 | OTodo Editor::newTodo( int cur, | 17 | OPimTodo Editor::newTodo( int cur, |
18 | QWidget*) { | 18 | QWidget*) { |
19 | 19 | ||
20 | OTaskEditor *e = self(); | 20 | OTaskEditor *e = self(); |
21 | e->setCaption( QObject::tr("Enter Task") ); | 21 | e->setCaption( QObject::tr("Enter Task") ); |
@@ -27,24 +27,24 @@ OTodo Editor::newTodo( int cur, | |||
27 | m_accepted = true; | 27 | m_accepted = true; |
28 | }else | 28 | }else |
29 | m_accepted = false; | 29 | m_accepted = false; |
30 | 30 | ||
31 | OTodo ev = e->todo(); | 31 | OPimTodo ev = e->todo(); |
32 | qWarning("Todo uid"); | 32 | qWarning("Todo uid"); |
33 | qWarning("Todo %s %d %d", ev.summary().latin1(), ev.progress(), ev.isCompleted() ); | 33 | qWarning("Todo %s %d %d", ev.summary().latin1(), ev.progress(), ev.isCompleted() ); |
34 | ev.setUid(1); | 34 | ev.setUid(1); |
35 | 35 | ||
36 | return ev; | 36 | return ev; |
37 | } | 37 | } |
38 | OTodo Editor::edit( QWidget *, | 38 | OPimTodo Editor::edit( QWidget *, |
39 | const OTodo& todo ) { | 39 | const OPimTodo& todo ) { |
40 | OTaskEditor *e = self(); | 40 | OTaskEditor *e = self(); |
41 | e->init( todo ); | 41 | e->init( todo ); |
42 | e->setCaption( QObject::tr( "Edit Task" ) ); | 42 | e->setCaption( QObject::tr( "Edit Task" ) ); |
43 | 43 | ||
44 | int ret = QPEApplication::execDialog( e ); | 44 | int ret = QPEApplication::execDialog( e ); |
45 | 45 | ||
46 | OTodo ev = e->todo(); | 46 | OPimTodo ev = e->todo(); |
47 | if ( ret == QDialog::Accepted ) | 47 | if ( ret == QDialog::Accepted ) |
48 | m_accepted = true; | 48 | m_accepted = true; |
49 | else | 49 | else |
50 | m_accepted = false; | 50 | m_accepted = false; |
diff --git a/core/pim/todo/todoeditor.h b/core/pim/todo/todoeditor.h index fe30634..bcfd205 100644 --- a/core/pim/todo/todoeditor.h +++ b/core/pim/todo/todoeditor.h | |||
@@ -1,8 +1,8 @@ | |||
1 | #ifndef OPIE_TODO_EDITOR_H | 1 | #ifndef OPIE_TODO_EDITOR_H |
2 | #define OPIE_TODO_EDITOR_H | 2 | #define OPIE_TODO_EDITOR_H |
3 | 3 | ||
4 | #include <opie/otodo.h> | 4 | #include <opie2/opimtodo.h> |
5 | 5 | ||
6 | 6 | ||
7 | class OTaskEditor; | 7 | class OTaskEditor; |
8 | namespace Todo { | 8 | namespace Todo { |
@@ -10,12 +10,12 @@ namespace Todo { | |||
10 | public: | 10 | public: |
11 | Editor(); | 11 | Editor(); |
12 | ~Editor(); | 12 | ~Editor(); |
13 | 13 | ||
14 | OTodo newTodo( int currentCatId, | 14 | OPimTodo newTodo( int currentCatId, |
15 | QWidget* par ); | 15 | QWidget* par ); |
16 | OTodo edit( QWidget* par, | 16 | OPimTodo edit( QWidget* par, |
17 | const OTodo& ev = OTodo() ); | 17 | const OPimTodo& ev = OPimTodo() ); |
18 | 18 | ||
19 | 19 | ||
20 | bool accepted()const; | 20 | bool accepted()const; |
21 | protected: | 21 | protected: |
diff --git a/core/pim/todo/todomanager.cpp b/core/pim/todo/todomanager.cpp index 501cca7..21e1d0c 100644 --- a/core/pim/todo/todomanager.cpp +++ b/core/pim/todo/todomanager.cpp | |||
@@ -41,48 +41,48 @@ TodoManager::TodoManager( QObject *obj ) | |||
41 | } | 41 | } |
42 | TodoManager::~TodoManager() { | 42 | TodoManager::~TodoManager() { |
43 | delete m_db; | 43 | delete m_db; |
44 | } | 44 | } |
45 | OTodo TodoManager::event(int uid ) { | 45 | OPimTodo TodoManager::event(int uid ) { |
46 | return m_db->find( uid ); | 46 | return m_db->find( uid ); |
47 | } | 47 | } |
48 | void TodoManager::updateList() { | 48 | void TodoManager::updateList() { |
49 | qWarning("update list"); | 49 | qWarning("update list"); |
50 | m_list = m_db->allRecords(); | 50 | m_list = m_db->allRecords(); |
51 | } | 51 | } |
52 | OTodoAccess::List TodoManager::list() const{ | 52 | OPimTodoAccess::List TodoManager::list() const{ |
53 | return m_list; | 53 | return m_list; |
54 | } | 54 | } |
55 | OTodoAccess::List TodoManager::sorted( bool asc, int so, int f, int cat ) { | 55 | OPimTodoAccess::List TodoManager::sorted( bool asc, int so, int f, int cat ) { |
56 | return m_db->sorted( asc, so, f, cat ); | 56 | return m_db->sorted( asc, so, f, cat ); |
57 | } | 57 | } |
58 | OTodoAccess::List::Iterator TodoManager::overDue() { | 58 | OPimTodoAccess::List::Iterator TodoManager::overDue() { |
59 | int filter = 2 | 1; | 59 | int filter = 2 | 1; |
60 | m_list = m_db->sorted(m_asc, m_sortOrder, filter, m_ca ); | 60 | m_list = m_db->sorted(m_asc, m_sortOrder, filter, m_ca ); |
61 | m_it = m_list.begin(); | 61 | m_it = m_list.begin(); |
62 | return m_it; | 62 | return m_it; |
63 | } | 63 | } |
64 | OTodoAccess::List::Iterator TodoManager::fromTo( const QDate& start, | 64 | OPimTodoAccess::List::Iterator TodoManager::fromTo( const QDate& start, |
65 | const QDate& end ) { | 65 | const QDate& end ) { |
66 | m_list = m_db->effectiveToDos( start, end ); | 66 | m_list = m_db->effectiveToDos( start, end ); |
67 | m_it = m_list.begin(); | 67 | m_it = m_list.begin(); |
68 | return m_it; | 68 | return m_it; |
69 | } | 69 | } |
70 | OTodoAccess::List::Iterator TodoManager::query( const OTodo& ev, int query ) { | 70 | OPimTodoAccess::List::Iterator TodoManager::query( const OPimTodo& ev, int query ) { |
71 | m_list = m_db->queryByExample( ev, query ); | 71 | m_list = m_db->queryByExample( ev, query ); |
72 | m_it = m_list.begin(); | 72 | m_it = m_list.begin(); |
73 | return m_it; | 73 | return m_it; |
74 | } | 74 | } |
75 | OTodoAccess* TodoManager::todoDB() { | 75 | OPimTodoAccess* TodoManager::todoDB() { |
76 | return m_db; | 76 | return m_db; |
77 | } | 77 | } |
78 | void TodoManager::add( const OTodo& ev ) { | 78 | void TodoManager::add( const OPimTodo& ev ) { |
79 | m_db->add( ev ); | 79 | m_db->add( ev ); |
80 | } | 80 | } |
81 | void TodoManager::update( int, const SmallTodo& ) { | 81 | void TodoManager::update( int, const SmallTodo& ) { |
82 | 82 | ||
83 | } | 83 | } |
84 | void TodoManager::update( int, const OTodo& ev) { | 84 | void TodoManager::update( int, const OPimTodo& ev) { |
85 | m_db->replace( ev ); | 85 | m_db->replace( ev ); |
86 | } | 86 | } |
87 | bool TodoManager::remove( int uid ) { | 87 | bool TodoManager::remove( int uid ) { |
88 | return m_db->remove( uid ); | 88 | return m_db->remove( uid ); |
@@ -120,8 +120,8 @@ bool TodoManager::isLoaded()const { | |||
120 | return (m_db == 0 ); | 120 | return (m_db == 0 ); |
121 | } | 121 | } |
122 | void TodoManager::load() { | 122 | void TodoManager::load() { |
123 | if (!m_db) { | 123 | if (!m_db) { |
124 | m_db = new OTodoAccess(); | 124 | m_db = new OPimTodoAccess(); |
125 | m_db->load(); | 125 | m_db->load(); |
126 | } | 126 | } |
127 | } | 127 | } |
diff --git a/core/pim/todo/todomanager.h b/core/pim/todo/todomanager.h index 8544277..865b47b 100644 --- a/core/pim/todo/todomanager.h +++ b/core/pim/todo/todomanager.h | |||
@@ -28,19 +28,21 @@ | |||
28 | 28 | ||
29 | #ifndef OPIE_TODO_MANAGER_H | 29 | #ifndef OPIE_TODO_MANAGER_H |
30 | #define OPIE_TODO_MANAGER_H | 30 | #define OPIE_TODO_MANAGER_H |
31 | 31 | ||
32 | #include <qarray.h> | 32 | #include <opie2/opimtodo.h> |
33 | #include <qobject.h> | 33 | #include <opie2/otodoaccess.h> |
34 | #include <qstring.h> | ||
35 | 34 | ||
36 | #include <qpe/categories.h> | 35 | #include <qpe/categories.h> |
37 | 36 | ||
38 | #include <opie/otodo.h> | 37 | #include <qarray.h> |
39 | #include <opie/otodoaccess.h> | 38 | #include <qobject.h> |
39 | #include <qstring.h> | ||
40 | 40 | ||
41 | #include "smalltodo.h" | 41 | #include "smalltodo.h" |
42 | 42 | ||
43 | using Opie::OPimTodo; | ||
44 | using Opie::OPimTodoAccess; | ||
43 | 45 | ||
44 | namespace Todo { | 46 | namespace Todo { |
45 | class TodoManager : public QObject{ | 47 | class TodoManager : public QObject{ |
46 | Q_OBJECT | 48 | Q_OBJECT |
@@ -51,38 +53,38 @@ namespace Todo { | |||
51 | ~TodoManager(); | 53 | ~TodoManager(); |
52 | 54 | ||
53 | QStringList categories()/*const*/; | 55 | QStringList categories()/*const*/; |
54 | int catId(const QString&); | 56 | int catId(const QString&); |
55 | OTodo event(int uid ); | 57 | OPimTodo event(int uid ); |
56 | 58 | ||
57 | void updateList(); | 59 | void updateList(); |
58 | /** returns the iterator sorted if set sorted*/ | 60 | /** returns the iterator sorted if set sorted*/ |
59 | OTodoAccess::List list()const; | 61 | OPimTodoAccess::List list()const; |
60 | OTodoAccess::List sorted( bool asc, int so, int f, int cat ); | 62 | OPimTodoAccess::List sorted( bool asc, int so, int f, int cat ); |
61 | 63 | ||
62 | OTodoAccess::List::Iterator overDue(); | 64 | OPimTodoAccess::List::Iterator overDue(); |
63 | OTodoAccess::List::Iterator fromTo( const QDate& start, | 65 | OPimTodoAccess::List::Iterator fromTo( const QDate& start, |
64 | const QDate& end ); | 66 | const QDate& end ); |
65 | OTodoAccess::List::Iterator query( const OTodo& ev, int query ); | 67 | OPimTodoAccess::List::Iterator query( const OPimTodo& ev, int query ); |
66 | 68 | ||
67 | void setCategory( bool sort, int category = -1); | 69 | void setCategory( bool sort, int category = -1); |
68 | void setShowOverDue( bool show ); | 70 | void setShowOverDue( bool show ); |
69 | void setSortOrder( int sortOrder ); | 71 | void setSortOrder( int sortOrder ); |
70 | void setSortASC( bool ); | 72 | void setSortASC( bool ); |
71 | void sort(); | 73 | void sort(); |
72 | 74 | ||
73 | OTodoAccess* todoDB(); | 75 | OPimTodoAccess* todoDB(); |
74 | bool saveAll(); | 76 | bool saveAll(); |
75 | 77 | ||
76 | 78 | ||
77 | signals: | 79 | signals: |
78 | void update(); | 80 | void update(); |
79 | void updateCategories(); | 81 | void updateCategories(); |
80 | 82 | ||
81 | public slots: | 83 | public slots: |
82 | void add( const OTodo& ); | 84 | void add( const OPimTodo& ); |
83 | void update( int uid, const SmallTodo& ); | 85 | void update( int uid, const SmallTodo& ); |
84 | void update( int uid, const OTodo& ); | 86 | void update( int uid, const OPimTodo& ); |
85 | bool remove( int uid ); | 87 | bool remove( int uid ); |
86 | void remove( const QArray<int>& ); | 88 | void remove( const QArray<int>& ); |
87 | 89 | ||
88 | /** | 90 | /** |
@@ -93,12 +95,12 @@ namespace Todo { | |||
93 | void reload(); | 95 | void reload(); |
94 | void save(); | 96 | void save(); |
95 | 97 | ||
96 | private: | 98 | private: |
97 | OTodoAccess* m_db; | 99 | OPimTodoAccess* m_db; |
98 | OTodoAccess::List m_list; | 100 | OPimTodoAccess::List m_list; |
99 | OTodoAccess::List::Iterator m_it; | 101 | OPimTodoAccess::List::Iterator m_it; |
100 | OTodoAccess::List m_sorted; | 102 | OPimTodoAccess::List m_sorted; |
101 | Categories m_cat; | 103 | Categories m_cat; |
102 | int m_ca; | 104 | int m_ca; |
103 | /* sort cat */ | 105 | /* sort cat */ |
104 | bool m_shCat; | 106 | bool m_shCat; |
diff --git a/core/pim/todo/todoshow.h b/core/pim/todo/todoshow.h index 2babe93..1eeadf8 100644 --- a/core/pim/todo/todoshow.h +++ b/core/pim/todo/todoshow.h | |||
@@ -30,9 +30,11 @@ | |||
30 | 30 | ||
31 | #include <qstring.h> | 31 | #include <qstring.h> |
32 | #include <qwidget.h> | 32 | #include <qwidget.h> |
33 | 33 | ||
34 | #include <opie/otodo.h> | 34 | #include <opie2/opimtodo.h> |
35 | |||
36 | using Opie::OPimTodo; | ||
35 | 37 | ||
36 | namespace Todo { | 38 | namespace Todo { |
37 | class MainWindow; | 39 | class MainWindow; |
38 | /** | 40 | /** |
@@ -45,9 +47,9 @@ namespace Todo { | |||
45 | public: | 47 | public: |
46 | TodoShow( MainWindow* win); | 48 | TodoShow( MainWindow* win); |
47 | virtual ~TodoShow(); | 49 | virtual ~TodoShow(); |
48 | virtual QString type()const = 0; | 50 | virtual QString type()const = 0; |
49 | virtual void slotShow( const OTodo& ev ) = 0; | 51 | virtual void slotShow( const OPimTodo& ev ) = 0; |
50 | virtual QWidget* widget() = 0; | 52 | virtual QWidget* widget() = 0; |
51 | protected: | 53 | protected: |
52 | void escapeView(); | 54 | void escapeView(); |
53 | void showNext(); | 55 | void showNext(); |
diff --git a/core/pim/todo/todotemplatemanager.cpp b/core/pim/todo/todotemplatemanager.cpp index 5b83f76..eeac51b 100644 --- a/core/pim/todo/todotemplatemanager.cpp +++ b/core/pim/todo/todotemplatemanager.cpp | |||
@@ -1,10 +1,10 @@ | |||
1 | #include <opie2/otodoaccess.h> | ||
2 | #include <opie2/otodoaccessxml.h> | ||
3 | |||
1 | #include <qpe/config.h> | 4 | #include <qpe/config.h> |
2 | #include <qpe/global.h> | 5 | #include <qpe/global.h> |
3 | 6 | ||
4 | #include <opie/otodoaccess.h> | ||
5 | #include <opie/otodoaccessxml.h> | ||
6 | |||
7 | #include "todotemplatemanager.h" | 7 | #include "todotemplatemanager.h" |
8 | 8 | ||
9 | 9 | ||
10 | using namespace Todo; | 10 | using namespace Todo; |
@@ -16,17 +16,17 @@ TemplateManager::~TemplateManager() { | |||
16 | save(); | 16 | save(); |
17 | } | 17 | } |
18 | void TemplateManager::load() { | 18 | void TemplateManager::load() { |
19 | Config conf("todolist_templates"); | 19 | Config conf("todolist_templates"); |
20 | OTodoAccessXML *xml = new OTodoAccessXML( QString::fromLatin1("template"), | 20 | OPimTodoAccessXML *xml = new OPimTodoAccessXML( QString::fromLatin1("template"), |
21 | m_path ); | 21 | m_path ); |
22 | OTodoAccess todoDB(xml ); | 22 | OPimTodoAccess todoDB(xml ); |
23 | todoDB.load(); | 23 | todoDB.load(); |
24 | 24 | ||
25 | OTodoAccess::List::Iterator it; | 25 | OPimTodoAccess::List::Iterator it; |
26 | OTodoAccess::List list = todoDB.allRecords(); | 26 | OPimTodoAccess::List list = todoDB.allRecords(); |
27 | for ( it = list.begin(); it != list.end(); ++it ) { | 27 | for ( it = list.begin(); it != list.end(); ++it ) { |
28 | OTodo ev = (*it); | 28 | OPimTodo ev = (*it); |
29 | conf.setGroup( QString::number( ev.uid() ) ); | 29 | conf.setGroup( QString::number( ev.uid() ) ); |
30 | QString str = conf.readEntry("Name", QString::null ); | 30 | QString str = conf.readEntry("Name", QString::null ); |
31 | if (str.isEmpty() ) | 31 | if (str.isEmpty() ) |
32 | continue; | 32 | continue; |
@@ -37,45 +37,45 @@ void TemplateManager::load() { | |||
37 | void TemplateManager::save() { | 37 | void TemplateManager::save() { |
38 | qWarning("Saving!!!!"); | 38 | qWarning("Saving!!!!"); |
39 | Config conf("todolist_templates"); | 39 | Config conf("todolist_templates"); |
40 | 40 | ||
41 | OTodoAccessXML *res = new OTodoAccessXML( "template", | 41 | OPimTodoAccessXML *res = new OPimTodoAccessXML( "template", |
42 | m_path ); | 42 | m_path ); |
43 | OTodoAccess db(res); | 43 | OPimTodoAccess db(res); |
44 | db.load(); | 44 | db.load(); |
45 | db.clear(); | 45 | db.clear(); |
46 | 46 | ||
47 | 47 | ||
48 | QMap<QString, OTodo>::Iterator it; | 48 | QMap<QString, OPimTodo>::Iterator it; |
49 | for ( it = m_templates.begin(); it != m_templates.end(); ++it ) { | 49 | for ( it = m_templates.begin(); it != m_templates.end(); ++it ) { |
50 | OTodo ev = it.data(); | 50 | OPimTodo ev = it.data(); |
51 | conf.setGroup( QString::number( ev.uid() ) ); | 51 | conf.setGroup( QString::number( ev.uid() ) ); |
52 | qWarning("Name" + it.key() ); | 52 | qWarning("Name" + it.key() ); |
53 | conf.writeEntry("Name", it.key() ); | 53 | conf.writeEntry("Name", it.key() ); |
54 | db.add( ev ); | 54 | db.add( ev ); |
55 | } | 55 | } |
56 | db.save(); | 56 | db.save(); |
57 | } | 57 | } |
58 | void TemplateManager::addEvent( const QString& str, | 58 | void TemplateManager::addEvent( const QString& str, |
59 | const OTodo& ev) { | 59 | const OPimTodo& ev) { |
60 | qWarning("AddEvent"+ str ); | 60 | qWarning("AddEvent"+ str ); |
61 | OTodo todo = ev; | 61 | OPimTodo todo = ev; |
62 | if( ev.uid() == 0 ) | 62 | if( ev.uid() == 0 ) |
63 | todo.setUid(1); // generate a new uid | 63 | todo.setUid(1); // generate a new uid |
64 | 64 | ||
65 | m_templates.replace( str, todo ); | 65 | m_templates.replace( str, todo ); |
66 | } | 66 | } |
67 | void TemplateManager::removeEvent( const QString& str ) { | 67 | void TemplateManager::removeEvent( const QString& str ) { |
68 | m_templates.remove( str ); | 68 | m_templates.remove( str ); |
69 | } | 69 | } |
70 | QStringList TemplateManager::templates() const { | 70 | QStringList TemplateManager::templates() const { |
71 | QStringList list; | 71 | QStringList list; |
72 | QMap<QString, OTodo>::ConstIterator it; | 72 | QMap<QString, OPimTodo>::ConstIterator it; |
73 | for (it = m_templates.begin(); it != m_templates.end(); ++it ) { | 73 | for (it = m_templates.begin(); it != m_templates.end(); ++it ) { |
74 | list << it.key(); | 74 | list << it.key(); |
75 | } | 75 | } |
76 | 76 | ||
77 | return list; | 77 | return list; |
78 | } | 78 | } |
79 | OTodo TemplateManager::templateEvent( const QString& templateName ) { | 79 | OPimTodo TemplateManager::templateEvent( const QString& templateName ) { |
80 | return m_templates[templateName]; | 80 | return m_templates[templateName]; |
81 | } | 81 | } |
diff --git a/core/pim/todo/todotemplatemanager.h b/core/pim/todo/todotemplatemanager.h index 387ced1..ee8aaaf 100644 --- a/core/pim/todo/todotemplatemanager.h +++ b/core/pim/todo/todotemplatemanager.h | |||
@@ -1,12 +1,13 @@ | |||
1 | #ifndef OPIE_TODO_TEMPLATE_H | 1 | #ifndef OPIE_TODO_TEMPLATE_H |
2 | #define OPIE_TODO_TEMPLATE_H | 2 | #define OPIE_TODO_TEMPLATE_H |
3 | 3 | ||
4 | #include <opie2/opimtodo.h> | ||
5 | |||
4 | #include <qstring.h> | 6 | #include <qstring.h> |
5 | #include <qmap.h> | 7 | #include <qmap.h> |
6 | 8 | ||
7 | #include <opie/otodo.h> | 9 | using namespace Opie; |
8 | |||
9 | 10 | ||
10 | namespace Todo { | 11 | namespace Todo { |
11 | class TemplateManager { | 12 | class TemplateManager { |
12 | public: | 13 | public: |
@@ -14,16 +15,16 @@ namespace Todo { | |||
14 | ~TemplateManager(); | 15 | ~TemplateManager(); |
15 | void load(); | 16 | void load(); |
16 | void save(); | 17 | void save(); |
17 | QStringList templates()const; | 18 | QStringList templates()const; |
18 | OTodo templateEvent( const QString& templateName ); | 19 | OPimTodo templateEvent( const QString& templateName ); |
19 | 20 | ||
20 | /* also replaces one */ | 21 | /* also replaces one */ |
21 | void addEvent( const QString&, const OTodo& ); | 22 | void addEvent( const QString&, const OPimTodo& ); |
22 | void removeEvent( const QString& ); | 23 | void removeEvent( const QString& ); |
23 | private: | 24 | private: |
24 | QString m_path; | 25 | QString m_path; |
25 | QMap<QString, OTodo> m_templates; | 26 | QMap<QString, OPimTodo> m_templates; |
26 | 27 | ||
27 | 28 | ||
28 | 29 | ||
29 | }; | 30 | }; |
diff --git a/core/pim/todo/todoview.cpp b/core/pim/todo/todoview.cpp index 31047cf..d99cf77 100644 --- a/core/pim/todo/todoview.cpp +++ b/core/pim/todo/todoview.cpp | |||
@@ -18,16 +18,16 @@ TodoView::~TodoView() { | |||
18 | MainWindow* TodoView::todoWindow() { | 18 | MainWindow* TodoView::todoWindow() { |
19 | return m_main; | 19 | return m_main; |
20 | } | 20 | } |
21 | 21 | ||
22 | OTodo TodoView::event(int uid ) { | 22 | OPimTodo TodoView::event(int uid ) { |
23 | return m_main->event( uid ); | 23 | return m_main->event( uid ); |
24 | } | 24 | } |
25 | OTodoAccess::List TodoView::list(){ | 25 | OPimTodoAccess::List TodoView::list(){ |
26 | todoWindow()->updateList(); | 26 | todoWindow()->updateList(); |
27 | return todoWindow()->list(); | 27 | return todoWindow()->list(); |
28 | } | 28 | } |
29 | OTodoAccess::List TodoView::sorted()const{ | 29 | OPimTodoAccess::List TodoView::sorted()const{ |
30 | return m_sort; | 30 | return m_sort; |
31 | } | 31 | } |
32 | void TodoView::sort() { | 32 | void TodoView::sort() { |
33 | m_sort = todoWindow()->sorted(m_asc,m_sortOrder ); | 33 | m_sort = todoWindow()->sorted(m_asc,m_sortOrder ); |
@@ -45,9 +45,9 @@ void TodoView::setAscending( bool b ) { | |||
45 | } | 45 | } |
46 | void TodoView::update(int, const SmallTodo& ) { | 46 | void TodoView::update(int, const SmallTodo& ) { |
47 | //m_main->slotUpate1( uid, to ); | 47 | //m_main->slotUpate1( uid, to ); |
48 | } | 48 | } |
49 | void TodoView::update(int , const OTodo& ev ) { | 49 | void TodoView::update(int , const OPimTodo& ev ) { |
50 | m_main->updateTodo( ev ); | 50 | m_main->updateTodo( ev ); |
51 | } | 51 | } |
52 | void TodoView::showTodo( int uid ) { | 52 | void TodoView::showTodo( int uid ) { |
53 | m_main->slotShow( uid ); | 53 | m_main->slotShow( uid ); |
@@ -60,9 +60,9 @@ void TodoView::remove( int uid ) { | |||
60 | } | 60 | } |
61 | void TodoView::complete( int uid ) { | 61 | void TodoView::complete( int uid ) { |
62 | m_main->slotComplete( uid ); | 62 | m_main->slotComplete( uid ); |
63 | } | 63 | } |
64 | void TodoView::complete( const OTodo& ev ) { | 64 | void TodoView::complete( const OPimTodo& ev ) { |
65 | m_main->slotComplete( ev ); | 65 | m_main->slotComplete( ev ); |
66 | } | 66 | } |
67 | void TodoView::removeQuery( int uid ) { | 67 | void TodoView::removeQuery( int uid ) { |
68 | m_main->slotDelete( uid ); | 68 | m_main->slotDelete( uid ); |
diff --git a/core/pim/todo/todoview.h b/core/pim/todo/todoview.h index e5ed66f..a5ea9f5 100644 --- a/core/pim/todo/todoview.h +++ b/core/pim/todo/todoview.h | |||
@@ -33,12 +33,14 @@ | |||
33 | #include <qstring.h> | 33 | #include <qstring.h> |
34 | #include <qvaluelist.h> | 34 | #include <qvaluelist.h> |
35 | #include <qwidget.h> | 35 | #include <qwidget.h> |
36 | 36 | ||
37 | #include <opie/otodoaccess.h> | 37 | #include <opie2/otodoaccess.h> |
38 | 38 | ||
39 | #include "smalltodo.h" | 39 | #include "smalltodo.h" |
40 | 40 | ||
41 | using Opie::OPimTodo; | ||
42 | using Opie::OPimTodoAccess; | ||
41 | 43 | ||
42 | namespace Todo { | 44 | namespace Todo { |
43 | class MainWindow; | 45 | class MainWindow; |
44 | 46 | ||
@@ -67,10 +69,10 @@ namespace Todo { | |||
67 | * update the view | 69 | * update the view |
68 | */ | 70 | */ |
69 | virtual void updateView() = 0; | 71 | virtual void updateView() = 0; |
70 | 72 | ||
71 | virtual void addEvent( const OTodo& ) = 0; | 73 | virtual void addEvent( const OPimTodo& ) = 0; |
72 | virtual void replaceEvent( const OTodo& ) = 0; | 74 | virtual void replaceEvent( const OPimTodo& ) = 0; |
73 | virtual void removeEvent( int uid ) = 0; | 75 | virtual void removeEvent( int uid ) = 0; |
74 | virtual void setShowCompleted( bool ) = 0; | 76 | virtual void setShowCompleted( bool ) = 0; |
75 | virtual void setShowDeadline( bool ) = 0; | 77 | virtual void setShowDeadline( bool ) = 0; |
76 | virtual void setShowCategory( const QString& = QString::null ) = 0; | 78 | virtual void setShowCategory( const QString& = QString::null ) = 0; |
@@ -103,11 +105,11 @@ namespace Todo { | |||
103 | virtual ~TodoView(); | 105 | virtual ~TodoView(); |
104 | 106 | ||
105 | protected: | 107 | protected: |
106 | MainWindow* todoWindow(); | 108 | MainWindow* todoWindow(); |
107 | OTodo event(int uid ); | 109 | OPimTodo event(int uid ); |
108 | OTodoAccess::List list(); | 110 | OPimTodoAccess::List list(); |
109 | OTodoAccess::List sorted()const; | 111 | OPimTodoAccess::List sorted()const; |
110 | void sort(); | 112 | void sort(); |
111 | void sort(int sort ); | 113 | void sort(int sort ); |
112 | void setSortOrder( int order ); | 114 | void setSortOrder( int order ); |
113 | void setAscending( bool ); | 115 | void setAscending( bool ); |
@@ -118,17 +120,17 @@ namespace Todo { | |||
118 | */ | 120 | */ |
119 | void showTodo( int uid ); | 121 | void showTodo( int uid ); |
120 | void edit( int uid ); | 122 | void edit( int uid ); |
121 | void update(int uid, const SmallTodo& to ); | 123 | void update(int uid, const SmallTodo& to ); |
122 | void update(int uid, const OTodo& ev); | 124 | void update(int uid, const OPimTodo& ev); |
123 | void remove( int uid ); | 125 | void remove( int uid ); |
124 | /* will ask the user if the item should be deleted */ | 126 | /* will ask the user if the item should be deleted */ |
125 | void removeQuery(int uid ); | 127 | void removeQuery(int uid ); |
126 | void complete( int uid ); | 128 | void complete( int uid ); |
127 | void complete( const OTodo& ev ); | 129 | void complete( const OPimTodo& ev ); |
128 | private: | 130 | private: |
129 | MainWindow *m_main; | 131 | MainWindow *m_main; |
130 | OTodoAccess::List m_sort; | 132 | OPimTodoAccess::List m_sort; |
131 | bool m_asc : 1; | 133 | bool m_asc : 1; |
132 | int m_sortOrder; | 134 | int m_sortOrder; |
133 | }; | 135 | }; |
134 | }; | 136 | }; |