summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index f8301f8..918931a 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -403,65 +403,64 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
403 topLayout->addWidget( mSplitterAgenda ); 403 topLayout->addWidget( mSplitterAgenda );
404 mAllDayFrame = new QHBox(mSplitterAgenda); 404 mAllDayFrame = new QHBox(mSplitterAgenda);
405 mAllDayFrame->setFocusPolicy(NoFocus); 405 mAllDayFrame->setFocusPolicy(NoFocus);
406 QWidget *agendaFrame = new QWidget(mSplitterAgenda); 406 QWidget *agendaFrame = new QWidget(mSplitterAgenda);
407 agendaFrame->setFocusPolicy(NoFocus); 407 agendaFrame->setFocusPolicy(NoFocus);
408 408
409#endif 409#endif
410 410
411 // Create all-day agenda widget 411 // Create all-day agenda widget
412 mDummyAllDayLeft = new QVBox( mAllDayFrame ); 412 mDummyAllDayLeft = new QVBox( mAllDayFrame );
413 413
414 mExpandButton = new QPushButton(mDummyAllDayLeft); 414 mExpandButton = new QPushButton(mDummyAllDayLeft);
415 mExpandButton->setPixmap( mNotExpandedPixmap ); 415 mExpandButton->setPixmap( mNotExpandedPixmap );
416 int widebut = mExpandButton->sizeHint().width(); 416 int widebut = mExpandButton->sizeHint().width();
417 if ( QApplication::desktop()->width() < 480 ) 417 if ( QApplication::desktop()->width() < 480 )
418 widebut = widebut*2; 418 widebut = widebut*2;
419 else 419 else
420 widebut = (widebut*3) / 2; 420 widebut = (widebut*3) / 2;
421 //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, 421 //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed,
422 // QSizePolicy::Fixed ) ); 422 // QSizePolicy::Fixed ) );
423 mExpandButton->setFixedSize( widebut, widebut); 423 mExpandButton->setFixedSize( widebut, widebut);
424 connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); 424 connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) );
425 mExpandButton->setFocusPolicy(NoFocus); 425 mExpandButton->setFocusPolicy(NoFocus);
426 mAllDayAgenda = new KOAgenda(1,mAllDayFrame); 426 mAllDayAgenda = new KOAgenda(1,mAllDayFrame);
427 mAllDayAgenda->setFocusPolicy(NoFocus); 427 mAllDayAgenda->setFocusPolicy(NoFocus);
428 QVBox *dummyAllDayRight = new QVBox(mAllDayFrame); 428 QVBox *dummyAllDayRight = new QVBox(mAllDayFrame);
429 429
430 QPushButton *dummyAllDayRightB = new QPushButton(dummyAllDayRight); 430 QPushButton *dummyAllDayRightB = new QPushButton(dummyAllDayRight);
431 mDummyAllDayRightL = new QLabel ( dummyAllDayRight ); 431 mDummyAllDayRightL = new QLabel ( dummyAllDayRight );
432 432
433 dummyAllDayRightB->setFlat( true ); 433 dummyAllDayRightB->setFlat( true );
434 dummyAllDayRightB->setFocusPolicy(NoFocus); 434 dummyAllDayRightB->setFocusPolicy(NoFocus);
435 // dummyAllDayRightB->setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding ));
436 dummyAllDayRightB->setFixedHeight( (dummyAllDayRightB->sizeHint().height()/4)*3 ); 435 dummyAllDayRightB->setFixedHeight( (dummyAllDayRightB->sizeHint().height()/4)*3 );
437 QPopupMenu * wpo = new QPopupMenu (this); 436 QPopupMenu * wpo = new QPopupMenu (this);
438 wpo->insertItem( i18n("W#"), 0 ); 437 wpo->insertItem( i18n("W#"), 0 );
439 int i; 438 int i;
440 for ( i = 1; i < 53; i++ ) 439 for ( i = 1; i < 53; i++ )
441 wpo->insertItem( QString::number( i ),i ); 440 wpo->insertItem( QString::number( i ),i );
442 //Qt bug - we must add some empty fields... 441 //Qt bug - we must add some empty fields...
443 for ( i = 53; i < 54; ++i ) { 442 for ( i = 53; i < 54; ++i ) {
444 wpo->insertItem( "", 52 ); 443 wpo->insertItem( "", 52 );
445 } 444 }
446 dummyAllDayRightB->setPopup( wpo ); 445 dummyAllDayRightB->setPopup( wpo );
447 446
448 connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) ); 447 connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) );
449 448
450 // Create event context menu for all day agenda 449 // Create event context menu for all day agenda
451 mAllDayAgendaPopup = eventPopup(); 450 mAllDayAgendaPopup = eventPopup();
452 connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), 451 connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
453 mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); 452 mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
454 453
455 // Create agenda frame 454 // Create agenda frame
456 QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3); 455 QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3);
457 // QHBox *agendaFrame = new QHBox(splitterAgenda); 456 // QHBox *agendaFrame = new QHBox(splitterAgenda);
458 457
459 // create event indicator bars 458 // create event indicator bars
460 mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); 459 mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame);
461 agendaLayout->addWidget(mEventIndicatorTop,0,1); 460 agendaLayout->addWidget(mEventIndicatorTop,0,1);
462 mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); 461 mEventIndicatorTop->setPaintWidget( mSplitterAgenda );
463 mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, 462 mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom,
464 agendaFrame); 463 agendaFrame);
465 agendaLayout->addWidget(mEventIndicatorBottom,2,1); 464 agendaLayout->addWidget(mEventIndicatorBottom,2,1);
466 QWidget *dummyAgendaRight = new QWidget(agendaFrame); 465 QWidget *dummyAgendaRight = new QWidget(agendaFrame);
467 agendaLayout->addWidget(dummyAgendaRight,0,2); 466 agendaLayout->addWidget(dummyAgendaRight,0,2);
@@ -562,65 +561,65 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
562 */ 561 */
563 // synchronize selections 562 // synchronize selections
564 connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), 563 connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ),
565 mAllDayAgenda, SLOT( deselectItem() ) ); 564 mAllDayAgenda, SLOT( deselectItem() ) );
566 connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), 565 connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ),
567 mAgenda, SLOT( deselectItem() ) ); 566 mAgenda, SLOT( deselectItem() ) );
568 connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), 567 connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ),
569 SIGNAL( incidenceSelected( Incidence * ) ) ); 568 SIGNAL( incidenceSelected( Incidence * ) ) );
570 connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), 569 connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ),
571 SIGNAL( incidenceSelected( Incidence * ) ) ); 570 SIGNAL( incidenceSelected( Incidence * ) ) );
572 connect( mAgenda, SIGNAL( resizedSignal() ), 571 connect( mAgenda, SIGNAL( resizedSignal() ),
573 SLOT( updateConfig( ) ) ); 572 SLOT( updateConfig( ) ) );
574 connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ), 573 connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ),
575 SLOT( addToCalSlot(Incidence *, Incidence * ) ) ); 574 SLOT( addToCalSlot(Incidence *, Incidence * ) ) );
576 connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ), 575 connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ),
577 SLOT( addToCalSlot(Incidence * , Incidence *) ) ); 576 SLOT( addToCalSlot(Incidence * , Incidence *) ) );
578 // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); 577 // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) );
579 //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); 578 //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) );
580 579
581 QFont dlf = KOPrefs::instance()->mTimeLabelsFont; 580 QFont dlf = KOPrefs::instance()->mTimeLabelsFont;
582 QFontMetrics fm ( dlf ); 581 QFontMetrics fm ( dlf );
583 QString dayTest = "30"; 582 QString dayTest = "30";
584 int wid = fm.width( dayTest ); 583 int wid = fm.width( dayTest );
585 int maxWid = dummyAllDayRight->width(); 584 int maxWid = dummyAllDayRight->width();
586 int fontPoint = dlf.pointSize(); 585 int fontPoint = dlf.pointSize();
587 while ( wid > maxWid ) { 586 while ( wid > maxWid ) {
588 --fontPoint; 587 --fontPoint;
589 dlf.setPointSize( fontPoint ); 588 dlf.setPointSize( fontPoint );
590 QFontMetrics f( dlf ); 589 QFontMetrics f( dlf );
591 wid = f.width( dayTest ); 590 wid = f.width( dayTest );
592 } 591 }
593 mDummyAllDayRightL->setFont( dlf ); 592 mDummyAllDayRightL->setFont( dlf );
594 593 mDummyAllDayRightL->setAlignment( AlignHCenter );
595} 594}
596 595
597void KOAgendaView::toggleAllDay() 596void KOAgendaView::toggleAllDay()
598{ 597{
599 if ( mSplitterAgenda->firstHandle() ) 598 if ( mSplitterAgenda->firstHandle() )
600 mSplitterAgenda->firstHandle()->toggle(); 599 mSplitterAgenda->firstHandle()->toggle();
601} 600}
602void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) 601void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld )
603{ 602{
604 calendar()->addIncidence( inc ); 603 calendar()->addIncidence( inc );
605 604
606 if ( incOld ) { 605 if ( incOld ) {
607 if ( incOld->type() == "Todo" ) 606 if ( incOld->type() == "Todo" )
608 emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); 607 emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED );
609 else 608 else
610 emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); 609 emit incidenceChanged(incOld, KOGlobals::EVENTEDITED);
611 } 610 }
612 611
613} 612}
614 613
615KOAgendaView::~KOAgendaView() 614KOAgendaView::~KOAgendaView()
616{ 615{
617 delete mAgendaPopup; 616 delete mAgendaPopup;
618 delete mAllDayAgendaPopup; 617 delete mAllDayAgendaPopup;
619 delete KOAgendaItem::paintPix(); 618 delete KOAgendaItem::paintPix();
620 delete KOAgendaItem::paintPixSel(); 619 delete KOAgendaItem::paintPixSel();
621} 620}
622void KOAgendaView::resizeEvent( QResizeEvent* e ) 621void KOAgendaView::resizeEvent( QResizeEvent* e )
623{ 622{
624 //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); 623 //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width());
625 bool uc = false; 624 bool uc = false;
626 int ow = e->oldSize().width(); 625 int ow = e->oldSize().width();