-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 @@ -424,35 +424,44 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); mExpandButton->setFocusPolicy(NoFocus); mAllDayAgenda = new KOAgenda(1,mAllDayFrame); mAllDayAgenda->setFocusPolicy(NoFocus); QVBox *dummyAllDayRight = new QVBox(mAllDayFrame); QPushButton *dummyAllDayRightB = new QPushButton(dummyAllDayRight); mDummyAllDayRightL = new QLabel ( dummyAllDayRight ); dummyAllDayRightB->setFlat( true ); dummyAllDayRightB->setFocusPolicy(NoFocus); dummyAllDayRightB->setFixedHeight( (dummyAllDayRightB->sizeHint().height()/4)*3 ); + QPopupMenu * wpo = new QPopupMenu (this); - wpo->insertItem( i18n("W#"), 0 ); + QPopupMenu * all = new QPopupMenu (this); + //wpo->insertItem( i18n("W#"), 0 ); + int first = 1; int i; - for ( i = 1; i < 53; i++ ) - wpo->insertItem( QString::number( i ),i ); - //Qt bug - we must add some empty fields... - for ( i = 53; i < 54; ++i ) { - wpo->insertItem( "", 52 ); + for ( i = 1; i < 50; ++i ) { + if ( !(i%10) ) { + all->insertItem( i18n("Select week %1-%2" ).arg(first).arg( i-1) ,wpo ); + connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) ); + first = i; + wpo = new QPopupMenu (this); + } + wpo->insertItem( QString::number(i), i ); + } + for ( i = 50; i < 53; ++i ) { + wpo->insertItem( QString::number(i), i); } - dummyAllDayRightB->setPopup( wpo ); - + all->insertItem( i18n("Select week %1-%2" ).arg(first).arg( i-1) ,wpo ); + dummyAllDayRightB->setPopup( all ); connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) ); // Create event context menu for all day agenda mAllDayAgendaPopup = eventPopup(); connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); // Create agenda frame QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3); // QHBox *agendaFrame = new QHBox(splitterAgenda); // create event indicator bars @@ -572,25 +581,25 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : SLOT( updateConfig( ) ) ); connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ), SLOT( addToCalSlot(Incidence *, Incidence * ) ) ); connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ), SLOT( addToCalSlot(Incidence * , Incidence *) ) ); // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); QFont dlf = KOPrefs::instance()->mTimeLabelsFont; QFontMetrics fm ( dlf ); QString dayTest = "30"; int wid = fm.width( dayTest ); - int maxWid = dummyAllDayRight->width(); + int maxWid = dummyAllDayRight->width()-2; int fontPoint = dlf.pointSize(); while ( wid > maxWid ) { --fontPoint; dlf.setPointSize( fontPoint ); QFontMetrics f( dlf ); wid = f.width( dayTest ); } mDummyAllDayRightL->setFont( dlf ); mDummyAllDayRightL->setAlignment( AlignHCenter ); } void KOAgendaView::toggleAllDay() |