-rw-r--r-- | korganizer/koagendaview.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 918931a..1908b1c 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -428,27 +428,36 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : | |||
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->setFixedHeight( (dummyAllDayRightB->sizeHint().height()/4)*3 ); | 435 | dummyAllDayRightB->setFixedHeight( (dummyAllDayRightB->sizeHint().height()/4)*3 ); |
436 | |||
436 | QPopupMenu * wpo = new QPopupMenu (this); | 437 | QPopupMenu * wpo = new QPopupMenu (this); |
437 | wpo->insertItem( i18n("W#"), 0 ); | 438 | QPopupMenu * all = new QPopupMenu (this); |
439 | //wpo->insertItem( i18n("W#"), 0 ); | ||
440 | int first = 1; | ||
438 | int i; | 441 | int i; |
439 | for ( i = 1; i < 53; i++ ) | 442 | for ( i = 1; i < 50; ++i ) { |
440 | wpo->insertItem( QString::number( i ),i ); | 443 | if ( !(i%10) ) { |
441 | //Qt bug - we must add some empty fields... | 444 | all->insertItem( i18n("Select week %1-%2" ).arg(first).arg( i-1) ,wpo ); |
442 | for ( i = 53; i < 54; ++i ) { | 445 | connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) ); |
443 | wpo->insertItem( "", 52 ); | 446 | first = i; |
447 | wpo = new QPopupMenu (this); | ||
448 | } | ||
449 | wpo->insertItem( QString::number(i), i ); | ||
450 | } | ||
451 | for ( i = 50; i < 53; ++i ) { | ||
452 | wpo->insertItem( QString::number(i), i); | ||
444 | } | 453 | } |
445 | dummyAllDayRightB->setPopup( wpo ); | 454 | all->insertItem( i18n("Select week %1-%2" ).arg(first).arg( i-1) ,wpo ); |
446 | 455 | dummyAllDayRightB->setPopup( all ); | |
447 | connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) ); | 456 | connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) ); |
448 | 457 | ||
449 | // Create event context menu for all day agenda | 458 | // Create event context menu for all day agenda |
450 | mAllDayAgendaPopup = eventPopup(); | 459 | mAllDayAgendaPopup = eventPopup(); |
451 | connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), | 460 | connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), |
452 | mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); | 461 | mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); |
453 | 462 | ||
454 | // Create agenda frame | 463 | // Create agenda frame |
@@ -576,17 +585,17 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : | |||
576 | SLOT( addToCalSlot(Incidence * , Incidence *) ) ); | 585 | SLOT( addToCalSlot(Incidence * , Incidence *) ) ); |
577 | // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); | 586 | // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); |
578 | //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); | 587 | //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); |
579 | 588 | ||
580 | QFont dlf = KOPrefs::instance()->mTimeLabelsFont; | 589 | QFont dlf = KOPrefs::instance()->mTimeLabelsFont; |
581 | QFontMetrics fm ( dlf ); | 590 | QFontMetrics fm ( dlf ); |
582 | QString dayTest = "30"; | 591 | QString dayTest = "30"; |
583 | int wid = fm.width( dayTest ); | 592 | int wid = fm.width( dayTest ); |
584 | int maxWid = dummyAllDayRight->width(); | 593 | int maxWid = dummyAllDayRight->width()-2; |
585 | int fontPoint = dlf.pointSize(); | 594 | int fontPoint = dlf.pointSize(); |
586 | while ( wid > maxWid ) { | 595 | while ( wid > maxWid ) { |
587 | --fontPoint; | 596 | --fontPoint; |
588 | dlf.setPointSize( fontPoint ); | 597 | dlf.setPointSize( fontPoint ); |
589 | QFontMetrics f( dlf ); | 598 | QFontMetrics f( dlf ); |
590 | wid = f.width( dayTest ); | 599 | wid = f.width( dayTest ); |
591 | } | 600 | } |
592 | mDummyAllDayRightL->setFont( dlf ); | 601 | mDummyAllDayRightL->setFont( dlf ); |