summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
authorzautrix <zautrix>2005-03-31 23:55:51 (UTC)
committer zautrix <zautrix>2005-03-31 23:55:51 (UTC)
commitb76ad1e7e329051a47e28c9d132ce3fcd0b25c5c (patch) (unidiff)
treeb0b3d0eb7a3d29981c183275aadeed0cbbef0007 /korganizer/koagendaview.cpp
parentc0fa26aa3b33c293853bdd7d028ddb0545e33c85 (diff)
downloadkdepimpi-b76ad1e7e329051a47e28c9d132ce3fcd0b25c5c.zip
kdepimpi-b76ad1e7e329051a47e28c9d132ce3fcd0b25c5c.tar.gz
kdepimpi-b76ad1e7e329051a47e28c9d132ce3fcd0b25c5c.tar.bz2
fixes
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index b9909d6..2996acb 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -395,194 +395,194 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
395 mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 395 mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
396 topLayout->addWidget( mSplitterAgenda ); 396 topLayout->addWidget( mSplitterAgenda );
397 mAllDayFrame = new QHBox(mSplitterAgenda); 397 mAllDayFrame = new QHBox(mSplitterAgenda);
398 mAllDayFrame->setFocusPolicy(NoFocus); 398 mAllDayFrame->setFocusPolicy(NoFocus);
399 QWidget *agendaFrame = new QWidget(mSplitterAgenda); 399 QWidget *agendaFrame = new QWidget(mSplitterAgenda);
400 agendaFrame->setFocusPolicy(NoFocus); 400 agendaFrame->setFocusPolicy(NoFocus);
401 401
402 // Create all-day agenda widget 402 // Create all-day agenda widget
403 mDummyAllDayLeft = new QVBox( mAllDayFrame ); 403 mDummyAllDayLeft = new QVBox( mAllDayFrame );
404 404
405 mExpandButton = new QPushButton(mDummyAllDayLeft); 405 mExpandButton = new QPushButton(mDummyAllDayLeft);
406 mExpandButton->setPixmap( expandPix ); 406 mExpandButton->setPixmap( expandPix );
407 int widebut = mExpandButton->sizeHint().width()+4; 407 int widebut = mExpandButton->sizeHint().width()+4;
408 int heibut = mExpandButton->sizeHint().height()+4; 408 int heibut = mExpandButton->sizeHint().height()+4;
409 if ( heibut > widebut ) 409 if ( heibut > widebut )
410 widebut = heibut ; 410 widebut = heibut ;
411 if ( QApplication::desktop()->width() < 480 ) 411 if ( QApplication::desktop()->width() < 480 )
412 widebut = widebut*3/2; 412 widebut = widebut*3/2;
413 //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, 413 //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed,
414 // QSizePolicy::Fixed ) ); 414 // QSizePolicy::Fixed ) );
415 mExpandButton->setFixedSize( widebut, widebut); 415 mExpandButton->setFixedSize( widebut, widebut);
416 connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); 416 connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) );
417 mExpandButton->setFocusPolicy(NoFocus); 417 mExpandButton->setFocusPolicy(NoFocus);
418 mAllDayAgenda = new KOAgenda(1,mAllDayFrame); 418 mAllDayAgenda = new KOAgenda(1,mAllDayFrame);
419 mAllDayAgenda->setFocusPolicy(NoFocus); 419 mAllDayAgenda->setFocusPolicy(NoFocus);
420 QLabel *dummyAllDayRight = new QLabel (mAllDayFrame); 420 QLabel *dummyAllDayRight = new QLabel (mAllDayFrame);
421 421
422 // Create event context menu for all day agenda 422 // Create event context menu for all day agenda
423 mAllDayAgendaPopup = eventPopup(); 423 mAllDayAgendaPopup = eventPopup();
424 connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), 424 connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
425 mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); 425 mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
426 426
427 // Create agenda frame 427 // Create agenda frame
428 QGridLayout *agendaLayout = new QGridLayout(agendaFrame,4,3); 428 QGridLayout *agendaLayout = new QGridLayout(agendaFrame,4,3);
429 // QHBox *agendaFrame = new QHBox(splitterAgenda); 429 // QHBox *agendaFrame = new QHBox(splitterAgenda);
430 430
431 // create event indicator bars 431 // create event indicator bars
432 mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); 432 mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame);
433#ifndef DESKTOP_VERSION 433#ifndef DESKTOP_VERSION
434 // FIX 434 // FIX
435 mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); 435 mEventIndicatorTop->setPaintWidget( mSplitterAgenda );
436#endif 436#endif
437 mDayLabelsFrame = new QHBox(agendaFrame); 437 mDayLabelsFrame = new QHBox(agendaFrame);
438 //topLayout->addWidget(mDayLabelsFrame); 438 //topLayout->addWidget(mDayLabelsFrame);
439 mDayLabels = new QFrame (mDayLabelsFrame); 439 mDayLabels = new QFrame (mDayLabelsFrame);
440 mLayoutDayLabels = new QHBoxLayout(mDayLabels); 440 mLayoutDayLabels = new QHBoxLayout(mDayLabels);
441 agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2); 441 agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2);
442 agendaLayout->addWidget(mEventIndicatorTop,1,1); 442 agendaLayout->addWidget(mEventIndicatorTop,1,1);
443 443
444 mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, 444 mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom,
445 agendaFrame); 445 agendaFrame);
446 agendaLayout->addWidget(mEventIndicatorBottom,3,1); 446 agendaLayout->addWidget(mEventIndicatorBottom,3,1);
447 QWidget *dummyAgendaRight = new QWidget(agendaFrame); 447 QWidget *dummyAgendaRight = new QWidget(agendaFrame);
448 agendaLayout->addWidget(dummyAgendaRight,1,2); 448 agendaLayout->addWidget(dummyAgendaRight,1,2);
449 449
450 // Create time labels 450 // Create time labels
451 mTimeLabels = new TimeLabels(24,agendaFrame); 451 mTimeLabels = new TimeLabels(24,agendaFrame);
452 agendaLayout->addWidget(mTimeLabels,2,0); 452 agendaLayout->addWidget(mTimeLabels,2,0);
453 connect(mTimeLabels,SIGNAL( scaleChanged()), 453 connect(mTimeLabels,SIGNAL( scaleChanged()),
454 this,SLOT(updateConfig())); 454 this,SLOT(updateConfig()));
455 455
456 // Create agenda 456 // Create agenda
457 mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); 457 mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame);
458 agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2); 458 agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2);
459 agendaLayout->setColStretch(1,1); 459 agendaLayout->setColStretch(1,1);
460 mAgenda->setFocusPolicy(NoFocus); 460 mAgenda->setFocusPolicy(NoFocus);
461 // Create event context menu for agenda 461 // Create event context menu for agenda
462 mAgendaPopup = eventPopup(); 462 mAgendaPopup = eventPopup();
463 463
464 mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), 464 mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")),
465 i18n("Toggle Alarm"),mAgenda, 465 i18n("Toggle Alarm"),mAgenda,
466 SLOT(popupAlarm()),true); 466 SLOT(popupAlarm()),true);
467 467
468 468
469 connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), 469 connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
470 mAgendaPopup,SLOT(showIncidencePopup(Incidence *))); 470 mAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
471 471
472 // make connections between dependent widgets 472 // make connections between dependent widgets
473 mTimeLabels->setAgenda(mAgenda); 473 mTimeLabels->setAgenda(mAgenda);
474 474
475 // Update widgets to reflect user preferences 475 // Update widgets to reflect user preferences
476 // updateConfig(); 476 // updateConfig();
477 477
478 // createDayLabels(); 478 // createDayLabels();
479 479
480 // these blank widgets make the All Day Event box line up with the agenda 480 // these blank widgets make the All Day Event box line up with the agenda
481 dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); 481 dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width());
482 dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); 482 dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width());
483 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); 483 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width());
484 484
485 // Scrolling 485 // Scrolling
486 connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), 486 connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)),
487 mTimeLabels, SLOT(positionChanged())); 487 mTimeLabels, SLOT(positionChanged()));
488 connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)), 488 connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)),
489 SLOT(setContentsPos(int))); 489 SLOT(setContentsPos(int)));
490 490
491 connect(mAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); 491 connect(mAgenda,SIGNAL(showDateView( int, int)),SLOT(slotShowDateView( int, int )));
492 connect(mAllDayAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); 492 connect(mAllDayAgenda,SIGNAL(showDateView( int, int )), SLOT(slotShowDateView( int, int ) ));
493 493
494 // Create/Show/Edit/Delete Event 494 // Create/Show/Edit/Delete Event
495 connect(mAgenda,SIGNAL(newEventSignal(int,int)), 495 connect(mAgenda,SIGNAL(newEventSignal(int,int)),
496 SLOT(newEvent(int,int))); 496 SLOT(newEvent(int,int)));
497 connect(mAgenda,SIGNAL(newTodoSignal(int,int)), 497 connect(mAgenda,SIGNAL(newTodoSignal(int,int)),
498 SLOT(newTodo(int,int))); 498 SLOT(newTodo(int,int)));
499 connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)), 499 connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)),
500 SLOT(newEvent(int,int,int,int))); 500 SLOT(newEvent(int,int,int,int)));
501 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)), 501 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)),
502 SLOT(newEventAllDay(int,int))); 502 SLOT(newEventAllDay(int,int)));
503 connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)), 503 connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)),
504 SLOT(newTodoAllDay(int,int))); 504 SLOT(newTodoAllDay(int,int)));
505 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)), 505 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)),
506 SLOT(newEventAllDay(int,int))); 506 SLOT(newEventAllDay(int,int)));
507 connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), 507 connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)),
508 SLOT(newTimeSpanSelected(int,int,int,int))); 508 SLOT(newTimeSpanSelected(int,int,int,int)));
509 connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), 509 connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)),
510 SLOT(newTimeSpanSelectedAllDay(int,int,int,int))); 510 SLOT(newTimeSpanSelectedAllDay(int,int,int,int)));
511 connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); 511 connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView()));
512 connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); 512 connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView()));
513 513
514 connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)), 514 connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)),
515 SIGNAL(editIncidenceSignal(Incidence *))); 515 SIGNAL(editIncidenceSignal(Incidence *)));
516 connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)), 516 connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)),
517 SIGNAL(editIncidenceSignal(Incidence *))); 517 SIGNAL(editIncidenceSignal(Incidence *)));
518 connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)), 518 connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)),
519 SIGNAL(showIncidenceSignal(Incidence *))); 519 SIGNAL(showIncidenceSignal(Incidence *)));
520 connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)), 520 connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)),
521 SIGNAL(showIncidenceSignal(Incidence *))); 521 SIGNAL(showIncidenceSignal(Incidence *)));
522 connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), 522 connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)),
523 SIGNAL(deleteIncidenceSignal(Incidence *))); 523 SIGNAL(deleteIncidenceSignal(Incidence *)));
524 connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), 524 connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)),
525 SIGNAL(deleteIncidenceSignal(Incidence *))); 525 SIGNAL(deleteIncidenceSignal(Incidence *)));
526 526
527 connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), 527 connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )),
528 SLOT(updateEventDates(KOAgendaItem *, int ))); 528 SLOT(updateEventDates(KOAgendaItem *, int )));
529 connect(mAllDayAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), 529 connect(mAllDayAgenda,SIGNAL(itemModified(KOAgendaItem *, int )),
530 SLOT(updateEventDates(KOAgendaItem *, int))); 530 SLOT(updateEventDates(KOAgendaItem *, int)));
531 531
532 // event indicator update 532 // event indicator update
533 connect(mAgenda,SIGNAL(lowerYChanged(int)), 533 connect(mAgenda,SIGNAL(lowerYChanged(int)),
534 SLOT(updateEventIndicatorTop(int))); 534 SLOT(updateEventIndicatorTop(int)));
535 connect(mAgenda,SIGNAL(upperYChanged(int)), 535 connect(mAgenda,SIGNAL(upperYChanged(int)),
536 SLOT(updateEventIndicatorBottom(int))); 536 SLOT(updateEventIndicatorBottom(int)));
537 // drag signals 537 // drag signals
538 /* 538 /*
539 connect(mAgenda,SIGNAL(startDragSignal(Event *)), 539 connect(mAgenda,SIGNAL(startDragSignal(Event *)),
540 SLOT(startDrag(Event *))); 540 SLOT(startDrag(Event *)));
541 connect(mAllDayAgenda,SIGNAL(startDragSignal(Event *)), 541 connect(mAllDayAgenda,SIGNAL(startDragSignal(Event *)),
542 SLOT(startDrag(Event *))); 542 SLOT(startDrag(Event *)));
543 */ 543 */
544 // synchronize selections 544 // synchronize selections
545 connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), 545 connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ),
546 mAllDayAgenda, SLOT( deselectItem() ) ); 546 mAllDayAgenda, SLOT( deselectItem() ) );
547 connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), 547 connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ),
548 mAgenda, SLOT( deselectItem() ) ); 548 mAgenda, SLOT( deselectItem() ) );
549 connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), 549 connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ),
550 SIGNAL( incidenceSelected( Incidence * ) ) ); 550 SIGNAL( incidenceSelected( Incidence * ) ) );
551 connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), 551 connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ),
552 SIGNAL( incidenceSelected( Incidence * ) ) ); 552 SIGNAL( incidenceSelected( Incidence * ) ) );
553 connect( mAgenda, SIGNAL( resizedSignal() ), 553 connect( mAgenda, SIGNAL( resizedSignal() ),
554 SLOT( updateConfig( ) ) ); 554 SLOT( updateConfig( ) ) );
555 connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ), 555 connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ),
556 SLOT( addToCalSlot(Incidence *, Incidence * ) ) ); 556 SLOT( addToCalSlot(Incidence *, Incidence * ) ) );
557 connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ), 557 connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ),
558 SLOT( addToCalSlot(Incidence * , Incidence *) ) ); 558 SLOT( addToCalSlot(Incidence * , Incidence *) ) );
559 // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); 559 // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) );
560 //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); 560 //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) );
561 561
562 562
563} 563}
564 564
565void KOAgendaView::toggleAllDay() 565void KOAgendaView::toggleAllDay()
566{ 566{
567 if ( mSplitterAgenda->firstHandle() ) 567 if ( mSplitterAgenda->firstHandle() )
568 mSplitterAgenda->firstHandle()->toggle(); 568 mSplitterAgenda->firstHandle()->toggle();
569} 569}
570void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) 570void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld )
571{ 571{
572 calendar()->addIncidence( inc ); 572 calendar()->addIncidence( inc );
573 573
574 if ( incOld ) { 574 if ( incOld ) {
575 if ( incOld->type() == "Todo" ) 575 if ( incOld->type() == "Todo" )
576 emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); 576 emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED );
577 else 577 else
578 emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); 578 emit incidenceChanged(incOld, KOGlobals::EVENTEDITED);
579 } 579 }
580 580
581} 581}
582 582
583KOAgendaView::~KOAgendaView() 583KOAgendaView::~KOAgendaView()
584{ 584{
585 delete mAgendaPopup; 585 delete mAgendaPopup;
586 delete mAllDayAgendaPopup; 586 delete mAllDayAgendaPopup;
587 delete KOAgendaItem::paintPix(); 587 delete KOAgendaItem::paintPix();
588 delete KOAgendaItem::paintPixSel(); 588 delete KOAgendaItem::paintPixSel();
@@ -1217,192 +1217,203 @@ void KOAgendaView::fillAgenda()
1217 if ( todo->hasCompletedDate() ) 1217 if ( todo->hasCompletedDate() )
1218 dt = todo->completed(); 1218 dt = todo->completed();
1219 else 1219 else
1220 dt = todo->dtDue();; 1220 dt = todo->dtDue();;
1221 1221
1222 1222
1223 int endY = mAgenda->timeToY(dt.time()) - 1; 1223 int endY = mAgenda->timeToY(dt.time()) - 1;
1224 int hi = (18/KOPrefs::instance()->mHourSize); 1224 int hi = (18/KOPrefs::instance()->mHourSize);
1225 //qDebug("hei %d ",KOPrefs::instance()->mHourSize); 1225 //qDebug("hei %d ",KOPrefs::instance()->mHourSize);
1226 int startY = endY -hi; 1226 int startY = endY -hi;
1227 1227
1228 mAgenda->insertItem(todo,currentDate,curCol,startY,endY); 1228 mAgenda->insertItem(todo,currentDate,curCol,startY,endY);
1229 1229
1230 if (startY < mMinY[curCol]) mMinY[curCol] = startY; 1230 if (startY < mMinY[curCol]) mMinY[curCol] = startY;
1231 if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; 1231 if (endY > mMaxY[curCol]) mMaxY[curCol] = endY;
1232 } 1232 }
1233 } 1233 }
1234 } 1234 }
1235 // ---------- display Todos] -------------- 1235 // ---------- display Todos] --------------
1236 1236
1237 ++curCol; 1237 ++curCol;
1238 } 1238 }
1239 mAgenda->hideUnused(); 1239 mAgenda->hideUnused();
1240 mAllDayAgenda->hideUnused(); 1240 mAllDayAgenda->hideUnused();
1241 mAgenda->checkScrollBoundaries(); 1241 mAgenda->checkScrollBoundaries();
1242 1242
1243 deleteSelectedDateTime(); 1243 deleteSelectedDateTime();
1244 1244
1245 createDayLabels(); 1245 createDayLabels();
1246 emit incidenceSelected( 0 ); 1246 emit incidenceSelected( 0 );
1247 1247
1248 if ( globalFlagBlockAgenda == 2 ) { 1248 if ( globalFlagBlockAgenda == 2 ) {
1249 if ( KOPrefs::instance()->mSetTimeToDayStartAt ) 1249 if ( KOPrefs::instance()->mSetTimeToDayStartAt )
1250 setStartHour( KOPrefs::instance()->mDayBegins ); 1250 setStartHour( KOPrefs::instance()->mDayBegins );
1251 else if ( KOPrefs::instance()->mCenterOnCurrentTime ) 1251 else if ( KOPrefs::instance()->mCenterOnCurrentTime )
1252 setStartHour( QTime::currentTime ().hour() ); 1252 setStartHour( QTime::currentTime ().hour() );
1253 // qApp->processEvents(); 1253 // qApp->processEvents();
1254 } 1254 }
1255 qApp->processEvents(); 1255 qApp->processEvents();
1256 //qDebug("qApp->processEvents(); END "); 1256 //qDebug("qApp->processEvents(); END ");
1257 globalFlagBlockAgenda = 0; 1257 globalFlagBlockAgenda = 0;
1258 1258
1259 // mAgenda->hideUnused(); 1259 // mAgenda->hideUnused();
1260 //mAllDayAgenda->hideUnused(); 1260 //mAllDayAgenda->hideUnused();
1261 mAllDayAgenda->drawContentsToPainter(); 1261 mAllDayAgenda->drawContentsToPainter();
1262 mAgenda->drawContentsToPainter(); 1262 mAgenda->drawContentsToPainter();
1263 repaintAgenda(); 1263 repaintAgenda();
1264 onlyOne = false; 1264 onlyOne = false;
1265 // mAgenda->finishUpdate(); 1265 // mAgenda->finishUpdate();
1266 //mAllDayAgenda->finishUpdate(); 1266 //mAllDayAgenda->finishUpdate();
1267 1267
1268 // repaintAgenda(); 1268 // repaintAgenda();
1269 //qApp->processEvents(); 1269 //qApp->processEvents();
1270 // globalFlagBlockAgenda = 0; 1270 // globalFlagBlockAgenda = 0;
1271} 1271}
1272void KOAgendaView::repaintAgenda() 1272void KOAgendaView::repaintAgenda()
1273{ 1273{
1274 // mAllDayAgenda->drawContentsToPainter(); 1274 // mAllDayAgenda->drawContentsToPainter();
1275// mAllDayAgenda->viewport()->repaint( false ); 1275// mAllDayAgenda->viewport()->repaint( false );
1276// mAgenda->drawContentsToPainter(); 1276// mAgenda->drawContentsToPainter();
1277// mAgenda->viewport()->repaint( false ); 1277// mAgenda->viewport()->repaint( false );
1278// qApp->processEvents(); 1278// qApp->processEvents();
1279 1279
1280 //qDebug("KOAgendaView::repaintAgenda() "); 1280 //qDebug("KOAgendaView::repaintAgenda() ");
1281 //qApp->processEvents(); 1281 //qApp->processEvents();
1282 mAgenda->viewport()->repaint( false ); 1282 mAgenda->viewport()->repaint( false );
1283 mAllDayAgenda->viewport()->repaint( false ); 1283 mAllDayAgenda->viewport()->repaint( false );
1284 mAgenda->finishUpdate(); 1284 mAgenda->finishUpdate();
1285 mAllDayAgenda->finishUpdate(); 1285 mAllDayAgenda->finishUpdate();
1286} 1286}
1287 1287
1288 1288
1289void KOAgendaView::clearView() 1289void KOAgendaView::clearView()
1290{ 1290{
1291 // kdDebug() << "ClearView" << endl; 1291 // kdDebug() << "ClearView" << endl;
1292 mAllDayAgenda->clear(); 1292 mAllDayAgenda->clear();
1293 mAgenda->clear(); 1293 mAgenda->clear();
1294} 1294}
1295 1295
1296void KOAgendaView::printPreview(CalPrinter *calPrinter, const QDate &fd, 1296void KOAgendaView::printPreview(CalPrinter *calPrinter, const QDate &fd,
1297 const QDate &td) 1297 const QDate &td)
1298{ 1298{
1299#ifndef KORG_NOPRINTER 1299#ifndef KORG_NOPRINTER
1300 if (fd == td) 1300 if (fd == td)
1301 calPrinter->preview(CalPrinter::Day, fd, td); 1301 calPrinter->preview(CalPrinter::Day, fd, td);
1302 else 1302 else
1303 calPrinter->preview(CalPrinter::Week, fd, td); 1303 calPrinter->preview(CalPrinter::Week, fd, td);
1304#endif 1304#endif
1305} 1305}
1306 1306
1307// void KOAgendaView::updateMovedTodo() 1307// void KOAgendaView::updateMovedTodo()
1308// { 1308// {
1309// // updateConfig(); 1309// // updateConfig();
1310// // emit updateTodoViews(); 1310// // emit updateTodoViews();
1311// } 1311// }
1312 1312
1313void KOAgendaView::slotShowDateView( int mode , int d )
1314{
1315 if ( d >= mSelectedDates.count() ) {
1316 qDebug("KOAgendaView::slotShowDateView datecounterror %d d ", d, mSelectedDates.count() );
1317
1318 } else {
1319 QDate day = mSelectedDates[d];
1320 emit showDateView(mode , day );
1321 }
1322
1323}
1313void KOAgendaView::newEvent(int gx, int gy) 1324void KOAgendaView::newEvent(int gx, int gy)
1314{ 1325{
1315 if (!mSelectedDates.count()) return; 1326 if (!mSelectedDates.count()) return;
1316 1327
1317 QDate day = mSelectedDates[gx]; 1328 QDate day = mSelectedDates[gx];
1318 1329
1319 QTime time = mAgenda->gyToTime(gy); 1330 QTime time = mAgenda->gyToTime(gy);
1320 QDateTime dt(day,time); 1331 QDateTime dt(day,time);
1321 // if ( dt < QDateTime::currentDateTime () ) 1332 // if ( dt < QDateTime::currentDateTime () )
1322 // dt = QDateTime::currentDateTime ().addSecs( 3600 ); 1333 // dt = QDateTime::currentDateTime ().addSecs( 3600 );
1323 emit newEventSignal(dt); 1334 emit newEventSignal(dt);
1324} 1335}
1325 1336
1326void KOAgendaView::newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd) 1337void KOAgendaView::newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd)
1327{ 1338{
1328 if (!mSelectedDates.count()) return; 1339 if (!mSelectedDates.count()) return;
1329 1340
1330 QDate dayStart = mSelectedDates[gxStart]; 1341 QDate dayStart = mSelectedDates[gxStart];
1331 QDate dayEnd = mSelectedDates[gxEnd]; 1342 QDate dayEnd = mSelectedDates[gxEnd];
1332 1343
1333 QTime timeStart = mAgenda->gyToTime(gyStart); 1344 QTime timeStart = mAgenda->gyToTime(gyStart);
1334 QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 ); 1345 QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 );
1335 1346
1336 QDateTime dtStart(dayStart,timeStart); 1347 QDateTime dtStart(dayStart,timeStart);
1337 QDateTime dtEnd(dayEnd,timeEnd); 1348 QDateTime dtEnd(dayEnd,timeEnd);
1338 1349
1339 emit newEventSignal(dtStart,dtEnd); 1350 emit newEventSignal(dtStart,dtEnd);
1340} 1351}
1341 1352
1342void KOAgendaView::newEventAllDay(int gx, int ) 1353void KOAgendaView::newEventAllDay(int gx, int )
1343{ 1354{
1344 if (!mSelectedDates.count()) return; 1355 if (!mSelectedDates.count()) return;
1345 1356
1346 QDate day = mSelectedDates[gx]; 1357 QDate day = mSelectedDates[gx];
1347 1358
1348 emit newEventSignal(day); 1359 emit newEventSignal(day);
1349} 1360}
1350void KOAgendaView::newTodoAllDay(int gx, int ) 1361void KOAgendaView::newTodoAllDay(int gx, int )
1351{ 1362{
1352 if (!mSelectedDates.count()) return; 1363 if (!mSelectedDates.count()) return;
1353 1364
1354 QDateTime day (mSelectedDates[gx] ); 1365 QDateTime day (mSelectedDates[gx] );
1355 emit newTodoSignal(day, true); 1366 emit newTodoSignal(day, true);
1356} 1367}
1357void KOAgendaView::newTodo(int gx, int gy ) 1368void KOAgendaView::newTodo(int gx, int gy )
1358{ 1369{
1359 if (!mSelectedDates.count()) return; 1370 if (!mSelectedDates.count()) return;
1360 QDate dayStart = mSelectedDates[gx]; 1371 QDate dayStart = mSelectedDates[gx];
1361 QTime timeStart = mAgenda->gyToTime(gy); 1372 QTime timeStart = mAgenda->gyToTime(gy);
1362 QDateTime dt (dayStart,timeStart); 1373 QDateTime dt (dayStart,timeStart);
1363 emit newTodoSignal( dt, false ); 1374 emit newTodoSignal( dt, false );
1364} 1375}
1365 1376
1366void KOAgendaView::updateEventIndicatorTop(int newY) 1377void KOAgendaView::updateEventIndicatorTop(int newY)
1367{ 1378{
1368 uint i; 1379 uint i;
1369 for(i=0;i<mMinY.size();++i) { 1380 for(i=0;i<mMinY.size();++i) {
1370 if (newY >= mMinY.at(i)) mEventIndicatorTop->enableColumn(i,true); 1381 if (newY >= mMinY.at(i)) mEventIndicatorTop->enableColumn(i,true);
1371 else mEventIndicatorTop->enableColumn(i,false); 1382 else mEventIndicatorTop->enableColumn(i,false);
1372 } 1383 }
1373 1384
1374 mEventIndicatorTop->update(); 1385 mEventIndicatorTop->update();
1375} 1386}
1376 1387
1377void KOAgendaView::updateEventIndicatorBottom(int newY) 1388void KOAgendaView::updateEventIndicatorBottom(int newY)
1378{ 1389{
1379 uint i; 1390 uint i;
1380 for(i=0;i<mMaxY.size();++i) { 1391 for(i=0;i<mMaxY.size();++i) {
1381 if (newY <= mMaxY.at(i)) mEventIndicatorBottom->enableColumn(i,true); 1392 if (newY <= mMaxY.at(i)) mEventIndicatorBottom->enableColumn(i,true);
1382 else mEventIndicatorBottom->enableColumn(i,false); 1393 else mEventIndicatorBottom->enableColumn(i,false);
1383 } 1394 }
1384 1395
1385 mEventIndicatorBottom->update(); 1396 mEventIndicatorBottom->update();
1386} 1397}
1387 1398
1388void KOAgendaView::startDrag(Event *event) 1399void KOAgendaView::startDrag(Event *event)
1389{ 1400{
1390#ifndef KORG_NODND 1401#ifndef KORG_NODND
1391 DndFactory factory( calendar() ); 1402 DndFactory factory( calendar() );
1392 ICalDrag *vd = factory.createDrag(event,this); 1403 ICalDrag *vd = factory.createDrag(event,this);
1393 if (vd->drag()) { 1404 if (vd->drag()) {
1394 kdDebug() << "KOAgendaView::startDrag(): Delete drag source" << endl; 1405 kdDebug() << "KOAgendaView::startDrag(): Delete drag source" << endl;
1395 } 1406 }
1396#endif 1407#endif
1397} 1408}
1398 1409
1399void KOAgendaView::readSettings() 1410void KOAgendaView::readSettings()
1400{ 1411{
1401 readSettings(KOGlobals::config()); 1412 readSettings(KOGlobals::config());
1402} 1413}
1403 1414
1404void KOAgendaView::readSettings(KConfig *config) 1415void KOAgendaView::readSettings(KConfig *config)
1405{ 1416{
1406 // kdDebug() << "KOAgendaView::readSettings()" << endl; 1417 // kdDebug() << "KOAgendaView::readSettings()" << endl;
1407 1418
1408 config->setGroup("Views"); 1419 config->setGroup("Views");