Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 98 |
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 @@ -29,4 +29,18 @@ #include <unistd.h> +#include <opie2/opimrecurrence.h> +#include <opie2/opimnotifymanager.h> +#include <opie2/otodoaccessvcal.h> +#include <opie2/oapplicationfactory.h> + +#include <qpe/applnk.h> +#include <qpe/config.h> +#include <qpe/ir.h> +#include <qpe/resource.h> +#include <qpe/qpemessagebox.h> +#include <qpe/alarmserver.h> +#include <qpe/timestring.h> +#include <qpe/qpeapplication.h> + #include <qmenubar.h> #include <qmessagebox.h> @@ -42,20 +56,4 @@ #include <qwhatsthis.h> -#include <qpe/applnk.h> -#include <qpe/config.h> -#include <qpe/ir.h> -#include <qpe/resource.h> -#include <qpe/qpemessagebox.h> -#include <qpe/alarmserver.h> -#include <qpe/timestring.h> -#include <qpe/qpeapplication.h> - -#include <opie/orecur.h> -#include <opie/opimnotifymanager.h> -#include <opie/otodoaccessvcal.h> -#include <opie/owidgetstack.h> - -#include <opie/oapplicationfactory.h> - #include "quickeditimpl.h" #include "todotemplatemanager.h" @@ -311,8 +309,8 @@ QToolBar* MainWindow::toolbar() { return m_tool; } -OTodoAccess::List MainWindow::list()const { +OPimTodoAccess::List MainWindow::list()const { return m_todoMgr.list(); } -OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) { +OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) { int cat = 0; if ( m_curCat != QWidget::tr("All Categories") ) @@ -332,5 +330,5 @@ OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) { return m_todoMgr.sorted( asc, sortOrder, filter, cat ); } -OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) { +OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) { int cat = 0; if ( m_curCat != QWidget::tr("All Categories") ) @@ -342,5 +340,5 @@ OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) { return m_todoMgr.sorted(asc, sortOrder, addFilter, cat ); } -OTodo MainWindow::event( int uid ) { +OPimTodo MainWindow::event( int uid ) { return m_todoMgr.event( uid ); } @@ -434,5 +432,5 @@ void MainWindow::slotNewFromTemplate( int id ) { QString name = m_template->text( id ); - OTodo event = templateManager()->templateEvent( name ); + OPimTodo event = templateManager()->templateEvent( name ); event = currentEditor()->edit(this, event ); @@ -441,5 +439,5 @@ void MainWindow::slotNewFromTemplate( int id ) { /* assign new todo */ event.setUid( 1 ); - handleAlarms( OTodo(), event ); + handleAlarms( OPimTodo(), event ); m_todoMgr.add( event ); currentView()->addEvent( event ); @@ -458,5 +456,5 @@ void MainWindow::slotDuplicate() { return; } - OTodo ev = m_todoMgr.event( currentView()->current() ); + OPimTodo ev = m_todoMgr.event( currentView()->current() ); /* let's generate a new uid */ ev.setUid(1); @@ -479,5 +477,5 @@ void MainWindow::slotDelete() { return; - handleAlarms( m_todoMgr.event( currentView()->current() ), OTodo() ); + handleAlarms( m_todoMgr.event( currentView()->current() ), OPimTodo() ); m_todoMgr.remove( currentView()->current() ); currentView()->removeEvent( currentView()->current() ); @@ -491,9 +489,9 @@ void MainWindow::slotDelete(int uid ) { return; } - OTodo to = m_todoMgr.event(uid); + OPimTodo to = m_todoMgr.event(uid); if (!QPEMessageBox::confirmDelete(this, QWidget::tr("Todo"), to.toShortText() ) ) return; - handleAlarms(to, OTodo() ); + handleAlarms(to, OPimTodo() ); m_todoMgr.remove( to.uid() ); currentView()->removeEvent( to.uid() ); @@ -598,9 +596,9 @@ void MainWindow::beamDone( Ir* ir) { } void MainWindow::receiveFile( const QString& filename ) { - OTodoAccessVCal* cal = new OTodoAccessVCal(filename ); + OPimTodoAccessVCal* cal = new OPimTodoAccessVCal(filename ); - OTodoAccess acc( cal ); + OPimTodoAccess acc( cal ); acc.load(); - OTodoAccess::List list = acc.allRecords(); + OPimTodoAccess::List list = acc.allRecords(); if (list.count()){ @@ -611,5 +609,5 @@ void MainWindow::receiveFile( const QString& filename ) { message, QMessageBox::Ok, QMessageBox::Cancel ) == QMessageBox::Ok ) { - OTodoAccess::List::Iterator it; + OPimTodoAccess::List::Iterator it; for ( it = list.begin(); it != list.end(); ++it ) m_todoMgr.add( (*it) ); @@ -709,7 +707,7 @@ void MainWindow::slotEdit( int uid ) { } - OTodo old_todo = m_todoMgr.event( uid ); + OPimTodo old_todo = m_todoMgr.event( uid ); - OTodo todo = currentEditor()->edit(this, old_todo ); + OPimTodo todo = currentEditor()->edit(this, old_todo ); /* if completed */ @@ -729,5 +727,5 @@ void MainWindow::slotUpdate1( int uid, const SmallTodo& ev) { } */ -void MainWindow::updateTodo( const OTodo& ev) { +void MainWindow::updateTodo( const OPimTodo& ev) { m_todoMgr.update( ev.uid() , ev ); } @@ -747,5 +745,5 @@ void MainWindow::setReadAhead( uint count ) { void MainWindow::slotQuickEntered() { qWarning("entered"); - OTodo todo = quickEditor()->todo(); + OPimTodo todo = quickEditor()->todo(); if (todo.isEmpty() ) return; @@ -761,6 +759,6 @@ void MainWindow::slotComplete( int uid ) { slotComplete( event(uid) ); } -void MainWindow::slotComplete( const OTodo& todo ) { - OTodo to = todo; +void MainWindow::slotComplete( const OPimTodo& todo ) { + OPimTodo to = todo; to.setCompleted( !to.isCompleted() ); to.setCompletedDate( QDate::currentDate() ); @@ -778,10 +776,10 @@ void MainWindow::slotComplete( const OTodo& todo ) { */ if ( to.hasRecurrence() && to.isCompleted() ) { - OTodo to2( to ); + OPimTodo to2( to ); /* the spinned off one won't recur anymore */ - to.setRecurrence( ORecur() ); + to.setRecurrence( OPimRecurrence() ); - ORecur rec = to2.recurrence(); + OPimRecurrence rec = to2.recurrence(); rec.setStart( to.dueDate() ); to2.setRecurrence( rec ); @@ -826,5 +824,5 @@ void MainWindow::slotComplete( const OTodo& todo ) { } to2.notifiers().setAlarms( als ); - handleAlarms( OTodo(), todo ); + handleAlarms( OPimTodo(), todo ); } to2.setCompletedDate( inval ); @@ -856,5 +854,5 @@ int MainWindow::create() { - OTodo todo = currentEditor()->newTodo( currentCatId(), + OPimTodo todo = currentEditor()->newTodo( currentCatId(), this ); @@ -862,5 +860,5 @@ int MainWindow::create() { //todo.assignUid(); uid = todo.uid(); - handleAlarms( OTodo(), todo ); + handleAlarms( OPimTodo(), todo ); m_todoMgr.add( todo ); currentView()->addEvent( todo ); @@ -881,5 +879,5 @@ bool MainWindow::remove( int uid ) { /* argh need to get the whole OEvent... to disable alarms -zecke */ - handleAlarms( OTodo(), m_todoMgr.event( uid ) ); + handleAlarms( OPimTodo(), m_todoMgr.event( uid ) ); return m_todoMgr.remove( uid ); @@ -891,7 +889,7 @@ void MainWindow::beam( int uid) { m_todoMgr.load(); - OTodo todo = event( uid ); - OTodoAccessVCal* cal = new OTodoAccessVCal(QString::fromLatin1(beamfile) ); - OTodoAccess acc( cal ); + OPimTodo todo = event( uid ); + OPimTodoAccessVCal* cal = new OPimTodoAccessVCal(QString::fromLatin1(beamfile) ); + OPimTodoAccess acc( cal ); acc.load(); acc.add( todo ); @@ -914,8 +912,8 @@ void MainWindow::edit( int uid ) { } void MainWindow::add( const OPimRecord& rec) { - if ( rec.rtti() != OTodo::rtti() ) return; + if ( rec.rtti() != OPimTodo::rtti() ) return; m_todoMgr.load(); // might not be loaded - const OTodo& todo = static_cast<const OTodo&>(rec); + const OPimTodo& todo = static_cast<const OPimTodo&>(rec); m_todoMgr.add(todo ); @@ -970,5 +968,5 @@ namespace { } -void MainWindow::handleAlarms( const OTodo& oldTodo, const OTodo& newTodo) { +void MainWindow::handleAlarms( const OPimTodo& oldTodo, const OPimTodo& newTodo) { /* * if oldTodo is not empty and has notifiers we need to find the deleted ones @@ -998,5 +996,5 @@ void MainWindow::doAlarm( const QDateTime& dt, int uid ) { m_todoMgr.load(); - OTodo todo = m_todoMgr.event( uid ); + OPimTodo todo = m_todoMgr.event( uid ); if (!todo.hasNotifiers() ) return; |