author | zautrix <zautrix> | 2005-06-25 02:23:09 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-25 02:23:09 (UTC) |
commit | 1d0b53abc70e66708d93b7081a21a7689b1a1303 (patch) (unidiff) | |
tree | 2a79eab02c3560af43af16162e2004adf507fb0f /korganizer | |
parent | ab93fa0a7cd97beada9475f6099bf6083547f0d6 (diff) | |
download | kdepimpi-1d0b53abc70e66708d93b7081a21a7689b1a1303.zip kdepimpi-1d0b53abc70e66708d93b7081a21a7689b1a1303.tar.gz kdepimpi-1d0b53abc70e66708d93b7081a21a7689b1a1303.tar.bz2 |
fixx
-rw-r--r-- | korganizer/koagendaview.cpp | 8 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 93ff55e..c851ab5 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -577,230 +577,232 @@ void KOAgendaView::toggleAllDay() | |||
577 | mSplitterAgenda->firstHandle()->toggle(); | 577 | mSplitterAgenda->firstHandle()->toggle(); |
578 | } | 578 | } |
579 | void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) | 579 | void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) |
580 | { | 580 | { |
581 | calendar()->addIncidence( inc ); | 581 | calendar()->addIncidence( inc ); |
582 | 582 | ||
583 | if ( incOld ) { | 583 | if ( incOld ) { |
584 | if ( incOld->typeID() == todoID ) | 584 | if ( incOld->typeID() == todoID ) |
585 | emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); | 585 | emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); |
586 | else | 586 | else |
587 | emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); | 587 | emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); |
588 | } | 588 | } |
589 | 589 | ||
590 | } | 590 | } |
591 | 591 | ||
592 | KOAgendaView::~KOAgendaView() | 592 | KOAgendaView::~KOAgendaView() |
593 | { | 593 | { |
594 | delete mAllAgendaPopup; | 594 | delete mAllAgendaPopup; |
595 | //delete mAllDayAgendaPopup; | 595 | //delete mAllDayAgendaPopup; |
596 | delete KOAgendaItem::paintPix(); | 596 | delete KOAgendaItem::paintPix(); |
597 | delete KOAgendaItem::paintPixSel(); | 597 | delete KOAgendaItem::paintPixSel(); |
598 | } | 598 | } |
599 | void KOAgendaView::resizeEvent( QResizeEvent* e ) | 599 | void KOAgendaView::resizeEvent( QResizeEvent* e ) |
600 | { | 600 | { |
601 | //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); | 601 | //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); |
602 | bool uc = false; | 602 | bool uc = false; |
603 | int ow = e->oldSize().width(); | 603 | int ow = e->oldSize().width(); |
604 | int oh = e->oldSize().height(); | 604 | int oh = e->oldSize().height(); |
605 | int w = e->size().width(); | 605 | int w = e->size().width(); |
606 | int h = e->size().height(); | 606 | int h = e->size().height(); |
607 | if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) { | 607 | if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) { |
608 | if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda ) | 608 | if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda ) |
609 | uc = true; | 609 | uc = true; |
610 | //qDebug("view changed %d %d %d %d ", ow, oh , w , h); | 610 | //qDebug("view changed %d %d %d %d ", ow, oh , w , h); |
611 | } | 611 | } |
612 | mUpcomingWidth = e->size().width() ; | 612 | mUpcomingWidth = e->size().width() ; |
613 | if ( mBlockUpdating || uc ) { | 613 | if ( mBlockUpdating || uc ) { |
614 | mBlockUpdating = false; | 614 | mBlockUpdating = false; |
615 | //mAgenda->setMinimumSize(800 , 600 ); | 615 | //mAgenda->setMinimumSize(800 , 600 ); |
616 | //qDebug("mAgenda->resize+++++++++++++++ "); | 616 | //qDebug("mAgenda->resize+++++++++++++++ "); |
617 | updateConfig(); | 617 | updateConfig(); |
618 | //qDebug("KOAgendaView::Updating now possible "); | 618 | //qDebug("KOAgendaView::Updating now possible "); |
619 | } else | 619 | } else |
620 | createDayLabels(); | 620 | createDayLabels(); |
621 | //qDebug("resizeEvent end "); | 621 | //qDebug("resizeEvent end "); |
622 | 622 | ||
623 | } | 623 | } |
624 | void KOAgendaView::slotDaylabelClicked( int num ) | 624 | void KOAgendaView::slotDaylabelClicked( int num ) |
625 | { | 625 | { |
626 | 626 | ||
627 | QDate firstDate = mSelectedDates.first(); | 627 | QDate firstDate = mSelectedDates.first(); |
628 | if ( num == -1 ) | 628 | if ( num == -1 ) |
629 | emit showDateView( 6, firstDate ); | 629 | emit showDateView( 6, firstDate ); |
630 | else if (num >= 0 ) { | 630 | else if (num >= 0 ) { |
631 | if ( mSelectedDates.count() == 1) | 631 | if ( mSelectedDates.count() == 1) |
632 | emit showDateView( 9, firstDate.addDays( num ) ); | 632 | emit showDateView( 9, firstDate.addDays( num ) ); |
633 | else | 633 | else |
634 | emit showDateView( 3, firstDate.addDays( num ) ); | 634 | emit showDateView( 3, firstDate.addDays( num ) ); |
635 | } | 635 | } |
636 | else | 636 | else |
637 | showDateView( 10, firstDate.addDays(1) ); | 637 | showDateView( 10, firstDate.addDays(1) ); |
638 | } | 638 | } |
639 | 639 | ||
640 | KOAgendaButton* KOAgendaView::getNewDaylabel() | 640 | KOAgendaButton* KOAgendaView::getNewDaylabel() |
641 | { | 641 | { |
642 | 642 | ||
643 | KOAgendaButton * dayLabel = new KOAgendaButton(mDayLabels); | 643 | KOAgendaButton * dayLabel = new KOAgendaButton(mDayLabels); |
644 | connect( dayLabel, SIGNAL( numClicked(int) ), this, SLOT ( slotDaylabelClicked(int) ) ); | 644 | connect( dayLabel, SIGNAL( numClicked(int) ), this, SLOT ( slotDaylabelClicked(int) ) ); |
645 | mDayLabelsList.append( dayLabel ); | 645 | mDayLabelsList.append( dayLabel ); |
646 | mLayoutDayLabels->addWidget(dayLabel); | 646 | mLayoutDayLabels->addWidget(dayLabel); |
647 | return dayLabel ; | 647 | return dayLabel ; |
648 | } | 648 | } |
649 | 649 | ||
650 | void KOAgendaView::createDayLabels() | 650 | void KOAgendaView::createDayLabels() |
651 | { | 651 | { |
652 | 652 | ||
653 | if ( mBlockUpdating || globalFlagBlockLabel == 1) { | 653 | if ( mBlockUpdating || globalFlagBlockLabel == 1) { |
654 | // qDebug(" KOAgendaView::createDayLabels() blocked "); | 654 | // qDebug(" KOAgendaView::createDayLabels() blocked "); |
655 | return; | 655 | return; |
656 | 656 | ||
657 | } | 657 | } |
658 | int newHight; | 658 | int newHight; |
659 | if ( !mSelectedDates.count()) | 659 | if ( !mSelectedDates.count()) |
660 | return; | 660 | return; |
661 | 661 | ||
662 | // ### Before deleting and recreating we could check if mSelectedDates changed... | 662 | // ### Before deleting and recreating we could check if mSelectedDates changed... |
663 | // It would remove some flickering and gain speed (since this is called by | 663 | // It would remove some flickering and gain speed (since this is called by |
664 | // each updateView() call) | 664 | // each updateView() call) |
665 | 665 | ||
666 | int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - mAgenda->frameWidth()*2; | 666 | int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - mAgenda->frameWidth()*2; |
667 | mDayLabelsFrame->setMaximumWidth( mUpcomingWidth ); | 667 | mDayLabelsFrame->setMaximumWidth( mUpcomingWidth ); |
668 | if ( maxWid < 20 ) | 668 | if ( maxWid < 20 ) |
669 | maxWid = 20; | 669 | maxWid = 20; |
670 | 670 | ||
671 | QFont dlf = KOPrefs::instance()->mTimeLabelsFont; | 671 | QFont dlf = KOPrefs::instance()->mTimeLabelsFont; |
672 | QFontMetrics fm ( dlf ); | 672 | QFontMetrics fm ( dlf ); |
673 | dlf.setBold( true ); | ||
673 | int selCount = mSelectedDates.count(); | 674 | int selCount = mSelectedDates.count(); |
674 | int widModulo = maxWid - (mAgenda->gridSpacingX() * selCount)+1; | 675 | int widModulo = maxWid - (mAgenda->gridSpacingX() * selCount)+1; |
675 | QString dayTest = "Mon 20"; | 676 | QString dayTest = "Mon 20"; |
676 | //QString dayTest = "Mon 20"; | 677 | //QString dayTest = "Mon 20"; |
677 | int wid = fm.width( dayTest ); | 678 | int wid = fm.width( dayTest ); |
678 | //maxWid -= ( selCount * 3 ); //working for QLabels | 679 | //maxWid -= ( selCount * 3 ); //working for QLabels |
679 | if ( QApplication::desktop()->width() <= 320 ) | 680 | if ( QApplication::desktop()->width() <= 320 ) |
680 | maxWid -= ( selCount * 3 ); //working for QPushButton | 681 | maxWid -= ( selCount * 3 ); //working for QPushButton |
681 | else | 682 | else |
682 | maxWid -= ( selCount * 3 ); //working for QPushButton | 683 | maxWid -= ( selCount * 4 ); //working for QPushButton |
683 | if ( maxWid < 0 ) | 684 | if ( maxWid < 0 ) |
684 | maxWid = 20; | 685 | maxWid = 20; |
685 | int needWid = wid * selCount; | 686 | int needWid = wid * selCount; |
686 | //qDebug("++++++++Needed : %d MaxWidth: %d", needWid, maxWid ); | 687 | //qDebug("++++++++Needed : %d MaxWidth: %d", needWid, maxWid ); |
687 | //if ( needWid > maxWid ) | 688 | //if ( needWid > maxWid ) |
688 | // qDebug("DAYLABELS TOOOOOOO BIG "); | 689 | // qDebug("DAYLABELS TOOOOOOO BIG "); |
689 | while ( needWid > maxWid ) { | 690 | while ( needWid > maxWid ) { |
690 | dayTest = dayTest.left( dayTest.length() - 1 ); | 691 | dayTest = dayTest.left( dayTest.length() - 1 ); |
691 | wid = fm.width( dayTest ); | 692 | wid = fm.width( dayTest ); |
692 | needWid = wid * selCount; | 693 | needWid = wid * selCount; |
693 | } | 694 | } |
694 | int maxLen = dayTest.length(); | 695 | int maxLen = dayTest.length(); |
695 | int fontPoint = dlf.pointSize(); | 696 | int fontPoint = dlf.pointSize(); |
696 | if ( maxLen < 2 ) { | 697 | if ( maxLen < 2 ) { |
697 | int fontPoint = dlf.pointSize(); | 698 | int fontPoint = dlf.pointSize(); |
698 | while ( fontPoint > 4 ) { | 699 | while ( fontPoint > 4 ) { |
699 | --fontPoint; | 700 | --fontPoint; |
700 | dlf.setPointSize( fontPoint ); | 701 | dlf.setPointSize( fontPoint ); |
701 | QFontMetrics f( dlf ); | 702 | QFontMetrics f( dlf ); |
702 | wid = f.width( "30" ); | 703 | wid = f.width( "30" ); |
703 | needWid = wid * selCount; | 704 | needWid = wid * selCount; |
704 | if ( needWid < maxWid ) | 705 | if ( needWid < maxWid ) |
705 | break; | 706 | break; |
706 | } | 707 | } |
707 | maxLen = 2; | 708 | maxLen = 2; |
708 | } | 709 | } |
709 | //qDebug("Max len %d ", dayTest.length() ); | 710 | //qDebug("Max len %d ", dayTest.length() ); |
710 | 711 | if ( !KOPrefs::instance()->mTimeLabelsFont.bold() ) | |
712 | dlf.setBold( false ); | ||
711 | QFontMetrics tempF( dlf ); | 713 | QFontMetrics tempF( dlf ); |
712 | newHight = tempF.height(); | 714 | newHight = tempF.height(); |
713 | mDayLabels->setFont( dlf ); | 715 | mDayLabels->setFont( dlf ); |
714 | // mLayoutDayLabels = new QHBoxLayout(mDayLabels);; | 716 | // mLayoutDayLabels = new QHBoxLayout(mDayLabels);; |
715 | // mLayoutDayLabels->addSpacing(mTimeLabels->width()); | 717 | // mLayoutDayLabels->addSpacing(mTimeLabels->width()); |
716 | //mLayoutDayLabels->addSpacing( 2 ); | 718 | //mLayoutDayLabels->addSpacing( 2 ); |
717 | // QFont lFont = dlf; | 719 | // QFont lFont = dlf; |
718 | bool appendLabels = false; | 720 | bool appendLabels = false; |
719 | KOAgendaButton *dayLabel; | 721 | KOAgendaButton *dayLabel; |
720 | dayLabel = mDayLabelsList.first(); | 722 | dayLabel = mDayLabelsList.first(); |
721 | if ( !dayLabel ) { | 723 | if ( !dayLabel ) { |
722 | appendLabels = true; | 724 | appendLabels = true; |
723 | dayLabel = getNewDaylabel(); | 725 | dayLabel = getNewDaylabel(); |
724 | } | 726 | } |
725 | dayLabel->setFixedWidth( mTimeLabels->width()+mAgenda->frameWidth() ); | 727 | dayLabel->setFixedWidth( mTimeLabels->width()+mAgenda->frameWidth() ); |
726 | dayLabel->setFont( dlf ); | 728 | dayLabel->setFont( dlf ); |
727 | dayLabel->setNum( -1 ); | 729 | dayLabel->setNum( -1 ); |
728 | //dayLabel->setAlignment(QLabel::AlignHCenter); | 730 | //dayLabel->setAlignment(QLabel::AlignHCenter); |
729 | 731 | ||
730 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); | 732 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); |
731 | dayLabel->show(); | 733 | dayLabel->show(); |
732 | DateList::ConstIterator dit; | 734 | DateList::ConstIterator dit; |
733 | bool oneday = (mSelectedDates.first() == mSelectedDates.last() ); | 735 | bool oneday = (mSelectedDates.first() == mSelectedDates.last() ); |
734 | int counter = -1; | 736 | int counter = -1; |
735 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { | 737 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { |
736 | ++counter; | 738 | ++counter; |
737 | QDate date = *dit; | 739 | QDate date = *dit; |
738 | // QBoxLayout *dayLayout = new QVBoxLayout(mLayoutDayLabels); | 740 | // QBoxLayout *dayLayout = new QVBoxLayout(mLayoutDayLabels); |
739 | if ( ! appendLabels ) { | 741 | if ( ! appendLabels ) { |
740 | dayLabel = mDayLabelsList.next(); | 742 | dayLabel = mDayLabelsList.next(); |
741 | if ( !dayLabel ) | 743 | if ( !dayLabel ) |
742 | appendLabels = true; | 744 | appendLabels = true; |
743 | } | 745 | } |
744 | if ( appendLabels ) { | 746 | if ( appendLabels ) { |
745 | dayLabel = getNewDaylabel(); | 747 | dayLabel = getNewDaylabel(); |
746 | } | 748 | } |
747 | dayLabel->setMinimumWidth( 1 ); | 749 | dayLabel->setMinimumWidth( 1 ); |
748 | dayLabel->setMaximumWidth( 10240 ); | 750 | dayLabel->setMaximumWidth( 10240 ); |
749 | dayLabel->setFont( dlf ); | 751 | dayLabel->setFont( dlf ); |
750 | dayLabel->show(); | 752 | dayLabel->show(); |
751 | dayLabel->setAutoRepeat( false ); | 753 | dayLabel->setAutoRepeat( false ); |
752 | dayLabel->setNum( counter ); | 754 | dayLabel->setNum( counter ); |
753 | QString str; | 755 | QString str; |
754 | int dW = KOGlobals::self()->calendarSystem()->dayOfWeek(date); | 756 | int dW = KOGlobals::self()->calendarSystem()->dayOfWeek(date); |
755 | QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( dW, true ); | 757 | QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( dW, true ); |
756 | switch ( maxLen ) { | 758 | switch ( maxLen ) { |
757 | case 2: | 759 | case 2: |
758 | str = QString::number( date.day() ); | 760 | str = QString::number( date.day() ); |
759 | break; | 761 | break; |
760 | 762 | ||
761 | case 3: | 763 | case 3: |
762 | str = dayName.left( 1 ) +QString::number( date.day()); | 764 | str = dayName.left( 1 ) +QString::number( date.day()); |
763 | 765 | ||
764 | break; | 766 | break; |
765 | case 4: | 767 | case 4: |
766 | str = dayName.left( 1 ) + " " +QString::number( date.day()); | 768 | str = dayName.left( 1 ) + " " +QString::number( date.day()); |
767 | 769 | ||
768 | break; | 770 | break; |
769 | case 5: | 771 | case 5: |
770 | str = dayName.left( 2 ) + " " +QString::number( date.day()); | 772 | str = dayName.left( 2 ) + " " +QString::number( date.day()); |
771 | 773 | ||
772 | break; | 774 | break; |
773 | case 6: | 775 | case 6: |
774 | str = dayName.left( 3 ) + " " +QString::number( date.day()); | 776 | str = dayName.left( 3 ) + " " +QString::number( date.day()); |
775 | break; | 777 | break; |
776 | 778 | ||
777 | default: | 779 | default: |
778 | break; | 780 | break; |
779 | } | 781 | } |
780 | if ( oneday ) { | 782 | if ( oneday ) { |
781 | QString addString; | 783 | QString addString; |
782 | if ( mSelectedDates.first() == QDateTime::currentDateTime().date() ) | 784 | if ( mSelectedDates.first() == QDateTime::currentDateTime().date() ) |
783 | addString = i18n("Today"); | 785 | addString = i18n("Today"); |
784 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) | 786 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) |
785 | addString = i18n("Tomorrow"); | 787 | addString = i18n("Tomorrow"); |
786 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) | 788 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) |
787 | addString = i18n("Yesterday"); | 789 | addString = i18n("Yesterday"); |
788 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) | 790 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) |
789 | addString = i18n("Day before yesterday"); | 791 | addString = i18n("Day before yesterday"); |
790 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) | 792 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) |
791 | addString = i18n("Day after tomorrow"); | 793 | addString = i18n("Day after tomorrow"); |
792 | if ( !addString.isEmpty() ) { | 794 | if ( !addString.isEmpty() ) { |
793 | str = addString+", " + str; | 795 | str = addString+", " + str; |
794 | } else { | 796 | } else { |
795 | str = KGlobal::locale()->formatDate( date, KOPrefs::instance()->mShortDateInViewer); | 797 | str = KGlobal::locale()->formatDate( date, KOPrefs::instance()->mShortDateInViewer); |
796 | } | 798 | } |
797 | } | 799 | } |
798 | dayLabel->setText(str); | 800 | dayLabel->setText(str); |
799 | //dayLabel->setAlignment(QLabel::AlignHCenter); | 801 | //dayLabel->setAlignment(QLabel::AlignHCenter); |
800 | if (date == QDate::currentDate()) { | 802 | if (date == QDate::currentDate()) { |
801 | QFont bFont = dlf; | 803 | QFont bFont = dlf; |
802 | bFont.setBold( true ); | 804 | bFont.setBold( true ); |
803 | dayLabel->setFont(bFont); | 805 | dayLabel->setFont(bFont); |
804 | } | 806 | } |
805 | //dayLayout->addWidget(dayLabel); | 807 | //dayLayout->addWidget(dayLabel); |
806 | 808 | ||
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 35a56ca..7ba1392 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp | |||
@@ -181,193 +181,193 @@ void KOPrefsDialog::setupLocaleTab() | |||
181 | addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); | 181 | addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); |
182 | syncPrefsGroup->addRadio(i18n("English")); | 182 | syncPrefsGroup->addRadio(i18n("English")); |
183 | syncPrefsGroup->addRadio(i18n("German")); | 183 | syncPrefsGroup->addRadio(i18n("German")); |
184 | syncPrefsGroup->addRadio(i18n("French")); | 184 | syncPrefsGroup->addRadio(i18n("French")); |
185 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); | 185 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); |
186 | if ( QApplication::desktop()->width() < 300 ) | 186 | if ( QApplication::desktop()->width() < 300 ) |
187 | ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 187 | ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
188 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 188 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
189 | ++iii; | 189 | ++iii; |
190 | 190 | ||
191 | syncPrefsGroup = | 191 | syncPrefsGroup = |
192 | addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); | 192 | addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); |
193 | if ( QApplication::desktop()->width() > 300 ) | 193 | if ( QApplication::desktop()->width() > 300 ) |
194 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 194 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
195 | syncPrefsGroup->addRadio(i18n("24:00")); | 195 | syncPrefsGroup->addRadio(i18n("24:00")); |
196 | syncPrefsGroup->addRadio(i18n("12:00am")); | 196 | syncPrefsGroup->addRadio(i18n("12:00am")); |
197 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 197 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
198 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 198 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
199 | ++iii; | 199 | ++iii; |
200 | KPrefsDialogWidBool *sb; | 200 | KPrefsDialogWidBool *sb; |
201 | if ( QApplication::desktop()->width() < 300 ) { | 201 | if ( QApplication::desktop()->width() < 300 ) { |
202 | sb = | 202 | sb = |
203 | addWidBool(i18n("Week starts on Sunday"), | 203 | addWidBool(i18n("Week starts on Sunday"), |
204 | &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); | 204 | &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); |
205 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 205 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
206 | ++iii; | 206 | ++iii; |
207 | sb = | 207 | sb = |
208 | addWidBool(i18n("Use short date in (WN/E) view"), | 208 | addWidBool(i18n("Use short date in (WN/E) view"), |
209 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); | 209 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); |
210 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 210 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
211 | } | 211 | } |
212 | else { | 212 | else { |
213 | QWidget * hb = new QWidget( topFrame ); | 213 | QWidget * hb = new QWidget( topFrame ); |
214 | QHBoxLayout *hbLayout = new QHBoxLayout(hb); | 214 | QHBoxLayout *hbLayout = new QHBoxLayout(hb); |
215 | sb = | 215 | sb = |
216 | addWidBool(i18n("Week starts on Sunday"), | 216 | addWidBool(i18n("Week starts on Sunday"), |
217 | &(KOPrefs::instance()->mWeekStartsOnSunday),hb); | 217 | &(KOPrefs::instance()->mWeekStartsOnSunday),hb); |
218 | hbLayout->addWidget(sb->checkBox() ); | 218 | hbLayout->addWidget(sb->checkBox() ); |
219 | sb = | 219 | sb = |
220 | addWidBool(i18n("Use short date in (WN/E) view"), | 220 | addWidBool(i18n("Use short date in (WN/E) view"), |
221 | &(KOPrefs::instance()->mShortDateInViewer),hb); | 221 | &(KOPrefs::instance()->mShortDateInViewer),hb); |
222 | hbLayout->addWidget(sb->checkBox() ); | 222 | hbLayout->addWidget(sb->checkBox() ); |
223 | topLayout->addMultiCellWidget(hb, iii,iii,0,1); | 223 | topLayout->addMultiCellWidget(hb, iii,iii,0,1); |
224 | 224 | ||
225 | } | 225 | } |
226 | // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION | 226 | // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION |
227 | #if 0 | 227 | #if 0 |
228 | ++iii; | 228 | ++iii; |
229 | sb = | 229 | sb = |
230 | addWidBool(i18n("Quick load/save (w/o Unicode)"), | 230 | addWidBool(i18n("Quick load/save (w/o Unicode)"), |
231 | &(KOPrefs::instance()->mUseQuicksave),topFrame); | 231 | &(KOPrefs::instance()->mUseQuicksave),topFrame); |
232 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 232 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
233 | #endif | 233 | #endif |
234 | #endif | 234 | #endif |
235 | } | 235 | } |
236 | 236 | ||
237 | void KOPrefsDialog::setupMainTab() | 237 | void KOPrefsDialog::setupMainTab() |
238 | { | 238 | { |
239 | QFrame *topFrame = addPage(i18n("General"),0,0); | 239 | QFrame *topFrame = addPage(i18n("General"),0,0); |
240 | // DesktopIcon("identity",KIcon::SizeMedium)); | 240 | // DesktopIcon("identity",KIcon::SizeMedium)); |
241 | 241 | ||
242 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); | 242 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); |
243 | topLayout->setSpacing(mSpacingHint); | 243 | topLayout->setSpacing(mSpacingHint); |
244 | topLayout->setMargin(mMarginHint); | 244 | topLayout->setMargin(mMarginHint); |
245 | 245 | ||
246 | // KPrefsDialogWidBool *emailControlCenter = | 246 | // KPrefsDialogWidBool *emailControlCenter = |
247 | // addWidBool(i18n("&Use email settings from Control Center"), | 247 | // addWidBool(i18n("&Use email settings from Control Center"), |
248 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); | 248 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); |
249 | // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); | 249 | // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); |
250 | // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), | 250 | // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), |
251 | // SLOT(toggleEmailSettings(bool))); | 251 | // SLOT(toggleEmailSettings(bool))); |
252 | 252 | ||
253 | mNameEdit = new QLineEdit(topFrame); | 253 | mNameEdit = new QLineEdit(topFrame); |
254 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); | 254 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); |
255 | topLayout->addWidget(mNameLabel,0,0); | 255 | topLayout->addWidget(mNameLabel,0,0); |
256 | topLayout->addWidget(mNameEdit,0,1); | 256 | topLayout->addWidget(mNameEdit,0,1); |
257 | 257 | ||
258 | mEmailEdit = new QLineEdit(topFrame); | 258 | mEmailEdit = new QLineEdit(topFrame); |
259 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); | 259 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); |
260 | topLayout->addWidget(mEmailLabel,1,0); | 260 | topLayout->addWidget(mEmailLabel,1,0); |
261 | topLayout->addWidget(mEmailEdit,1,1); | 261 | topLayout->addWidget(mEmailEdit,1,1); |
262 | KPrefsDialogWidBool *wb; | 262 | KPrefsDialogWidBool *wb; |
263 | 263 | ||
264 | 264 | ||
265 | 265 | ||
266 | KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"), | 266 | KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"), |
267 | &(KOPrefs::instance()->mShowFullMenu),topFrame); | 267 | &(KOPrefs::instance()->mShowFullMenu),topFrame); |
268 | topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1); | 268 | topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1); |
269 | 269 | ||
270 | 270 | ||
271 | widbool = addWidBool(i18n("Mini icons in toolbar(nr)"), | 271 | widbool = addWidBool(i18n("Mini icons in toolbar(nr)"), |
272 | &(KOPrefs::instance()->mToolBarMiniIcons),topFrame); | 272 | &(KOPrefs::instance()->mToolBarMiniIcons),topFrame); |
273 | topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1); | 273 | topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1); |
274 | 274 | ||
275 | 275 | ||
276 | KPrefsDialogWidBool *verticalScreen = | 276 | KPrefsDialogWidBool *verticalScreen = |
277 | addWidBool(i18n("Show vertical screen (Needs restart)"), | 277 | addWidBool(i18n("Vertical screen layout(Needs restart)"), |
278 | &(KOPrefs::instance()->mVerticalScreen),topFrame); | 278 | &(KOPrefs::instance()->mVerticalScreen),topFrame); |
279 | //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); | 279 | //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); |
280 | topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1); | 280 | topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1); |
281 | 281 | ||
282 | 282 | ||
283 | int iii = 5; | 283 | int iii = 5; |
284 | widbool = addWidBool(i18n("Block popup until mouse button release"), | 284 | widbool = addWidBool(i18n("Block popup until mouse button release"), |
285 | &(KOPrefs::instance()->mBlockPopupMenu),topFrame); | 285 | &(KOPrefs::instance()->mBlockPopupMenu),topFrame); |
286 | topLayout->addMultiCellWidget( widbool->checkBox(), iii,iii,0,1); | 286 | topLayout->addMultiCellWidget( widbool->checkBox(), iii,iii,0,1); |
287 | ++iii; | 287 | ++iii; |
288 | if ( QApplication::desktop()->height() <= 240 ) { | 288 | if ( QApplication::desktop()->height() <= 240 ) { |
289 | topFrame = addPage(i18n("General") +" 2",0,0); | 289 | topFrame = addPage(i18n("General") +" 2",0,0); |
290 | topLayout = new QGridLayout(topFrame,4,2); | 290 | topLayout = new QGridLayout(topFrame,4,2); |
291 | topLayout->setSpacing(2); | 291 | topLayout->setSpacing(2); |
292 | topLayout->setMargin(3); | 292 | topLayout->setMargin(3); |
293 | iii = 0; | 293 | iii = 0; |
294 | } | 294 | } |
295 | QHBox *dummy = new QHBox(topFrame); | 295 | QHBox *dummy = new QHBox(topFrame); |
296 | new QLabel(i18n("Days in Next-X-Days:"),dummy); | 296 | new QLabel(i18n("Days in Next-X-Days:"),dummy); |
297 | mNextXDaysSpin = new QSpinBox(2,14,1,dummy); | 297 | mNextXDaysSpin = new QSpinBox(2,14,1,dummy); |
298 | 298 | ||
299 | topLayout->addMultiCellWidget(dummy,iii,iii,0,1); | 299 | topLayout->addMultiCellWidget(dummy,iii,iii,0,1); |
300 | 300 | ||
301 | ++iii; | 301 | ++iii; |
302 | 302 | ||
303 | 303 | ||
304 | // KPrefsDialogWidBool *bcc = | 304 | // KPrefsDialogWidBool *bcc = |
305 | // addWidBool(i18n("Send copy to owner when mailing events"), | 305 | // addWidBool(i18n("Send copy to owner when mailing events"), |
306 | // &(KOPrefs::instance()->mBcc),topFrame); | 306 | // &(KOPrefs::instance()->mBcc),topFrame); |
307 | // topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); | 307 | // topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); |
308 | 308 | ||
309 | 309 | ||
310 | // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); | 310 | // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); |
311 | //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); | 311 | //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); |
312 | 312 | ||
313 | // addWidBool(i18n("Enable automatic saving of calendar"), | 313 | // addWidBool(i18n("Enable automatic saving of calendar"), |
314 | // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); | 314 | // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); |
315 | 315 | ||
316 | QHBox *intervalBox = new QHBox(topFrame); | 316 | QHBox *intervalBox = new QHBox(topFrame); |
317 | // intervalBox->setSpacing(mSpacingHint); | 317 | // intervalBox->setSpacing(mSpacingHint); |
318 | topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1); | 318 | topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1); |
319 | ++iii; | 319 | ++iii; |
320 | QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); | 320 | QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); |
321 | mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); | 321 | mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); |
322 | autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); | 322 | autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); |
323 | /* | 323 | /* |
324 | QHBox * agendasize = new QHBox ( topFrame ); | 324 | QHBox * agendasize = new QHBox ( topFrame ); |
325 | 325 | ||
326 | new QLabel (i18n("AllDayAgenda Height:"), agendasize ); | 326 | new QLabel (i18n("AllDayAgenda Height:"), agendasize ); |
327 | 327 | ||
328 | 328 | ||
329 | mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); | 329 | mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); |
330 | topLayout->addMultiCellWidget(agendasize,7,7,0,1); | 330 | topLayout->addMultiCellWidget(agendasize,7,7,0,1); |
331 | */ | 331 | */ |
332 | 332 | ||
333 | 333 | ||
334 | KPrefsDialogWidBool *ask = | 334 | KPrefsDialogWidBool *ask = |
335 | addWidBool(i18n("Ask for quit when closing KO/Pi"), | 335 | addWidBool(i18n("Ask for quit when closing KO/Pi"), |
336 | &(KOPrefs::instance()->mAskForQuit),topFrame); | 336 | &(KOPrefs::instance()->mAskForQuit),topFrame); |
337 | topLayout->addMultiCellWidget(ask->checkBox(),iii,iii,0,1); | 337 | topLayout->addMultiCellWidget(ask->checkBox(),iii,iii,0,1); |
338 | ++iii; | 338 | ++iii; |
339 | 339 | ||
340 | 340 | ||
341 | /* | 341 | /* |
342 | KPrefsDialogWidBool *confirmCheck = | 342 | KPrefsDialogWidBool *confirmCheck = |
343 | addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), | 343 | addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), |
344 | topFrame); | 344 | topFrame); |
345 | topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); | 345 | topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); |
346 | 346 | ||
347 | 347 | ||
348 | mEnableGroupScheduling = | 348 | mEnableGroupScheduling = |
349 | addWidBool(i18n("Enable group scheduling"), | 349 | addWidBool(i18n("Enable group scheduling"), |
350 | &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); | 350 | &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); |
351 | topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); | 351 | topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); |
352 | connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), | 352 | connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), |
353 | SLOT(warningGroupScheduling())); | 353 | SLOT(warningGroupScheduling())); |
354 | 354 | ||
355 | mEnableProjectView = | 355 | mEnableProjectView = |
356 | addWidBool(i18n("Enable project view"), | 356 | addWidBool(i18n("Enable project view"), |
357 | &(KOPrefs::instance()->mEnableProjectView),topFrame); | 357 | &(KOPrefs::instance()->mEnableProjectView),topFrame); |
358 | topLayout->addWidget(mEnableProjectView->checkBox(),9,0); | 358 | topLayout->addWidget(mEnableProjectView->checkBox(),9,0); |
359 | connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), | 359 | connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), |
360 | SLOT(warningProjectView())); | 360 | SLOT(warningProjectView())); |
361 | 361 | ||
362 | // Can't be disabled anymore | 362 | // Can't be disabled anymore |
363 | mEnableGroupScheduling->checkBox()->hide(); | 363 | mEnableGroupScheduling->checkBox()->hide(); |
364 | 364 | ||
365 | // Disable setting, because this feature now becomes stable | 365 | // Disable setting, because this feature now becomes stable |
366 | mEnableProjectView->checkBox()->hide(); | 366 | mEnableProjectView->checkBox()->hide(); |
367 | 367 | ||
368 | KPrefsDialogWidRadios *defaultFormatGroup = | 368 | KPrefsDialogWidRadios *defaultFormatGroup = |
369 | addWidRadios(i18n("Default Calendar Format"), | 369 | addWidRadios(i18n("Default Calendar Format"), |
370 | &(KOPrefs::instance()->mDefaultFormat),topFrame); | 370 | &(KOPrefs::instance()->mDefaultFormat),topFrame); |
371 | defaultFormatGroup->addRadio(i18n("vCalendar")); | 371 | defaultFormatGroup->addRadio(i18n("vCalendar")); |
372 | defaultFormatGroup->addRadio(i18n("iCalendar")); | 372 | defaultFormatGroup->addRadio(i18n("iCalendar")); |
373 | 373 | ||