-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 @@ -30,2 +30,16 @@ +#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> @@ -43,18 +57,2 @@ -#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" @@ -312,6 +310,6 @@ QToolBar* MainWindow::toolbar() { } -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; @@ -333,3 +331,3 @@ OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) { } -OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) { +OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) { int cat = 0; @@ -343,3 +341,3 @@ OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) { } -OTodo MainWindow::event( int uid ) { +OPimTodo MainWindow::event( int uid ) { return m_todoMgr.event( uid ); @@ -435,3 +433,3 @@ void MainWindow::slotNewFromTemplate( int id ) { - OTodo event = templateManager()->templateEvent( name ); + OPimTodo event = templateManager()->templateEvent( name ); event = currentEditor()->edit(this, @@ -442,3 +440,3 @@ void MainWindow::slotNewFromTemplate( int id ) { event.setUid( 1 ); - handleAlarms( OTodo(), event ); + handleAlarms( OPimTodo(), event ); m_todoMgr.add( event ); @@ -459,3 +457,3 @@ void MainWindow::slotDuplicate() { } - OTodo ev = m_todoMgr.event( currentView()->current() ); + OPimTodo ev = m_todoMgr.event( currentView()->current() ); /* let's generate a new uid */ @@ -480,3 +478,3 @@ void MainWindow::slotDelete() { - handleAlarms( m_todoMgr.event( currentView()->current() ), OTodo() ); + handleAlarms( m_todoMgr.event( currentView()->current() ), OPimTodo() ); m_todoMgr.remove( currentView()->current() ); @@ -492,3 +490,3 @@ void MainWindow::slotDelete(int uid ) { } - OTodo to = m_todoMgr.event(uid); + OPimTodo to = m_todoMgr.event(uid); if (!QPEMessageBox::confirmDelete(this, QWidget::tr("Todo"), to.toShortText() ) ) @@ -496,3 +494,3 @@ void MainWindow::slotDelete(int uid ) { - handleAlarms(to, OTodo() ); + handleAlarms(to, OPimTodo() ); m_todoMgr.remove( to.uid() ); @@ -599,7 +597,7 @@ 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(); @@ -612,3 +610,3 @@ void MainWindow::receiveFile( const QString& filename ) { QMessageBox::Cancel ) == QMessageBox::Ok ) { - OTodoAccess::List::Iterator it; + OPimTodoAccess::List::Iterator it; for ( it = list.begin(); it != list.end(); ++it ) @@ -710,5 +708,5 @@ 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 ); @@ -730,3 +728,3 @@ 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 ); @@ -748,3 +746,3 @@ void MainWindow::slotQuickEntered() { qWarning("entered"); - OTodo todo = quickEditor()->todo(); + OPimTodo todo = quickEditor()->todo(); if (todo.isEmpty() ) @@ -762,4 +760,4 @@ void MainWindow::slotComplete( int uid ) { } -void MainWindow::slotComplete( const OTodo& todo ) { - OTodo to = todo; +void MainWindow::slotComplete( const OPimTodo& todo ) { + OPimTodo to = todo; to.setCompleted( !to.isCompleted() ); @@ -779,8 +777,8 @@ 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() ); @@ -827,3 +825,3 @@ void MainWindow::slotComplete( const OTodo& todo ) { to2.notifiers().setAlarms( als ); - handleAlarms( OTodo(), todo ); + handleAlarms( OPimTodo(), todo ); } @@ -857,3 +855,3 @@ int MainWindow::create() { - OTodo todo = currentEditor()->newTodo( currentCatId(), + OPimTodo todo = currentEditor()->newTodo( currentCatId(), this ); @@ -863,3 +861,3 @@ int MainWindow::create() { uid = todo.uid(); - handleAlarms( OTodo(), todo ); + handleAlarms( OPimTodo(), todo ); m_todoMgr.add( todo ); @@ -882,3 +880,3 @@ 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 ) ); @@ -892,5 +890,5 @@ void MainWindow::beam( int uid) { - 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(); @@ -915,6 +913,6 @@ 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); @@ -971,3 +969,3 @@ namespace { -void MainWindow::handleAlarms( const OTodo& oldTodo, const OTodo& newTodo) { +void MainWindow::handleAlarms( const OPimTodo& oldTodo, const OPimTodo& newTodo) { /* @@ -999,3 +997,3 @@ void MainWindow::doAlarm( const QDateTime& dt, int uid ) { - OTodo todo = m_todoMgr.event( uid ); + OPimTodo todo = m_todoMgr.event( uid ); if (!todo.hasNotifiers() ) return; |