Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index f0642c4..d552928 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp | |||
@@ -25,12 +25,13 @@ | |||
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <unistd.h> | 29 | #include <unistd.h> |
30 | 30 | ||
31 | #include <opie2/odebug.h> | ||
31 | #include <opie2/opimrecurrence.h> | 32 | #include <opie2/opimrecurrence.h> |
32 | #include <opie2/opimnotifymanager.h> | 33 | #include <opie2/opimnotifymanager.h> |
33 | #include <opie2/otodoaccessvcal.h> | 34 | #include <opie2/otodoaccessvcal.h> |
34 | #include <opie2/oapplicationfactory.h> | 35 | #include <opie2/oapplicationfactory.h> |
35 | 36 | ||
36 | #include <qpe/applnk.h> | 37 | #include <qpe/applnk.h> |
@@ -292,13 +293,13 @@ QPopupMenu* MainWindow::contextMenu( int , bool recur ) { | |||
292 | ; // FIXME | 293 | ; // FIXME |
293 | } | 294 | } |
294 | 295 | ||
295 | return menu; | 296 | return menu; |
296 | } | 297 | } |
297 | QPopupMenu* MainWindow::options() { | 298 | QPopupMenu* MainWindow::options() { |
298 | qWarning("Options"); | 299 | Opie::Core::owarn << "Options" << oendl; |
299 | return m_options; | 300 | return m_options; |
300 | } | 301 | } |
301 | QPopupMenu* MainWindow::edit() { | 302 | QPopupMenu* MainWindow::edit() { |
302 | return m_edit; | 303 | return m_edit; |
303 | } | 304 | } |
304 | QToolBar* MainWindow::toolbar() { | 305 | QToolBar* MainWindow::toolbar() { |
@@ -311,13 +312,13 @@ OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) { | |||
311 | int cat = 0; | 312 | int cat = 0; |
312 | if ( m_curCat != QWidget::tr("All Categories") ) | 313 | if ( m_curCat != QWidget::tr("All Categories") ) |
313 | cat = currentCatId(); | 314 | cat = currentCatId(); |
314 | if ( m_curCat == QWidget::tr("Unfiled") ) | 315 | if ( m_curCat == QWidget::tr("Unfiled") ) |
315 | cat = -1; | 316 | cat = -1; |
316 | 317 | ||
317 | qWarning(" Category %d %s", cat, m_curCat.latin1() ); | 318 | Opie::Core::owarn << " Category " << cat << " " << m_curCat << oendl; |
318 | 319 | ||
319 | int filter = 1; | 320 | int filter = 1; |
320 | 321 | ||
321 | if (!m_completed ) | 322 | if (!m_completed ) |
322 | filter |= 4; | 323 | filter |= 4; |
323 | if (m_overdue) | 324 | if (m_overdue) |
@@ -370,13 +371,13 @@ void MainWindow::closeEvent( QCloseEvent* e ) { | |||
370 | if (m_syncing ) { | 371 | if (m_syncing ) { |
371 | e->accept(); | 372 | e->accept(); |
372 | return; | 373 | return; |
373 | } | 374 | } |
374 | bool quit = false; | 375 | bool quit = false; |
375 | if ( m_todoMgr.saveAll() ){ | 376 | if ( m_todoMgr.saveAll() ){ |
376 | qWarning("saved"); | 377 | Opie::Core::owarn << "saved" << oendl; |
377 | quit = true; | 378 | quit = true; |
378 | }else { | 379 | }else { |
379 | if ( QMessageBox::critical( this, QWidget::tr("Out of space"), | 380 | if ( QMessageBox::critical( this, QWidget::tr("Out of space"), |
380 | QWidget::tr("Todo was unable\n" | 381 | QWidget::tr("Todo was unable\n" |
381 | "to save your changes.\n" | 382 | "to save your changes.\n" |
382 | "Free up some space\n" | 383 | "Free up some space\n" |
@@ -533,13 +534,13 @@ void MainWindow::slotEdit() { | |||
533 | * set the category | 534 | * set the category |
534 | */ | 535 | */ |
535 | void MainWindow::setCategory( int c) { | 536 | void MainWindow::setCategory( int c) { |
536 | if ( c <= 0 ) return; | 537 | if ( c <= 0 ) return; |
537 | 538 | ||
538 | 539 | ||
539 | qWarning("Iterating over cats %d", c ); | 540 | Opie::Core::owarn << "Iterating over cats " << c << oendl; |
540 | for ( unsigned int i = 1; i < m_catMenu->count(); i++ ) | 541 | for ( unsigned int i = 1; i < m_catMenu->count(); i++ ) |
541 | m_catMenu->setItemChecked(i, c == (int)i ); | 542 | m_catMenu->setItemChecked(i, c == (int)i ); |
542 | 543 | ||
543 | if (c == 1 ) { | 544 | if (c == 1 ) { |
544 | m_curCat = QString::null; | 545 | m_curCat = QString::null; |
545 | setCaption( QWidget::tr("Todo") + " - " + QWidget::tr("All Categories" ) ); | 546 | setCaption( QWidget::tr("Todo") + " - " + QWidget::tr("All Categories" ) ); |
@@ -677,13 +678,13 @@ void MainWindow::slotShowDue(bool ov) { | |||
677 | m_overdue = ov; | 678 | m_overdue = ov; |
678 | currentView()->showOverDue( ov ); | 679 | currentView()->showOverDue( ov ); |
679 | raiseCurrentView(); | 680 | raiseCurrentView(); |
680 | } | 681 | } |
681 | void MainWindow::slotShow( int uid ) { | 682 | void MainWindow::slotShow( int uid ) { |
682 | if ( uid == 0 ) return; | 683 | if ( uid == 0 ) return; |
683 | qWarning("slotShow"); | 684 | Opie::Core::owarn << "slotShow" << oendl; |
684 | currentShow()->slotShow( event( uid ) ); | 685 | currentShow()->slotShow( event( uid ) ); |
685 | m_stack->raiseWidget( currentShow()->widget() ); | 686 | m_stack->raiseWidget( currentShow()->widget() ); |
686 | } | 687 | } |
687 | void MainWindow::slotShowNext() { | 688 | void MainWindow::slotShowNext() { |
688 | int l = currentView()->next(); | 689 | int l = currentView()->next(); |
689 | if (l!=0) | 690 | if (l!=0) |
@@ -736,13 +737,13 @@ void MainWindow::updateList() { | |||
736 | } | 737 | } |
737 | void MainWindow::setReadAhead( uint count ) { | 738 | void MainWindow::setReadAhead( uint count ) { |
738 | if (m_todoMgr.todoDB() ) | 739 | if (m_todoMgr.todoDB() ) |
739 | m_todoMgr.todoDB()->setReadAhead( count ); | 740 | m_todoMgr.todoDB()->setReadAhead( count ); |
740 | } | 741 | } |
741 | void MainWindow::slotQuickEntered() { | 742 | void MainWindow::slotQuickEntered() { |
742 | qWarning("entered"); | 743 | Opie::Core::owarn << "entered" << oendl; |
743 | OPimTodo todo = quickEditor()->todo(); | 744 | OPimTodo todo = quickEditor()->todo(); |
744 | if (todo.isEmpty() ) | 745 | if (todo.isEmpty() ) |
745 | return; | 746 | return; |
746 | 747 | ||
747 | m_todoMgr.add( todo ); | 748 | m_todoMgr.add( todo ); |
748 | currentView()->addEvent( todo ); | 749 | currentView()->addEvent( todo ); |
@@ -783,13 +784,13 @@ void MainWindow::slotComplete( const OPimTodo& todo ) { | |||
783 | * if there is a next occurence | 784 | * if there is a next occurence |
784 | * from the duedate of the last recurrance | 785 | * from the duedate of the last recurrance |
785 | */ | 786 | */ |
786 | QDate date; | 787 | QDate date; |
787 | if ( to2.recurrence().nextOcurrence( to2.dueDate().addDays(1), date ) ) { | 788 | if ( to2.recurrence().nextOcurrence( to2.dueDate().addDays(1), date ) ) { |
788 | int dayDiff = to.dueDate().daysTo( date ); | 789 | int dayDiff = to.dueDate().daysTo( date ); |
789 | qWarning("day diff is %d", dayDiff ); | 790 | Opie::Core::owarn << "day diff is " << dayDiff << oendl; |
790 | QDate inval; | 791 | QDate inval; |
791 | /* generate a new uid for the old record */ | 792 | /* generate a new uid for the old record */ |
792 | to.setUid( 1 ); | 793 | to.setUid( 1 ); |
793 | 794 | ||
794 | /* add the old one cause it has a new UID here cause it was spin off */ | 795 | /* add the old one cause it has a new UID here cause it was spin off */ |
795 | m_todoMgr.add( to ); | 796 | m_todoMgr.add( to ); |
@@ -946,21 +947,21 @@ namespace { | |||
946 | } | 947 | } |
947 | return nonMatching; | 948 | return nonMatching; |
948 | } | 949 | } |
949 | void addAlarms( const OPimNotifyManager::Alarms& als, int uid ) { | 950 | void addAlarms( const OPimNotifyManager::Alarms& als, int uid ) { |
950 | OPimNotifyManager::Alarms::ConstIterator it; | 951 | OPimNotifyManager::Alarms::ConstIterator it; |
951 | for ( it = als.begin(); it != als.end(); ++it ) { | 952 | for ( it = als.begin(); it != als.end(); ++it ) { |
952 | qWarning("Adding alarm for %s", (*it).dateTime().toString().latin1() ); | 953 | Opie::Core::owarn << "Adding alarm for " << (*it).dateTime().toString() << oendl; |
953 | AlarmServer::addAlarm( (*it).dateTime(), "QPE/Application/todolist", "alarm(QDateTime,int)", uid ); | 954 | AlarmServer::addAlarm( (*it).dateTime(), "QPE/Application/todolist", "alarm(QDateTime,int)", uid ); |
954 | } | 955 | } |
955 | 956 | ||
956 | } | 957 | } |
957 | void removeAlarms( const OPimNotifyManager::Alarms& als, int uid ) { | 958 | void removeAlarms( const OPimNotifyManager::Alarms& als, int uid ) { |
958 | OPimNotifyManager::Alarms::ConstIterator it; | 959 | OPimNotifyManager::Alarms::ConstIterator it; |
959 | for ( it = als.begin(); it != als.end(); ++it ) { | 960 | for ( it = als.begin(); it != als.end(); ++it ) { |
960 | qWarning("Removinf alarm for %s", (*it).dateTime().toString().latin1() ); | 961 | Opie::Core::owarn << "Removinf alarm for " << (*it).dateTime().toString() << oendl; |
961 | AlarmServer::deleteAlarm( (*it).dateTime(), "QPE/Application/todolist", "alarm(QDateTime,int)", uid ); | 962 | AlarmServer::deleteAlarm( (*it).dateTime(), "QPE/Application/todolist", "alarm(QDateTime,int)", uid ); |
962 | } | 963 | } |
963 | } | 964 | } |
964 | } | 965 | } |
965 | 966 | ||
966 | void MainWindow::handleAlarms( const OPimTodo& oldTodo, const OPimTodo& newTodo) { | 967 | void MainWindow::handleAlarms( const OPimTodo& oldTodo, const OPimTodo& newTodo) { |