summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
authorzautrix <zautrix>2005-04-02 12:16:34 (UTC)
committer zautrix <zautrix>2005-04-02 12:16:34 (UTC)
commit997e7660a81baa2b8aeb1b66a3cc3ebe54e00ebe (patch) (unidiff)
treef788b37459574b5cea0d2ab874882c6a396c240d /korganizer/koagendaview.cpp
parente0d51120d2f0c178115746e0c1357af40f95bc77 (diff)
downloadkdepimpi-997e7660a81baa2b8aeb1b66a3cc3ebe54e00ebe.zip
kdepimpi-997e7660a81baa2b8aeb1b66a3cc3ebe54e00ebe.tar.gz
kdepimpi-997e7660a81baa2b8aeb1b66a3cc3ebe54e00ebe.tar.bz2
more fixes
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 8d32152..95388ef 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -484,97 +484,99 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
484 mAllDayFrame->setFocusPolicy(NoFocus); 484 mAllDayFrame->setFocusPolicy(NoFocus);
485 QWidget *agendaFrame = new QWidget(mSplitterAgenda); 485 QWidget *agendaFrame = new QWidget(mSplitterAgenda);
486 agendaFrame->setFocusPolicy(NoFocus); 486 agendaFrame->setFocusPolicy(NoFocus);
487 487
488 // Create all-day agenda widget 488 // Create all-day agenda widget
489 mDummyAllDayLeft = new QVBox( mAllDayFrame ); 489 mDummyAllDayLeft = new QVBox( mAllDayFrame );
490 490
491 mExpandButton = new QPushButton(mDummyAllDayLeft); 491 mExpandButton = new QPushButton(mDummyAllDayLeft);
492 mExpandButton->setPixmap( expandPix ); 492 mExpandButton->setPixmap( expandPix );
493 int widebut = mExpandButton->sizeHint().width()+4; 493 int widebut = mExpandButton->sizeHint().width()+4;
494 int heibut = mExpandButton->sizeHint().height()+4; 494 int heibut = mExpandButton->sizeHint().height()+4;
495 if ( heibut > widebut ) 495 if ( heibut > widebut )
496 widebut = heibut ; 496 widebut = heibut ;
497 497
498 //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, 498 //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed,
499 // QSizePolicy::Fixed ) ); 499 // QSizePolicy::Fixed ) );
500 mExpandButton->setFixedSize( widebut, widebut); 500 mExpandButton->setFixedSize( widebut, widebut);
501 connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); 501 connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) );
502 mExpandButton->setFocusPolicy(NoFocus); 502 mExpandButton->setFocusPolicy(NoFocus);
503 mAllDayAgenda = new KOAgenda(1,mAllDayFrame); 503 mAllDayAgenda = new KOAgenda(1,mAllDayFrame);
504 mAllDayAgenda->setFocusPolicy(NoFocus); 504 mAllDayAgenda->setFocusPolicy(NoFocus);
505 QLabel *dummyAllDayRight = new QLabel (mAllDayFrame); 505 QLabel *dummyAllDayRight = new QLabel (mAllDayFrame);
506 506
507 // Create event context menu for all day agenda 507 // Create event context menu for all day agenda
508 mAllDayAgendaPopup = eventPopup(); 508 //mAllDayAgendaPopup = eventPopup();
509 connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
510 mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
511 509
512 // Create agenda frame 510 // Create agenda frame
513 QGridLayout *agendaLayout = new QGridLayout(agendaFrame,4,3); 511 QGridLayout *agendaLayout = new QGridLayout(agendaFrame,4,3);
514 // QHBox *agendaFrame = new QHBox(splitterAgenda); 512 // QHBox *agendaFrame = new QHBox(splitterAgenda);
515 513
516 // create event indicator bars 514 // create event indicator bars
517 mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); 515 mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame);
518#ifndef DESKTOP_VERSION 516#ifndef DESKTOP_VERSION
519 // FIX 517 // FIX
520 mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); 518 mEventIndicatorTop->setPaintWidget( mSplitterAgenda );
521#endif 519#endif
522 mDayLabelsFrame = new QHBox(agendaFrame); 520 mDayLabelsFrame = new QHBox(agendaFrame);
523 //topLayout->addWidget(mDayLabelsFrame); 521 //topLayout->addWidget(mDayLabelsFrame);
524 mDayLabels = new QFrame (mDayLabelsFrame); 522 mDayLabels = new QFrame (mDayLabelsFrame);
525 mLayoutDayLabels = new QHBoxLayout(mDayLabels); 523 mLayoutDayLabels = new QHBoxLayout(mDayLabels);
526 agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2); 524 agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2);
527 agendaLayout->addWidget(mEventIndicatorTop,1,1); 525 agendaLayout->addWidget(mEventIndicatorTop,1,1);
528 526
529 mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, 527 mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom,
530 agendaFrame); 528 agendaFrame);
531 agendaLayout->addWidget(mEventIndicatorBottom,3,1); 529 agendaLayout->addWidget(mEventIndicatorBottom,3,1);
532 QWidget *dummyAgendaRight = new QWidget(agendaFrame); 530 QWidget *dummyAgendaRight = new QWidget(agendaFrame);
533 agendaLayout->addWidget(dummyAgendaRight,1,2); 531 agendaLayout->addWidget(dummyAgendaRight,1,2);
534 532
535 // Create time labels 533 // Create time labels
536 mTimeLabels = new TimeLabels(24,agendaFrame); 534 mTimeLabels = new TimeLabels(24,agendaFrame);
537 agendaLayout->addWidget(mTimeLabels,2,0); 535 agendaLayout->addWidget(mTimeLabels,2,0);
538 connect(mTimeLabels,SIGNAL( scaleChanged()), 536 connect(mTimeLabels,SIGNAL( scaleChanged()),
539 this,SLOT(updateConfig())); 537 this,SLOT(updateConfig()));
540 538
541 // Create agenda 539 // Create agenda
542 mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); 540 mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame);
543 agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2); 541 agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2);
544 agendaLayout->setColStretch(1,1); 542 agendaLayout->setColStretch(1,1);
545 mAgenda->setFocusPolicy(NoFocus); 543 mAgenda->setFocusPolicy(NoFocus);
546 // Create event context menu for agenda 544 // Create event context menu for agenda
547 mAgendaPopup = eventPopup(); 545 mAllAgendaPopup = eventPopup();
548 546
549 mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), 547 mAllAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")),
550 i18n("Toggle Alarm"),mAgenda, 548 i18n("Toggle Alarm"),mAgenda,
551 SLOT(popupAlarm()),true); 549 SLOT(popupAlarm()),true);
552 550
553 551
554 connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), 552 connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
555 mAgendaPopup,SLOT(showIncidencePopup(Incidence *))); 553 mAllAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
556 554
555 connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
556 mAllAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
557 mAgenda->setPopup( mAllAgendaPopup );
558 mAllDayAgenda->setPopup( mAllAgendaPopup );
557 // make connections between dependent widgets 559 // make connections between dependent widgets
558 mTimeLabels->setAgenda(mAgenda); 560 mTimeLabels->setAgenda(mAgenda);
559 561
560 // Update widgets to reflect user preferences 562 // Update widgets to reflect user preferences
561 // updateConfig(); 563 // updateConfig();
562 564
563 // createDayLabels(); 565 // createDayLabels();
564 566
565 // these blank widgets make the All Day Event box line up with the agenda 567 // these blank widgets make the All Day Event box line up with the agenda
566 dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); 568 dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width());
567 dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); 569 dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width());
568 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); 570 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width());
569 571
570 // Scrolling 572 // Scrolling
571 connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), 573 connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)),
572 mTimeLabels, SLOT(positionChanged())); 574 mTimeLabels, SLOT(positionChanged()));
573 connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)), 575 connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)),
574 SLOT(setContentsPos(int))); 576 SLOT(setContentsPos(int)));
575 577
576 connect(mAgenda,SIGNAL(showDateView( int, int)),SLOT(slotShowDateView( int, int ))); 578 connect(mAgenda,SIGNAL(showDateView( int, int)),SLOT(slotShowDateView( int, int )));
577 connect(mAllDayAgenda,SIGNAL(showDateView( int, int )), SLOT(slotShowDateView( int, int ) )); 579 connect(mAllDayAgenda,SIGNAL(showDateView( int, int )), SLOT(slotShowDateView( int, int ) ));
578 580
579 // Create/Show/Edit/Delete Event 581 // Create/Show/Edit/Delete Event
580 connect(mAgenda,SIGNAL(newEventSignal(int,int)), 582 connect(mAgenda,SIGNAL(newEventSignal(int,int)),
@@ -646,50 +648,50 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
646 648
647 649
648} 650}
649 651
650void KOAgendaView::toggleAllDay() 652void KOAgendaView::toggleAllDay()
651{ 653{
652 if ( mSplitterAgenda->firstHandle() ) 654 if ( mSplitterAgenda->firstHandle() )
653 mSplitterAgenda->firstHandle()->toggle(); 655 mSplitterAgenda->firstHandle()->toggle();
654} 656}
655void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) 657void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld )
656{ 658{
657 calendar()->addIncidence( inc ); 659 calendar()->addIncidence( inc );
658 660
659 if ( incOld ) { 661 if ( incOld ) {
660 if ( incOld->type() == "Todo" ) 662 if ( incOld->type() == "Todo" )
661 emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); 663 emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED );
662 else 664 else
663 emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); 665 emit incidenceChanged(incOld, KOGlobals::EVENTEDITED);
664 } 666 }
665 667
666} 668}
667 669
668KOAgendaView::~KOAgendaView() 670KOAgendaView::~KOAgendaView()
669{ 671{
670 delete mAgendaPopup; 672 delete mAllAgendaPopup;
671 delete mAllDayAgendaPopup; 673 //delete mAllDayAgendaPopup;
672 delete KOAgendaItem::paintPix(); 674 delete KOAgendaItem::paintPix();
673 delete KOAgendaItem::paintPixSel(); 675 delete KOAgendaItem::paintPixSel();
674} 676}
675void KOAgendaView::resizeEvent( QResizeEvent* e ) 677void KOAgendaView::resizeEvent( QResizeEvent* e )
676{ 678{
677 //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); 679 //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width());
678 bool uc = false; 680 bool uc = false;
679 int ow = e->oldSize().width(); 681 int ow = e->oldSize().width();
680 int oh = e->oldSize().height(); 682 int oh = e->oldSize().height();
681 int w = e->size().width(); 683 int w = e->size().width();
682 int h = e->size().height(); 684 int h = e->size().height();
683 if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) { 685 if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) {
684 if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda ) 686 if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda )
685 uc = true; 687 uc = true;
686 //qDebug("view changed %d %d %d %d ", ow, oh , w , h); 688 //qDebug("view changed %d %d %d %d ", ow, oh , w , h);
687 } 689 }
688 mUpcomingWidth = e->size().width() ; 690 mUpcomingWidth = e->size().width() ;
689 if ( mBlockUpdating || uc ) { 691 if ( mBlockUpdating || uc ) {
690 mBlockUpdating = false; 692 mBlockUpdating = false;
691 //mAgenda->setMinimumSize(800 , 600 ); 693 //mAgenda->setMinimumSize(800 , 600 );
692 //qDebug("mAgenda->resize+++++++++++++++ "); 694 //qDebug("mAgenda->resize+++++++++++++++ ");
693 updateConfig(); 695 updateConfig();
694 //qDebug("KOAgendaView::Updating now possible "); 696 //qDebug("KOAgendaView::Updating now possible ");
695 } else 697 } else