summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-07-10 01:20:01 (UTC)
committer zautrix <zautrix>2005-07-10 01:20:01 (UTC)
commit2a3542ecc4eee8bb4b3d81fcf69e0cf97f07ff4a (patch) (unidiff)
treeb85ac7b9a3bc85abe04f6e3aea77b0e70fa22396
parent2d1e1fe5d290503db8c0462fc294f5c04f58e95c (diff)
downloadkdepimpi-2a3542ecc4eee8bb4b3d81fcf69e0cf97f07ff4a.zip
kdepimpi-2a3542ecc4eee8bb4b3d81fcf69e0cf97f07ff4a.tar.gz
kdepimpi-2a3542ecc4eee8bb4b3d81fcf69e0cf97f07ff4a.tar.bz2
fixxx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp3
-rw-r--r--korganizer/kotodoview.cpp31
2 files changed, 21 insertions, 13 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index ab69158..5a2482e 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2749,129 +2749,130 @@ void CalendarView::changeEventDisplay(Event *which, int action)
2749 clearallviews = true; 2749 clearallviews = true;
2750 mDateNavigator->updateView(); 2750 mDateNavigator->updateView();
2751 //mDialogManager->updateSearchDialog(); 2751 //mDialogManager->updateSearchDialog();
2752 if (which) { 2752 if (which) {
2753 // If there is an event view visible update the display 2753 // If there is an event view visible update the display
2754 mViewManager->currentView()->changeEventDisplay(which,action); 2754 mViewManager->currentView()->changeEventDisplay(which,action);
2755 // TODO: check, if update needed 2755 // TODO: check, if update needed
2756 // if (which->getTodoStatus()) { 2756 // if (which->getTodoStatus()) {
2757 mTodoList->updateView(); 2757 mTodoList->updateView();
2758 if ( action != KOGlobals::EVENTDELETED ) { 2758 if ( action != KOGlobals::EVENTDELETED ) {
2759 mConflictingEvent = which ; 2759 mConflictingEvent = which ;
2760 QTimer::singleShot( 1000, this, SLOT ( checkConflictForEvent() ) ); 2760 QTimer::singleShot( 1000, this, SLOT ( checkConflictForEvent() ) );
2761 } 2761 }
2762 // } 2762 // }
2763 } else { 2763 } else {
2764 mViewManager->currentView()->updateView(); 2764 mViewManager->currentView()->updateView();
2765 } 2765 }
2766} 2766}
2767void CalendarView::checkConflictForEvent() 2767void CalendarView::checkConflictForEvent()
2768{ 2768{
2769 2769
2770 if (!KOPrefs::instance()->mConfirm) 2770 if (!KOPrefs::instance()->mConfirm)
2771 return; 2771 return;
2772 if ( ! mConflictingEvent ) return; 2772 if ( ! mConflictingEvent ) return;
2773 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); 2773 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") );
2774 QPtrList<Event> testlist = mCalendar->events(); 2774 QPtrList<Event> testlist = mCalendar->events();
2775 Event * test = testlist.first(); 2775 Event * test = testlist.first();
2776 QDateTime conflict; 2776 QDateTime conflict;
2777 QDateTime retVal; 2777 QDateTime retVal;
2778 bool found = false; 2778 bool found = false;
2779 Event * cE = 0; 2779 Event * cE = 0;
2780 QDateTime current = QDateTime::currentDateTime(); 2780 QDateTime current = QDateTime::currentDateTime();
2781 while ( test ) { 2781 while ( test ) {
2782 qApp->processEvents(); 2782 qApp->processEvents();
2783 if ( !test->doesFloat() ) { 2783 if ( !test->doesFloat() ) {
2784 if ( mConflictingEvent->isOverlapping ( test, &retVal, &current ) ) { 2784 if ( mConflictingEvent->isOverlapping ( test, &retVal, &current ) ) {
2785 if ( ! found ) { 2785 if ( ! found ) {
2786 conflict = retVal; 2786 conflict = retVal;
2787 cE = test; 2787 cE = test;
2788 } else { 2788 } else {
2789 if ( retVal < conflict ) { 2789 if ( retVal < conflict ) {
2790 conflict = retVal; 2790 conflict = retVal;
2791 cE = test; 2791 cE = test;
2792 } 2792 }
2793 } 2793 }
2794 found = true; 2794 found = true;
2795 } 2795 }
2796 } 2796 }
2797 test = testlist.next(); 2797 test = testlist.next();
2798 } 2798 }
2799 if ( found ) { 2799 if ( found ) {
2800 QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( mConflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ; 2800 QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( mConflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ;
2801 qApp->processEvents(); 2801 qApp->processEvents();
2802 int km = KMessageBox::warningContinueCancel(this,mess, 2802 int km = KMessageBox::warningContinueCancel(this,mess,
2803 i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!")); 2803 i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!"));
2804 if ( km != KMessageBox::Continue ) 2804 if ( km != KMessageBox::Continue )
2805 return; 2805 return;
2806 2806
2807 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) 2807 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
2808 mViewManager->showDayView(); 2808 mViewManager->showDayView();
2809 mNavigator->slotDaySelect( conflict.date() ); 2809 mNavigator->slotDaySelect( conflict.date() );
2810 int hour = conflict.time().hour(); 2810 int hour = conflict.time().hour();
2811 mViewManager->agendaView()->setStartHour( hour ); 2811 mViewManager->agendaView()->setStartHour( hour );
2812 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( mConflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) ); 2812 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( mConflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) );
2813 } 2813 } else
2814 topLevelWidget()->setCaption( i18n("No conflict found") );
2814 mConflictingEvent = 0; 2815 mConflictingEvent = 0;
2815 return; 2816 return;
2816 2817
2817} 2818}
2818 2819
2819void CalendarView::updateTodoViews() 2820void CalendarView::updateTodoViews()
2820{ 2821{
2821 mTodoList->updateView(); 2822 mTodoList->updateView();
2822 mViewManager->currentView()->updateView(); 2823 mViewManager->currentView()->updateView();
2823 2824
2824} 2825}
2825 2826
2826 2827
2827 2828
2828void CalendarView::clearAllViews() 2829void CalendarView::clearAllViews()
2829{ 2830{
2830 mTodoList->clearList(); 2831 mTodoList->clearList();
2831 mViewManager->clearAllViews(); 2832 mViewManager->clearAllViews();
2832 SearchDialog * sd = mDialogManager->getSearchDialog(); 2833 SearchDialog * sd = mDialogManager->getSearchDialog();
2833 if ( sd ) { 2834 if ( sd ) {
2834 KOListView* kol = sd->listview(); 2835 KOListView* kol = sd->listview();
2835 if ( kol ) 2836 if ( kol )
2836 kol->clearList(); 2837 kol->clearList();
2837 } 2838 }
2838} 2839}
2839void CalendarView::updateView() 2840void CalendarView::updateView()
2840{ 2841{
2841 static bool clearallviews = false; 2842 static bool clearallviews = false;
2842 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { 2843 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
2843 if ( clearallviews ) { 2844 if ( clearallviews ) {
2844 clearAllViews(); 2845 clearAllViews();
2845 clearallviews = false; 2846 clearallviews = false;
2846 } 2847 }
2847 return; 2848 return;
2848 } 2849 }
2849 clearallviews = true; 2850 clearallviews = true;
2850 DateList tmpList = mNavigator->selectedDates(); 2851 DateList tmpList = mNavigator->selectedDates();
2851 2852
2852 if ( KOPrefs::instance()->mHideNonStartedTodos ) 2853 if ( KOPrefs::instance()->mHideNonStartedTodos )
2853 mTodoList->updateView(); 2854 mTodoList->updateView();
2854 // We assume that the navigator only selects consecutive days. 2855 // We assume that the navigator only selects consecutive days.
2855 updateView( tmpList.first(), tmpList.last() ); 2856 updateView( tmpList.first(), tmpList.last() );
2856} 2857}
2857 2858
2858void CalendarView::updateUnmanagedViews() 2859void CalendarView::updateUnmanagedViews()
2859{ 2860{
2860 mDateNavigator->updateDayMatrix(); 2861 mDateNavigator->updateDayMatrix();
2861} 2862}
2862 2863
2863int CalendarView::msgItemDelete(const QString name) 2864int CalendarView::msgItemDelete(const QString name)
2864{ 2865{
2865 return KMessageBox::warningContinueCancel(this,name +"\n\n"+ 2866 return KMessageBox::warningContinueCancel(this,name +"\n\n"+
2866 i18n("This item will be\npermanently deleted."), 2867 i18n("This item will be\npermanently deleted."),
2867 i18n("KO/Pi Confirmation"),i18n("Delete")); 2868 i18n("KO/Pi Confirmation"),i18n("Delete"));
2868} 2869}
2869 2870
2870 2871
2871void CalendarView::edit_cut() 2872void CalendarView::edit_cut()
2872{ 2873{
2873 Event *anEvent=0; 2874 Event *anEvent=0;
2874 2875
2875 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2876 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2876 2877
2877 if (mViewManager->currentView()->isEventView()) { 2878 if (mViewManager->currentView()->isEventView()) {
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 94f35e6..3ae977d 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -462,153 +462,160 @@ void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e)
462 QListView::contentsMouseReleaseEvent(e); 462 QListView::contentsMouseReleaseEvent(e);
463 mMousePressed = false; 463 mMousePressed = false;
464} 464}
465 465
466void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) 466void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
467{ 467{
468 if (!e) return; 468 if (!e) return;
469 469
470 QPoint vp = contentsToViewport(e->pos()); 470 QPoint vp = contentsToViewport(e->pos());
471 471
472 QListViewItem *item = itemAt(vp); 472 QListViewItem *item = itemAt(vp);
473 473
474 emit double_Clicked(item); 474 emit double_Clicked(item);
475 if (!item) return; 475 if (!item) return;
476 476
477 emit doubleClicked(item,vp,0); 477 emit doubleClicked(item,vp,0);
478} 478}
479 479
480///////////////////////////////////////////////////////////////////////////// 480/////////////////////////////////////////////////////////////////////////////
481 481
482KOQuickTodo::KOQuickTodo(QWidget *parent) : 482KOQuickTodo::KOQuickTodo(QWidget *parent) :
483 QLineEdit(parent) 483 QLineEdit(parent)
484{ 484{
485 setText(i18n("Click to add new Todo")); 485 setText(i18n("Click to add new Todo"));
486} 486}
487 487
488void KOQuickTodo::focusInEvent(QFocusEvent *ev) 488void KOQuickTodo::focusInEvent(QFocusEvent *ev)
489{ 489{
490 if ( text()==i18n("Click to add new Todo") ) 490 if ( text()==i18n("Click to add new Todo") )
491 setText(""); 491 setText("");
492 QLineEdit::focusInEvent(ev); 492 QLineEdit::focusInEvent(ev);
493} 493}
494 494
495void KOQuickTodo::focusOutEvent(QFocusEvent *ev) 495void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
496{ 496{
497 setText(i18n("Click to add new Todo")); 497 setText(i18n("Click to add new Todo"));
498 QLineEdit::focusOutEvent(ev); 498 QLineEdit::focusOutEvent(ev);
499} 499}
500 500
501///////////////////////////////////////////////////////////////////////////// 501/////////////////////////////////////////////////////////////////////////////
502 502
503KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : 503KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
504 KOrg::BaseView(calendar,parent,name) 504 KOrg::BaseView(calendar,parent,name)
505{ 505{
506 mCategoryPopupMenu = 0; 506 mCategoryPopupMenu = 0;
507 mPendingUpdateBeforeRepaint = false; 507 mPendingUpdateBeforeRepaint = false;
508 isFlatDisplay = false; 508 isFlatDisplay = false;
509 mNavigator = 0; 509 mNavigator = 0;
510 QBoxLayout *topLayout = new QVBoxLayout(this); 510 QBoxLayout *topLayout = new QVBoxLayout(this);
511 mName = QString ( name ); 511 mName = QString ( name );
512 mBlockUpdate = false; 512 mBlockUpdate = false;
513 mQuickBar = new QWidget( this ); 513 mQuickBar = new QWidget( this );
514 topLayout->addWidget(mQuickBar); 514 topLayout->addWidget(mQuickBar);
515 515
516 mQuickAdd = new KOQuickTodo(mQuickBar); 516 mQuickAdd = new KOQuickTodo(mQuickBar);
517 QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); 517 QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar);
518 quickLayout->addWidget( mQuickAdd ); 518 quickLayout->addWidget( mQuickAdd );
519 mNewSubBut = new QPushButton( "sub",mQuickBar ); 519 mNewSubBut = new QPushButton( "sub",mQuickBar );
520 QPushButton * s_done = new QPushButton( "D",mQuickBar ); 520 QPushButton * s_done = new QPushButton( "D",mQuickBar );
521 QPushButton * s_run = new QPushButton( "R",mQuickBar ); 521 QPushButton * s_run = new QPushButton( "R",mQuickBar );
522 QPushButton * allopen = new QPushButton( "O",mQuickBar ); 522 QPushButton * allopen = new QPushButton( "O",mQuickBar );
523 QPushButton * allclose = new QPushButton( "C",mQuickBar ); 523 QPushButton * allclose = new QPushButton( "C",mQuickBar );
524 QPushButton * flat = new QPushButton( "F",mQuickBar ); 524 QPushButton * flat = new QPushButton( "F",mQuickBar );
525 525
526 int fixwid = flat->sizeHint().height(); 526 int fixwid = mQuickAdd->sizeHint().height();
527 if ( QApplication::desktop()->width() >= 800 ) 527 if ( QApplication::desktop()->width() > 800 )
528 fixwid *= 2; 528 fixwid *= 2;
529 flat->setFixedWidth( fixwid );
530 connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat())); 529 connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat()));
531 allopen->setFixedWidth( fixwid );
532 connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen())); 530 connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen()));
533 allclose->setFixedWidth( fixwid );
534 connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose())); 531 connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose()));
535 s_done->setPixmap( SmallIcon("greenhook16")); 532 s_done->setPixmap( SmallIcon("greenhook16"));
536 s_done->setFixedWidth( fixwid );
537 s_done->setFixedHeight( flat->sizeHint().height() ); 533 s_done->setFixedHeight( flat->sizeHint().height() );
538 connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted())); 534 connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted()));
539 s_run->setPixmap( SmallIcon("ko16old")); 535 s_run->setPixmap( SmallIcon("ko16old"));
540 s_run->setFixedWidth( fixwid );
541 s_run->setFixedHeight( flat->sizeHint().height() );
542 connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning())); 536 connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning()));
543 537
544 mNewSubBut->setFixedWidth( fixwid*3/2 );
545 connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo())); 538 connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo()));
539
540 mNewSubBut->setFixedWidth(mNewSubBut->sizeHint().width() );
546 mNewSubBut->setEnabled( false ); 541 mNewSubBut->setEnabled( false );
542 flat->setFixedWidth( fixwid );
543 s_done->setFixedWidth( fixwid );
544 allopen->setFixedWidth( fixwid );
545 allclose->setFixedWidth( fixwid );
546 s_run->setFixedWidth( fixwid );
547 if ( QApplication::desktop()->width() < 800 ) {
548 flat->setFixedHeight( fixwid );
549 s_done->setFixedHeight( fixwid );
550 allopen->setFixedHeight( fixwid );
551 allclose->setFixedHeight( fixwid );
552 s_run->setFixedHeight( fixwid );
553 mNewSubBut->setFixedHeight( fixwid );
554 }
547 quickLayout->addWidget( mNewSubBut ); 555 quickLayout->addWidget( mNewSubBut );
548 quickLayout->addWidget( s_done ); 556 quickLayout->addWidget( s_done );
549 quickLayout->addWidget( s_run ); 557 quickLayout->addWidget( s_run );
550
551 quickLayout->addWidget( allopen ); 558 quickLayout->addWidget( allopen );
552 quickLayout->addWidget( allclose ); 559 quickLayout->addWidget( allclose );
553 quickLayout->addWidget( flat ); 560 quickLayout->addWidget( flat );
554 561
555 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide(); 562 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide();
556 563
557 mTodoListView = new KOTodoListView(calendar,this, name ); 564 mTodoListView = new KOTodoListView(calendar,this, name );
558 topLayout->addWidget(mTodoListView); 565 topLayout->addWidget(mTodoListView);
559 //mTodoListView->header()->setMaximumHeight(30); 566 //mTodoListView->header()->setMaximumHeight(30);
560 mTodoListView->setRootIsDecorated(true); 567 mTodoListView->setRootIsDecorated(true);
561 mTodoListView->setAllColumnsShowFocus(true); 568 mTodoListView->setAllColumnsShowFocus(true);
562 569
563 mTodoListView->setShowSortIndicator(true); 570 mTodoListView->setShowSortIndicator(true);
564 571
565 mTodoListView->addColumn(i18n("Todo")); 572 mTodoListView->addColumn(i18n("Todo"));
566 mTodoListView->addColumn(i18n("Prio")); 573 mTodoListView->addColumn(i18n("Prio"));
567 mTodoListView->setColumnAlignment(1,AlignHCenter); 574 mTodoListView->setColumnAlignment(1,AlignHCenter);
568 mTodoListView->addColumn(i18n("Complete")); 575 mTodoListView->addColumn(i18n("Complete"));
569 mTodoListView->setColumnAlignment(2,AlignCenter); 576 mTodoListView->setColumnAlignment(2,AlignCenter);
570 577
571 mTodoListView->addColumn(i18n("Due Date")); 578 mTodoListView->addColumn(i18n("Due Date"));
572 mTodoListView->setColumnAlignment(3,AlignLeft); 579 mTodoListView->setColumnAlignment(3,AlignLeft);
573 mTodoListView->addColumn(i18n("Due Time")); 580 mTodoListView->addColumn(i18n("Due Time"));
574 mTodoListView->setColumnAlignment(4,AlignHCenter); 581 mTodoListView->setColumnAlignment(4,AlignHCenter);
575 582
576 mTodoListView->addColumn(i18n("Start Date")); 583 mTodoListView->addColumn(i18n("Start Date"));
577 mTodoListView->setColumnAlignment(5,AlignLeft); 584 mTodoListView->setColumnAlignment(5,AlignLeft);
578 mTodoListView->addColumn(i18n("Start Time")); 585 mTodoListView->addColumn(i18n("Start Time"));
579 mTodoListView->setColumnAlignment(6,AlignHCenter); 586 mTodoListView->setColumnAlignment(6,AlignHCenter);
580 587
581 //mTodoListView->addColumn(i18n("Cancelled")); 588 //mTodoListView->addColumn(i18n("Cancelled"));
582 mTodoListView->addColumn(i18n("Categories")); 589 mTodoListView->addColumn(i18n("Categories"));
583 mTodoListView->addColumn(i18n("Calendar")); 590 mTodoListView->addColumn(i18n("Calendar"));
584 mTodoListView->addColumn(i18n("Last Modified")); 591 mTodoListView->addColumn(i18n("Last Modified"));
585 mTodoListView->addColumn(i18n("Created")); 592 mTodoListView->addColumn(i18n("Created"));
586 mTodoListView->addColumn(i18n("Last Modified Sub")); 593 mTodoListView->addColumn(i18n("Last Modified Sub"));
587#if 0 594#if 0
588 mTodoListView->addColumn(i18n("Sort Id")); 595 mTodoListView->addColumn(i18n("Sort Id"));
589 mTodoListView->setColumnAlignment(4,AlignHCenter); 596 mTodoListView->setColumnAlignment(4,AlignHCenter);
590#endif 597#endif
591 598
592 mTodoListView->setMinimumHeight( 60 ); 599 mTodoListView->setMinimumHeight( 60 );
593 mTodoListView->setItemsRenameable( true ); 600 mTodoListView->setItemsRenameable( true );
594 mTodoListView->setRenameable( 0 ); 601 mTodoListView->setRenameable( 0 );
595 mTodoListView->setColumnWidth( 0, 120 ); 602 mTodoListView->setColumnWidth( 0, 120 );
596 int iii = 0; 603 int iii = 0;
597 for ( iii = 0; iii< 12 ; ++iii ) 604 for ( iii = 0; iii< 12 ; ++iii )
598 mTodoListView->setColumnWidthMode( iii, QListView::Manual ); 605 mTodoListView->setColumnWidthMode( iii, QListView::Manual );
599 606
600 607
601 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); 608 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this);
602 609
603 mPriorityPopupMenu = new QPopupMenu(this); 610 mPriorityPopupMenu = new QPopupMenu(this);
604 for (int i = 1; i <= 5; i++) { 611 for (int i = 1; i <= 5; i++) {
605 QString label = QString ("%1").arg (i); 612 QString label = QString ("%1").arg (i);
606 mPriority[mPriorityPopupMenu->insertItem (label)] = i; 613 mPriority[mPriorityPopupMenu->insertItem (label)] = i;
607 } 614 }
608 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); 615 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int)));
609 616
610 mPercentageCompletedPopupMenu = new QPopupMenu(this); 617 mPercentageCompletedPopupMenu = new QPopupMenu(this);
611 for (int i = 0; i <= 100; i+=20) { 618 for (int i = 0; i <= 100; i+=20) {
612 QString label = QString ("%1 %").arg (i); 619 QString label = QString ("%1 %").arg (i);
613 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; 620 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
614 } 621 }
@@ -1053,131 +1060,131 @@ QPtrList<Incidence> KOTodoView::selectedIncidences()
1053 1060
1054 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); 1061 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
1055// if (!item) item = mActiveItem; 1062// if (!item) item = mActiveItem;
1056 if (item) selected.append(item->todo()); 1063 if (item) selected.append(item->todo());
1057 1064
1058 return selected; 1065 return selected;
1059} 1066}
1060 1067
1061QPtrList<Todo> KOTodoView::selectedTodos() 1068QPtrList<Todo> KOTodoView::selectedTodos()
1062{ 1069{
1063 QPtrList<Todo> selected; 1070 QPtrList<Todo> selected;
1064 1071
1065 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); 1072 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
1066// if (!item) item = mActiveItem; 1073// if (!item) item = mActiveItem;
1067 if (item) selected.append(item->todo()); 1074 if (item) selected.append(item->todo());
1068 1075
1069 return selected; 1076 return selected;
1070} 1077}
1071 1078
1072void KOTodoView::changeEventDisplay(Event *, int) 1079void KOTodoView::changeEventDisplay(Event *, int)
1073{ 1080{
1074 updateView(); 1081 updateView();
1075} 1082}
1076 1083
1077void KOTodoView::showDates(const QDate &, const QDate &) 1084void KOTodoView::showDates(const QDate &, const QDate &)
1078{ 1085{
1079} 1086}
1080 1087
1081void KOTodoView::showEvents(QPtrList<Event>) 1088void KOTodoView::showEvents(QPtrList<Event>)
1082{ 1089{
1083 kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; 1090 kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl;
1084} 1091}
1085 1092
1086void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, 1093void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd,
1087 const QDate &td) 1094 const QDate &td)
1088{ 1095{
1089#ifndef KORG_NOPRINTER 1096#ifndef KORG_NOPRINTER
1090 calPrinter->preview(CalPrinter::Todolist, fd, td); 1097 calPrinter->preview(CalPrinter::Todolist, fd, td);
1091#endif 1098#endif
1092} 1099}
1093 1100
1094void KOTodoView::editItem(QListViewItem *item ) 1101void KOTodoView::editItem(QListViewItem *item )
1095{ 1102{
1096 emit editTodoSignal(((KOTodoViewItem *)item)->todo()); 1103 emit editTodoSignal(((KOTodoViewItem *)item)->todo());
1097} 1104}
1098 1105
1099void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) 1106void KOTodoView::showItem(QListViewItem *item,const QPoint &,int)
1100{ 1107{
1101 emit showTodoSignal(((KOTodoViewItem *)item)->todo()); 1108 emit showTodoSignal(((KOTodoViewItem *)item)->todo());
1102} 1109}
1103 1110
1104void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column) 1111void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column)
1105{ 1112{
1106 pendingSubtodo = 0; 1113 pendingSubtodo = 0;
1107 mActiveItem = (KOTodoViewItem *)item; 1114 mActiveItem = (KOTodoViewItem *)item;
1108 if (item) { 1115 if (item) {
1109 switch (column){ 1116 switch (column){
1110 case 1: 1117 case 1:
1111 mPriorityPopupMenu->popup(QCursor::pos ()); break; 1118 mPriorityPopupMenu->popup(QCursor::pos ()); break;
1112 case 2: 1119 case 2:
1113 mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; 1120 mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break;
1114 case 3: 1121 case 3:
1115 moveTodo(); 1122 moveTodo();
1116 break; 1123 break;
1117 case 8: 1124 case 7:
1118 mCategoryPopupMenu->popup(QCursor::pos ()); break; 1125 mCategoryPopupMenu->popup(QCursor::pos ()); break;
1119 case 9: 1126 case 8:
1120 mCalPopupMenu->popup(QCursor::pos ()); break; 1127 mCalPopupMenu->popup(QCursor::pos ()); break;
1121 default: 1128 default:
1122 mItemPopupMenu->popup(QCursor::pos()); 1129 mItemPopupMenu->popup(QCursor::pos());
1123 } 1130 }
1124 } else mPopupMenu->popup(QCursor::pos()); 1131 } else mPopupMenu->popup(QCursor::pos());
1125} 1132}
1126void KOTodoView::newTodo() 1133void KOTodoView::newTodo()
1127{ 1134{
1128 emit newTodoSignal(); 1135 emit newTodoSignal();
1129} 1136}
1130 1137
1131void KOTodoView::newSubTodo() 1138void KOTodoView::newSubTodo()
1132{ 1139{
1133 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1140 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1134 if (mActiveItem) { 1141 if (mActiveItem) {
1135 if ( mQuickAdd->isVisible() && !mQuickAdd->text().isEmpty() && mQuickAdd->text() != i18n("Click to add new Todo") ) { 1142 if ( mQuickAdd->isVisible() && !mQuickAdd->text().isEmpty() && mQuickAdd->text() != i18n("Click to add new Todo") ) {
1136 addQuickTodoPar( mActiveItem->todo()); 1143 addQuickTodoPar( mActiveItem->todo());
1137 } else 1144 } else
1138 emit newSubTodoSignal(mActiveItem->todo()); 1145 emit newSubTodoSignal(mActiveItem->todo());
1139 } 1146 }
1140} 1147}
1141void KOTodoView::unparentTodo() 1148void KOTodoView::unparentTodo()
1142{ 1149{
1143 if (mActiveItem) { 1150 if (mActiveItem) {
1144 emit unparentTodoSignal(mActiveItem->todo()); 1151 emit unparentTodoSignal(mActiveItem->todo());
1145 } 1152 }
1146} 1153}
1147 1154
1148void KOTodoView::reparentTodo() 1155void KOTodoView::reparentTodo()
1149{ 1156{
1150 if (mActiveItem) { 1157 if (mActiveItem) {
1151 topLevelWidget()->setCaption(i18n("Click on new parent item")); 1158 topLevelWidget()->setCaption(i18n("Click on new parent item"));
1152 pendingSubtodo = mActiveItem; 1159 pendingSubtodo = mActiveItem;
1153 } 1160 }
1154} 1161}
1155void KOTodoView::editTodo() 1162void KOTodoView::editTodo()
1156{ 1163{
1157 if (mActiveItem) { 1164 if (mActiveItem) {
1158 emit editTodoSignal(mActiveItem->todo()); 1165 emit editTodoSignal(mActiveItem->todo());
1159 } 1166 }
1160} 1167}
1161void KOTodoView::cloneTodo() 1168void KOTodoView::cloneTodo()
1162{ 1169{
1163 if (mActiveItem) { 1170 if (mActiveItem) {
1164 emit cloneTodoSignal((Incidence*)mActiveItem->todo()); 1171 emit cloneTodoSignal((Incidence*)mActiveItem->todo());
1165 } 1172 }
1166} 1173}
1167void KOTodoView::cancelTodo() 1174void KOTodoView::cancelTodo()
1168{ 1175{
1169 if (mActiveItem) { 1176 if (mActiveItem) {
1170 emit cancelTodoSignal((Incidence*)mActiveItem->todo()); 1177 emit cancelTodoSignal((Incidence*)mActiveItem->todo());
1171 } 1178 }
1172} 1179}
1173void KOTodoView::moveTodo() 1180void KOTodoView::moveTodo()
1174{ 1181{
1175 if (mActiveItem) { 1182 if (mActiveItem) {
1176 emit moveTodoSignal((Incidence*)mActiveItem->todo()); 1183 emit moveTodoSignal((Incidence*)mActiveItem->todo());
1177 } 1184 }
1178} 1185}
1179void KOTodoView::beamTodo() 1186void KOTodoView::beamTodo()
1180{ 1187{
1181 if (mActiveItem) { 1188 if (mActiveItem) {
1182 emit beamTodoSignal((Incidence*)mActiveItem->todo()); 1189 emit beamTodoSignal((Incidence*)mActiveItem->todo());
1183 } 1190 }