-rw-r--r-- | korganizer/komonthview.cpp | 18 | ||||
-rw-r--r-- | korganizer/komonthview.h | 2 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 3 | ||||
-rw-r--r-- | korganizer/koprefs.h | 1 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 5 |
5 files changed, 24 insertions, 5 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index daa37fd..dfa89e2 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -489,634 +489,648 @@ void MonthViewCell::insertEvent(Event *event) | |||
489 | 489 | ||
490 | MonthViewItem *item = new MonthViewItem( event, mDate, text ); | 490 | MonthViewItem *item = new MonthViewItem( event, mDate, text ); |
491 | QPalette pal; | 491 | QPalette pal; |
492 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 492 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
493 | QStringList categories = event->categories(); | 493 | QStringList categories = event->categories(); |
494 | QString cat = categories.first(); | 494 | QString cat = categories.first(); |
495 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 495 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
496 | pal = getPalette(); | 496 | pal = getPalette(); |
497 | if (cat.isEmpty()) { | 497 | if (cat.isEmpty()) { |
498 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 498 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
499 | } else { | 499 | } else { |
500 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 500 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
501 | } | 501 | } |
502 | 502 | ||
503 | } else { | 503 | } else { |
504 | if (cat.isEmpty()) { | 504 | if (cat.isEmpty()) { |
505 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 505 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
506 | } else { | 506 | } else { |
507 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 507 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
508 | } | 508 | } |
509 | } | 509 | } |
510 | 510 | ||
511 | } else { | 511 | } else { |
512 | pal = mStandardPalette ; | 512 | pal = mStandardPalette ; |
513 | } | 513 | } |
514 | item->setPalette( pal ); | 514 | item->setPalette( pal ); |
515 | item->setRecur( event->recurrence()->doesRecur() ); | 515 | item->setRecur( event->recurrence()->doesRecur() ); |
516 | item->setAlarm( event->isAlarmEnabled() ); | 516 | item->setAlarm( event->isAlarmEnabled() ); |
517 | item->setMoreInfo( event->description().length() > 0 ); | 517 | item->setMoreInfo( event->description().length() > 0 ); |
518 | #ifdef DESKTOP_VERSION | 518 | #ifdef DESKTOP_VERSION |
519 | Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, | 519 | Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, |
520 | KOPrefs::instance()->email()); | 520 | KOPrefs::instance()->email()); |
521 | if ( me != 0 ) { | 521 | if ( me != 0 ) { |
522 | if ( me->status() == Attendee::NeedsAction && me->RSVP()) | 522 | if ( me->status() == Attendee::NeedsAction && me->RSVP()) |
523 | item->setReply(true); | 523 | item->setReply(true); |
524 | else | 524 | else |
525 | item->setReply(false); | 525 | item->setReply(false); |
526 | } else | 526 | } else |
527 | item->setReply(false); | 527 | item->setReply(false); |
528 | #endif | 528 | #endif |
529 | mItemList->insertItem( item ); | 529 | mItemList->insertItem( item ); |
530 | mToolTip += "\n"; | 530 | mToolTip += "\n"; |
531 | } | 531 | } |
532 | void MonthViewCell::insertTodo(Todo *todo) | 532 | void MonthViewCell::insertTodo(Todo *todo) |
533 | { | 533 | { |
534 | QString text; | 534 | QString text; |
535 | if (todo->hasDueDate()) { | 535 | if (todo->hasDueDate()) { |
536 | if (!todo->doesFloat()) { | 536 | if (!todo->doesFloat()) { |
537 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); | 537 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); |
538 | text += " "; | 538 | text += " "; |
539 | } | 539 | } |
540 | } | 540 | } |
541 | text += i18n("To-Do: %1").arg(todo->summary()); | 541 | text += i18n("To-Do: %1").arg(todo->summary()); |
542 | 542 | ||
543 | MonthViewItem *item = new MonthViewItem( todo, mDate, text ); | 543 | MonthViewItem *item = new MonthViewItem( todo, mDate, text ); |
544 | //item->setPalette( mStandardPalette ); | 544 | //item->setPalette( mStandardPalette ); |
545 | QPalette pal; | 545 | QPalette pal; |
546 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 546 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
547 | QStringList categories = todo->categories(); | 547 | QStringList categories = todo->categories(); |
548 | QString cat = categories.first(); | 548 | QString cat = categories.first(); |
549 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 549 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
550 | pal = getPalette(); | 550 | pal = getPalette(); |
551 | if (cat.isEmpty()) { | 551 | if (cat.isEmpty()) { |
552 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 552 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
553 | } else { | 553 | } else { |
554 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 554 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
555 | } | 555 | } |
556 | 556 | ||
557 | } else { | 557 | } else { |
558 | if (cat.isEmpty()) { | 558 | if (cat.isEmpty()) { |
559 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 559 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
560 | } else { | 560 | } else { |
561 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 561 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
562 | } | 562 | } |
563 | } | 563 | } |
564 | 564 | ||
565 | } else { | 565 | } else { |
566 | pal = mStandardPalette ; | 566 | pal = mStandardPalette ; |
567 | } | 567 | } |
568 | item->setPalette( pal ); | 568 | item->setPalette( pal ); |
569 | mItemList->insertItem( item ); | 569 | mItemList->insertItem( item ); |
570 | mToolTip += text+"\n"; | 570 | mToolTip += text+"\n"; |
571 | } | 571 | } |
572 | void MonthViewCell::finishUpdateCell() | 572 | void MonthViewCell::finishUpdateCell() |
573 | { | 573 | { |
574 | #ifdef DESKTOP_VERSION | 574 | #ifdef DESKTOP_VERSION |
575 | if (mToolTip != "") | 575 | if (mToolTip != "") |
576 | QToolTip::add(this,mToolTip,toolTipGroup(),""); | 576 | QToolTip::add(this,mToolTip,toolTipGroup(),""); |
577 | #endif | 577 | #endif |
578 | mItemList->sort(); | 578 | mItemList->sort(); |
579 | //setMyPalette(); | 579 | //setMyPalette(); |
580 | setMyPalette(); | 580 | setMyPalette(); |
581 | QString text; | 581 | QString text; |
582 | bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; | 582 | bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; |
583 | if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { | 583 | if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { |
584 | text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; | 584 | text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; |
585 | mLabel->resize( mLabelBigSize ); | 585 | mLabel->resize( mLabelBigSize ); |
586 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); | 586 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); |
587 | } else { | 587 | } else { |
588 | mLabel->resize( mLabelSize ); | 588 | mLabel->resize( mLabelSize ); |
589 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); | 589 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); |
590 | } | 590 | } |
591 | 591 | ||
592 | mLabel->setText( text ); | 592 | mLabel->setText( text ); |
593 | resizeEvent( 0 ); | 593 | resizeEvent( 0 ); |
594 | } | 594 | } |
595 | void MonthViewCell::updateCell() | 595 | void MonthViewCell::updateCell() |
596 | { | 596 | { |
597 | if ( !mMonthView->isUpdatePossible() ) | 597 | if ( !mMonthView->isUpdatePossible() ) |
598 | return; | 598 | return; |
599 | startUpdateCell(); | 599 | startUpdateCell(); |
600 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); | 600 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); |
601 | QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); | 601 | QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); |
602 | Event *event; | 602 | Event *event; |
603 | for( event = events.first(); event; event = events.next() ) { // for event | 603 | for( event = events.first(); event; event = events.next() ) { // for event |
604 | insertEvent(event); | 604 | insertEvent(event); |
605 | } | 605 | } |
606 | // insert due todos | 606 | // insert due todos |
607 | QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); | 607 | QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); |
608 | Todo *todo; | 608 | Todo *todo; |
609 | for(todo = todos.first(); todo; todo = todos.next()) { | 609 | for(todo = todos.first(); todo; todo = todos.next()) { |
610 | insertTodo( todo ); | 610 | insertTodo( todo ); |
611 | } | 611 | } |
612 | finishUpdateCell(); | 612 | finishUpdateCell(); |
613 | // if ( isVisible()) | 613 | // if ( isVisible()) |
614 | //qApp->processEvents(); | 614 | //qApp->processEvents(); |
615 | } | 615 | } |
616 | 616 | ||
617 | void MonthViewCell::updateConfig() | 617 | void MonthViewCell::updateConfig( bool bigFont ) // = false |
618 | { | 618 | { |
619 | setFont( KOPrefs::instance()->mMonthViewFont ); | 619 | |
620 | if ( bigFont ) { | ||
621 | QFont fo = KOPrefs::instance()->mMonthViewFont; | ||
622 | int ps = fo.pointSize() + 2; | ||
623 | if ( ps < 18 ) | ||
624 | ps += 2; | ||
625 | fo.setPointSize( ps ); | ||
626 | setFont( fo ); | ||
627 | } else | ||
628 | setFont( KOPrefs::instance()->mMonthViewFont ); | ||
620 | 629 | ||
621 | QFontMetrics fm( font() ); | 630 | QFontMetrics fm( font() ); |
622 | mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 ); | 631 | mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 ); |
623 | mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 ); | 632 | mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 ); |
624 | mHolidayPalette = mStandardPalette; | 633 | mHolidayPalette = mStandardPalette; |
625 | mPrimaryPalette = mStandardPalette; | 634 | mPrimaryPalette = mStandardPalette; |
626 | mNonPrimaryPalette = mStandardPalette; | 635 | mNonPrimaryPalette = mStandardPalette; |
627 | if ( KOPrefs::instance()->mMonthViewUsesDayColors ) { | 636 | if ( KOPrefs::instance()->mMonthViewUsesDayColors ) { |
628 | mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor ); | 637 | mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor ); |
629 | mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor ); | 638 | mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor ); |
630 | mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark()); | 639 | mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark()); |
631 | mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark()); | 640 | mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark()); |
632 | mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor); | 641 | mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor); |
633 | mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor); | 642 | mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor); |
634 | mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark()); | 643 | mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark()); |
635 | mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor); | 644 | mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor); |
636 | mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor); | 645 | mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor); |
637 | } | 646 | } |
638 | //updateCell(); | 647 | //updateCell(); |
639 | } | 648 | } |
640 | 649 | ||
641 | void MonthViewCell::enableScrollBars( bool enabled ) | 650 | void MonthViewCell::enableScrollBars( bool enabled ) |
642 | { | 651 | { |
643 | if ( enabled ) { | 652 | if ( enabled ) { |
644 | mItemList->setVScrollBarMode(QScrollView::Auto); | 653 | mItemList->setVScrollBarMode(QScrollView::Auto); |
645 | mItemList->setHScrollBarMode(QScrollView::Auto); | 654 | mItemList->setHScrollBarMode(QScrollView::Auto); |
646 | } else { | 655 | } else { |
647 | mItemList->setVScrollBarMode(QScrollView::AlwaysOff); | 656 | mItemList->setVScrollBarMode(QScrollView::AlwaysOff); |
648 | mItemList->setHScrollBarMode(QScrollView::AlwaysOff); | 657 | mItemList->setHScrollBarMode(QScrollView::AlwaysOff); |
649 | } | 658 | } |
650 | } | 659 | } |
651 | 660 | ||
652 | Incidence *MonthViewCell::selectedIncidence() | 661 | Incidence *MonthViewCell::selectedIncidence() |
653 | { | 662 | { |
654 | int index = mItemList->currentItem(); | 663 | int index = mItemList->currentItem(); |
655 | if ( index < 0 ) return 0; | 664 | if ( index < 0 ) return 0; |
656 | 665 | ||
657 | MonthViewItem *item = | 666 | MonthViewItem *item = |
658 | static_cast<MonthViewItem *>( mItemList->item( index ) ); | 667 | static_cast<MonthViewItem *>( mItemList->item( index ) ); |
659 | 668 | ||
660 | if ( !item ) return 0; | 669 | if ( !item ) return 0; |
661 | 670 | ||
662 | return item->incidence(); | 671 | return item->incidence(); |
663 | } | 672 | } |
664 | 673 | ||
665 | QDate MonthViewCell::selectedIncidenceDate() | 674 | QDate MonthViewCell::selectedIncidenceDate() |
666 | { | 675 | { |
667 | QDate qd; | 676 | QDate qd; |
668 | int index = mItemList->currentItem(); | 677 | int index = mItemList->currentItem(); |
669 | if ( index < 0 ) return qd; | 678 | if ( index < 0 ) return qd; |
670 | 679 | ||
671 | MonthViewItem *item = | 680 | MonthViewItem *item = |
672 | static_cast<MonthViewItem *>( mItemList->item( index ) ); | 681 | static_cast<MonthViewItem *>( mItemList->item( index ) ); |
673 | 682 | ||
674 | if ( !item ) return qd; | 683 | if ( !item ) return qd; |
675 | 684 | ||
676 | return item->incidenceDate(); | 685 | return item->incidenceDate(); |
677 | } | 686 | } |
678 | 687 | ||
679 | void MonthViewCell::deselect() | 688 | void MonthViewCell::deselect() |
680 | { | 689 | { |
681 | mItemList->clearSelection(); | 690 | mItemList->clearSelection(); |
682 | enableScrollBars( false ); | 691 | enableScrollBars( false ); |
683 | // updateCell(); | 692 | // updateCell(); |
684 | } | 693 | } |
685 | void MonthViewCell::select() | 694 | void MonthViewCell::select() |
686 | { | 695 | { |
687 | ;// updateCell(); | 696 | ;// updateCell(); |
688 | } | 697 | } |
689 | 698 | ||
690 | void MonthViewCell::resizeEvent ( QResizeEvent * ) | 699 | void MonthViewCell::resizeEvent ( QResizeEvent * ) |
691 | { | 700 | { |
692 | if ( !mMonthView->isUpdatePossible() ) | 701 | if ( !mMonthView->isUpdatePossible() ) |
693 | return; | 702 | return; |
694 | 703 | ||
695 | int size = height() - mLabel->height() - 2; | 704 | int size = height() - mLabel->height() - 2; |
696 | if ( size > 0 ) | 705 | if ( size > 0 ) |
697 | mItemList->verticalScrollBar()->setMaximumHeight( size ); | 706 | mItemList->verticalScrollBar()->setMaximumHeight( size ); |
698 | size = width() - mLabel->width() -2; | 707 | size = width() - mLabel->width() -2; |
699 | if ( size > 0 ) | 708 | if ( size > 0 ) |
700 | mItemList->horizontalScrollBar()->setMaximumWidth( size ); | 709 | mItemList->horizontalScrollBar()->setMaximumWidth( size ); |
701 | mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() ); | 710 | mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() ); |
702 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); | 711 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); |
703 | } | 712 | } |
704 | 713 | ||
705 | void MonthViewCell::defaultAction( QListBoxItem *item ) | 714 | void MonthViewCell::defaultAction( QListBoxItem *item ) |
706 | { | 715 | { |
707 | if ( !item ) return; | 716 | if ( !item ) return; |
708 | 717 | ||
709 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); | 718 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); |
710 | Incidence *incidence = eventItem->incidence(); | 719 | Incidence *incidence = eventItem->incidence(); |
711 | if ( incidence ) mMonthView->defaultAction( incidence ); | 720 | if ( incidence ) mMonthView->defaultAction( incidence ); |
712 | } | 721 | } |
713 | void MonthViewCell::showDay() | 722 | void MonthViewCell::showDay() |
714 | { | 723 | { |
715 | emit showDaySignal( date() ); | 724 | emit showDaySignal( date() ); |
716 | } | 725 | } |
717 | void MonthViewCell::newEvent() | 726 | void MonthViewCell::newEvent() |
718 | { | 727 | { |
719 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); | 728 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); |
720 | emit newEventSignal( dt ); | 729 | emit newEventSignal( dt ); |
721 | } | 730 | } |
722 | void MonthViewCell::cellClicked( QListBoxItem *item ) | 731 | void MonthViewCell::cellClicked( QListBoxItem *item ) |
723 | { | 732 | { |
724 | static QListBoxItem * lastClicked = 0; | 733 | static QListBoxItem * lastClicked = 0; |
725 | if ( item == 0 ) { | 734 | if ( item == 0 ) { |
726 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); | 735 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); |
727 | emit newEventSignal( dt ); | 736 | emit newEventSignal( dt ); |
728 | return; | 737 | return; |
729 | } | 738 | } |
730 | /* | 739 | /* |
731 | if ( lastClicked ) | 740 | if ( lastClicked ) |
732 | if ( ! item ) { | 741 | if ( ! item ) { |
733 | if ( lastClicked->listBox() != item->listBox() ) | 742 | if ( lastClicked->listBox() != item->listBox() ) |
734 | lastClicked->listBox()->clearSelection(); | 743 | lastClicked->listBox()->clearSelection(); |
735 | } | 744 | } |
736 | */ | 745 | */ |
737 | 746 | ||
738 | mMonthView->setSelectedCell( this ); | 747 | mMonthView->setSelectedCell( this ); |
739 | if( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) enableScrollBars( true ); | 748 | if( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) enableScrollBars( true ); |
740 | select(); | 749 | select(); |
741 | } | 750 | } |
742 | 751 | ||
743 | void MonthViewCell::contextMenu( QListBoxItem *item ) | 752 | void MonthViewCell::contextMenu( QListBoxItem *item ) |
744 | { | 753 | { |
745 | if ( !item ) return; | 754 | if ( !item ) return; |
746 | 755 | ||
747 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); | 756 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); |
748 | Incidence *incidence = eventItem->incidence(); | 757 | Incidence *incidence = eventItem->incidence(); |
749 | if ( incidence ) mMonthView->showContextMenu( incidence ); | 758 | if ( incidence ) mMonthView->showContextMenu( incidence ); |
750 | } | 759 | } |
751 | 760 | ||
752 | void MonthViewCell::selection( QListBoxItem *item ) | 761 | void MonthViewCell::selection( QListBoxItem *item ) |
753 | { | 762 | { |
754 | if ( !item ) return; | 763 | if ( !item ) return; |
755 | 764 | ||
756 | mMonthView->setSelectedCell( this ); | 765 | mMonthView->setSelectedCell( this ); |
757 | } | 766 | } |
758 | 767 | ||
759 | 768 | ||
760 | // ******************************************************************************* | 769 | // ******************************************************************************* |
761 | // ******************************************************************************* | 770 | // ******************************************************************************* |
762 | // ******************************************************************************* | 771 | // ******************************************************************************* |
763 | 772 | ||
764 | 773 | ||
765 | KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | 774 | KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) |
766 | : KOEventView( calendar, parent, name ), | 775 | : KOEventView( calendar, parent, name ), |
767 | mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), | 776 | mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), |
768 | mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) | 777 | mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) |
769 | { | 778 | { |
770 | 779 | ||
771 | clPending = true; | 780 | clPending = true; |
772 | mWidStack = new QWidgetStack( this ); | 781 | mWidStack = new QWidgetStack( this ); |
773 | QHBoxLayout* hb = new QHBoxLayout( this ); | 782 | QHBoxLayout* hb = new QHBoxLayout( this ); |
774 | mMonthView = new QWidget( mWidStack ); | 783 | mMonthView = new QWidget( mWidStack ); |
775 | mWeekView = new QWidget( mWidStack ); | 784 | mWeekView = new QWidget( mWidStack ); |
776 | #if QT_VERSION >= 0x030000 | 785 | #if QT_VERSION >= 0x030000 |
777 | mWidStack->addWidget(mMonthView ); | 786 | mWidStack->addWidget(mMonthView ); |
778 | mWidStack->addWidget(mWeekView ); | 787 | mWidStack->addWidget(mWeekView ); |
779 | #else | 788 | #else |
780 | mWidStack->addWidget( mMonthView, 1 ); | 789 | mWidStack->addWidget( mMonthView, 1 ); |
781 | mWidStack->addWidget( mWeekView , 1 ); | 790 | mWidStack->addWidget( mWeekView , 1 ); |
782 | #endif | 791 | #endif |
783 | hb->addWidget( mWidStack ); | 792 | hb->addWidget( mWidStack ); |
784 | mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); | 793 | mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); |
785 | mShowWeekView = KOPrefs::instance()->mMonthViewWeek; | 794 | mShowWeekView = KOPrefs::instance()->mMonthViewWeek; |
786 | if ( mShowWeekView ) | 795 | if ( mShowWeekView ) |
787 | mWeekStartsMonday = true; | 796 | mWeekStartsMonday = true; |
788 | updatePossible = false; | 797 | updatePossible = false; |
789 | mCells.setAutoDelete( true ); | 798 | mCells.setAutoDelete( true ); |
790 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; | 799 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; |
791 | mDayLabels.resize( mDaysPerWeek ); | 800 | mDayLabels.resize( mDaysPerWeek ); |
792 | mDayLabelsW.resize( mDaysPerWeek ); | 801 | mDayLabelsW.resize( mDaysPerWeek ); |
793 | QFont bfont = font(); | 802 | QFont bfont = font(); |
794 | if ( QApplication::desktop()->width() < 650 ) { | 803 | if ( QApplication::desktop()->width() < 650 ) { |
795 | bfont.setPointSize( bfont.pointSize() - 2 ); | 804 | bfont.setPointSize( bfont.pointSize() - 2 ); |
796 | } | 805 | } |
797 | bfont.setBold( true ); | 806 | bfont.setBold( true ); |
798 | int i; | 807 | int i; |
799 | 808 | ||
800 | for( i = 0; i < mDaysPerWeek; i++ ) { | 809 | for( i = 0; i < mDaysPerWeek; i++ ) { |
801 | QLabel *label = new QLabel( mMonthView ); | 810 | QLabel *label = new QLabel( mMonthView ); |
802 | label->setFont(bfont); | 811 | label->setFont(bfont); |
803 | label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 812 | label->setFrameStyle(QFrame::Panel|QFrame::Raised); |
804 | label->setLineWidth(1); | 813 | label->setLineWidth(1); |
805 | label->setAlignment(AlignCenter); | 814 | label->setAlignment(AlignCenter); |
806 | mDayLabels.insert( i, label ); | 815 | mDayLabels.insert( i, label ); |
807 | label = new QLabel( mWeekView ); | 816 | label = new QLabel( mWeekView ); |
808 | label->setFont(bfont); | 817 | label->setFont(bfont); |
809 | label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 818 | label->setFrameStyle(QFrame::Panel|QFrame::Raised); |
810 | label->setLineWidth(1); | 819 | label->setLineWidth(1); |
811 | label->setAlignment(AlignCenter); | 820 | label->setAlignment(AlignCenter); |
812 | mDayLabelsW.insert( i, label ); | 821 | mDayLabelsW.insert( i, label ); |
813 | } | 822 | } |
814 | 823 | ||
815 | bfont.setBold( false ); | 824 | bfont.setBold( false ); |
816 | mWeekLabels.resize( mNumWeeks+1 ); | 825 | mWeekLabels.resize( mNumWeeks+1 ); |
817 | mWeekLabelsW.resize( 2 ); | 826 | mWeekLabelsW.resize( 2 ); |
818 | for( i = 0; i < mNumWeeks+1; i++ ) { | 827 | for( i = 0; i < mNumWeeks+1; i++ ) { |
819 | KOWeekButton *label = new KOWeekButton( mMonthView ); | 828 | KOWeekButton *label = new KOWeekButton( mMonthView ); |
820 | label->setFont(bfont); | 829 | label->setFont(bfont); |
821 | connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); | 830 | connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); |
822 | label->setFlat(true); | 831 | label->setFlat(true); |
823 | QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); | 832 | QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); |
824 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 833 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); |
825 | //label->setLineWidth(1); | 834 | //label->setLineWidth(1); |
826 | //label->setAlignment(AlignCenter); | 835 | //label->setAlignment(AlignCenter); |
827 | mWeekLabels.insert( i, label ); | 836 | mWeekLabels.insert( i, label ); |
828 | } | 837 | } |
829 | mWeekLabels[mNumWeeks]->setText( i18n("W")); | 838 | mWeekLabels[mNumWeeks]->setText( i18n("W")); |
830 | QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); | 839 | QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); |
831 | 840 | ||
832 | for( i = 0; i < 1+1; i++ ) { | 841 | for( i = 0; i < 1+1; i++ ) { |
833 | KOWeekButton *label = new KOWeekButton( mWeekView ); | 842 | KOWeekButton *label = new KOWeekButton( mWeekView ); |
834 | label->setFont(bfont); | 843 | label->setFont(bfont); |
835 | connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); | 844 | connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); |
836 | label->setFlat(true); | 845 | label->setFlat(true); |
837 | QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); | 846 | QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); |
838 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 847 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); |
839 | //label->setLineWidth(1); | 848 | //label->setLineWidth(1); |
840 | //label->setAlignment(AlignCenter); | 849 | //label->setAlignment(AlignCenter); |
841 | mWeekLabelsW.insert( i, label ); | 850 | mWeekLabelsW.insert( i, label ); |
842 | } | 851 | } |
843 | mWeekLabelsW[1]->setText( i18n("W")); | 852 | mWeekLabelsW[1]->setText( i18n("W")); |
844 | 853 | ||
845 | 854 | ||
846 | int row, col; | 855 | int row, col; |
847 | mCells.resize( mNumCells ); | 856 | mCells.resize( mNumCells ); |
848 | for( row = 0; row < mNumWeeks; ++row ) { | 857 | for( row = 0; row < mNumWeeks; ++row ) { |
849 | for( col = 0; col < mDaysPerWeek; ++col ) { | 858 | for( col = 0; col < mDaysPerWeek; ++col ) { |
850 | MonthViewCell *cell = new MonthViewCell( this, mMonthView ); | 859 | MonthViewCell *cell = new MonthViewCell( this, mMonthView ); |
851 | mCells.insert( row * mDaysPerWeek + col, cell ); | 860 | mCells.insert( row * mDaysPerWeek + col, cell ); |
852 | 861 | ||
853 | connect( cell, SIGNAL( defaultAction( Incidence * ) ), | 862 | connect( cell, SIGNAL( defaultAction( Incidence * ) ), |
854 | SLOT( defaultAction( Incidence * ) ) ); | 863 | SLOT( defaultAction( Incidence * ) ) ); |
855 | connect( cell, SIGNAL( newEventSignal( QDateTime ) ), | 864 | connect( cell, SIGNAL( newEventSignal( QDateTime ) ), |
856 | SIGNAL( newEventSignal( QDateTime ) ) ); | 865 | SIGNAL( newEventSignal( QDateTime ) ) ); |
857 | connect( cell, SIGNAL( showDaySignal( QDate ) ), | 866 | connect( cell, SIGNAL( showDaySignal( QDate ) ), |
858 | SIGNAL( showDaySignal( QDate ) ) ); | 867 | SIGNAL( showDaySignal( QDate ) ) ); |
859 | } | 868 | } |
860 | } | 869 | } |
861 | mCellsW.resize( mDaysPerWeek ); | 870 | mCellsW.resize( mDaysPerWeek ); |
862 | for( col = 0; col < mDaysPerWeek; ++col ) { | 871 | for( col = 0; col < mDaysPerWeek; ++col ) { |
863 | MonthViewCell *cell = new MonthViewCell( this, mWeekView ); | 872 | MonthViewCell *cell = new MonthViewCell( this, mWeekView ); |
864 | mCellsW.insert( col, cell ); | 873 | mCellsW.insert( col, cell ); |
865 | 874 | ||
866 | connect( cell, SIGNAL( defaultAction( Incidence * ) ), | 875 | connect( cell, SIGNAL( defaultAction( Incidence * ) ), |
867 | SLOT( defaultAction( Incidence * ) ) ); | 876 | SLOT( defaultAction( Incidence * ) ) ); |
868 | connect( cell, SIGNAL( newEventSignal( QDateTime ) ), | 877 | connect( cell, SIGNAL( newEventSignal( QDateTime ) ), |
869 | SIGNAL( newEventSignal( QDateTime ) ) ); | 878 | SIGNAL( newEventSignal( QDateTime ) ) ); |
870 | connect( cell, SIGNAL( showDaySignal( QDate ) ), | 879 | connect( cell, SIGNAL( showDaySignal( QDate ) ), |
871 | SIGNAL( showDaySignal( QDate ) ) ); | 880 | SIGNAL( showDaySignal( QDate ) ) ); |
881 | cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont ); | ||
872 | } | 882 | } |
873 | 883 | ||
874 | //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); | 884 | //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); |
875 | mContextMenu = eventPopup(); | 885 | mContextMenu = eventPopup(); |
876 | // updateConfig(); //useless here | 886 | // updateConfig(); //useless here |
877 | 887 | ||
878 | //mWeekLabels[mNumWeeks]->setText( i18n("W")); | 888 | //mWeekLabels[mNumWeeks]->setText( i18n("W")); |
879 | #if 0 | 889 | #if 0 |
880 | mWidStack = new QWidgetStack( this ); | 890 | mWidStack = new QWidgetStack( this ); |
881 | mMonthView = new QWidget( mWidStack ); | 891 | mMonthView = new QWidget( mWidStack ); |
882 | mWeekView = new QWidget( mWidStack ); | 892 | mWeekView = new QWidget( mWidStack ); |
883 | #endif | 893 | #endif |
884 | if ( mShowWeekView ) | 894 | if ( mShowWeekView ) |
885 | mWidStack->raiseWidget( mWeekView ); | 895 | mWidStack->raiseWidget( mWeekView ); |
886 | else | 896 | else |
887 | mWidStack->raiseWidget( mMonthView ); | 897 | mWidStack->raiseWidget( mMonthView ); |
888 | 898 | ||
889 | emit incidenceSelected( 0 ); | 899 | emit incidenceSelected( 0 ); |
890 | } | 900 | } |
891 | 901 | ||
892 | KOMonthView::~KOMonthView() | 902 | KOMonthView::~KOMonthView() |
893 | { | 903 | { |
894 | delete mContextMenu; | 904 | delete mContextMenu; |
895 | } | 905 | } |
896 | void KOMonthView::selectDateWeekNum ( int ) | 906 | void KOMonthView::selectDateWeekNum ( int ) |
897 | { | 907 | { |
898 | 908 | ||
899 | } | 909 | } |
900 | void KOMonthView::selectInternalWeekNum ( int n ) | 910 | void KOMonthView::selectInternalWeekNum ( int n ) |
901 | { | 911 | { |
902 | switchView(); | 912 | switchView(); |
903 | emit selectWeekNum ( n ); | 913 | emit selectWeekNum ( n ); |
904 | } | 914 | } |
905 | 915 | ||
906 | void KOMonthView::switchView() | 916 | void KOMonthView::switchView() |
907 | { | 917 | { |
908 | 918 | ||
909 | if ( selectedCell( ) ) | 919 | if ( selectedCell( ) ) |
910 | selectedCell()->deselect(); | 920 | selectedCell()->deselect(); |
911 | mShowWeekView = !mShowWeekView; | 921 | mShowWeekView = !mShowWeekView; |
912 | KOPrefs::instance()->mMonthViewWeek = mShowWeekView; | 922 | KOPrefs::instance()->mMonthViewWeek = mShowWeekView; |
913 | //emit showNavigator( !mShowWeekView ); | 923 | //emit showNavigator( !mShowWeekView ); |
914 | if ( clPending ) { | 924 | if ( clPending ) { |
915 | computeLayout(); | 925 | computeLayout(); |
916 | updateConfig(); | 926 | updateConfig(); |
917 | } | 927 | } |
918 | if ( mShowWeekView ) | 928 | if ( mShowWeekView ) |
919 | mWidStack->raiseWidget( mWeekView ); | 929 | mWidStack->raiseWidget( mWeekView ); |
920 | else | 930 | else |
921 | mWidStack->raiseWidget( mMonthView ); | 931 | mWidStack->raiseWidget( mMonthView ); |
922 | clPending = false; | 932 | clPending = false; |
923 | } | 933 | } |
924 | 934 | ||
925 | int KOMonthView::maxDatesHint() | 935 | int KOMonthView::maxDatesHint() |
926 | { | 936 | { |
927 | return mNumCells; | 937 | return mNumCells; |
928 | } | 938 | } |
929 | 939 | ||
930 | int KOMonthView::currentDateCount() | 940 | int KOMonthView::currentDateCount() |
931 | { | 941 | { |
932 | return mNumCells; | 942 | return mNumCells; |
933 | } | 943 | } |
934 | 944 | ||
935 | QPtrList<Incidence> KOMonthView::selectedIncidences() | 945 | QPtrList<Incidence> KOMonthView::selectedIncidences() |
936 | { | 946 | { |
937 | QPtrList<Incidence> selected; | 947 | QPtrList<Incidence> selected; |
938 | 948 | ||
939 | if ( mSelectedCell ) { | 949 | if ( mSelectedCell ) { |
940 | Incidence *incidence = mSelectedCell->selectedIncidence(); | 950 | Incidence *incidence = mSelectedCell->selectedIncidence(); |
941 | if ( incidence ) selected.append( incidence ); | 951 | if ( incidence ) selected.append( incidence ); |
942 | } | 952 | } |
943 | 953 | ||
944 | return selected; | 954 | return selected; |
945 | } | 955 | } |
946 | 956 | ||
947 | DateList KOMonthView::selectedDates() | 957 | DateList KOMonthView::selectedDates() |
948 | { | 958 | { |
949 | DateList selected; | 959 | DateList selected; |
950 | 960 | ||
951 | if ( mSelectedCell ) { | 961 | if ( mSelectedCell ) { |
952 | QDate qd = mSelectedCell->selectedIncidenceDate(); | 962 | QDate qd = mSelectedCell->selectedIncidenceDate(); |
953 | if ( qd.isValid() ) selected.append( qd ); | 963 | if ( qd.isValid() ) selected.append( qd ); |
954 | } | 964 | } |
955 | 965 | ||
956 | return selected; | 966 | return selected; |
957 | } | 967 | } |
958 | 968 | ||
959 | void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd, | 969 | void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd, |
960 | const QDate &td) | 970 | const QDate &td) |
961 | { | 971 | { |
962 | #ifndef KORG_NOPRINTER | 972 | #ifndef KORG_NOPRINTER |
963 | calPrinter->preview(CalPrinter::Month, fd, td); | 973 | calPrinter->preview(CalPrinter::Month, fd, td); |
964 | #endif | 974 | #endif |
965 | } | 975 | } |
966 | 976 | ||
967 | void KOMonthView::updateConfig() | 977 | void KOMonthView::updateConfig() |
968 | { | 978 | { |
969 | 979 | ||
970 | mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); | 980 | mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); |
971 | 981 | ||
972 | if ( mShowWeekView ) { | 982 | if ( mShowWeekView ) { |
973 | mWeekStartsMonday = true; | 983 | mWeekStartsMonday = true; |
974 | } | 984 | } |
975 | QFontMetrics fontmetric(mDayLabels[0]->font()); | 985 | QFontMetrics fontmetric(mDayLabels[0]->font()); |
976 | mWidthLongDayLabel = 0; | 986 | mWidthLongDayLabel = 0; |
977 | 987 | ||
978 | for (int i = 0; i < 7; i++) { | 988 | for (int i = 0; i < 7; i++) { |
979 | int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); | 989 | int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); |
980 | if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; | 990 | if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; |
981 | } | 991 | } |
982 | bool temp = mShowSatSunComp ; | 992 | bool temp = mShowSatSunComp ; |
983 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; | 993 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; |
984 | if ( ! mShowWeekView ) { | 994 | if ( ! mShowWeekView ) { |
985 | if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) | 995 | if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) |
986 | computeLayout(); | 996 | computeLayout(); |
987 | } | 997 | } |
988 | updateDayLabels(); | 998 | updateDayLabels(); |
989 | //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks); | 999 | //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks); |
990 | //int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; | 1000 | //int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; |
991 | //resizeEvent( 0 ); | 1001 | //resizeEvent( 0 ); |
992 | for (uint i = 0; i < mCells.count(); ++i) { | 1002 | for (uint i = 0; i < mCells.count(); ++i) { |
993 | mCells[i]->updateConfig(); | 1003 | mCells[i]->updateConfig(); |
994 | } | 1004 | } |
1005 | |||
1006 | for (uint i = 0; i < mCellsW.count(); ++i) { | ||
1007 | mCellsW[i]->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont); | ||
1008 | } | ||
995 | #ifdef DESKTOP_VERSION | 1009 | #ifdef DESKTOP_VERSION |
996 | MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); | 1010 | MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); |
997 | #endif | 1011 | #endif |
998 | updateView(); | 1012 | updateView(); |
999 | } | 1013 | } |
1000 | 1014 | ||
1001 | void KOMonthView::updateDayLabels() | 1015 | void KOMonthView::updateDayLabels() |
1002 | { | 1016 | { |
1003 | 1017 | ||
1004 | QPtrVector<QLabel> *mDayLabelsT; | 1018 | QPtrVector<QLabel> *mDayLabelsT; |
1005 | #if 0 | 1019 | #if 0 |
1006 | if (mShowWeekView ) | 1020 | if (mShowWeekView ) |
1007 | mDayLabelsT = &mDayLabelsW; | 1021 | mDayLabelsT = &mDayLabelsW; |
1008 | else | 1022 | else |
1009 | mDayLabelsT = &mDayLabels; | 1023 | mDayLabelsT = &mDayLabels; |
1010 | #endif | 1024 | #endif |
1011 | 1025 | ||
1012 | mDayLabelsT = &mDayLabelsW; | 1026 | mDayLabelsT = &mDayLabelsW; |
1013 | for (int i = 0; i < 7; i++) { | 1027 | for (int i = 0; i < 7; i++) { |
1014 | if (mWeekStartsMonday) { | 1028 | if (mWeekStartsMonday) { |
1015 | bool show = mShortDayLabels; | 1029 | bool show = mShortDayLabels; |
1016 | if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) | 1030 | if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) |
1017 | show = true; | 1031 | show = true; |
1018 | (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); | 1032 | (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); |
1019 | } else { | 1033 | } else { |
1020 | if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels)); | 1034 | if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels)); |
1021 | else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels)); | 1035 | else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels)); |
1022 | 1036 | ||
1023 | } | 1037 | } |
1024 | } | 1038 | } |
1025 | mDayLabelsT = &mDayLabels; | 1039 | mDayLabelsT = &mDayLabels; |
1026 | for (int i = 0; i < 7; i++) { | 1040 | for (int i = 0; i < 7; i++) { |
1027 | if (mWeekStartsMonday) { | 1041 | if (mWeekStartsMonday) { |
1028 | bool show = mShortDayLabels; | 1042 | bool show = mShortDayLabels; |
1029 | if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) | 1043 | if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) |
1030 | show = true; | 1044 | show = true; |
1031 | (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); | 1045 | (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); |
1032 | } else { | 1046 | } else { |
1033 | if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels)); | 1047 | if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels)); |
1034 | else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels)); | 1048 | else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels)); |
1035 | 1049 | ||
1036 | } | 1050 | } |
1037 | } | 1051 | } |
1038 | 1052 | ||
1039 | } | 1053 | } |
1040 | 1054 | ||
1041 | void KOMonthView::showDates(const QDate &start, const QDate &) | 1055 | void KOMonthView::showDates(const QDate &start, const QDate &) |
1042 | { | 1056 | { |
1043 | // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; | 1057 | // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; |
1044 | 1058 | ||
1045 | QPtrVector<MonthViewCell> *cells; | 1059 | QPtrVector<MonthViewCell> *cells; |
1046 | QPtrVector<QLabel> *dayLabels; | 1060 | QPtrVector<QLabel> *dayLabels; |
1047 | QPtrVector<KOWeekButton> *weekLabels; | 1061 | QPtrVector<KOWeekButton> *weekLabels; |
1048 | int weekNum = 6; | 1062 | int weekNum = 6; |
1049 | if ( mShowWeekView ) { | 1063 | if ( mShowWeekView ) { |
1050 | weekNum = 1; | 1064 | weekNum = 1; |
1051 | cells = &mCellsW; | 1065 | cells = &mCellsW; |
1052 | dayLabels = &mDayLabelsW; | 1066 | dayLabels = &mDayLabelsW; |
1053 | weekLabels = &mWeekLabelsW; | 1067 | weekLabels = &mWeekLabelsW; |
1054 | } else { | 1068 | } else { |
1055 | cells = &mCells; | 1069 | cells = &mCells; |
1056 | dayLabels = &mDayLabels; | 1070 | dayLabels = &mDayLabels; |
1057 | weekLabels = &mWeekLabels; | 1071 | weekLabels = &mWeekLabels; |
1058 | } | 1072 | } |
1059 | 1073 | ||
1060 | mStartDate = start; | 1074 | mStartDate = start; |
1061 | 1075 | ||
1062 | int startWeekDay = mWeekStartsMonday ? 1 : 7; | 1076 | int startWeekDay = mWeekStartsMonday ? 1 : 7; |
1063 | 1077 | ||
1064 | while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) { | 1078 | while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) { |
1065 | mStartDate = mStartDate.addDays( -1 ); | 1079 | mStartDate = mStartDate.addDays( -1 ); |
1066 | } | 1080 | } |
1067 | 1081 | ||
1068 | bool primary = false; | 1082 | bool primary = false; |
1069 | uint i; | 1083 | uint i; |
1070 | for( i = 0; i < (*cells).size(); ++i ) { | 1084 | for( i = 0; i < (*cells).size(); ++i ) { |
1071 | QDate date = mStartDate.addDays( i ); | 1085 | QDate date = mStartDate.addDays( i ); |
1072 | (*cells)[i]->setDate( date ); | 1086 | (*cells)[i]->setDate( date ); |
1073 | 1087 | ||
1074 | #ifndef KORG_NOPLUGINS | 1088 | #ifndef KORG_NOPLUGINS |
1075 | // add holiday, if present | 1089 | // add holiday, if present |
1076 | QString hstring(KOCore::self()->holiday(date)); | 1090 | QString hstring(KOCore::self()->holiday(date)); |
1077 | (*cells)[i]->setHoliday( hstring ); | 1091 | (*cells)[i]->setHoliday( hstring ); |
1078 | #endif | 1092 | #endif |
1079 | 1093 | ||
1080 | } | 1094 | } |
1081 | QDate date = mStartDate.addDays( mWeekStartsMonday ? 3 : 4 ); | 1095 | QDate date = mStartDate.addDays( mWeekStartsMonday ? 3 : 4 ); |
1082 | for( i = 0; i < weekNum; ++i ) { | 1096 | for( i = 0; i < weekNum; ++i ) { |
1083 | int wno; | 1097 | int wno; |
1084 | // remember, according to ISO 8601, the first week of the year is the | 1098 | // remember, according to ISO 8601, the first week of the year is the |
1085 | // first week that contains a thursday. Thus we must subtract off 4, | 1099 | // first week that contains a thursday. Thus we must subtract off 4, |
1086 | // not just 1. | 1100 | // not just 1. |
1087 | int dayOfYear = date.dayOfYear(); | 1101 | int dayOfYear = date.dayOfYear(); |
1088 | if (dayOfYear % 7 != 0) | 1102 | if (dayOfYear % 7 != 0) |
1089 | wno = dayOfYear / 7 + 1; | 1103 | wno = dayOfYear / 7 + 1; |
1090 | else | 1104 | else |
1091 | wno =dayOfYear / 7; | 1105 | wno =dayOfYear / 7; |
1092 | (*weekLabels)[i]->setWeekNum( wno ); | 1106 | (*weekLabels)[i]->setWeekNum( wno ); |
1093 | date = date.addDays( 7 ); | 1107 | date = date.addDays( 7 ); |
1094 | } | 1108 | } |
1095 | updateView(); | 1109 | updateView(); |
1096 | } | 1110 | } |
1097 | 1111 | ||
1098 | void KOMonthView::showEvents(QPtrList<Event>) | 1112 | void KOMonthView::showEvents(QPtrList<Event>) |
1099 | { | 1113 | { |
1100 | qDebug("KOMonthView::selectEvents is not implemented yet. "); | 1114 | qDebug("KOMonthView::selectEvents is not implemented yet. "); |
1101 | } | 1115 | } |
1102 | 1116 | ||
1103 | void KOMonthView::changeEventDisplay(Event *, int) | 1117 | void KOMonthView::changeEventDisplay(Event *, int) |
1104 | { | 1118 | { |
1105 | // this should be re-written to be much more efficient, but this | 1119 | // this should be re-written to be much more efficient, but this |
1106 | // quick-and-dirty-hack gets the job done for right now. | 1120 | // quick-and-dirty-hack gets the job done for right now. |
1107 | updateView(); | 1121 | updateView(); |
1108 | } | 1122 | } |
1109 | 1123 | ||
1110 | void KOMonthView::updateView() | 1124 | void KOMonthView::updateView() |
1111 | { | 1125 | { |
1112 | 1126 | ||
1113 | if ( !updatePossible ) | 1127 | if ( !updatePossible ) |
1114 | return; | 1128 | return; |
1115 | //QTime ti; | 1129 | //QTime ti; |
1116 | //ti.start(); | 1130 | //ti.start(); |
1117 | QPtrVector<MonthViewCell> *cells; | 1131 | QPtrVector<MonthViewCell> *cells; |
1118 | if ( mShowWeekView ) { | 1132 | if ( mShowWeekView ) { |
1119 | cells = &mCellsW; | 1133 | cells = &mCellsW; |
1120 | } else { | 1134 | } else { |
1121 | cells = &mCells; | 1135 | cells = &mCells; |
1122 | } | 1136 | } |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index b89b2bc..700f098 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -18,257 +18,257 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #ifndef _KOMONTHVIEW_H | 20 | #ifndef _KOMONTHVIEW_H |
21 | #define _KOMONTHVIEW_H | 21 | #define _KOMONTHVIEW_H |
22 | 22 | ||
23 | #include <qlabel.h> | 23 | #include <qlabel.h> |
24 | #include <qframe.h> | 24 | #include <qframe.h> |
25 | #include <qdatetime.h> | 25 | #include <qdatetime.h> |
26 | #include <qlistbox.h> | 26 | #include <qlistbox.h> |
27 | #include <qpoint.h> | 27 | #include <qpoint.h> |
28 | #include <qwidgetstack.h> | 28 | #include <qwidgetstack.h> |
29 | #include <qlayout.h> | 29 | #include <qlayout.h> |
30 | #include <qintdict.h> | 30 | #include <qintdict.h> |
31 | #include <qpushbutton.h> | 31 | #include <qpushbutton.h> |
32 | #include <qvaluelist.h> | 32 | #include <qvaluelist.h> |
33 | #include <qptrvector.h> | 33 | #include <qptrvector.h> |
34 | 34 | ||
35 | #include <libkcal/calendar.h> | 35 | #include <libkcal/calendar.h> |
36 | #include <libkcal/event.h> | 36 | #include <libkcal/event.h> |
37 | 37 | ||
38 | #include "koeventview.h" | 38 | #include "koeventview.h" |
39 | 39 | ||
40 | #ifdef DESKTOP_VERSION | 40 | #ifdef DESKTOP_VERSION |
41 | class QToolTipGroup; | 41 | class QToolTipGroup; |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | class KNOWhatsThis; | 44 | class KNOWhatsThis; |
45 | class KOWeekButton : public QPushButton | 45 | class KOWeekButton : public QPushButton |
46 | { | 46 | { |
47 | Q_OBJECT | 47 | Q_OBJECT |
48 | public: | 48 | public: |
49 | KOWeekButton( QWidget *parent=0, const char *name=0 ) : | 49 | KOWeekButton( QWidget *parent=0, const char *name=0 ) : |
50 | QPushButton( parent, name) | 50 | QPushButton( parent, name) |
51 | { | 51 | { |
52 | connect( this, SIGNAL( clicked() ), | 52 | connect( this, SIGNAL( clicked() ), |
53 | SLOT( bottonClicked() )); | 53 | SLOT( bottonClicked() )); |
54 | mNumber = -1; | 54 | mNumber = -1; |
55 | } | 55 | } |
56 | void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));} | 56 | void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));} |
57 | signals: | 57 | signals: |
58 | void selectWeekNum ( int ); | 58 | void selectWeekNum ( int ); |
59 | private: | 59 | private: |
60 | int mNumber; | 60 | int mNumber; |
61 | private slots : | 61 | private slots : |
62 | void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } | 62 | void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } |
63 | }; | 63 | }; |
64 | 64 | ||
65 | class KNoScrollListBox: public QListBox | 65 | class KNoScrollListBox: public QListBox |
66 | { | 66 | { |
67 | Q_OBJECT | 67 | Q_OBJECT |
68 | public: | 68 | public: |
69 | KNoScrollListBox(QWidget *parent=0, const char *name=0); | 69 | KNoScrollListBox(QWidget *parent=0, const char *name=0); |
70 | ~KNoScrollListBox(); | 70 | ~KNoScrollListBox(); |
71 | QString getWhatsThisText(QPoint p) ; | 71 | QString getWhatsThisText(QPoint p) ; |
72 | 72 | ||
73 | signals: | 73 | signals: |
74 | void shiftDown(); | 74 | void shiftDown(); |
75 | void shiftUp(); | 75 | void shiftUp(); |
76 | void rightClick(); | 76 | void rightClick(); |
77 | 77 | ||
78 | protected slots: | 78 | protected slots: |
79 | void keyPressEvent(QKeyEvent *); | 79 | void keyPressEvent(QKeyEvent *); |
80 | void keyReleaseEvent(QKeyEvent *); | 80 | void keyReleaseEvent(QKeyEvent *); |
81 | void mousePressEvent(QMouseEvent *); | 81 | void mousePressEvent(QMouseEvent *); |
82 | 82 | ||
83 | private: | 83 | private: |
84 | KNOWhatsThis * mWT; | 84 | KNOWhatsThis * mWT; |
85 | }; | 85 | }; |
86 | 86 | ||
87 | 87 | ||
88 | class MonthViewItem: public QListBoxItem | 88 | class MonthViewItem: public QListBoxItem |
89 | { | 89 | { |
90 | public: | 90 | public: |
91 | MonthViewItem( Incidence *, QDate qd, const QString & title ); | 91 | MonthViewItem( Incidence *, QDate qd, const QString & title ); |
92 | 92 | ||
93 | void setRecur(bool on) { mRecur = on; } | 93 | void setRecur(bool on) { mRecur = on; } |
94 | void setAlarm(bool on) { mAlarm = on; } | 94 | void setAlarm(bool on) { mAlarm = on; } |
95 | void setReply(bool on) { mReply = on; } | 95 | void setReply(bool on) { mReply = on; } |
96 | void setMoreInfo(bool on) { mInfo = on; } | 96 | void setMoreInfo(bool on) { mInfo = on; } |
97 | 97 | ||
98 | 98 | ||
99 | void setPalette(const QPalette &p) { mPalette = p; } | 99 | void setPalette(const QPalette &p) { mPalette = p; } |
100 | QPalette palette() const { return mPalette; } | 100 | QPalette palette() const { return mPalette; } |
101 | 101 | ||
102 | Incidence *incidence() const { return mIncidence; } | 102 | Incidence *incidence() const { return mIncidence; } |
103 | QDate incidenceDate() { return mDate; } | 103 | QDate incidenceDate() { return mDate; } |
104 | 104 | ||
105 | protected: | 105 | protected: |
106 | virtual void paint(QPainter *); | 106 | virtual void paint(QPainter *); |
107 | virtual int height(const QListBox *) const; | 107 | virtual int height(const QListBox *) const; |
108 | virtual int width(const QListBox *) const; | 108 | virtual int width(const QListBox *) const; |
109 | 109 | ||
110 | private: | 110 | private: |
111 | bool mRecur; | 111 | bool mRecur; |
112 | bool mAlarm; | 112 | bool mAlarm; |
113 | bool mReply; | 113 | bool mReply; |
114 | bool mInfo; | 114 | bool mInfo; |
115 | 115 | ||
116 | QPalette mPalette; | 116 | QPalette mPalette; |
117 | QDate mDate; | 117 | QDate mDate; |
118 | 118 | ||
119 | Incidence *mIncidence; | 119 | Incidence *mIncidence; |
120 | }; | 120 | }; |
121 | 121 | ||
122 | 122 | ||
123 | class KOMonthView; | 123 | class KOMonthView; |
124 | 124 | ||
125 | class MonthViewCell : public QWidget | 125 | class MonthViewCell : public QWidget |
126 | { | 126 | { |
127 | Q_OBJECT | 127 | Q_OBJECT |
128 | public: | 128 | public: |
129 | MonthViewCell(KOMonthView *,QWidget* ); | 129 | MonthViewCell(KOMonthView *,QWidget* ); |
130 | 130 | ||
131 | void setDate( const QDate & ); | 131 | void setDate( const QDate & ); |
132 | QDate date() const; | 132 | QDate date() const; |
133 | 133 | ||
134 | void setPrimary( bool ); | 134 | void setPrimary( bool ); |
135 | bool isPrimary() const; | 135 | bool isPrimary() const; |
136 | 136 | ||
137 | void setHoliday( bool ); | 137 | void setHoliday( bool ); |
138 | void setHoliday( const QString & ); | 138 | void setHoliday( const QString & ); |
139 | 139 | ||
140 | void updateCell(); | 140 | void updateCell(); |
141 | void startUpdateCell(); | 141 | void startUpdateCell(); |
142 | void finishUpdateCell(); | 142 | void finishUpdateCell(); |
143 | void insertEvent(Event *); | 143 | void insertEvent(Event *); |
144 | void insertTodo(Todo *); | 144 | void insertTodo(Todo *); |
145 | 145 | ||
146 | void updateConfig(); | 146 | void updateConfig( bool bigFont = false ); |
147 | 147 | ||
148 | void enableScrollBars( bool ); | 148 | void enableScrollBars( bool ); |
149 | 149 | ||
150 | Incidence *selectedIncidence(); | 150 | Incidence *selectedIncidence(); |
151 | QDate selectedIncidenceDate(); | 151 | QDate selectedIncidenceDate(); |
152 | 152 | ||
153 | void deselect(); | 153 | void deselect(); |
154 | void select(); | 154 | void select(); |
155 | void clear(); | 155 | void clear(); |
156 | 156 | ||
157 | #ifdef DESKTOP_VERSION | 157 | #ifdef DESKTOP_VERSION |
158 | static QToolTipGroup *toolTipGroup(); | 158 | static QToolTipGroup *toolTipGroup(); |
159 | #endif | 159 | #endif |
160 | signals: | 160 | signals: |
161 | void defaultAction( Incidence * ); | 161 | void defaultAction( Incidence * ); |
162 | void newEventSignal( QDateTime ); | 162 | void newEventSignal( QDateTime ); |
163 | void showDaySignal( QDate ); | 163 | void showDaySignal( QDate ); |
164 | 164 | ||
165 | protected: | 165 | protected: |
166 | QString mToolTip; | 166 | QString mToolTip; |
167 | void resizeEvent( QResizeEvent * ); | 167 | void resizeEvent( QResizeEvent * ); |
168 | 168 | ||
169 | protected slots: | 169 | protected slots: |
170 | void defaultAction( QListBoxItem * ); | 170 | void defaultAction( QListBoxItem * ); |
171 | void contextMenu( QListBoxItem * ); | 171 | void contextMenu( QListBoxItem * ); |
172 | void selection( QListBoxItem * ); | 172 | void selection( QListBoxItem * ); |
173 | void cellClicked( QListBoxItem * ); | 173 | void cellClicked( QListBoxItem * ); |
174 | void newEvent(); | 174 | void newEvent(); |
175 | void showDay(); | 175 | void showDay(); |
176 | 176 | ||
177 | private: | 177 | private: |
178 | KOMonthView *mMonthView; | 178 | KOMonthView *mMonthView; |
179 | 179 | ||
180 | QDate mDate; | 180 | QDate mDate; |
181 | bool mPrimary; | 181 | bool mPrimary; |
182 | bool mHoliday; | 182 | bool mHoliday; |
183 | QString mHolidayString; | 183 | QString mHolidayString; |
184 | 184 | ||
185 | //QLabel *mLabel; | 185 | //QLabel *mLabel; |
186 | QPushButton *mLabel; | 186 | QPushButton *mLabel; |
187 | QListBox *mItemList; | 187 | QListBox *mItemList; |
188 | #ifdef DESKTOP_VERSION | 188 | #ifdef DESKTOP_VERSION |
189 | static QToolTipGroup *mToolTipGroup; | 189 | static QToolTipGroup *mToolTipGroup; |
190 | #endif | 190 | #endif |
191 | QSize mLabelSize; | 191 | QSize mLabelSize; |
192 | QSize mLabelBigSize; | 192 | QSize mLabelBigSize; |
193 | QPalette mHolidayPalette; | 193 | QPalette mHolidayPalette; |
194 | QPalette mStandardPalette; | 194 | QPalette mStandardPalette; |
195 | QPalette mPrimaryPalette; | 195 | QPalette mPrimaryPalette; |
196 | QPalette mNonPrimaryPalette; | 196 | QPalette mNonPrimaryPalette; |
197 | void setMyPalette(); | 197 | void setMyPalette(); |
198 | QPalette getPalette (); | 198 | QPalette getPalette (); |
199 | void keyPressEvent ( QKeyEvent * ) ; | 199 | void keyPressEvent ( QKeyEvent * ) ; |
200 | 200 | ||
201 | }; | 201 | }; |
202 | 202 | ||
203 | 203 | ||
204 | class KOMonthView: public KOEventView | 204 | class KOMonthView: public KOEventView |
205 | { | 205 | { |
206 | Q_OBJECT | 206 | Q_OBJECT |
207 | public: | 207 | public: |
208 | KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 ); | 208 | KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 ); |
209 | ~KOMonthView(); | 209 | ~KOMonthView(); |
210 | 210 | ||
211 | /** Returns maximum number of days supported by the komonthview */ | 211 | /** Returns maximum number of days supported by the komonthview */ |
212 | virtual int maxDatesHint(); | 212 | virtual int maxDatesHint(); |
213 | 213 | ||
214 | /** Returns number of currently shown dates. */ | 214 | /** Returns number of currently shown dates. */ |
215 | virtual int currentDateCount(); | 215 | virtual int currentDateCount(); |
216 | 216 | ||
217 | /** returns the currently selected events */ | 217 | /** returns the currently selected events */ |
218 | virtual QPtrList<Incidence> selectedIncidences(); | 218 | virtual QPtrList<Incidence> selectedIncidences(); |
219 | 219 | ||
220 | /** returns dates of the currently selected events */ | 220 | /** returns dates of the currently selected events */ |
221 | virtual DateList selectedDates(); | 221 | virtual DateList selectedDates(); |
222 | 222 | ||
223 | virtual void printPreview(CalPrinter *calPrinter, | 223 | virtual void printPreview(CalPrinter *calPrinter, |
224 | const QDate &, const QDate &); | 224 | const QDate &, const QDate &); |
225 | bool isMonthView() { return true; } | 225 | bool isMonthView() { return true; } |
226 | bool isUpdatePossible() { return updatePossible; } | 226 | bool isUpdatePossible() { return updatePossible; } |
227 | 227 | ||
228 | MonthViewCell * selectedCell(); | 228 | MonthViewCell * selectedCell(); |
229 | public slots: | 229 | public slots: |
230 | virtual void updateView(); | 230 | virtual void updateView(); |
231 | virtual void updateConfig(); | 231 | virtual void updateConfig(); |
232 | virtual void showDates(const QDate &start, const QDate &end); | 232 | virtual void showDates(const QDate &start, const QDate &end); |
233 | virtual void showEvents(QPtrList<Event> eventList); | 233 | virtual void showEvents(QPtrList<Event> eventList); |
234 | 234 | ||
235 | void changeEventDisplay(Event *, int); | 235 | void changeEventDisplay(Event *, int); |
236 | 236 | ||
237 | void clearSelection(); | 237 | void clearSelection(); |
238 | 238 | ||
239 | void showContextMenu( Incidence * ); | 239 | void showContextMenu( Incidence * ); |
240 | 240 | ||
241 | void setSelectedCell( MonthViewCell * ); | 241 | void setSelectedCell( MonthViewCell * ); |
242 | 242 | ||
243 | protected slots: | 243 | protected slots: |
244 | void selectDateWeekNum ( int ); | 244 | void selectDateWeekNum ( int ); |
245 | void selectInternalWeekNum ( int ); | 245 | void selectInternalWeekNum ( int ); |
246 | void switchView(); | 246 | void switchView(); |
247 | void processSelectionChange(); | 247 | void processSelectionChange(); |
248 | signals: | 248 | signals: |
249 | void nextMonth(); | 249 | void nextMonth(); |
250 | void prevMonth(); | 250 | void prevMonth(); |
251 | void showNavigator( bool ); | 251 | void showNavigator( bool ); |
252 | void selectWeekNum ( int ); | 252 | void selectWeekNum ( int ); |
253 | void showDaySignal( QDate ); | 253 | void showDaySignal( QDate ); |
254 | protected: | 254 | protected: |
255 | void resizeEvent(QResizeEvent *); | 255 | void resizeEvent(QResizeEvent *); |
256 | void viewChanged(); | 256 | void viewChanged(); |
257 | void updateDayLabels(); | 257 | void updateDayLabels(); |
258 | 258 | ||
259 | private: | 259 | private: |
260 | bool clPending; | 260 | bool clPending; |
261 | QWidgetStack * mWidStack; | 261 | QWidgetStack * mWidStack; |
262 | QWidget* mMonthView; | 262 | QWidget* mMonthView; |
263 | QWidget* mWeekView; | 263 | QWidget* mWeekView; |
264 | bool mShowWeekView; | 264 | bool mShowWeekView; |
265 | bool updatePossible; | 265 | bool updatePossible; |
266 | int mDaysPerWeek; | 266 | int mDaysPerWeek; |
267 | int mNumWeeks; | 267 | int mNumWeeks; |
268 | int mNumCells; | 268 | int mNumCells; |
269 | bool mWeekStartsMonday; | 269 | bool mWeekStartsMonday; |
270 | bool mShowSatSunComp; | 270 | bool mShowSatSunComp; |
271 | void computeLayout(); | 271 | void computeLayout(); |
272 | void computeLayoutWeek(); | 272 | void computeLayoutWeek(); |
273 | 273 | ||
274 | QPtrVector<MonthViewCell> mCells; | 274 | QPtrVector<MonthViewCell> mCells; |
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 2fb7c36..ea5aaa1 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -120,257 +120,258 @@ KOPrefs::KOPrefs() : | |||
120 | addItemStringList("LocationDefaults",&mLocationDefaults ); | 120 | addItemStringList("LocationDefaults",&mLocationDefaults ); |
121 | addItemStringList("EventSummary User",&mEventSummaryUser); | 121 | addItemStringList("EventSummary User",&mEventSummaryUser); |
122 | addItemStringList("TodoSummary User",&mTodoSummaryUser); | 122 | addItemStringList("TodoSummary User",&mTodoSummaryUser); |
123 | 123 | ||
124 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); | 124 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); |
125 | addItemBool("Enable Project View",&mEnableProjectView,false); | 125 | addItemBool("Enable Project View",&mEnableProjectView,false); |
126 | addItemBool("Auto Save",&mAutoSave,false); | 126 | addItemBool("Auto Save",&mAutoSave,false); |
127 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); | 127 | addItemInt("Auto Save Interval",&mAutoSaveInterval,3); |
128 | addItemBool("Confirm Deletes",&mConfirm,true); | 128 | addItemBool("Confirm Deletes",&mConfirm,true); |
129 | addItemString("Archive File",&mArchiveFile); | 129 | addItemString("Archive File",&mArchiveFile); |
130 | addItemString("Html Export File",&mHtmlExportFile, | 130 | addItemString("Html Export File",&mHtmlExportFile, |
131 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); | 131 | QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); |
132 | addItemBool("Html With Save",&mHtmlWithSave,false); | 132 | addItemBool("Html With Save",&mHtmlWithSave,false); |
133 | 133 | ||
134 | KPrefs::setCurrentGroup("Personal Settings"); | 134 | KPrefs::setCurrentGroup("Personal Settings"); |
135 | 135 | ||
136 | addItemInt("Mail Client",&mMailClient,MailClientKMail); | 136 | addItemInt("Mail Client",&mMailClient,MailClientKMail); |
137 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); | 137 | addItemBool("Use Control Center Email",&mEmailControlCenter,false); |
138 | addItemBool("Bcc",&mBcc,false); | 138 | addItemBool("Bcc",&mBcc,false); |
139 | 139 | ||
140 | KPrefs::setCurrentGroup("Time & Date"); | 140 | KPrefs::setCurrentGroup("Time & Date"); |
141 | 141 | ||
142 | 142 | ||
143 | addItemInt("Default Start Time",&mStartTime,10); | 143 | addItemInt("Default Start Time",&mStartTime,10); |
144 | addItemInt("Default Duration",&mDefaultDuration,2); | 144 | addItemInt("Default Duration",&mDefaultDuration,2); |
145 | addItemInt("Default Alarm Time",&mAlarmTime,3); | 145 | addItemInt("Default Alarm Time",&mAlarmTime,3); |
146 | KPrefs::setCurrentGroup("AlarmSettings"); | 146 | KPrefs::setCurrentGroup("AlarmSettings"); |
147 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); | 147 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); |
148 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); | 148 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); |
149 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); | 149 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); |
150 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); | 150 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); |
151 | 151 | ||
152 | 152 | ||
153 | KPrefs::setCurrentGroup("Calendar"); | 153 | KPrefs::setCurrentGroup("Calendar"); |
154 | 154 | ||
155 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); | 155 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); |
156 | 156 | ||
157 | KPrefs::setCurrentGroup("Fonts"); | 157 | KPrefs::setCurrentGroup("Fonts"); |
158 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); | 158 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); |
159 | addItemFont("TimeBar Font",&mTimeBarFont); | 159 | addItemFont("TimeBar Font",&mTimeBarFont); |
160 | addItemFont("MonthView Font",&mMonthViewFont); | 160 | addItemFont("MonthView Font",&mMonthViewFont); |
161 | addItemFont("AgendaView Font",&mAgendaViewFont); | 161 | addItemFont("AgendaView Font",&mAgendaViewFont); |
162 | addItemFont("MarcusBains Font",&mMarcusBainsFont); | 162 | addItemFont("MarcusBains Font",&mMarcusBainsFont); |
163 | addItemFont("TimeLabels Font",&mTimeLabelsFont); | 163 | addItemFont("TimeLabels Font",&mTimeLabelsFont); |
164 | addItemFont("TodoView Font",&mTodoViewFont); | 164 | addItemFont("TodoView Font",&mTodoViewFont); |
165 | addItemFont("ListView Font",&mListViewFont); | 165 | addItemFont("ListView Font",&mListViewFont); |
166 | addItemFont("DateNavigator Font",&mDateNavigatorFont); | 166 | addItemFont("DateNavigator Font",&mDateNavigatorFont); |
167 | addItemFont("EditBox Font",&mEditBoxFont); | 167 | addItemFont("EditBox Font",&mEditBoxFont); |
168 | addItemFont("JournalView Font",&mJornalViewFont); | 168 | addItemFont("JournalView Font",&mJornalViewFont); |
169 | addItemFont("WhatsNextView Font",&mWhatsNextFont); | 169 | addItemFont("WhatsNextView Font",&mWhatsNextFont); |
170 | addItemFont("EventView Font",&mEventViewFont); | 170 | addItemFont("EventView Font",&mEventViewFont); |
171 | 171 | ||
172 | KPrefs::setCurrentGroup("RemoteSyncing"); | 172 | KPrefs::setCurrentGroup("RemoteSyncing"); |
173 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); | 173 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); |
174 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); | 174 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); |
175 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); | 175 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); |
176 | addItemInt("LastSyncTime",&mLastSyncTime,0); | 176 | addItemInt("LastSyncTime",&mLastSyncTime,0); |
177 | 177 | ||
178 | #ifdef _WIN32_ | 178 | #ifdef _WIN32_ |
179 | QString hdp= locateLocal("data","korganizer")+"\\\\"; | 179 | QString hdp= locateLocal("data","korganizer")+"\\\\"; |
180 | #else | 180 | #else |
181 | QString hdp= locateLocal("data","korganizer")+"/"; | 181 | QString hdp= locateLocal("data","korganizer")+"/"; |
182 | #endif | 182 | #endif |
183 | 183 | ||
184 | KPrefs::setCurrentGroup("LoadSaveFileNames"); | 184 | KPrefs::setCurrentGroup("LoadSaveFileNames"); |
185 | 185 | ||
186 | addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); | 186 | addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); |
187 | addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); | 187 | addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); |
188 | addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); | 188 | addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); |
189 | addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); | 189 | addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); |
190 | 190 | ||
191 | 191 | ||
192 | KPrefs::setCurrentGroup("Locale"); | 192 | KPrefs::setCurrentGroup("Locale"); |
193 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); | 193 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); |
194 | 194 | ||
195 | 195 | ||
196 | KPrefs::setCurrentGroup("Colors"); | 196 | KPrefs::setCurrentGroup("Colors"); |
197 | addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); | 197 | addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); |
198 | addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); | 198 | addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); |
199 | addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); | 199 | addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); |
200 | addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); | 200 | addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); |
201 | addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); | 201 | addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); |
202 | addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); | 202 | addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); |
203 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); | 203 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); |
204 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); | 204 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); |
205 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); | 205 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); |
206 | addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); | 206 | addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); |
207 | addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); | 207 | addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); |
208 | addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); | 208 | addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); |
209 | addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); | 209 | addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); |
210 | addItemBool("MonthViewWeek",&mMonthViewWeek,false); | 210 | addItemBool("MonthViewWeek",&mMonthViewWeek,false); |
211 | addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); | 211 | addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); |
212 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); | 212 | addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); |
213 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); | 213 | addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); |
214 | addItemBool("UseAppColors",&mUseAppColors,false); | 214 | addItemBool("UseAppColors",&mUseAppColors,false); |
215 | 215 | ||
216 | 216 | ||
217 | 217 | ||
218 | KPrefs::setCurrentGroup("Views"); | 218 | KPrefs::setCurrentGroup("Views"); |
219 | addItemBool("Show Date Navigator",&mShowDateNavigator,true); | 219 | addItemBool("Show Date Navigator",&mShowDateNavigator,true); |
220 | addItemInt("Hour Size",&mHourSize,8); | 220 | addItemInt("Hour Size",&mHourSize,8); |
221 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); | 221 | addItemBool("Show Daily Recurrences",&mDailyRecur,true); |
222 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); | 222 | addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); |
223 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); | 223 | addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); |
224 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); | 224 | addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); |
225 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); | 225 | addItemBool("ShowShortMonthName",&mMonthShowShort,false); |
226 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); | 226 | addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); |
227 | #ifdef DESKTOP_VERION | 227 | #ifdef DESKTOP_VERION |
228 | addItemBool("Enable ToolTips",&mEnableToolTips,true); | 228 | addItemBool("Enable ToolTips",&mEnableToolTips,true); |
229 | #else | 229 | #else |
230 | addItemBool("Enable ToolTips",&mEnableToolTips,false); | 230 | addItemBool("Enable ToolTips",&mEnableToolTips,false); |
231 | #endif | 231 | #endif |
232 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); | 232 | addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); |
233 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); | 233 | addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); |
234 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); | 234 | addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); |
235 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); | 235 | addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); |
236 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); | 236 | addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); |
237 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); | 237 | addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); |
238 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); | 238 | addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); |
239 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); | 239 | addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); |
240 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); | 240 | addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); |
241 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; | 241 | addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; |
242 | addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); | 242 | addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); |
243 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); | 243 | addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); |
244 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); | 244 | addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); |
245 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); | 245 | addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); |
246 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); | 246 | addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); |
247 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); | 247 | addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); |
248 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false); | 248 | addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); |
249 | addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); | ||
249 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); | 250 | addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); |
250 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); | 251 | addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); |
251 | #ifdef DESKTOP_VERSION | 252 | #ifdef DESKTOP_VERSION |
252 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); | 253 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); |
253 | #else | 254 | #else |
254 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); | 255 | addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); |
255 | #endif | 256 | #endif |
256 | addItemInt("Day Begins",&mDayBegins,7); | 257 | addItemInt("Day Begins",&mDayBegins,7); |
257 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); | 258 | addItemInt("Working Hours Start",&mWorkingHoursStart,8); |
258 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); | 259 | addItemInt("Working Hours End",&mWorkingHoursEnd,17); |
259 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); | 260 | addItemBool("Exclude Holidays",&mExcludeHolidays,true); |
260 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); | 261 | addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); |
261 | 262 | ||
262 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); | 263 | addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); |
263 | addItemBool("Full View Month",&mFullViewMonth,true); | 264 | addItemBool("Full View Month",&mFullViewMonth,true); |
264 | addItemBool("Full View Todo",&mFullViewTodo,true); | 265 | addItemBool("Full View Todo",&mFullViewTodo,true); |
265 | addItemBool("Quick Todo",&mEnableQuickTodo,false); | 266 | addItemBool("Quick Todo",&mEnableQuickTodo,false); |
266 | 267 | ||
267 | addItemInt("Next X Days",&mNextXDays,3); | 268 | addItemInt("Next X Days",&mNextXDays,3); |
268 | 269 | ||
269 | KPrefs::setCurrentGroup("Printer"); | 270 | KPrefs::setCurrentGroup("Printer"); |
270 | 271 | ||
271 | KPrefs::setCurrentGroup("Layout"); | 272 | KPrefs::setCurrentGroup("Layout"); |
272 | 273 | ||
273 | addItemBool("CompactDialogs",&mCompactDialogs,false); | 274 | addItemBool("CompactDialogs",&mCompactDialogs,false); |
274 | addItemBool("VerticalScreen",&mVerticalScreen,true); | 275 | addItemBool("VerticalScreen",&mVerticalScreen,true); |
275 | 276 | ||
276 | KPrefs::setCurrentGroup("KOrganizer Plugins"); | 277 | KPrefs::setCurrentGroup("KOrganizer Plugins"); |
277 | 278 | ||
278 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); | 279 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); |
279 | 280 | ||
280 | KPrefs::setCurrentGroup("Group Scheduling"); | 281 | KPrefs::setCurrentGroup("Group Scheduling"); |
281 | 282 | ||
282 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); | 283 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); |
283 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); | 284 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); |
284 | addItemStringList("AdditionalMails",&mAdditionalMails,""); | 285 | addItemStringList("AdditionalMails",&mAdditionalMails,""); |
285 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); | 286 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); |
286 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); | 287 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); |
287 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); | 288 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); |
288 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); | 289 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); |
289 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); | 290 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); |
290 | 291 | ||
291 | KPrefs::setCurrentGroup( "Editors" ); | 292 | KPrefs::setCurrentGroup( "Editors" ); |
292 | 293 | ||
293 | addItemStringList( "EventTemplates", &mEventTemplates ); | 294 | addItemStringList( "EventTemplates", &mEventTemplates ); |
294 | addItemStringList( "TodoTemplates", &mTodoTemplates ); | 295 | addItemStringList( "TodoTemplates", &mTodoTemplates ); |
295 | 296 | ||
296 | addItemInt("DestinationPolicy",&mDestination,standardDestination); | 297 | addItemInt("DestinationPolicy",&mDestination,standardDestination); |
297 | 298 | ||
298 | 299 | ||
299 | 300 | ||
300 | } | 301 | } |
301 | 302 | ||
302 | 303 | ||
303 | KOPrefs::~KOPrefs() | 304 | KOPrefs::~KOPrefs() |
304 | { | 305 | { |
305 | if (mInstance == this) | 306 | if (mInstance == this) |
306 | mInstance = insd.setObject(0); | 307 | mInstance = insd.setObject(0); |
307 | 308 | ||
308 | //qDebug("KOPrefs::~KOPrefs() "); | 309 | //qDebug("KOPrefs::~KOPrefs() "); |
309 | } | 310 | } |
310 | 311 | ||
311 | 312 | ||
312 | KOPrefs *KOPrefs::instance() | 313 | KOPrefs *KOPrefs::instance() |
313 | { | 314 | { |
314 | if (!mInstance) { | 315 | if (!mInstance) { |
315 | mInstance = insd.setObject(new KOPrefs()); | 316 | mInstance = insd.setObject(new KOPrefs()); |
316 | mInstance->readConfig(); | 317 | mInstance->readConfig(); |
317 | } | 318 | } |
318 | 319 | ||
319 | return mInstance; | 320 | return mInstance; |
320 | } | 321 | } |
321 | 322 | ||
322 | void KOPrefs::usrSetDefaults() | 323 | void KOPrefs::usrSetDefaults() |
323 | { | 324 | { |
324 | 325 | ||
325 | } | 326 | } |
326 | 327 | ||
327 | void KOPrefs::fillMailDefaults() | 328 | void KOPrefs::fillMailDefaults() |
328 | { | 329 | { |
329 | if (mName.isEmpty()) mName = i18n("Anonymous"); | 330 | if (mName.isEmpty()) mName = i18n("Anonymous"); |
330 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); | 331 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); |
331 | } | 332 | } |
332 | 333 | ||
333 | void KOPrefs::setTimeZoneIdDefault() | 334 | void KOPrefs::setTimeZoneIdDefault() |
334 | { | 335 | { |
335 | ; | 336 | ; |
336 | } | 337 | } |
337 | 338 | ||
338 | void KOPrefs::setCategoryDefaults() | 339 | void KOPrefs::setCategoryDefaults() |
339 | { | 340 | { |
340 | mCustomCategories.clear(); | 341 | mCustomCategories.clear(); |
341 | mCustomCategories = getDefaultList(); | 342 | mCustomCategories = getDefaultList(); |
342 | 343 | ||
343 | QStringList::Iterator it; | 344 | QStringList::Iterator it; |
344 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 345 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
345 | setCategoryColor(*it,mDefaultCategoryColor); | 346 | setCategoryColor(*it,mDefaultCategoryColor); |
346 | } | 347 | } |
347 | } | 348 | } |
348 | 349 | ||
349 | QStringList KOPrefs::getDefaultList() | 350 | QStringList KOPrefs::getDefaultList() |
350 | { | 351 | { |
351 | QStringList retval ; | 352 | QStringList retval ; |
352 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") | 353 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") |
353 | << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") | 354 | << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") |
354 | << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") | 355 | << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") |
355 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") | 356 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") |
356 | << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") | 357 | << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") |
357 | << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") | 358 | << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") |
358 | << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") | 359 | << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") |
359 | << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; | 360 | << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; |
360 | retval.sort(); | 361 | retval.sort(); |
361 | return retval; | 362 | return retval; |
362 | } | 363 | } |
363 | 364 | ||
364 | void KOPrefs::usrReadConfig() | 365 | void KOPrefs::usrReadConfig() |
365 | { | 366 | { |
366 | config()->setGroup("General"); | 367 | config()->setGroup("General"); |
367 | 368 | ||
368 | mCustomCategories = config()->readListEntry("Custom Categories"); | 369 | mCustomCategories = config()->readListEntry("Custom Categories"); |
369 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != mOldLanguage ) { | 370 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != mOldLanguage ) { |
370 | mLocationDefaults.clear(); | 371 | mLocationDefaults.clear(); |
371 | mEventSummaryUser.clear(); | 372 | mEventSummaryUser.clear(); |
372 | mTodoSummaryUser.clear(); | 373 | mTodoSummaryUser.clear(); |
373 | } | 374 | } |
374 | mOldLoadedLanguage = mOldLanguage ; | 375 | mOldLoadedLanguage = mOldLanguage ; |
375 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; | 376 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; |
376 | if (mLocationDefaults.isEmpty()) { | 377 | if (mLocationDefaults.isEmpty()) { |
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index 6541af2..dddcdca 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h | |||
@@ -115,166 +115,167 @@ class KOPrefs : public KPimPrefs | |||
115 | QFont mEditBoxFont; | 115 | QFont mEditBoxFont; |
116 | QFont mJornalViewFont; | 116 | QFont mJornalViewFont; |
117 | QFont mWhatsNextFont; | 117 | QFont mWhatsNextFont; |
118 | QFont mEventViewFont; | 118 | QFont mEventViewFont; |
119 | 119 | ||
120 | 120 | ||
121 | 121 | ||
122 | 122 | ||
123 | QColor mHolidayColor; | 123 | QColor mHolidayColor; |
124 | QColor mHighlightColor; | 124 | QColor mHighlightColor; |
125 | QColor mEventColor; | 125 | QColor mEventColor; |
126 | QColor mTodoDoneColor; | 126 | QColor mTodoDoneColor; |
127 | QColor mAgendaBgColor; | 127 | QColor mAgendaBgColor; |
128 | QColor mWorkingHoursColor; | 128 | QColor mWorkingHoursColor; |
129 | QColor mTodoDueTodayColor; | 129 | QColor mTodoDueTodayColor; |
130 | QColor mTodoOverdueColor; | 130 | QColor mTodoOverdueColor; |
131 | QColor mMonthViewEvenColor; | 131 | QColor mMonthViewEvenColor; |
132 | QColor mMonthViewOddColor; | 132 | QColor mMonthViewOddColor; |
133 | QColor mMonthViewHolidayColor; | 133 | QColor mMonthViewHolidayColor; |
134 | bool mMonthViewUsesDayColors; | 134 | bool mMonthViewUsesDayColors; |
135 | bool mMonthViewSatSunTog; | 135 | bool mMonthViewSatSunTog; |
136 | bool mMonthViewWeek; | 136 | bool mMonthViewWeek; |
137 | QColor mAppColor1; | 137 | QColor mAppColor1; |
138 | QColor mAppColor2; | 138 | QColor mAppColor2; |
139 | bool mUseAppColors; | 139 | bool mUseAppColors; |
140 | 140 | ||
141 | int mDayBegins; | 141 | int mDayBegins; |
142 | int mHourSize; | 142 | int mHourSize; |
143 | int mAllDaySize; | 143 | int mAllDaySize; |
144 | bool mShowFullMenu; | 144 | bool mShowFullMenu; |
145 | bool mDailyRecur; | 145 | bool mDailyRecur; |
146 | bool mWeeklyRecur; | 146 | bool mWeeklyRecur; |
147 | bool mMonthDailyRecur; | 147 | bool mMonthDailyRecur; |
148 | bool mMonthWeeklyRecur; | 148 | bool mMonthWeeklyRecur; |
149 | bool mMonthShowIcons; | 149 | bool mMonthShowIcons; |
150 | bool mMonthShowShort; | 150 | bool mMonthShowShort; |
151 | bool mEnableToolTips; | 151 | bool mEnableToolTips; |
152 | bool mEnableMonthScroll; | 152 | bool mEnableMonthScroll; |
153 | bool mFullViewMonth; | 153 | bool mFullViewMonth; |
154 | bool mMonthViewUsesCategoryColor; | 154 | bool mMonthViewUsesCategoryColor; |
155 | bool mFullViewTodo; | 155 | bool mFullViewTodo; |
156 | bool mShowCompletedTodo; | 156 | bool mShowCompletedTodo; |
157 | bool mMarcusBainsEnabled; | 157 | bool mMarcusBainsEnabled; |
158 | int mNextXDays; | 158 | int mNextXDays; |
159 | int mWhatsNextDays; | 159 | int mWhatsNextDays; |
160 | int mWhatsNextPrios; | 160 | int mWhatsNextPrios; |
161 | bool mEnableQuickTodo; | 161 | bool mEnableQuickTodo; |
162 | 162 | ||
163 | bool mCompactDialogs; | 163 | bool mCompactDialogs; |
164 | bool mVerticalScreen; | 164 | bool mVerticalScreen; |
165 | 165 | ||
166 | bool mShowIconNewTodo; | 166 | bool mShowIconNewTodo; |
167 | bool mShowIconNewEvent; | 167 | bool mShowIconNewEvent; |
168 | bool mShowIconSearch; | 168 | bool mShowIconSearch; |
169 | bool mShowIconList; | 169 | bool mShowIconList; |
170 | bool mShowIconDay1; | 170 | bool mShowIconDay1; |
171 | bool mShowIconDay5; | 171 | bool mShowIconDay5; |
172 | bool mShowIconDay7; | 172 | bool mShowIconDay7; |
173 | bool mShowIconMonth; | 173 | bool mShowIconMonth; |
174 | bool mShowIconTodoview; | 174 | bool mShowIconTodoview; |
175 | bool mShowIconBackFast; | 175 | bool mShowIconBackFast; |
176 | bool mShowIconBack; | 176 | bool mShowIconBack; |
177 | bool mShowIconToday; | 177 | bool mShowIconToday; |
178 | bool mShowIconForward; | 178 | bool mShowIconForward; |
179 | bool mShowIconForwardFast; | 179 | bool mShowIconForwardFast; |
180 | bool mShowIconWhatsThis; | 180 | bool mShowIconWhatsThis; |
181 | bool mShowIconNextDays; | 181 | bool mShowIconNextDays; |
182 | bool mShowIconNext; | 182 | bool mShowIconNext; |
183 | bool mShowIconJournal; | 183 | bool mShowIconJournal; |
184 | 184 | ||
185 | bool mShowIconStretch; | 185 | bool mShowIconStretch; |
186 | 186 | ||
187 | bool mToolBarHor; | 187 | bool mToolBarHor; |
188 | bool mToolBarUp; | 188 | bool mToolBarUp; |
189 | bool mToolBarMiniIcons; | 189 | bool mToolBarMiniIcons; |
190 | 190 | ||
191 | bool mAskForQuit; | 191 | bool mAskForQuit; |
192 | bool mUsePassWd; | 192 | bool mUsePassWd; |
193 | bool mShowSyncEvents; | 193 | bool mShowSyncEvents; |
194 | bool mShowTodoInAgenda; | 194 | bool mShowTodoInAgenda; |
195 | bool mShowTimeInAgenda; | 195 | bool mShowTimeInAgenda; |
196 | bool mHideNonStartedTodos; | 196 | bool mHideNonStartedTodos; |
197 | 197 | ||
198 | int mLastSyncTime; | 198 | int mLastSyncTime; |
199 | void setCategoryColor(QString cat,const QColor & color); | 199 | void setCategoryColor(QString cat,const QColor & color); |
200 | QColor *categoryColor(QString cat); | 200 | QColor *categoryColor(QString cat); |
201 | 201 | ||
202 | QString mArchiveFile; | 202 | QString mArchiveFile; |
203 | QString mHtmlExportFile; | 203 | QString mHtmlExportFile; |
204 | bool mHtmlWithSave; | 204 | bool mHtmlWithSave; |
205 | 205 | ||
206 | QStringList mSelectedPlugins; | 206 | QStringList mSelectedPlugins; |
207 | 207 | ||
208 | QString mLastImportFile; | 208 | QString mLastImportFile; |
209 | QString mLastVcalFile; | 209 | QString mLastVcalFile; |
210 | QString mLastSaveFile; | 210 | QString mLastSaveFile; |
211 | QString mLastLoadFile; | 211 | QString mLastLoadFile; |
212 | 212 | ||
213 | 213 | ||
214 | QString mDefaultAlarmFile; | 214 | QString mDefaultAlarmFile; |
215 | int mIMIPScheduler; | 215 | int mIMIPScheduler; |
216 | int mIMIPSend; | 216 | int mIMIPSend; |
217 | QStringList mAdditionalMails; | 217 | QStringList mAdditionalMails; |
218 | int mIMIPAutoRefresh; | 218 | int mIMIPAutoRefresh; |
219 | int mIMIPAutoInsertReply; | 219 | int mIMIPAutoInsertReply; |
220 | int mIMIPAutoInsertRequest; | 220 | int mIMIPAutoInsertRequest; |
221 | int mIMIPAutoFreeBusy; | 221 | int mIMIPAutoFreeBusy; |
222 | int mIMIPAutoFreeBusyReply; | 222 | int mIMIPAutoFreeBusyReply; |
223 | 223 | ||
224 | QStringList mTodoTemplates; | 224 | QStringList mTodoTemplates; |
225 | QStringList mEventTemplates; | 225 | QStringList mEventTemplates; |
226 | 226 | ||
227 | int mDestination; | 227 | int mDestination; |
228 | 228 | ||
229 | 229 | ||
230 | bool mEditOnDoubleClick; | 230 | bool mEditOnDoubleClick; |
231 | bool mViewChangeHoldFullscreen; | 231 | bool mViewChangeHoldFullscreen; |
232 | bool mViewChangeHoldNonFullscreen; | 232 | bool mViewChangeHoldNonFullscreen; |
233 | bool mCenterOnCurrentTime; | 233 | bool mCenterOnCurrentTime; |
234 | bool mSetTimeToDayStartAt; | 234 | bool mSetTimeToDayStartAt; |
235 | bool mHighlightCurrentDay; | 235 | bool mHighlightCurrentDay; |
236 | bool mUseHighlightLightColor; | 236 | bool mUseHighlightLightColor; |
237 | bool mListViewMonthTimespan; | 237 | bool mListViewMonthTimespan; |
238 | bool mWNViewShowsParents; | 238 | bool mWNViewShowsParents; |
239 | bool mWNViewShowsPast; | 239 | bool mWNViewShowsPast; |
240 | bool mWNViewShowLocation; | 240 | bool mWNViewShowLocation; |
241 | bool mTodoViewShowsPercentage; | 241 | bool mTodoViewShowsPercentage; |
242 | bool mTodoViewUsesCatColors; | 242 | bool mTodoViewUsesCatColors; |
243 | bool mMonthViewUsesBigFont; | ||
243 | bool mTodoViewUsesSmallFont; | 244 | bool mTodoViewUsesSmallFont; |
244 | bool mTodoViewUsesForegroundColor; | 245 | bool mTodoViewUsesForegroundColor; |
245 | bool mMonthViewUsesForegroundColor; | 246 | bool mMonthViewUsesForegroundColor; |
246 | 247 | ||
247 | bool mHightlightDateTimeEdit; | 248 | bool mHightlightDateTimeEdit; |
248 | bool mShortDateInViewer; | 249 | bool mShortDateInViewer; |
249 | 250 | ||
250 | bool mShowDateNavigator; | 251 | bool mShowDateNavigator; |
251 | 252 | ||
252 | QStringList mLocationDefaults; | 253 | QStringList mLocationDefaults; |
253 | QStringList mEventSummaryUser; | 254 | QStringList mEventSummaryUser; |
254 | QStringList mTodoSummaryUser; | 255 | QStringList mTodoSummaryUser; |
255 | 256 | ||
256 | bool mUseInternalAlarmNotification; | 257 | bool mUseInternalAlarmNotification; |
257 | int mAlarmPlayBeeps; | 258 | int mAlarmPlayBeeps; |
258 | int mAlarmSuspendTime; | 259 | int mAlarmSuspendTime; |
259 | int mAlarmSuspendCount; | 260 | int mAlarmSuspendCount; |
260 | int mAlarmBeepInterval; | 261 | int mAlarmBeepInterval; |
261 | int mOldLanguage; | 262 | int mOldLanguage; |
262 | int mOldLoadedLanguage; | 263 | int mOldLoadedLanguage; |
263 | 264 | ||
264 | 265 | ||
265 | QString mActiveSyncPort; | 266 | QString mActiveSyncPort; |
266 | QString mActiveSyncIP; | 267 | QString mActiveSyncIP; |
267 | 268 | ||
268 | private: | 269 | private: |
269 | QDict<QColor> mCategoryColors; | 270 | QDict<QColor> mCategoryColors; |
270 | QColor mDefaultCategoryColor; | 271 | QColor mDefaultCategoryColor; |
271 | 272 | ||
272 | QFont mDefaultTimeBarFont; | 273 | QFont mDefaultTimeBarFont; |
273 | QFont mDefaultViewFont; | 274 | QFont mDefaultViewFont; |
274 | QFont mDefaultMonthViewFont; | 275 | QFont mDefaultMonthViewFont; |
275 | 276 | ||
276 | QString mName; | 277 | QString mName; |
277 | QString mEmail; | 278 | QString mEmail; |
278 | }; | 279 | }; |
279 | 280 | ||
280 | #endif | 281 | #endif |
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 580dff2..452d019 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp | |||
@@ -634,257 +634,260 @@ void KOPrefsDialog::setupViewsTab() | |||
634 | 634 | ||
635 | KPrefsDialogWidBool *enableToolTips = | 635 | KPrefsDialogWidBool *enableToolTips = |
636 | addWidBool(i18n("Enable tooltips displaying summary of ev."), | 636 | addWidBool(i18n("Enable tooltips displaying summary of ev."), |
637 | &(KOPrefs::instance()->mEnableToolTips),topFrame); | 637 | &(KOPrefs::instance()->mEnableToolTips),topFrame); |
638 | topLayout->addWidget(enableToolTips->checkBox(),ii++,0); | 638 | topLayout->addWidget(enableToolTips->checkBox(),ii++,0); |
639 | 639 | ||
640 | } | 640 | } |
641 | 641 | ||
642 | KPrefsDialogWidBool *marcusBainsEnabled = | 642 | KPrefsDialogWidBool *marcusBainsEnabled = |
643 | addWidBool(i18n("Show Marcus Bains line"), | 643 | addWidBool(i18n("Show Marcus Bains line"), |
644 | &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); | 644 | &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); |
645 | topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); | 645 | topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); |
646 | 646 | ||
647 | 647 | ||
648 | // topLayout->addWidget(hourSizeGroup,ii++,0); | 648 | // topLayout->addWidget(hourSizeGroup,ii++,0); |
649 | // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); | 649 | // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); |
650 | //topLayout->setRowStretch(11,1); | 650 | //topLayout->setRowStretch(11,1); |
651 | 651 | ||
652 | 652 | ||
653 | 653 | ||
654 | 654 | ||
655 | 655 | ||
656 | 656 | ||
657 | topFrame = addPage(i18n("ViewChange"),0,0); | 657 | topFrame = addPage(i18n("ViewChange"),0,0); |
658 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 658 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
659 | 659 | ||
660 | topLayout = new QGridLayout(topFrame,6,1); | 660 | topLayout = new QGridLayout(topFrame,6,1); |
661 | topLayout->setSpacing(spacingHint()); | 661 | topLayout->setSpacing(spacingHint()); |
662 | topLayout->setMargin(marginHint()); | 662 | topLayout->setMargin(marginHint()); |
663 | ii = 0; | 663 | ii = 0; |
664 | 664 | ||
665 | 665 | ||
666 | dummy = | 666 | dummy = |
667 | addWidBool(i18n("Hold fullscreen on view change"), | 667 | addWidBool(i18n("Hold fullscreen on view change"), |
668 | &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); | 668 | &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); |
669 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 669 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
670 | 670 | ||
671 | dummy = | 671 | dummy = |
672 | addWidBool(i18n("Hold non-fullscreen on view change"), | 672 | addWidBool(i18n("Hold non-fullscreen on view change"), |
673 | &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); | 673 | &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); |
674 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 674 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
675 | 675 | ||
676 | 676 | ||
677 | KPrefsDialogWidBool *fullViewTodo = | 677 | KPrefsDialogWidBool *fullViewTodo = |
678 | addWidBool(i18n("Event list view uses full window"), | 678 | addWidBool(i18n("Event list view uses full window"), |
679 | &(KOPrefs::instance()->mFullViewTodo),topFrame); | 679 | &(KOPrefs::instance()->mFullViewTodo),topFrame); |
680 | topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); | 680 | topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); |
681 | 681 | ||
682 | KPrefsDialogWidBool *fullViewMonth = | 682 | KPrefsDialogWidBool *fullViewMonth = |
683 | addWidBool(i18n("Next days view uses full window"), | 683 | addWidBool(i18n("Next days view uses full window"), |
684 | &(KOPrefs::instance()->mFullViewMonth),topFrame); | 684 | &(KOPrefs::instance()->mFullViewMonth),topFrame); |
685 | topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); | 685 | topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); |
686 | 686 | ||
687 | dummy = | 687 | dummy = |
688 | addWidBool(i18n("Set agenda to DayBeginsAt on change"), | 688 | addWidBool(i18n("Set agenda to DayBeginsAt on change"), |
689 | &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); | 689 | &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); |
690 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 690 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
691 | 691 | ||
692 | dummy = | 692 | dummy = |
693 | addWidBool(i18n("Set agenda to current time on change"), | 693 | addWidBool(i18n("Set agenda to current time on change"), |
694 | &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); | 694 | &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); |
695 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 695 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
696 | 696 | ||
697 | dummy = | 697 | dummy = |
698 | addWidBool(i18n("Listview uses monthly timespan"), | 698 | addWidBool(i18n("Listview uses monthly timespan"), |
699 | &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); | 699 | &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); |
700 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 700 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
701 | dummy = | 701 | dummy = |
702 | addWidBool(i18n("Highlight selection in Time Edit"), | 702 | addWidBool(i18n("Highlight selection in Time Edit"), |
703 | &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); | 703 | &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); |
704 | topLayout->addWidget( dummy->checkBox(), ii++,0); | 704 | topLayout->addWidget( dummy->checkBox(), ii++,0); |
705 | 705 | ||
706 | 706 | ||
707 | 707 | ||
708 | 708 | ||
709 | 709 | ||
710 | topFrame = addPage(i18n("Month View"),0,0); | 710 | topFrame = addPage(i18n("Month View"),0,0); |
711 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 711 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
712 | 712 | ||
713 | topLayout = new QGridLayout(topFrame,5,1); | 713 | topLayout = new QGridLayout(topFrame,5,1); |
714 | topLayout->setSpacing(spacingHint()); | 714 | topLayout->setSpacing(spacingHint()); |
715 | topLayout->setMargin(marginHint()); | 715 | topLayout->setMargin(marginHint()); |
716 | ii = 0; | 716 | ii = 0; |
717 | QLabel *lab; | 717 | QLabel *lab; |
718 | QHBox *habo = new QHBox( topFrame ); | 718 | QHBox *habo = new QHBox( topFrame ); |
719 | if ( QApplication::desktop()->width() <= 480 ) { | 719 | if ( QApplication::desktop()->width() <= 480 ) { |
720 | lab = new QLabel ( i18n("Show events that recur "), topFrame ); | 720 | lab = new QLabel ( i18n("Show events that recur "), topFrame ); |
721 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); | 721 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); |
722 | ii++; | 722 | ii++; |
723 | } else { | 723 | } else { |
724 | new QLabel ( i18n("Show events that recur "), habo ); | 724 | new QLabel ( i18n("Show events that recur "), habo ); |
725 | } | 725 | } |
726 | dailyRecur = | 726 | dailyRecur = |
727 | addWidBool(i18n("daily"), | 727 | addWidBool(i18n("daily"), |
728 | &(KOPrefs::instance()->mMonthDailyRecur),habo); | 728 | &(KOPrefs::instance()->mMonthDailyRecur),habo); |
729 | // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); | 729 | // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); |
730 | 730 | ||
731 | weeklyRecur = | 731 | weeklyRecur = |
732 | addWidBool(i18n("weekly"), | 732 | addWidBool(i18n("weekly"), |
733 | &(KOPrefs::instance()->mMonthWeeklyRecur),habo); | 733 | &(KOPrefs::instance()->mMonthWeeklyRecur),habo); |
734 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); | 734 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); |
735 | ii++; | 735 | ii++; |
736 | 736 | ||
737 | 737 | ||
738 | habo = new QHBox( topFrame ); | 738 | habo = new QHBox( topFrame ); |
739 | if ( QApplication::desktop()->width() <= 480 ) { | 739 | if ( QApplication::desktop()->width() <= 480 ) { |
740 | lab = new QLabel (i18n("Show in every cell ") , topFrame ); | 740 | lab = new QLabel (i18n("Show in every cell ") , topFrame ); |
741 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); | 741 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); |
742 | ii++; | 742 | ii++; |
743 | 743 | ||
744 | } else { | 744 | } else { |
745 | new QLabel ( i18n("Show in every cell "), habo ); | 745 | new QLabel ( i18n("Show in every cell "), habo ); |
746 | } | 746 | } |
747 | weeklyRecur = | 747 | weeklyRecur = |
748 | addWidBool(i18n("short month"), | 748 | addWidBool(i18n("short month"), |
749 | &(KOPrefs::instance()->mMonthShowShort),habo); | 749 | &(KOPrefs::instance()->mMonthShowShort),habo); |
750 | weeklyRecur = | 750 | weeklyRecur = |
751 | addWidBool(i18n("icons"), | 751 | addWidBool(i18n("icons"), |
752 | &(KOPrefs::instance()->mMonthShowIcons),habo); | 752 | &(KOPrefs::instance()->mMonthShowIcons),habo); |
753 | 753 | ||
754 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); | 754 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); |
755 | ii++; | 755 | ii++; |
756 | #ifdef DESKTOP_VERSION | 756 | #ifdef DESKTOP_VERSION |
757 | KPrefsDialogWidBool *enableMonthScroll = | 757 | KPrefsDialogWidBool *enableMonthScroll = |
758 | addWidBool(i18n("Enable scrollbars in month view cells"), | 758 | addWidBool(i18n("Enable scrollbars in month view cells"), |
759 | &(KOPrefs::instance()->mEnableMonthScroll),topFrame); | 759 | &(KOPrefs::instance()->mEnableMonthScroll),topFrame); |
760 | topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); | 760 | topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); |
761 | #endif | 761 | #endif |
762 | 762 | dummy = | |
763 | addWidBool(i18n("Week view mode uses bigger font"), | ||
764 | &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame); | ||
765 | topLayout->addWidget(dummy->checkBox(),ii++,0); | ||
763 | dummy = | 766 | dummy = |
764 | addWidBool(i18n("Show Sat/Sun together"), | 767 | addWidBool(i18n("Show Sat/Sun together"), |
765 | &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); | 768 | &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); |
766 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 769 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
767 | 770 | ||
768 | KPrefsDialogWidBool *coloredCategoriesInMonthView = | 771 | KPrefsDialogWidBool *coloredCategoriesInMonthView = |
769 | addWidBool(i18n("Month view uses category colors"), | 772 | addWidBool(i18n("Month view uses category colors"), |
770 | &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); | 773 | &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); |
771 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); | 774 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); |
772 | 775 | ||
773 | dummy = | 776 | dummy = |
774 | addWidBool(i18n("Categorie colors are applied to text"), | 777 | addWidBool(i18n("Categorie colors are applied to text"), |
775 | &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); | 778 | &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); |
776 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 779 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
777 | coloredCategoriesInMonthView = | 780 | coloredCategoriesInMonthView = |
778 | addWidBool(i18n("Month view uses day colors"), | 781 | addWidBool(i18n("Month view uses day colors"), |
779 | &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); | 782 | &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); |
780 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); | 783 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); |
781 | 784 | ||
782 | KPrefsDialogWidColor *holidayColor = | 785 | KPrefsDialogWidColor *holidayColor = |
783 | addWidColor(i18n("Day color odd months"), | 786 | addWidColor(i18n("Day color odd months"), |
784 | &(KOPrefs::instance()->mMonthViewOddColor),topFrame); | 787 | &(KOPrefs::instance()->mMonthViewOddColor),topFrame); |
785 | topLayout->addWidget(holidayColor->label(),ii,0); | 788 | topLayout->addWidget(holidayColor->label(),ii,0); |
786 | topLayout->addWidget(holidayColor->button(),ii++,1); | 789 | topLayout->addWidget(holidayColor->button(),ii++,1); |
787 | 790 | ||
788 | holidayColor = | 791 | holidayColor = |
789 | addWidColor(i18n("Day color even months"), | 792 | addWidColor(i18n("Day color even months"), |
790 | &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); | 793 | &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); |
791 | topLayout->addWidget(holidayColor->label(),ii,0); | 794 | topLayout->addWidget(holidayColor->label(),ii,0); |
792 | topLayout->addWidget(holidayColor->button(),ii++,1); | 795 | topLayout->addWidget(holidayColor->button(),ii++,1); |
793 | 796 | ||
794 | 797 | ||
795 | holidayColor = | 798 | holidayColor = |
796 | addWidColor(i18n("Color for Sundays + category \"Holiday\""), | 799 | addWidColor(i18n("Color for Sundays + category \"Holiday\""), |
797 | &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); | 800 | &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); |
798 | topLayout->addWidget(holidayColor->label(),ii,0); | 801 | topLayout->addWidget(holidayColor->label(),ii,0); |
799 | topLayout->addWidget(holidayColor->button(),ii++,1); | 802 | topLayout->addWidget(holidayColor->button(),ii++,1); |
800 | // *********************** What'sNext View | 803 | // *********************** What'sNext View |
801 | topFrame = addPage(i18n("What's Next View"),0,0); | 804 | topFrame = addPage(i18n("What's Next View"),0,0); |
802 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 805 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
803 | 806 | ||
804 | topLayout = new QGridLayout(topFrame,4,1); | 807 | topLayout = new QGridLayout(topFrame,4,1); |
805 | topLayout->setSpacing(spacingHint()); | 808 | topLayout->setSpacing(spacingHint()); |
806 | topLayout->setMargin(marginHint()); | 809 | topLayout->setMargin(marginHint()); |
807 | ii = 0; | 810 | ii = 0; |
808 | KPrefsDialogWidBool *passwdk = | 811 | KPrefsDialogWidBool *passwdk = |
809 | 812 | ||
810 | addWidBool(i18n("Show events, that are done in \nWhat's Next view"), | 813 | addWidBool(i18n("Show events, that are done in \nWhat's Next view"), |
811 | &(KOPrefs::instance()->mWNViewShowsPast),topFrame); | 814 | &(KOPrefs::instance()->mWNViewShowsPast),topFrame); |
812 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 815 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
813 | passwdk = | 816 | passwdk = |
814 | addWidBool(i18n("Show parent To-Do's in What's Next view"), | 817 | addWidBool(i18n("Show parent To-Do's in What's Next view"), |
815 | &(KOPrefs::instance()->mWNViewShowsParents),topFrame); | 818 | &(KOPrefs::instance()->mWNViewShowsParents),topFrame); |
816 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 819 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
817 | 820 | ||
818 | passwdk = | 821 | passwdk = |
819 | addWidBool(i18n("Show location in What's Next view"), | 822 | addWidBool(i18n("Show location in What's Next view"), |
820 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); | 823 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); |
821 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 824 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
822 | 825 | ||
823 | passwdk = | 826 | passwdk = |
824 | addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"), | 827 | addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"), |
825 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); | 828 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); |
826 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 829 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
827 | passwdk = | 830 | passwdk = |
828 | addWidBool(i18n("Use short date in \nWhat's Next/Event view"), | 831 | addWidBool(i18n("Use short date in \nWhat's Next/Event view"), |
829 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); | 832 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); |
830 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 833 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
831 | 834 | ||
832 | 835 | ||
833 | 836 | ||
834 | 837 | ||
835 | // *********************** Todo View | 838 | // *********************** Todo View |
836 | 839 | ||
837 | topFrame = addPage(i18n("Todo View"),0,0); | 840 | topFrame = addPage(i18n("Todo View"),0,0); |
838 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 841 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
839 | 842 | ||
840 | topLayout = new QGridLayout(topFrame,4,1); | 843 | topLayout = new QGridLayout(topFrame,4,1); |
841 | topLayout->setSpacing(spacingHint()); | 844 | topLayout->setSpacing(spacingHint()); |
842 | topLayout->setMargin(marginHint()); | 845 | topLayout->setMargin(marginHint()); |
843 | ii = 0; | 846 | ii = 0; |
844 | dummy = | 847 | dummy = |
845 | addWidBool(i18n("Hide not running Todos in To-do view"), | 848 | addWidBool(i18n("Hide not running Todos in To-do view"), |
846 | &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); | 849 | &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); |
847 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 850 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
848 | 851 | ||
849 | 852 | ||
850 | KPrefsDialogWidBool *showCompletedTodo = | 853 | KPrefsDialogWidBool *showCompletedTodo = |
851 | addWidBool(i18n("To-do view shows completed Todos"), | 854 | addWidBool(i18n("To-do view shows completed Todos"), |
852 | &(KOPrefs::instance()->mShowCompletedTodo),topFrame); | 855 | &(KOPrefs::instance()->mShowCompletedTodo),topFrame); |
853 | topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); | 856 | topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); |
854 | dummy = | 857 | dummy = |
855 | addWidBool(i18n("To-do view shows complete as 'xx %'"), | 858 | addWidBool(i18n("To-do view shows complete as 'xx %'"), |
856 | &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); | 859 | &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); |
857 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 860 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
858 | 861 | ||
859 | dummy = | 862 | dummy = |
860 | addWidBool(i18n("Small To-do view uses smaller font"), | 863 | addWidBool(i18n("Small To-do view uses smaller font"), |
861 | &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); | 864 | &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); |
862 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 865 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
863 | 866 | ||
864 | 867 | ||
865 | 868 | ||
866 | dummy = | 869 | dummy = |
867 | addWidBool(i18n("Todo view uses category colors"), | 870 | addWidBool(i18n("Todo view uses category colors"), |
868 | &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); | 871 | &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); |
869 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 872 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
870 | 873 | ||
871 | 874 | ||
872 | QWidget* wid = new QWidget( topFrame ); | 875 | QWidget* wid = new QWidget( topFrame ); |
873 | // Todo due today color | 876 | // Todo due today color |
874 | KPrefsDialogWidColor *todoDueTodayColor = | 877 | KPrefsDialogWidColor *todoDueTodayColor = |
875 | addWidColor(i18n("Todo due today color:"), | 878 | addWidColor(i18n("Todo due today color:"), |
876 | &(KOPrefs::instance()->mTodoDueTodayColor),wid); | 879 | &(KOPrefs::instance()->mTodoDueTodayColor),wid); |
877 | QHBoxLayout *widLayout = new QHBoxLayout(wid); | 880 | QHBoxLayout *widLayout = new QHBoxLayout(wid); |
878 | widLayout->addWidget( todoDueTodayColor->label() ); | 881 | widLayout->addWidget( todoDueTodayColor->label() ); |
879 | widLayout->addWidget( todoDueTodayColor->button() ); | 882 | widLayout->addWidget( todoDueTodayColor->button() ); |
880 | topLayout->addWidget(wid,ii++,0); | 883 | topLayout->addWidget(wid,ii++,0); |
881 | //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); | 884 | //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); |
882 | 885 | ||
883 | // Todo overdue color | 886 | // Todo overdue color |
884 | wid = new QWidget( topFrame ); | 887 | wid = new QWidget( topFrame ); |
885 | widLayout = new QHBoxLayout(wid); | 888 | widLayout = new QHBoxLayout(wid); |
886 | KPrefsDialogWidColor *todoOverdueColor = | 889 | KPrefsDialogWidColor *todoOverdueColor = |
887 | addWidColor(i18n("Todo overdue color:"), | 890 | addWidColor(i18n("Todo overdue color:"), |
888 | &(KOPrefs::instance()->mTodoOverdueColor),wid); | 891 | &(KOPrefs::instance()->mTodoOverdueColor),wid); |
889 | widLayout->addWidget(todoOverdueColor->label()); | 892 | widLayout->addWidget(todoOverdueColor->label()); |
890 | widLayout->addWidget(todoOverdueColor->button()); | 893 | widLayout->addWidget(todoOverdueColor->button()); |