-rw-r--r-- | core/pim/todo/main.cpp | 2 | ||||
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 2 | ||||
-rw-r--r-- | core/pim/todo/mainwindow.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/core/pim/todo/main.cpp b/core/pim/todo/main.cpp index aeae794..58ed45c 100644 --- a/core/pim/todo/main.cpp +++ b/core/pim/todo/main.cpp @@ -1,49 +1,49 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "mainwindow.h" #include <qdatetime.h> #include <qpe/qpeapplication.h> void myMessages( QtMsgType, const char* ) { } int main( int argc, char **argv ) { -// qInstallMsgHandler( myMessages ); + qInstallMsgHandler( myMessages ); QPEApplication a( argc, argv ); QTime time; time.start(); Todo::MainWindow mw; int t = time.elapsed(); qWarning("QTime %d", t/1000 ); mw.setCaption("Opie Todolist"); QObject::connect( &a, SIGNAL( flush() ), &mw, SLOT( slotFlush() ) ); QObject::connect( &a, SIGNAL( reload() ), &mw, SLOT( slotReload() ) ); a.showMainWidget(&mw); return a.exec(); } diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index d328558..7810285 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp @@ -687,132 +687,132 @@ QuickEditBase* MainWindow::quickEditor() { } void MainWindow::slotComplete( int uid ) { slotComplete( event(uid) ); } void MainWindow::slotComplete( const OTodo& todo ) { OTodo to = todo; to.setCompleted( !to.isCompleted() ); to.setCompletedDate( QDate::currentDate() ); /* * if the item does recur * we need to spin it off * and update the items duedate to the next * possible recurrance of this item... * the spinned off one will loose the */ if ( to.recurrence().doesRecur() && to.isCompleted() ) { OTodo to2( to ); /* the spinned off one won't recur anymore */ to.setRecurrence( ORecur() ); ORecur 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 ) ) { 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 */ to2.setDueDate( date ); to2.setStartDate( inval ); to2.setCompletedDate( inval ); to2.setCompleted( false ); updateTodo( to2 ); }else updateTodo( to ); }else updateTodo( to ); currentView()->updateView(); raiseCurrentView(); } void MainWindow::flush() { slotFlush(); } void MainWindow::reload() { slotReload(); } int MainWindow::create() { int uid = 0; if(m_syncing) { QMessageBox::warning(this, QWidget::tr("Todo"), QWidget::tr("Can not edit data, currently syncing")); return uid; } OTodo todo = currentEditor()->newTodo( currentCatId(), this ); if ( currentEditor()->accepted() ) { //todo.assignUid(); uid = todo.uid(); m_todoMgr.add( todo ); currentView()->addEvent( todo ); // I'm afraid we must call this every time now, otherwise // spend expensive time comparing all these strings... // but only call if we changed something -zecke populateCategories(); } raiseCurrentView( ); return uid; } /* delete it silently... */ bool MainWindow::remove( int uid ) { if (m_syncing) return false; return m_todoMgr.remove( uid ); } -void MainWindow::beam( int uid, int ) { +void MainWindow::beam( int uid) { ::unlink( beamfile ); OTodo todo = event( uid ); OTodoAccessVCal* cal = new OTodoAccessVCal(QString::fromLatin1(beamfile) ); OTodoAccess acc( cal ); acc.load(); acc.add( todo ); acc.save(); Ir* ir = new Ir(this ); connect(ir, SIGNAL(done(Ir*) ), this, SLOT(beamDone(Ir*) ) ); ir->send( beamfile, todo.summary(), "text/x-vCalendar" ); } void MainWindow::show( int uid ) { slotShow( uid ); } void MainWindow::edit( int uid ) { slotEdit( uid ); } void MainWindow::add( const OPimRecord& rec) { if ( rec.rtti() != OTodo::rtti() ) return; const OTodo& todo = static_cast<const OTodo&>(rec); m_todoMgr.add(todo ); currentView()->addEvent( todo ); // I'm afraid we must call this every time now, otherwise // spend expensive time comparing all these strings... // but only call if we changed something -zecke populateCategories(); } void MainWindow::slotReturnFromView() { raiseCurrentView(); } diff --git a/core/pim/todo/mainwindow.h b/core/pim/todo/mainwindow.h index f880505..434e969 100644 --- a/core/pim/todo/mainwindow.h +++ b/core/pim/todo/mainwindow.h @@ -98,104 +98,104 @@ private slots: void slotQuickEntered(); void populateCategories(); void slotReload(); void slotFlush(); protected: void closeEvent( QCloseEvent* e ); private: void receiveFile( const QString& filename ); void connectBase( ViewBase* ); void initUI(); void initActions(); void initConfig(); void initViews(); void initEditor(); void initShow(); void initTemplate(); void raiseCurrentView(); ViewBase* currentView(); ViewBase* m_curView; QuickEditBase* m_curQuick; Editor* m_curEdit; TodoShow* currentShow(); TodoShow* m_curShow; TemplateEditor* currentTemplateEditor(); TemplateEditor* m_curTempEd; QMenuBar* m_bar; QToolBar* m_tool; QAction* m_editAction, *m_deleteAction, *m_findAction, *m_completedAction, *m_showDeadLineAction, *m_deleteAllAction, *m_deleteCompleteAction, *m_duplicateAction, *m_showOverDueAction, *m_showQuickTaskAction, *m_effectiveAction; QWidgetStack *m_stack; QPopupMenu* m_catMenu, *m_edit, *m_options, *m_template; bool m_syncing:1; bool m_deadline:1; bool m_completed:1; bool m_overdue:1; bool m_quicktask:1; TodoManager m_todoMgr; QString m_curCat; QList<ViewBase> m_views; uint m_counter; TemplateManager* m_tempManager; private slots: void slotShow(int); void slotEdit(int); void slotUpdate3( QWidget* ); void slotComplete( int uid ); void slotComplete( const OTodo& ev ); void slotNewFromTemplate(int id ); void slotNew(); void slotDuplicate(); void slotDelete(); void slotDeleteAll(); void slotDeleteCompleted(); void slotEdit(); void slotFind(); void setCategory( int ); void slotShowDeadLine( bool ); void slotShowCompleted( bool ); void slotShowQuickTask( bool ); void setDocument( const QString& ); void slotBeam(); void beamDone( Ir* ); void slotShowDetails(); void slotShowDue( bool ); void slotReturnFromView(); // for TodoShow... /* reimplementation from opimmainwindow */ protected slots: void flush(); void reload(); int create(); bool remove( int uid ); - void beam(int uid, int transport = IrDa ); + void beam(int uid); void show( int uid ); void edit( int uid ); void add( const OPimRecord& ); }; }; #endif |