summaryrefslogtreecommitdiffabout
Unidiff
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
@@ -2789,49 +2789,50 @@ void CalendarView::checkConflictForEvent()
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 }
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 94f35e6..3ae977d 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -502,73 +502,80 @@ void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
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);
@@ -1093,51 +1100,51 @@ void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd,
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) {