summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/ui/opimrecurrencewidget.cpp
Unidiff
Diffstat (limited to 'libopie2/opiepim/ui/opimrecurrencewidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/ui/opimrecurrencewidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie2/opiepim/ui/opimrecurrencewidget.cpp b/libopie2/opiepim/ui/opimrecurrencewidget.cpp
index 569bdd5..90c1a5f 100644
--- a/libopie2/opiepim/ui/opimrecurrencewidget.cpp
+++ b/libopie2/opiepim/ui/opimrecurrencewidget.cpp
@@ -507,98 +507,98 @@ void OPimRecurrenceWidget::setupWeekly() {
507 // might as well set the day too... 507 // might as well set the day too...
508 if ( startWeekOnMonday ) { 508 if ( startWeekOnMonday ) {
509 fraExtra->setButton( start.dayOfWeek() - 1 ); 509 fraExtra->setButton( start.dayOfWeek() - 1 );
510 } else { 510 } else {
511 fraExtra->setButton( start.dayOfWeek() % 7 ); 511 fraExtra->setButton( start.dayOfWeek() % 7 );
512 } 512 }
513 lblFreq->setText( tr("week(s)") ); 513 lblFreq->setText( tr("week(s)") );
514 lblVar2->show(); 514 lblVar2->show();
515 showRepeatStuff(); 515 showRepeatStuff();
516 setupRepeatLabel( 1 ); 516 setupRepeatLabel( 1 );
517} 517}
518void OPimRecurrenceWidget::setupMonthly() { 518void OPimRecurrenceWidget::setupMonthly() {
519 hideExtras(); 519 hideExtras();
520 lblWeekVar->hide(); 520 lblWeekVar->hide();
521 fraExtra->setTitle( tr("Repeat By") ); 521 fraExtra->setTitle( tr("Repeat By") );
522 fraExtra->setExclusive( TRUE ); 522 fraExtra->setExclusive( TRUE );
523 fraExtra->show(); 523 fraExtra->show();
524 cmdExtra1->setText( tr("Day") ); 524 cmdExtra1->setText( tr("Day") );
525 cmdExtra1->show(); 525 cmdExtra1->show();
526 cmdExtra2->setText( tr("Date") ); 526 cmdExtra2->setText( tr("Date") );
527 cmdExtra2->show(); 527 cmdExtra2->show();
528 spinFreq->setValue( 1 ); 528 spinFreq->setValue( 1 );
529 lblFreq->setText( tr("month(s)") ); 529 lblFreq->setText( tr("month(s)") );
530 lblVar2->show(); 530 lblVar2->show();
531 showRepeatStuff(); 531 showRepeatStuff();
532 setupRepeatLabel( 1 ); 532 setupRepeatLabel( 1 );
533} 533}
534void OPimRecurrenceWidget::setupYearly() { 534void OPimRecurrenceWidget::setupYearly() {
535hideExtras(); 535hideExtras();
536 lblWeekVar->hide(); 536 lblWeekVar->hide();
537 spinFreq->setValue( 1 ); 537 spinFreq->setValue( 1 );
538 lblFreq->setText( tr("year(s)") ); 538 lblFreq->setText( tr("year(s)") );
539 lblFreq->show(); 539 lblFreq->show();
540 lblFreq->show(); 540 lblFreq->show();
541 showRepeatStuff(); 541 showRepeatStuff();
542 lblVar2->show(); 542 lblVar2->show();
543 QString strEvery = strYearTemplate.arg( start.monthName(start.month()) ).arg( numberPlacing(start.day()) ); 543 QString strEvery = strYearTemplate.arg( start.monthName(start.month()) ).arg( numberPlacing(start.day()) );
544 lblRepeat->setText( strEvery ); 544 lblRepeat->setText( strEvery );
545 setupRepeatLabel( 1 ); 545 setupRepeatLabel( 1 );
546 546
547} 547}
548void OPimRecurrenceWidget::init() { 548void OPimRecurrenceWidget::init() {
549 QPopupMenu *m1 = new QPopupMenu( this ); 549 QPopupMenu *m1 = new QPopupMenu( this );
550 repeatPicker = new DateBookMonth( m1, 0, TRUE ); 550 repeatPicker = new DateBookMonth( m1, 0, TRUE );
551 m1->insertItem( repeatPicker ); 551 m1->insertItem( repeatPicker );
552 cmdEnd->setPopup( m1 ); 552 cmdEnd->setPopup( m1 );
553 cmdEnd->setPopupDelay( 0 ); 553 cmdEnd->setPopupDelay( 0 );
554 554
555 QObject::connect( repeatPicker, SIGNAL(dateClicked(int, int, int)), 555 QObject::connect( repeatPicker, SIGNAL(dateClicked(int,int,int)),
556 this, SLOT(endDateChanged(int, int, int)) ); 556 this, SLOT(endDateChanged(int,int,int)) );
557 QObject::connect( qApp, SIGNAL(weekChanged(bool)), 557 QObject::connect( qApp, SIGNAL(weekChanged(bool)),
558 this, SLOT(slotChangeStartOfWeek(bool)) ); 558 this, SLOT(slotChangeStartOfWeek(bool)) );
559 559
560 listRTypeButtons.setAutoDelete( TRUE ); 560 listRTypeButtons.setAutoDelete( TRUE );
561 listRTypeButtons.append( cmdNone ); 561 listRTypeButtons.append( cmdNone );
562 listRTypeButtons.append( cmdDay ); 562 listRTypeButtons.append( cmdDay );
563 listRTypeButtons.append( cmdWeek ); 563 listRTypeButtons.append( cmdWeek );
564 listRTypeButtons.append( cmdMonth ); 564 listRTypeButtons.append( cmdMonth );
565 listRTypeButtons.append( cmdYear ); 565 listRTypeButtons.append( cmdYear );
566 566
567 listExtra.setAutoDelete( TRUE ); 567 listExtra.setAutoDelete( TRUE );
568 listExtra.append( cmdExtra1 ); 568 listExtra.append( cmdExtra1 );
569 listExtra.append( cmdExtra2 ); 569 listExtra.append( cmdExtra2 );
570 listExtra.append( cmdExtra3 ); 570 listExtra.append( cmdExtra3 );
571 listExtra.append( cmdExtra4 ); 571 listExtra.append( cmdExtra4 );
572 listExtra.append( cmdExtra5 ); 572 listExtra.append( cmdExtra5 );
573 listExtra.append( cmdExtra6 ); 573 listExtra.append( cmdExtra6 );
574 listExtra.append( cmdExtra7 ); 574 listExtra.append( cmdExtra7 );
575} 575}
576void OPimRecurrenceWidget::hideExtras() { 576void OPimRecurrenceWidget::hideExtras() {
577 // hide the extra buttons... 577 // hide the extra buttons...
578 fraExtra->hide(); 578 fraExtra->hide();
579 chkNoEnd->hide(); 579 chkNoEnd->hide();
580 QListIterator<QToolButton> it( listExtra ); 580 QListIterator<QToolButton> it( listExtra );
581 for ( ; *it; ++it ) { 581 for ( ; *it; ++it ) {
582 (*it)->hide(); 582 (*it)->hide();
583 (*it)->setOn( FALSE ); 583 (*it)->setOn( FALSE );
584 } 584 }
585} 585}
586void OPimRecurrenceWidget::showRepeatStuff() { 586void OPimRecurrenceWidget::showRepeatStuff() {
587 cmdEnd->show(); 587 cmdEnd->show();
588 chkNoEnd->show(); 588 chkNoEnd->show();
589 lblFreq->show(); 589 lblFreq->show();
590 lblEvery->show(); 590 lblEvery->show();
591 lblFreq->show(); 591 lblFreq->show();
592 spinFreq->show(); 592 spinFreq->show();
593 lblEnd->show(); 593 lblEnd->show();
594 lblRepeat->setText( tr("Every") ); 594 lblRepeat->setText( tr("Every") );
595} 595}
596 596
597 597
598static int week( const QDate &start ) 598static int week( const QDate &start )
599{ 599{
600 // figure out the week... 600 // figure out the week...
601 int stop = start.day(), 601 int stop = start.day(),
602 sentinel = start.dayOfWeek(), 602 sentinel = start.dayOfWeek(),
603 dayOfWeek = QDate( start.year(), start.month(), 1 ).dayOfWeek(), 603 dayOfWeek = QDate( start.year(), start.month(), 1 ).dayOfWeek(),
604 week = 1, 604 week = 1,