summaryrefslogtreecommitdiff
path: root/core/pim/todo/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp19
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
@@ -19,24 +19,25 @@
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <unistd.h>
+#include <opie2/odebug.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/qpeapplication.h>
@@ -286,44 +287,44 @@ QPopupMenu* MainWindow::contextMenu( int , bool recur ) {
/*
* if this event recurs we allow
* to detach it.
* remove all
*/
if ( recur ) {
; // FIXME
}
return menu;
}
QPopupMenu* MainWindow::options() {
- qWarning("Options");
+ Opie::Core::owarn << "Options" << oendl;
return m_options;
}
QPopupMenu* MainWindow::edit() {
return m_edit;
}
QToolBar* MainWindow::toolbar() {
return m_tool;
}
OPimTodoAccess::List MainWindow::list()const {
return m_todoMgr.list();
}
OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) {
int cat = 0;
if ( m_curCat != QWidget::tr("All Categories") )
cat = currentCatId();
if ( m_curCat == QWidget::tr("Unfiled") )
cat = -1;
- qWarning(" Category %d %s", cat, m_curCat.latin1() );
+ Opie::Core::owarn << " Category " << cat << " " << m_curCat << oendl;
int filter = 1;
if (!m_completed )
filter |= 4;
if (m_overdue)
filter |= 2;
return m_todoMgr.sorted( asc, sortOrder, filter, cat );
}
OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) {
int cat = 0;
@@ -364,25 +365,25 @@ void MainWindow::closeEvent( QCloseEvent* e ) {
return;
}
/*
* we should have flushed and now we're still saving
* so there is no need to flush
*/
if (m_syncing ) {
e->accept();
return;
}
bool quit = false;
if ( m_todoMgr.saveAll() ){
- qWarning("saved");
+ Opie::Core::owarn << "saved" << oendl;
quit = true;
}else {
if ( QMessageBox::critical( this, QWidget::tr("Out of space"),
QWidget::tr("Todo was unable\n"
"to save your changes.\n"
"Free up some space\n"
"and try again.\n"
"\nQuit Anyway?"),
QMessageBox::Yes|QMessageBox::Escape,
QMessageBox::No|QMessageBox::Default)
!= QMessageBox::No ) {
e->accept();
@@ -527,25 +528,25 @@ void MainWindow::slotFind() {
}
void MainWindow::slotEdit() {
slotEdit( currentView()->current() );
}
/*
* set the category
*/
void MainWindow::setCategory( int c) {
if ( c <= 0 ) return;
- qWarning("Iterating over cats %d", c );
+ Opie::Core::owarn << "Iterating over cats " << c << oendl;
for ( unsigned int i = 1; i < m_catMenu->count(); i++ )
m_catMenu->setItemChecked(i, c == (int)i );
if (c == 1 ) {
m_curCat = QString::null;
setCaption( QWidget::tr("Todo") + " - " + QWidget::tr("All Categories" ) );
}else if ( c == (int)m_catMenu->count() - 1 ) {
m_curCat = QWidget::tr("Unfiled");
setCaption( QWidget::tr("Todo") + " - " + QWidget::tr("Unfiled") );
}else {
m_curCat = m_todoMgr.categories()[c-2];
@@ -671,25 +672,25 @@ void MainWindow::raiseCurrentView() {
// in returnFromView we fix up m_showing
if (m_showing ) return;
m_stack->raiseWidget( m_curView->widget() );
}
void MainWindow::slotShowDue(bool ov) {
m_overdue = ov;
currentView()->showOverDue( ov );
raiseCurrentView();
}
void MainWindow::slotShow( int uid ) {
if ( uid == 0 ) return;
- qWarning("slotShow");
+ Opie::Core::owarn << "slotShow" << oendl;
currentShow()->slotShow( event( uid ) );
m_stack->raiseWidget( currentShow()->widget() );
}
void MainWindow::slotShowNext() {
int l = currentView()->next();
if (l!=0)
slotShow(l);
}
void MainWindow::slotShowPrev() {
int l = currentView()->prev();
if (l!=0)
slotShow(l);
@@ -730,25 +731,25 @@ void MainWindow::updateTodo( const OPimTodo& ev) {
*/
void MainWindow::slotUpdate3( QWidget* ) {
}
void MainWindow::updateList() {
m_todoMgr.updateList();
}
void MainWindow::setReadAhead( uint count ) {
if (m_todoMgr.todoDB() )
m_todoMgr.todoDB()->setReadAhead( count );
}
void MainWindow::slotQuickEntered() {
- qWarning("entered");
+ Opie::Core::owarn << "entered" << oendl;
OPimTodo todo = quickEditor()->todo();
if (todo.isEmpty() )
return;
m_todoMgr.add( todo );
currentView()->addEvent( todo );
raiseCurrentView();
}
QuickEditBase* MainWindow::quickEditor() {
return m_curQuick;
}
void MainWindow::slotComplete( int uid ) {
@@ -777,25 +778,25 @@ void MainWindow::slotComplete( const OPimTodo& todo ) {
to.setRecurrence( OPimRecurrence() );
OPimRecurrence rec = to2.recurrence();
rec.setStart( to.dueDate() );
to2.setRecurrence( rec );
/*
* if there is a next occurence
* from the duedate of the last recurrance
*/
QDate date;
if ( to2.recurrence().nextOcurrence( to2.dueDate().addDays(1), date ) ) {
int dayDiff = to.dueDate().daysTo( date );
- qWarning("day diff is %d", dayDiff );
+ Opie::Core::owarn << "day diff is " << dayDiff << oendl;
QDate inval;
/* generate a new uid for the old record */
to.setUid( 1 );
/* add the old one cause it has a new UID here cause it was spin off */
m_todoMgr.add( to );
/*
* update the due date
* start date
* and complete date
*/
@@ -940,33 +941,33 @@ namespace {
found = true;
break;
}
}
if (!found)
nonMatching.append( (*oldIt) );
}
return nonMatching;
}
void addAlarms( const OPimNotifyManager::Alarms& als, int uid ) {
OPimNotifyManager::Alarms::ConstIterator it;
for ( it = als.begin(); it != als.end(); ++it ) {
- qWarning("Adding alarm for %s", (*it).dateTime().toString().latin1() );
+ Opie::Core::owarn << "Adding alarm for " << (*it).dateTime().toString() << oendl;
AlarmServer::addAlarm( (*it).dateTime(), "QPE/Application/todolist", "alarm(QDateTime,int)", uid );
}
}
void removeAlarms( const OPimNotifyManager::Alarms& als, int uid ) {
OPimNotifyManager::Alarms::ConstIterator it;
for ( it = als.begin(); it != als.end(); ++it ) {
- qWarning("Removinf alarm for %s", (*it).dateTime().toString().latin1() );
+ Opie::Core::owarn << "Removinf alarm for " << (*it).dateTime().toString() << oendl;
AlarmServer::deleteAlarm( (*it).dateTime(), "QPE/Application/todolist", "alarm(QDateTime,int)", uid );
}
}
}
void MainWindow::handleAlarms( const OPimTodo& oldTodo, const OPimTodo& newTodo) {
/*
* if oldTodo is not empty and has notifiers we need to find the deleted ones
*/
if(!oldTodo.isEmpty() && oldTodo.hasNotifiers() ) {
OPimNotifyManager::Alarms removed;
OPimNotifyManager::Alarms oldAls = oldTodo.notifiers().alarms();