summaryrefslogtreecommitdiff
path: root/core/pim/todo/mainwindow.cpp
Unidiff
Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index 7810285..58981ca 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -609,48 +609,49 @@ bool MainWindow::showQuickTask()const {
609} 609}
610QString MainWindow::currentCategory()const { 610QString MainWindow::currentCategory()const {
611 return m_curCat; 611 return m_curCat;
612} 612}
613int MainWindow::currentCatId() { 613int MainWindow::currentCatId() {
614 return m_todoMgr.catId( m_curCat ); 614 return m_todoMgr.catId( m_curCat );
615} 615}
616ViewBase* MainWindow::currentView() { 616ViewBase* MainWindow::currentView() {
617 return m_curView; 617 return m_curView;
618} 618}
619void MainWindow::raiseCurrentView() { 619void MainWindow::raiseCurrentView() {
620 m_stack->raiseWidget( m_curView->widget() ); 620 m_stack->raiseWidget( m_curView->widget() );
621} 621}
622void MainWindow::slotShowDue(bool ov) { 622void MainWindow::slotShowDue(bool ov) {
623 m_overdue = ov; 623 m_overdue = ov;
624 currentView()->showOverDue( ov ); 624 currentView()->showOverDue( ov );
625 raiseCurrentView(); 625 raiseCurrentView();
626} 626}
627void MainWindow::slotShow( int uid ) { 627void MainWindow::slotShow( int uid ) {
628 qWarning("slotShow"); 628 qWarning("slotShow");
629 currentShow()->slotShow( event( uid ) ); 629 currentShow()->slotShow( event( uid ) );
630 m_stack->raiseWidget( currentShow()->widget() ); 630 m_stack->raiseWidget( currentShow()->widget() );
631} 631}
632void MainWindow::slotEdit( int uid ) { 632void MainWindow::slotEdit( int uid ) {
633 if (uid == 1 ) return;
633 if(m_syncing) { 634 if(m_syncing) {
634 QMessageBox::warning(this, QWidget::tr("Todo"), 635 QMessageBox::warning(this, QWidget::tr("Todo"),
635 QWidget::tr("Can not edit data, currently syncing")); 636 QWidget::tr("Can not edit data, currently syncing"));
636 return; 637 return;
637 } 638 }
638 639
639 OTodo todo = m_todoMgr.event( uid ); 640 OTodo todo = m_todoMgr.event( uid );
640 641
641 todo = currentEditor()->edit(this, todo ); 642 todo = currentEditor()->edit(this, todo );
642 643
643 /* if completed */ 644 /* if completed */
644 if ( currentEditor()->accepted() ) { 645 if ( currentEditor()->accepted() ) {
645 qWarning("Replacing now" ); 646 qWarning("Replacing now" );
646 m_todoMgr.update( todo.uid(), todo ); 647 m_todoMgr.update( todo.uid(), todo );
647 currentView()->replaceEvent( todo ); 648 currentView()->replaceEvent( todo );
648 /* a Category might have changed */ 649 /* a Category might have changed */
649 populateCategories(); 650 populateCategories();
650 } 651 }
651 652
652 raiseCurrentView(); 653 raiseCurrentView();
653} 654}
654/* 655/*
655void MainWindow::slotUpdate1( int uid, const SmallTodo& ev) { 656void MainWindow::slotUpdate1( int uid, const SmallTodo& ev) {
656 m_todoMgr.update( uid, ev ); 657 m_todoMgr.update( uid, ev );
@@ -770,49 +771,49 @@ int MainWindow::create() {
770 // but only call if we changed something -zecke 771 // but only call if we changed something -zecke
771 populateCategories(); 772 populateCategories();
772 } 773 }
773 raiseCurrentView( ); 774 raiseCurrentView( );
774 775
775 return uid; 776 return uid;
776} 777}
777/* delete it silently... */ 778/* delete it silently... */
778bool MainWindow::remove( int uid ) { 779bool MainWindow::remove( int uid ) {
779 if (m_syncing) return false; 780 if (m_syncing) return false;
780 781
781 return m_todoMgr.remove( uid ); 782 return m_todoMgr.remove( uid );
782} 783}
783void MainWindow::beam( int uid) { 784void MainWindow::beam( int uid) {
784 ::unlink( beamfile ); 785 ::unlink( beamfile );
785 OTodo todo = event( uid ); 786 OTodo todo = event( uid );
786 OTodoAccessVCal* cal = new OTodoAccessVCal(QString::fromLatin1(beamfile) ); 787 OTodoAccessVCal* cal = new OTodoAccessVCal(QString::fromLatin1(beamfile) );
787 OTodoAccess acc( cal ); 788 OTodoAccess acc( cal );
788 acc.load(); 789 acc.load();
789 acc.add( todo ); 790 acc.add( todo );
790 acc.save(); 791 acc.save();
791 Ir* ir = new Ir(this ); 792 Ir* ir = new Ir(this );
792 connect(ir, SIGNAL(done(Ir*) ), 793 connect(ir, SIGNAL(done(Ir*) ),
793 this, SLOT(beamDone(Ir*) ) ); 794 this, SLOT(beamDone(Ir*) ) );
794 ir->send( beamfile, todo.summary(), "text/x-vCalendar" ); 795 ir->send(beamfile, todo.summary(), "text/x-vCalendar" );
795} 796}
796void MainWindow::show( int uid ) { 797void MainWindow::show( int uid ) {
797 slotShow( uid ); 798 slotShow( uid );
798} 799}
799void MainWindow::edit( int uid ) { 800void MainWindow::edit( int uid ) {
800 slotEdit( uid ); 801 slotEdit( uid );
801} 802}
802void MainWindow::add( const OPimRecord& rec) { 803void MainWindow::add( const OPimRecord& rec) {
803 if ( rec.rtti() != OTodo::rtti() ) return; 804 if ( rec.rtti() != OTodo::rtti() ) return;
804 805
805 const OTodo& todo = static_cast<const OTodo&>(rec); 806 const OTodo& todo = static_cast<const OTodo&>(rec);
806 807
807 m_todoMgr.add(todo ); 808 m_todoMgr.add(todo );
808 currentView()->addEvent( todo ); 809 currentView()->addEvent( todo );
809 810
810 811
811 // I'm afraid we must call this every time now, otherwise 812 // I'm afraid we must call this every time now, otherwise
812 // spend expensive time comparing all these strings... 813 // spend expensive time comparing all these strings...
813 // but only call if we changed something -zecke 814 // but only call if we changed something -zecke
814 populateCategories(); 815 populateCategories();
815} 816}
816void MainWindow::slotReturnFromView() { 817void MainWindow::slotReturnFromView() {
817 raiseCurrentView(); 818 raiseCurrentView();
818} 819}