summaryrefslogtreecommitdiff
path: root/core/pim/todo/mainwindow.cpp
Unidiff
Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp98
1 files changed, 48 insertions, 50 deletions
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
@@ -30,2 +30,16 @@
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>
@@ -43,18 +57,2 @@
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"
@@ -312,6 +310,6 @@ QToolBar* MainWindow::toolbar() {
312} 310}
313OTodoAccess::List MainWindow::list()const { 311OPimTodoAccess::List MainWindow::list()const {
314 return m_todoMgr.list(); 312 return m_todoMgr.list();
315} 313}
316OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) { 314OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) {
317 int cat = 0; 315 int cat = 0;
@@ -333,3 +331,3 @@ OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) {
333} 331}
334OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) { 332OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) {
335 int cat = 0; 333 int cat = 0;
@@ -343,3 +341,3 @@ OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) {
343} 341}
344OTodo MainWindow::event( int uid ) { 342OPimTodo MainWindow::event( int uid ) {
345 return m_todoMgr.event( uid ); 343 return m_todoMgr.event( uid );
@@ -435,3 +433,3 @@ void MainWindow::slotNewFromTemplate( int 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,
@@ -442,3 +440,3 @@ void MainWindow::slotNewFromTemplate( int id ) {
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 );
@@ -459,3 +457,3 @@ void MainWindow::slotDuplicate() {
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 */
@@ -480,3 +478,3 @@ void MainWindow::slotDelete() {
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() );
@@ -492,3 +490,3 @@ void MainWindow::slotDelete(int uid ) {
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() ) )
@@ -496,3 +494,3 @@ void MainWindow::slotDelete(int uid ) {
496 494
497 handleAlarms(to, OTodo() ); 495 handleAlarms(to, OPimTodo() );
498 m_todoMgr.remove( to.uid() ); 496 m_todoMgr.remove( to.uid() );
@@ -599,7 +597,7 @@ void MainWindow::beamDone( Ir* ir) {
599void MainWindow::receiveFile( const QString& filename ) { 597void 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
@@ -612,3 +610,3 @@ void MainWindow::receiveFile( const QString& filename ) {
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 )
@@ -710,5 +708,5 @@ void MainWindow::slotEdit( int uid ) {
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
@@ -730,3 +728,3 @@ void MainWindow::slotUpdate1( int uid, const SmallTodo& ev) {
730*/ 728*/
731void MainWindow::updateTodo( const OTodo& ev) { 729void MainWindow::updateTodo( const OPimTodo& ev) {
732 m_todoMgr.update( ev.uid() , ev ); 730 m_todoMgr.update( ev.uid() , ev );
@@ -748,3 +746,3 @@ 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() )
@@ -762,4 +760,4 @@ void MainWindow::slotComplete( int uid ) {
762} 760}
763void MainWindow::slotComplete( const OTodo& todo ) { 761void MainWindow::slotComplete( const OPimTodo& todo ) {
764 OTodo to = todo; 762 OPimTodo to = todo;
765 to.setCompleted( !to.isCompleted() ); 763 to.setCompleted( !to.isCompleted() );
@@ -779,8 +777,8 @@ void MainWindow::slotComplete( const OTodo& todo ) {
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() );
@@ -827,3 +825,3 @@ void MainWindow::slotComplete( const OTodo& todo ) {
827 to2.notifiers().setAlarms( als ); 825 to2.notifiers().setAlarms( als );
828 handleAlarms( OTodo(), todo ); 826 handleAlarms( OPimTodo(), todo );
829 } 827 }
@@ -857,3 +855,3 @@ int MainWindow::create() {
857 855
858 OTodo todo = currentEditor()->newTodo( currentCatId(), 856 OPimTodo todo = currentEditor()->newTodo( currentCatId(),
859 this ); 857 this );
@@ -863,3 +861,3 @@ int MainWindow::create() {
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 );
@@ -882,3 +880,3 @@ bool MainWindow::remove( int uid ) {
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
@@ -892,5 +890,5 @@ void MainWindow::beam( int uid) {
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();
@@ -915,6 +913,6 @@ void MainWindow::edit( int uid ) {
915void MainWindow::add( const OPimRecord& rec) { 913void 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
@@ -971,3 +969,3 @@ namespace {
971 969
972void MainWindow::handleAlarms( const OTodo& oldTodo, const OTodo& newTodo) { 970void MainWindow::handleAlarms( const OPimTodo& oldTodo, const OPimTodo& newTodo) {
973 /* 971 /*
@@ -999,3 +997,3 @@ void MainWindow::doAlarm( const QDateTime& dt, int uid ) {
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;