-rw-r--r-- | korganizer/kolistview.cpp | 10 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 17 | ||||
-rw-r--r-- | korganizer/searchdialog.cpp | 12 |
3 files changed, 21 insertions, 18 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index e0e138e..341f473 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -698,553 +698,553 @@ void KOListView::writeToFile( bool iCal ) | |||
698 | KOPrefs::instance()->mLastSaveFile = fn; | 698 | KOPrefs::instance()->mLastSaveFile = fn; |
699 | topLevelWidget()->setCaption(mes); | 699 | topLevelWidget()->setCaption(mes); |
700 | } | 700 | } |
701 | } | 701 | } |
702 | } | 702 | } |
703 | void KOListView::deleteAll() | 703 | void KOListView::deleteAll() |
704 | { | 704 | { |
705 | int icount = 0; | 705 | int icount = 0; |
706 | QPtrList<Incidence> delSel ; | 706 | QPtrList<Incidence> delSel ; |
707 | QListViewItem *item = mListView->firstChild (); | 707 | QListViewItem *item = mListView->firstChild (); |
708 | while ( item ) { | 708 | while ( item ) { |
709 | if ( item->isSelected() ) { | 709 | if ( item->isSelected() ) { |
710 | delSel.append(((KOListViewItem *)item)->data()); | 710 | delSel.append(((KOListViewItem *)item)->data()); |
711 | ++icount; | 711 | ++icount; |
712 | } | 712 | } |
713 | 713 | ||
714 | item = item->nextSibling(); | 714 | item = item->nextSibling(); |
715 | } | 715 | } |
716 | if ( icount ) { | 716 | if ( icount ) { |
717 | Incidence *incidence = delSel.first(); | 717 | Incidence *incidence = delSel.first(); |
718 | Incidence *toDelete; | 718 | Incidence *toDelete; |
719 | KOPrefs *p = KOPrefs::instance(); | 719 | KOPrefs *p = KOPrefs::instance(); |
720 | bool confirm = p->mConfirm; | 720 | bool confirm = p->mConfirm; |
721 | QString mess; | 721 | QString mess; |
722 | mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount ); | 722 | mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount ); |
723 | if ( KMessageBox::Continue == KMessageBox::warningContinueCancel(this, mess + i18n("All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n"), i18n("KO/Pi Confirmation"),i18n("Delete")) ) { | 723 | if ( KMessageBox::Continue == KMessageBox::warningContinueCancel(this, mess + i18n("All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n"), i18n("KO/Pi Confirmation"),i18n("Delete")) ) { |
724 | p->mConfirm = false; | 724 | p->mConfirm = false; |
725 | int delCounter = 0; | 725 | int delCounter = 0; |
726 | QDialog dia ( this, "p-dialog", true ); | 726 | QDialog dia ( this, "p-dialog", true ); |
727 | QLabel lab (i18n("Close dialog to abort deletion!"), &dia ); | 727 | QLabel lab (i18n("Close dialog to abort deletion!"), &dia ); |
728 | QVBoxLayout lay( &dia ); | 728 | QVBoxLayout lay( &dia ); |
729 | lay.setMargin(7); | 729 | lay.setMargin(7); |
730 | lay.setSpacing(7); | 730 | lay.setSpacing(7); |
731 | lay.addWidget( &lab); | 731 | lay.addWidget( &lab); |
732 | QProgressBar bar( icount, &dia ); | 732 | QProgressBar bar( icount, &dia ); |
733 | lay.addWidget( &bar); | 733 | lay.addWidget( &bar); |
734 | int w = 220; | 734 | int w = 220; |
735 | int h = 50; | 735 | int h = 50; |
736 | int dw = QApplication::desktop()->width(); | 736 | int dw = QApplication::desktop()->width(); |
737 | int dh = QApplication::desktop()->height(); | 737 | int dh = QApplication::desktop()->height(); |
738 | dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 738 | dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
739 | //dia.resize( 240,50 ); | 739 | //dia.resize( 240,50 ); |
740 | dia.show(); | 740 | dia.show(); |
741 | 741 | ||
742 | while ( incidence ) { | 742 | while ( incidence ) { |
743 | bar.setProgress( delCounter ); | 743 | bar.setProgress( delCounter ); |
744 | mess = mess.sprintf( i18n("Deleting item %d ..."), ++delCounter ); | 744 | mess = mess.sprintf( i18n("Deleting item %d ..."), ++delCounter ); |
745 | dia.setCaption( mess ); | 745 | dia.setCaption( mess ); |
746 | qApp->processEvents(); | 746 | qApp->processEvents(); |
747 | toDelete = (incidence); | 747 | toDelete = (incidence); |
748 | incidence = delSel.next(); | 748 | incidence = delSel.next(); |
749 | emit deleteIncidenceSignal(toDelete ); | 749 | emit deleteIncidenceSignal(toDelete ); |
750 | if ( dia.result() != 0 ) | 750 | if ( dia.result() != 0 ) |
751 | break; | 751 | break; |
752 | 752 | ||
753 | } | 753 | } |
754 | mess = mess.sprintf( i18n("%d items remaining in list."), count() ); | 754 | mess = mess.sprintf( i18n("%d items remaining in list."), count() ); |
755 | topLevelWidget ()->setCaption( mess ); | 755 | topLevelWidget ()->setCaption( mess ); |
756 | p->mConfirm = confirm; | 756 | p->mConfirm = confirm; |
757 | } | 757 | } |
758 | } | 758 | } |
759 | 759 | ||
760 | 760 | ||
761 | } | 761 | } |
762 | int KOListView::maxDatesHint() | 762 | int KOListView::maxDatesHint() |
763 | { | 763 | { |
764 | return 0; | 764 | return 0; |
765 | } | 765 | } |
766 | 766 | ||
767 | int KOListView::currentDateCount() | 767 | int KOListView::currentDateCount() |
768 | { | 768 | { |
769 | return 0; | 769 | return 0; |
770 | } | 770 | } |
771 | 771 | ||
772 | QPtrList<Incidence> KOListView::selectedIncidences() | 772 | QPtrList<Incidence> KOListView::selectedIncidences() |
773 | { | 773 | { |
774 | QPtrList<Incidence> eventList; | 774 | QPtrList<Incidence> eventList; |
775 | QListViewItem *item = mListView->firstChild (); | 775 | QListViewItem *item = mListView->firstChild (); |
776 | while ( item ) { | 776 | while ( item ) { |
777 | if ( item->isSelected() ) { | 777 | if ( item->isSelected() ) { |
778 | eventList.append(((KOListViewItem *)item)->data()); | 778 | eventList.append(((KOListViewItem *)item)->data()); |
779 | } | 779 | } |
780 | 780 | ||
781 | item = item->nextSibling(); | 781 | item = item->nextSibling(); |
782 | } | 782 | } |
783 | 783 | ||
784 | // // QListViewItem *item = mListView->selectedItem(); | 784 | // // QListViewItem *item = mListView->selectedItem(); |
785 | //if (item) eventList.append(((KOListViewItem *)item)->data()); | 785 | //if (item) eventList.append(((KOListViewItem *)item)->data()); |
786 | 786 | ||
787 | return eventList; | 787 | return eventList; |
788 | } | 788 | } |
789 | 789 | ||
790 | DateList KOListView::selectedDates() | 790 | DateList KOListView::selectedDates() |
791 | { | 791 | { |
792 | DateList eventList; | 792 | DateList eventList; |
793 | return eventList; | 793 | return eventList; |
794 | } | 794 | } |
795 | 795 | ||
796 | void KOListView::showDates(bool show) | 796 | void KOListView::showDates(bool show) |
797 | { | 797 | { |
798 | // Shouldn't we set it to a value greater 0? When showDates is called with | 798 | // Shouldn't we set it to a value greater 0? When showDates is called with |
799 | // show == true at first, then the columnwidths are set to zero. | 799 | // show == true at first, then the columnwidths are set to zero. |
800 | static int oldColWidth1 = 0; | 800 | static int oldColWidth1 = 0; |
801 | static int oldColWidth3 = 0; | 801 | static int oldColWidth3 = 0; |
802 | 802 | ||
803 | if (!show) { | 803 | if (!show) { |
804 | oldColWidth1 = mListView->columnWidth(1); | 804 | oldColWidth1 = mListView->columnWidth(1); |
805 | oldColWidth3 = mListView->columnWidth(3); | 805 | oldColWidth3 = mListView->columnWidth(3); |
806 | mListView->setColumnWidth(1, 0); | 806 | mListView->setColumnWidth(1, 0); |
807 | mListView->setColumnWidth(3, 0); | 807 | mListView->setColumnWidth(3, 0); |
808 | } else { | 808 | } else { |
809 | mListView->setColumnWidth(1, oldColWidth1); | 809 | mListView->setColumnWidth(1, oldColWidth1); |
810 | mListView->setColumnWidth(3, oldColWidth3); | 810 | mListView->setColumnWidth(3, oldColWidth3); |
811 | } | 811 | } |
812 | mListView->repaint(); | 812 | mListView->repaint(); |
813 | } | 813 | } |
814 | 814 | ||
815 | void KOListView::printPreview(CalPrinter *calPrinter, const QDate &fd, | 815 | void KOListView::printPreview(CalPrinter *calPrinter, const QDate &fd, |
816 | const QDate &td) | 816 | const QDate &td) |
817 | { | 817 | { |
818 | #ifndef KORG_NOPRINTER | 818 | #ifndef KORG_NOPRINTER |
819 | calPrinter->preview(CalPrinter::Day, fd, td); | 819 | calPrinter->preview(CalPrinter::Day, fd, td); |
820 | #endif | 820 | #endif |
821 | } | 821 | } |
822 | 822 | ||
823 | void KOListView::showDates() | 823 | void KOListView::showDates() |
824 | { | 824 | { |
825 | showDates(true); | 825 | showDates(true); |
826 | } | 826 | } |
827 | 827 | ||
828 | void KOListView::hideDates() | 828 | void KOListView::hideDates() |
829 | { | 829 | { |
830 | showDates(false); | 830 | showDates(false); |
831 | } | 831 | } |
832 | void KOListView::resetFocus() | 832 | void KOListView::resetFocus() |
833 | { | 833 | { |
834 | mListView->setFocus(); | 834 | mListView->setFocus(); |
835 | } | 835 | } |
836 | void KOListView::updateView() | 836 | void KOListView::updateView() |
837 | { | 837 | { |
838 | mListView->setFocus(); | 838 | mListView->setFocus(); |
839 | if ( mListView->firstChild () ) | 839 | if ( mListView->firstChild () ) |
840 | mListView->setCurrentItem( mListView->firstChild () ); | 840 | mListView->setCurrentItem( mListView->firstChild () ); |
841 | } | 841 | } |
842 | void KOListView::updateConfig() | 842 | void KOListView::updateConfig() |
843 | { | 843 | { |
844 | 844 | ||
845 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); | 845 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); |
846 | updateView(); | 846 | updateView(); |
847 | 847 | ||
848 | } | 848 | } |
849 | void KOListView::setStartDate(const QDate &start) | 849 | void KOListView::setStartDate(const QDate &start) |
850 | { | 850 | { |
851 | mStartDate = start; | 851 | mStartDate = start; |
852 | } | 852 | } |
853 | 853 | ||
854 | void KOListView::showDates(const QDate &start, const QDate &end) | 854 | void KOListView::showDates(const QDate &start, const QDate &end) |
855 | { | 855 | { |
856 | clear(); | 856 | clear(); |
857 | mStartDate = start; | 857 | mStartDate = start; |
858 | QDate date = start; | 858 | QDate date = start; |
859 | QPtrList<Journal> j_list; | 859 | QPtrList<Journal> j_list; |
860 | while( date <= end ) { | 860 | while( date <= end ) { |
861 | addEvents(calendar()->events(date)); | 861 | addEvents(calendar()->events(date)); |
862 | addTodos(calendar()->todos(date)); | 862 | addTodos(calendar()->todos(date)); |
863 | Journal* jo = calendar()->journal(date); | 863 | Journal* jo = calendar()->journal(date); |
864 | if ( jo ) | 864 | if ( jo ) |
865 | j_list.append( jo ); | 865 | j_list.append( jo ); |
866 | date = date.addDays( 1 ); | 866 | date = date.addDays( 1 ); |
867 | } | 867 | } |
868 | addJournals(j_list); | 868 | addJournals(j_list); |
869 | emit incidenceSelected( 0 ); | 869 | emit incidenceSelected( 0 ); |
870 | updateView(); | 870 | updateView(); |
871 | 871 | ||
872 | } | 872 | } |
873 | 873 | ||
874 | void KOListView::addEvents(QPtrList<Event> eventList) | 874 | void KOListView::addEvents(QPtrList<Event> eventList) |
875 | { | 875 | { |
876 | Event *ev; | 876 | Event *ev; |
877 | for(ev = eventList.first(); ev; ev = eventList.next()) { | 877 | for(ev = eventList.first(); ev; ev = eventList.next()) { |
878 | addIncidence(ev); | 878 | addIncidence(ev); |
879 | } | 879 | } |
880 | if ( !mListView->currentItem() ){ | 880 | if ( !mListView->currentItem() ){ |
881 | updateView(); | 881 | updateView(); |
882 | } | 882 | } |
883 | } | 883 | } |
884 | 884 | ||
885 | void KOListView::addTodos(QPtrList<Todo> eventList) | 885 | void KOListView::addTodos(QPtrList<Todo> eventList) |
886 | { | 886 | { |
887 | Todo *ev; | 887 | Todo *ev; |
888 | for(ev = eventList.first(); ev; ev = eventList.next()) { | 888 | for(ev = eventList.first(); ev; ev = eventList.next()) { |
889 | addIncidence(ev); | 889 | addIncidence(ev); |
890 | } | 890 | } |
891 | if ( !mListView->currentItem() ){ | 891 | if ( !mListView->currentItem() ){ |
892 | updateView(); | 892 | updateView(); |
893 | } | 893 | } |
894 | } | 894 | } |
895 | void KOListView::addJournals(QPtrList<Journal> eventList) | 895 | void KOListView::addJournals(QPtrList<Journal> eventList) |
896 | { | 896 | { |
897 | Journal *ev; | 897 | Journal *ev; |
898 | for(ev = eventList.first(); ev; ev = eventList.next()) { | 898 | for(ev = eventList.first(); ev; ev = eventList.next()) { |
899 | addIncidence(ev); | 899 | addIncidence(ev); |
900 | } | 900 | } |
901 | if ( !mListView->currentItem() ){ | 901 | if ( !mListView->currentItem() ){ |
902 | updateView(); | 902 | updateView(); |
903 | } | 903 | } |
904 | } | 904 | } |
905 | 905 | ||
906 | void KOListView::addIncidence(Incidence *incidence) | 906 | void KOListView::addIncidence(Incidence *incidence) |
907 | { | 907 | { |
908 | if ( mUidDict.find( incidence->uid() ) ) return; | 908 | if ( mUidDict.find( incidence->uid() ) ) return; |
909 | 909 | ||
910 | // mListView->setFont ( KOPrefs::instance()->mListViewFont ); | 910 | // mListView->setFont ( KOPrefs::instance()->mListViewFont ); |
911 | mUidDict.insert( incidence->uid(), incidence ); | 911 | mUidDict.insert( incidence->uid(), incidence ); |
912 | 912 | ||
913 | KOListViewItem *item = new KOListViewItem( incidence, mListView ); | 913 | KOListViewItem *item = new KOListViewItem( incidence, mListView ); |
914 | ListItemVisitor v(item, mStartDate ); | 914 | ListItemVisitor v(item, mStartDate ); |
915 | if (incidence->accept(v)) return; | 915 | if (incidence->accept(v)) return; |
916 | else delete item; | 916 | else delete item; |
917 | //qDebug("delete item "); | 917 | //qDebug("delete item "); |
918 | } | 918 | } |
919 | 919 | ||
920 | void KOListView::showEvents(QPtrList<Event> eventList) | 920 | void KOListView::showEvents(QPtrList<Event> eventList) |
921 | { | 921 | { |
922 | clear(); | 922 | clear(); |
923 | 923 | ||
924 | addEvents(eventList); | 924 | addEvents(eventList); |
925 | 925 | ||
926 | // After new creation of list view no events are selected. | 926 | // After new creation of list view no events are selected. |
927 | emit incidenceSelected( 0 ); | 927 | emit incidenceSelected( 0 ); |
928 | } | 928 | } |
929 | int KOListView::count() | 929 | int KOListView::count() |
930 | { | 930 | { |
931 | return mListView->childCount(); | 931 | return mListView->childCount(); |
932 | } | 932 | } |
933 | 933 | ||
934 | void KOListView::changeEventDisplay(Event *event, int action) | 934 | void KOListView::changeEventDisplay(Event *event, int action) |
935 | { | 935 | { |
936 | KOListViewItem *item; | 936 | KOListViewItem *item; |
937 | 937 | ||
938 | switch(action) { | 938 | switch(action) { |
939 | case KOGlobals::EVENTADDED: | 939 | case KOGlobals::EVENTADDED: |
940 | addIncidence( event ); | 940 | addIncidence( event ); |
941 | break; | 941 | break; |
942 | case KOGlobals::EVENTEDITED: | 942 | case KOGlobals::EVENTEDITED: |
943 | item = getItemForEvent(event); | 943 | item = getItemForEvent(event); |
944 | if (item) { | 944 | if (item) { |
945 | mUidDict.remove( event->uid() ); | 945 | mUidDict.remove( event->uid() ); |
946 | delete item; | 946 | delete item; |
947 | addIncidence( event ); | 947 | addIncidence( event ); |
948 | } | 948 | } |
949 | break; | 949 | break; |
950 | case KOGlobals::EVENTDELETED: | 950 | case KOGlobals::EVENTDELETED: |
951 | item = getItemForEvent(event); | 951 | item = getItemForEvent(event); |
952 | if (item) { | 952 | if (item) { |
953 | mUidDict.remove( event->uid() ); | 953 | mUidDict.remove( event->uid() ); |
954 | delete item; | 954 | delete item; |
955 | } | 955 | } |
956 | break; | 956 | break; |
957 | default: | 957 | default: |
958 | ; | 958 | ; |
959 | } | 959 | } |
960 | } | 960 | } |
961 | 961 | ||
962 | KOListViewItem *KOListView::getItemForEvent(Event *event) | 962 | KOListViewItem *KOListView::getItemForEvent(Event *event) |
963 | { | 963 | { |
964 | KOListViewItem *item = (KOListViewItem *)mListView->firstChild(); | 964 | KOListViewItem *item = (KOListViewItem *)mListView->firstChild(); |
965 | while (item) { | 965 | while (item) { |
966 | if (item->data() == event) return item; | 966 | if (item->data() == event) return item; |
967 | item = (KOListViewItem *)item->nextSibling(); | 967 | item = (KOListViewItem *)item->nextSibling(); |
968 | } | 968 | } |
969 | return 0; | 969 | return 0; |
970 | } | 970 | } |
971 | 971 | ||
972 | void KOListView::defaultItemAction(QListViewItem *i) | 972 | void KOListView::defaultItemAction(QListViewItem *i) |
973 | { | 973 | { |
974 | KOListViewItem *item = static_cast<KOListViewItem *>( i ); | 974 | KOListViewItem *item = static_cast<KOListViewItem *>( i ); |
975 | if ( item ) defaultAction( item->data() ); | 975 | if ( item ) defaultAction( item->data() ); |
976 | 976 | ||
977 | } | 977 | } |
978 | 978 | ||
979 | void KOListView::popupMenu(QListViewItem *item,const QPoint &,int) | 979 | void KOListView::popupMenu(QListViewItem *item,const QPoint &,int) |
980 | { | 980 | { |
981 | mActiveItem = (KOListViewItem *)item; | 981 | mActiveItem = (KOListViewItem *)item; |
982 | if (mActiveItem) { | 982 | if (mActiveItem) { |
983 | Incidence *incidence = mActiveItem->data(); | 983 | Incidence *incidence = mActiveItem->data(); |
984 | mPopupMenu->showIncidencePopup(incidence); | 984 | mPopupMenu->showIncidencePopup(incidence); |
985 | 985 | ||
986 | /* | 986 | /* |
987 | if ( incidence && incidence->type() == "Event" ) { | 987 | if ( incidence && incidence->type() == "Event" ) { |
988 | Event *event = static_cast<Event *>( incidence ); | 988 | Event *event = static_cast<Event *>( incidence ); |
989 | mPopupMenu->showEventPopup(event); | 989 | mPopupMenu->showEventPopup(event); |
990 | } | 990 | } |
991 | */ | 991 | */ |
992 | } | 992 | } |
993 | } | 993 | } |
994 | 994 | ||
995 | void KOListView::readSettings(KConfig *config, QString setting) | 995 | void KOListView::readSettings(KConfig *config, QString setting) |
996 | { | 996 | { |
997 | // qDebug("KOListView::readSettings "); | 997 | // qDebug("KOListView::readSettings "); |
998 | mListView->restoreLayout(config,setting); | 998 | mListView->restoreLayout(config,setting); |
999 | } | 999 | } |
1000 | 1000 | ||
1001 | void KOListView::writeSettings(KConfig *config, QString setting) | 1001 | void KOListView::writeSettings(KConfig *config, QString setting) |
1002 | { | 1002 | { |
1003 | // qDebug("KOListView::writeSettings "); | 1003 | // qDebug("KOListView::writeSettings "); |
1004 | mListView->saveLayout(config, setting); | 1004 | mListView->saveLayout(config, setting); |
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | void KOListView::processSelectionChange(QListViewItem *) | 1007 | void KOListView::processSelectionChange(QListViewItem *) |
1008 | { | 1008 | { |
1009 | 1009 | ||
1010 | KOListViewItem *item = | 1010 | KOListViewItem *item = |
1011 | static_cast<KOListViewItem *>( mListView->currentItem() ); | 1011 | static_cast<KOListViewItem *>( mListView->currentItem() ); |
1012 | 1012 | ||
1013 | if ( !item ) { | 1013 | if ( !item ) { |
1014 | emit incidenceSelected( 0 ); | 1014 | emit incidenceSelected( 0 ); |
1015 | } else { | 1015 | } else { |
1016 | emit incidenceSelected( item->data() ); | 1016 | emit incidenceSelected( item->data() ); |
1017 | } | 1017 | } |
1018 | } | 1018 | } |
1019 | 1019 | ||
1020 | void KOListView::clearSelection() | 1020 | void KOListView::clearSelection() |
1021 | { | 1021 | { |
1022 | mListView->selectAll( false ); | 1022 | mListView->selectAll( false ); |
1023 | } | 1023 | } |
1024 | void KOListView::allSelection() | 1024 | void KOListView::allSelection() |
1025 | { | 1025 | { |
1026 | mListView->selectAll( true ); | 1026 | mListView->selectAll( true ); |
1027 | } | 1027 | } |
1028 | 1028 | ||
1029 | void KOListView::clear() | 1029 | void KOListView::clear() |
1030 | { | 1030 | { |
1031 | mListView->clear(); | 1031 | mListView->clear(); |
1032 | mUidDict.clear(); | 1032 | mUidDict.clear(); |
1033 | } | 1033 | } |
1034 | 1034 | ||
1035 | Incidence* KOListView::currentItem() | 1035 | Incidence* KOListView::currentItem() |
1036 | { | 1036 | { |
1037 | if ( mListView->currentItem() ) | 1037 | if ( mListView->currentItem() ) |
1038 | return ((KOListViewItem*) mListView->currentItem())->data(); | 1038 | return ((KOListViewItem*) mListView->currentItem())->data(); |
1039 | return 0; | 1039 | return 0; |
1040 | } | 1040 | } |
1041 | void KOListView::keyPressEvent ( QKeyEvent *e) | 1041 | void KOListView::keyPressEvent ( QKeyEvent *e) |
1042 | { | 1042 | { |
1043 | 1043 | ||
1044 | if ( e->key() == Qt::Key_Delete || e->key() == Qt::Key_Backspace ) { | 1044 | if ( e->key() == Qt::Key_Delete || e->key() == Qt::Key_Backspace ) { |
1045 | deleteAll(); | 1045 | deleteAll(); |
1046 | return; | 1046 | return; |
1047 | } | 1047 | } |
1048 | 1048 | ||
1049 | e->ignore(); | 1049 | e->ignore(); |
1050 | } | 1050 | } |
1051 | void KOListViewListView::keyPressEvent ( QKeyEvent *e) | 1051 | void KOListViewListView::keyPressEvent ( QKeyEvent *e) |
1052 | { | 1052 | { |
1053 | 1053 | ||
1054 | switch ( e->key() ) { | 1054 | switch ( e->key() ) { |
1055 | case Qt::Key_Down: | 1055 | case Qt::Key_Down: |
1056 | if ( e->state() == ShiftButton ) { | 1056 | if ( e->state() == ShiftButton ) { |
1057 | QListViewItem* cn = currentItem(); | 1057 | QListViewItem* cn = currentItem(); |
1058 | if ( !cn ) | 1058 | if ( !cn ) |
1059 | cn = firstChild(); | 1059 | cn = firstChild(); |
1060 | if ( !cn ) | 1060 | if ( !cn ) |
1061 | return; | 1061 | return; |
1062 | while ( cn->nextSibling() ) | 1062 | while ( cn->nextSibling() ) |
1063 | cn = cn->nextSibling(); | 1063 | cn = cn->nextSibling(); |
1064 | setCurrentItem ( cn ); | 1064 | setCurrentItem ( cn ); |
1065 | ensureItemVisible ( cn ); | 1065 | ensureItemVisible ( cn ); |
1066 | 1066 | ||
1067 | e->accept(); | 1067 | e->accept(); |
1068 | return; | 1068 | return; |
1069 | } | 1069 | } |
1070 | if ( e->state() == ControlButton ) { | 1070 | if ( e->state() == ControlButton ) { |
1071 | int count = childCount (); | 1071 | int count = childCount (); |
1072 | int jump = count / 5; | 1072 | int jump = count / 5; |
1073 | QListViewItem* cn; | 1073 | QListViewItem* cn; |
1074 | cn = currentItem(); | 1074 | cn = currentItem(); |
1075 | if ( ! cn ) | 1075 | if ( ! cn ) |
1076 | return; | 1076 | return; |
1077 | if ( jump == 0 ) | 1077 | if ( jump == 0 ) |
1078 | jump = 1; | 1078 | jump = 1; |
1079 | while ( jump && cn->nextSibling() ) { | 1079 | while ( jump && cn->nextSibling() ) { |
1080 | cn = cn->nextSibling(); | 1080 | cn = cn->nextSibling(); |
1081 | --jump; | 1081 | --jump; |
1082 | } | 1082 | } |
1083 | setCurrentItem ( cn ); | 1083 | setCurrentItem ( cn ); |
1084 | ensureItemVisible ( cn ); | 1084 | ensureItemVisible ( cn ); |
1085 | 1085 | ||
1086 | } else | 1086 | } else |
1087 | QListView::keyPressEvent ( e ) ; | 1087 | QListView::keyPressEvent ( e ) ; |
1088 | e->accept(); | 1088 | e->accept(); |
1089 | break; | 1089 | break; |
1090 | 1090 | ||
1091 | case Qt::Key_Up: | 1091 | case Qt::Key_Up: |
1092 | if ( e->state() == ShiftButton ) { | 1092 | if ( e->state() == ShiftButton ) { |
1093 | QListViewItem* cn = firstChild(); | 1093 | QListViewItem* cn = firstChild(); |
1094 | if ( cn ) { | 1094 | if ( cn ) { |
1095 | setCurrentItem ( cn ); | 1095 | setCurrentItem ( cn ); |
1096 | ensureItemVisible ( cn ); | 1096 | ensureItemVisible ( cn ); |
1097 | } | 1097 | } |
1098 | e->accept(); | 1098 | e->accept(); |
1099 | return; | 1099 | return; |
1100 | } | 1100 | } |
1101 | if ( e->state() == ControlButton ) { | 1101 | if ( e->state() == ControlButton ) { |
1102 | int count = childCount (); | 1102 | int count = childCount (); |
1103 | int jump = count / 5; | 1103 | int jump = count / 5; |
1104 | QListViewItem* cn; | 1104 | QListViewItem* cn; |
1105 | cn = currentItem(); | 1105 | cn = currentItem(); |
1106 | if ( ! cn ) | 1106 | if ( ! cn ) |
1107 | return; | 1107 | return; |
1108 | if ( jump == 0 ) | 1108 | if ( jump == 0 ) |
1109 | jump = 1; | 1109 | jump = 1; |
1110 | while ( jump && cn->itemAbove ()) { | 1110 | while ( jump && cn->itemAbove ()) { |
1111 | cn = cn->itemAbove (); | 1111 | cn = cn->itemAbove (); |
1112 | --jump; | 1112 | --jump; |
1113 | } | 1113 | } |
1114 | setCurrentItem ( cn ); | 1114 | setCurrentItem ( cn ); |
1115 | ensureItemVisible ( cn ); | 1115 | ensureItemVisible ( cn ); |
1116 | } else | 1116 | } else |
1117 | QListView::keyPressEvent ( e ) ; | 1117 | QListView::keyPressEvent ( e ) ; |
1118 | e->accept(); | 1118 | e->accept(); |
1119 | break; | 1119 | break; |
1120 | case Qt::Key_I: { | 1120 | case Qt::Key_I: { |
1121 | QListViewItem* cn; | 1121 | QListViewItem* cn; |
1122 | cn = currentItem(); | 1122 | cn = currentItem(); |
1123 | if ( cn ) { | 1123 | if ( cn ) { |
1124 | KOListViewItem* ci = (KOListViewItem*)( cn ); | 1124 | KOListViewItem* ci = (KOListViewItem*)( cn ); |
1125 | if ( ci ){ | 1125 | if ( ci ){ |
1126 | //emit showIncidence( ci->data()); | 1126 | //emit showIncidence( ci->data()); |
1127 | cn = cn->nextSibling(); | 1127 | cn = cn->nextSibling(); |
1128 | if ( cn ) { | 1128 | if ( cn ) { |
1129 | setCurrentItem ( cn ); | 1129 | setCurrentItem ( cn ); |
1130 | ensureItemVisible ( cn ); | 1130 | ensureItemVisible ( cn ); |
1131 | } | 1131 | } |
1132 | emit showIncidence( ci->data()); | 1132 | emit showIncidence( ci->data()); |
1133 | } | 1133 | } |
1134 | } | 1134 | } |
1135 | e->accept(); | 1135 | e->accept(); |
1136 | } | 1136 | } |
1137 | break; | 1137 | break; |
1138 | case Qt::Key_Return: | 1138 | case Qt::Key_Return: |
1139 | case Qt::Key_Enter: | 1139 | case Qt::Key_Enter: |
1140 | { | 1140 | { |
1141 | QListViewItem* cn; | 1141 | QListViewItem* cn; |
1142 | cn = currentItem(); | 1142 | cn = currentItem(); |
1143 | if ( cn ) { | 1143 | if ( cn ) { |
1144 | KOListViewItem* ci = (KOListViewItem*)( cn ); | 1144 | KOListViewItem* ci = (KOListViewItem*)( cn ); |
1145 | if ( ci ){ | 1145 | if ( ci ){ |
1146 | if ( e->state() == ShiftButton ) | 1146 | if ( e->state() == ShiftButton ) |
1147 | ci->setSelected( false ); | 1147 | ci->setSelected( false ); |
1148 | else | 1148 | else |
1149 | ci->setSelected( true ); | 1149 | ci->setSelected( true ); |
1150 | cn = cn->nextSibling(); | 1150 | cn = cn->nextSibling(); |
1151 | if ( cn ) { | 1151 | if ( cn ) { |
1152 | setCurrentItem ( cn ); | 1152 | setCurrentItem ( cn ); |
1153 | ensureItemVisible ( cn ); | 1153 | ensureItemVisible ( cn ); |
1154 | } | 1154 | } |
1155 | } | 1155 | } |
1156 | } | 1156 | } |
1157 | e->accept(); | 1157 | e->accept(); |
1158 | } | 1158 | } |
1159 | break; | 1159 | break; |
1160 | default: | 1160 | default: |
1161 | e->ignore(); | 1161 | e->ignore(); |
1162 | } | 1162 | } |
1163 | } | 1163 | } |
1164 | KOListViewListView::KOListViewListView(KOListView * lv ) | 1164 | KOListViewListView::KOListViewListView(KOListView * lv ) |
1165 | : KListView( lv, "kolistlistview", false ) | 1165 | : KListView( lv, "kolistlistview", false ) |
1166 | { | 1166 | { |
1167 | mPopupTimer = new QTimer(this); | 1167 | mPopupTimer = new QTimer(this); |
1168 | connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); | 1168 | connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); |
1169 | #ifndef DESKTOP_VERSION | 1169 | #ifndef DESKTOP_VERSION |
1170 | //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); | 1170 | //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); |
1171 | #endif | 1171 | #endif |
1172 | setSelectionMode( QListView::Multi ); | 1172 | setSelectionMode( QListView::Multi ); |
1173 | setMultiSelection( true); | 1173 | setMultiSelection( true); |
1174 | } | 1174 | } |
1175 | void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) | 1175 | void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) |
1176 | { | 1176 | { |
1177 | if (!e) return; | 1177 | if (!e) return; |
1178 | QPoint vp = contentsToViewport(e->pos()); | 1178 | QPoint vp = contentsToViewport(e->pos()); |
1179 | QListViewItem *item = itemAt(vp); | 1179 | QListViewItem *item = itemAt(vp); |
1180 | if (!item) { | 1180 | if (!item) { |
1181 | emit newEvent(); | 1181 | emit newEvent(); |
1182 | return; | 1182 | return; |
1183 | } | 1183 | } |
1184 | KListView::contentsMouseDoubleClickEvent(e); | 1184 | KListView::contentsMouseDoubleClickEvent(e); |
1185 | } | 1185 | } |
1186 | #if 0 | 1186 | #if 0 |
1187 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) | 1187 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) |
1188 | { | 1188 | { |
1189 | //qDebug("contentsMousePressEvent++++ "); | 1189 | //qDebug("contentsMousePressEvent++++ "); |
1190 | KListView::contentsMousePressEvent( e ); | 1190 | KListView::contentsMousePressEvent( e ); |
1191 | if ( e->button() == RightButton ) { | 1191 | if ( e->button() == RightButton ) { |
1192 | QListViewItem* ci = currentItem(); | 1192 | QListViewItem* ci = currentItem(); |
1193 | clearSelection () ; | 1193 | clearSelection () ; |
1194 | if ( ci ) | 1194 | if ( ci ) |
1195 | ci->setSelected( true ); | 1195 | ci->setSelected( true ); |
1196 | } | 1196 | } |
1197 | } | 1197 | } |
1198 | void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) | 1198 | void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) |
1199 | { | 1199 | { |
1200 | KListView::contentsMouseReleaseEvent(e); | 1200 | KListView::contentsMouseReleaseEvent(e); |
1201 | } | 1201 | } |
1202 | void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) | 1202 | void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) |
1203 | { | 1203 | { |
1204 | KListView::contentsMouseMoveEvent(e); | 1204 | KListView::contentsMouseMoveEvent(e); |
1205 | } | 1205 | } |
1206 | #endif | 1206 | #endif |
1207 | void KOListViewListView::popupMenu() | 1207 | void KOListViewListView::popupMenu() |
1208 | { | 1208 | { |
1209 | mPopupTimer->stop(); | 1209 | mPopupTimer->stop(); |
1210 | //qDebug("HUUUUUUUUUUUUUUUUUUUU "); | ||
1211 | QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, RightButton , RightButton ); | 1210 | QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, RightButton , RightButton ); |
1212 | QApplication::postEvent( this->viewport(), e ); | 1211 | QApplication::postEvent( this->viewport(), e ); |
1212 | |||
1213 | } | 1213 | } |
1214 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) | 1214 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) |
1215 | { | 1215 | { |
1216 | //qDebug("contentsMousePressEvent++++ "); | 1216 | //qDebug("contentsMousePressEvent++++ %d %d", e->pos().y(), e->globalPos().y()); |
1217 | mYMousePos = mapToGlobal( (e->pos())).y(); | 1217 | mYMousePos = mapToGlobal( (e->pos())).y(); |
1218 | if ( e->button() == LeftButton ) { | 1218 | if ( e->button() == LeftButton ) { |
1219 | mPopupTimer->start( 600 ); | 1219 | mPopupTimer->start( 600 ); |
1220 | mEventPos = e->pos(); | 1220 | mEventPos = contentsToViewport(e->pos()); |
1221 | mEventGlobalPos = e->globalPos(); | 1221 | mEventGlobalPos = e->globalPos(); |
1222 | } | 1222 | } |
1223 | KListView::contentsMousePressEvent( e ); | 1223 | KListView::contentsMousePressEvent( e ); |
1224 | if ( e->button() == RightButton ) { | 1224 | if ( e->button() == RightButton ) { |
1225 | QListViewItem* ci = currentItem(); | 1225 | QListViewItem* ci = currentItem(); |
1226 | //clearSelection(); | 1226 | //clearSelection(); |
1227 | if ( ci ) | 1227 | if ( ci ) |
1228 | ci->setSelected( true ); | 1228 | ci->setSelected( true ); |
1229 | } | 1229 | } |
1230 | } | 1230 | } |
1231 | void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) | 1231 | void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) |
1232 | { | 1232 | { |
1233 | mPopupTimer->stop(); | 1233 | mPopupTimer->stop(); |
1234 | KListView::contentsMouseReleaseEvent(e); | 1234 | KListView::contentsMouseReleaseEvent(e); |
1235 | } | 1235 | } |
1236 | void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) | 1236 | void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) |
1237 | { | 1237 | { |
1238 | // qDebug("contentsMouseMoveEv....... "); | 1238 | // qDebug("contentsMouseMoveEv....... "); |
1239 | // qDebug("start: %d current %d ",mYMousePos , mapToGlobal( (e->pos())).y() ); | 1239 | // qDebug("start: %d current %d ",mYMousePos , mapToGlobal( (e->pos())).y() ); |
1240 | int diff = mYMousePos - mapToGlobal( (e->pos())).y(); | 1240 | int diff = mYMousePos - mapToGlobal( (e->pos())).y(); |
1241 | if ( diff < 0 ) diff = -diff; | 1241 | if ( diff < 0 ) diff = -diff; |
1242 | if ( diff > 15 ) | 1242 | if ( diff > 15 ) |
1243 | mPopupTimer->stop(); | 1243 | mPopupTimer->stop(); |
1244 | else { | 1244 | else { |
1245 | mEventPos = e->pos(); | 1245 | mEventPos = contentsToViewport(e->pos()); |
1246 | mEventGlobalPos = e->globalPos(); | 1246 | mEventGlobalPos = e->globalPos(); |
1247 | } | 1247 | } |
1248 | KListView::contentsMouseMoveEvent(e); | 1248 | KListView::contentsMouseMoveEvent(e); |
1249 | } | 1249 | } |
1250 | 1250 | ||
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 8439b81..e72f94b 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp | |||
@@ -317,1054 +317,1051 @@ void KOPrefsDialog::setupSyncTab() | |||
317 | ++iii; | 317 | ++iii; |
318 | 318 | ||
319 | mLocalTempFile = new QLineEdit(topFrame); | 319 | mLocalTempFile = new QLineEdit(topFrame); |
320 | lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); | 320 | lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); |
321 | topLayout->addWidget(lab ,iii,0); | 321 | topLayout->addWidget(lab ,iii,0); |
322 | topLayout->addWidget(mLocalTempFile,iii,1); | 322 | topLayout->addWidget(mLocalTempFile,iii,1); |
323 | ++iii; | 323 | ++iii; |
324 | 324 | ||
325 | KPrefsDialogWidBool *wb = | 325 | KPrefsDialogWidBool *wb = |
326 | addWidBool(i18n("Write back synced file"), | 326 | addWidBool(i18n("Write back synced file"), |
327 | &(KOPrefs::instance()->mWriteBackFile),topFrame); | 327 | &(KOPrefs::instance()->mWriteBackFile),topFrame); |
328 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); | 328 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); |
329 | ++iii; | 329 | ++iii; |
330 | wb = | 330 | wb = |
331 | addWidBool(i18n("Write back existing entries only"), | 331 | addWidBool(i18n("Write back existing entries only"), |
332 | &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); | 332 | &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); |
333 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); | 333 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); |
334 | ++iii; | 334 | ++iii; |
335 | 335 | ||
336 | #endif | 336 | #endif |
337 | } | 337 | } |
338 | 338 | ||
339 | void KOPrefsDialog::setupMainTab() | 339 | void KOPrefsDialog::setupMainTab() |
340 | { | 340 | { |
341 | QFrame *topFrame = addPage(i18n("General"),0,0); | 341 | QFrame *topFrame = addPage(i18n("General"),0,0); |
342 | // DesktopIcon("identity",KIcon::SizeMedium)); | 342 | // DesktopIcon("identity",KIcon::SizeMedium)); |
343 | 343 | ||
344 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); | 344 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); |
345 | topLayout->setSpacing(mSpacingHint); | 345 | topLayout->setSpacing(mSpacingHint); |
346 | topLayout->setMargin(mMarginHint); | 346 | topLayout->setMargin(mMarginHint); |
347 | 347 | ||
348 | // KPrefsDialogWidBool *emailControlCenter = | 348 | // KPrefsDialogWidBool *emailControlCenter = |
349 | // addWidBool(i18n("&Use email settings from Control Center"), | 349 | // addWidBool(i18n("&Use email settings from Control Center"), |
350 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); | 350 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); |
351 | // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); | 351 | // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); |
352 | // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), | 352 | // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), |
353 | // SLOT(toggleEmailSettings(bool))); | 353 | // SLOT(toggleEmailSettings(bool))); |
354 | 354 | ||
355 | mNameEdit = new QLineEdit(topFrame); | 355 | mNameEdit = new QLineEdit(topFrame); |
356 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); | 356 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); |
357 | topLayout->addWidget(mNameLabel,0,0); | 357 | topLayout->addWidget(mNameLabel,0,0); |
358 | topLayout->addWidget(mNameEdit,0,1); | 358 | topLayout->addWidget(mNameEdit,0,1); |
359 | 359 | ||
360 | mEmailEdit = new QLineEdit(topFrame); | 360 | mEmailEdit = new QLineEdit(topFrame); |
361 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); | 361 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); |
362 | topLayout->addWidget(mEmailLabel,1,0); | 362 | topLayout->addWidget(mEmailLabel,1,0); |
363 | topLayout->addWidget(mEmailEdit,1,1); | 363 | topLayout->addWidget(mEmailEdit,1,1); |
364 | KPrefsDialogWidBool *wb; | 364 | KPrefsDialogWidBool *wb; |
365 | 365 | ||
366 | 366 | ||
367 | 367 | ||
368 | KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"), | 368 | KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"), |
369 | &(KOPrefs::instance()->mShowFullMenu),topFrame); | 369 | &(KOPrefs::instance()->mShowFullMenu),topFrame); |
370 | topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1); | 370 | topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1); |
371 | 371 | ||
372 | 372 | ||
373 | widbool = addWidBool(i18n("Mini icons in toolbar(nr)"), | 373 | widbool = addWidBool(i18n("Mini icons in toolbar(nr)"), |
374 | &(KOPrefs::instance()->mToolBarMiniIcons),topFrame); | 374 | &(KOPrefs::instance()->mToolBarMiniIcons),topFrame); |
375 | topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1); | 375 | topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1); |
376 | 376 | ||
377 | 377 | ||
378 | KPrefsDialogWidBool *verticalScreen = | 378 | KPrefsDialogWidBool *verticalScreen = |
379 | addWidBool(i18n("Show vertical screen (Needs restart)"), | 379 | addWidBool(i18n("Show vertical screen (Needs restart)"), |
380 | &(KOPrefs::instance()->mVerticalScreen),topFrame); | 380 | &(KOPrefs::instance()->mVerticalScreen),topFrame); |
381 | //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); | 381 | //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); |
382 | topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1); | 382 | topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1); |
383 | 383 | ||
384 | 384 | ||
385 | QHBox *dummy = new QHBox(topFrame); | 385 | QHBox *dummy = new QHBox(topFrame); |
386 | new QLabel(i18n("Days in Next-X-Days:"),dummy); | 386 | new QLabel(i18n("Days in Next-X-Days:"),dummy); |
387 | mNextXDaysSpin = new QSpinBox(2,14,1,dummy); | 387 | mNextXDaysSpin = new QSpinBox(2,14,1,dummy); |
388 | 388 | ||
389 | topLayout->addMultiCellWidget(dummy,5,5,0,1); | 389 | topLayout->addMultiCellWidget(dummy,5,5,0,1); |
390 | 390 | ||
391 | 391 | ||
392 | 392 | ||
393 | // KPrefsDialogWidBool *bcc = | 393 | // KPrefsDialogWidBool *bcc = |
394 | // addWidBool(i18n("Send copy to owner when mailing events"), | 394 | // addWidBool(i18n("Send copy to owner when mailing events"), |
395 | // &(KOPrefs::instance()->mBcc),topFrame); | 395 | // &(KOPrefs::instance()->mBcc),topFrame); |
396 | // topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); | 396 | // topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); |
397 | 397 | ||
398 | 398 | ||
399 | // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); | 399 | // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); |
400 | //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); | 400 | //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); |
401 | 401 | ||
402 | // addWidBool(i18n("Enable automatic saving of calendar"), | 402 | // addWidBool(i18n("Enable automatic saving of calendar"), |
403 | // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); | 403 | // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); |
404 | 404 | ||
405 | QHBox *intervalBox = new QHBox(topFrame); | 405 | QHBox *intervalBox = new QHBox(topFrame); |
406 | // intervalBox->setSpacing(mSpacingHint); | 406 | // intervalBox->setSpacing(mSpacingHint); |
407 | topLayout->addMultiCellWidget(intervalBox,6,6,0,1); | 407 | topLayout->addMultiCellWidget(intervalBox,6,6,0,1); |
408 | QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); | 408 | QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); |
409 | mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); | 409 | mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); |
410 | autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); | 410 | autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); |
411 | /* | 411 | /* |
412 | QHBox * agendasize = new QHBox ( topFrame ); | 412 | QHBox * agendasize = new QHBox ( topFrame ); |
413 | 413 | ||
414 | new QLabel (i18n("AllDayAgenda Height:"), agendasize ); | 414 | new QLabel (i18n("AllDayAgenda Height:"), agendasize ); |
415 | 415 | ||
416 | 416 | ||
417 | mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); | 417 | mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); |
418 | topLayout->addMultiCellWidget(agendasize,7,7,0,1); | 418 | topLayout->addMultiCellWidget(agendasize,7,7,0,1); |
419 | */ | 419 | */ |
420 | 420 | ||
421 | 421 | ||
422 | KPrefsDialogWidBool *ask = | 422 | KPrefsDialogWidBool *ask = |
423 | addWidBool(i18n("Ask for quit when closing KO/Pi"), | 423 | addWidBool(i18n("Ask for quit when closing KO/Pi"), |
424 | &(KOPrefs::instance()->mAskForQuit),topFrame); | 424 | &(KOPrefs::instance()->mAskForQuit),topFrame); |
425 | topLayout->addMultiCellWidget(ask->checkBox(),7,7,0,1); | 425 | topLayout->addMultiCellWidget(ask->checkBox(),7,7,0,1); |
426 | 426 | ||
427 | 427 | ||
428 | /* | 428 | /* |
429 | KPrefsDialogWidBool *confirmCheck = | 429 | KPrefsDialogWidBool *confirmCheck = |
430 | addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), | 430 | addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), |
431 | topFrame); | 431 | topFrame); |
432 | topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); | 432 | topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); |
433 | 433 | ||
434 | 434 | ||
435 | mEnableGroupScheduling = | 435 | mEnableGroupScheduling = |
436 | addWidBool(i18n("Enable group scheduling"), | 436 | addWidBool(i18n("Enable group scheduling"), |
437 | &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); | 437 | &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); |
438 | topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); | 438 | topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); |
439 | connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), | 439 | connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), |
440 | SLOT(warningGroupScheduling())); | 440 | SLOT(warningGroupScheduling())); |
441 | 441 | ||
442 | mEnableProjectView = | 442 | mEnableProjectView = |
443 | addWidBool(i18n("Enable project view"), | 443 | addWidBool(i18n("Enable project view"), |
444 | &(KOPrefs::instance()->mEnableProjectView),topFrame); | 444 | &(KOPrefs::instance()->mEnableProjectView),topFrame); |
445 | topLayout->addWidget(mEnableProjectView->checkBox(),9,0); | 445 | topLayout->addWidget(mEnableProjectView->checkBox(),9,0); |
446 | connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), | 446 | connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), |
447 | SLOT(warningProjectView())); | 447 | SLOT(warningProjectView())); |
448 | 448 | ||
449 | // Can't be disabled anymore | 449 | // Can't be disabled anymore |
450 | mEnableGroupScheduling->checkBox()->hide(); | 450 | mEnableGroupScheduling->checkBox()->hide(); |
451 | 451 | ||
452 | // Disable setting, because this feature now becomes stable | 452 | // Disable setting, because this feature now becomes stable |
453 | mEnableProjectView->checkBox()->hide(); | 453 | mEnableProjectView->checkBox()->hide(); |
454 | 454 | ||
455 | KPrefsDialogWidRadios *defaultFormatGroup = | 455 | KPrefsDialogWidRadios *defaultFormatGroup = |
456 | addWidRadios(i18n("Default Calendar Format"), | 456 | addWidRadios(i18n("Default Calendar Format"), |
457 | &(KOPrefs::instance()->mDefaultFormat),topFrame); | 457 | &(KOPrefs::instance()->mDefaultFormat),topFrame); |
458 | defaultFormatGroup->addRadio(i18n("vCalendar")); | 458 | defaultFormatGroup->addRadio(i18n("vCalendar")); |
459 | defaultFormatGroup->addRadio(i18n("iCalendar")); | 459 | defaultFormatGroup->addRadio(i18n("iCalendar")); |
460 | 460 | ||
461 | topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); | 461 | topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); |
462 | 462 | ||
463 | // Default format unconditionally is iCalendar | 463 | // Default format unconditionally is iCalendar |
464 | defaultFormatGroup->groupBox()->hide(); | 464 | defaultFormatGroup->groupBox()->hide(); |
465 | 465 | ||
466 | KPrefsDialogWidRadios *mailClientGroup = | 466 | KPrefsDialogWidRadios *mailClientGroup = |
467 | addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), | 467 | addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), |
468 | topFrame); | 468 | topFrame); |
469 | mailClientGroup->addRadio(i18n("KMail")); | 469 | mailClientGroup->addRadio(i18n("KMail")); |
470 | mailClientGroup->addRadio(i18n("Sendmail")); | 470 | mailClientGroup->addRadio(i18n("Sendmail")); |
471 | topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); | 471 | topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); |
472 | 472 | ||
473 | KPrefsDialogWidBool *htmlsave = | 473 | KPrefsDialogWidBool *htmlsave = |
474 | addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), | 474 | addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), |
475 | topFrame); | 475 | topFrame); |
476 | topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); | 476 | topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); |
477 | 477 | ||
478 | KPrefsDialogWidRadios *destinationGroup = | 478 | KPrefsDialogWidRadios *destinationGroup = |
479 | addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), | 479 | addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), |
480 | topFrame); | 480 | topFrame); |
481 | destinationGroup->addRadio(i18n("be added to the standard resource")); | 481 | destinationGroup->addRadio(i18n("be added to the standard resource")); |
482 | destinationGroup->addRadio(i18n("be asked which resource to use")); | 482 | destinationGroup->addRadio(i18n("be asked which resource to use")); |
483 | topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); | 483 | topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); |
484 | 484 | ||
485 | topLayout->setRowStretch(14,1); | 485 | topLayout->setRowStretch(14,1); |
486 | */ | 486 | */ |
487 | } | 487 | } |
488 | 488 | ||
489 | 489 | ||
490 | void KOPrefsDialog::setupTimeTab() | 490 | void KOPrefsDialog::setupTimeTab() |
491 | { | 491 | { |
492 | QFrame *topFrame = addPage(i18n("Time"),0,0); | 492 | QFrame *topFrame = addPage(i18n("Time"),0,0); |
493 | // DesktopIcon("clock",KIcon::SizeMedium)); | 493 | // DesktopIcon("clock",KIcon::SizeMedium)); |
494 | 494 | ||
495 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 495 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
496 | topLayout->setSpacing(mSpacingHint); | 496 | topLayout->setSpacing(mSpacingHint); |
497 | topLayout->setMargin(mMarginHint); | 497 | topLayout->setMargin(mMarginHint); |
498 | 498 | ||
499 | QHBox *dummy = new QHBox(topFrame); | 499 | QHBox *dummy = new QHBox(topFrame); |
500 | KPrefsDialogWidTime *dayBegins = | 500 | KPrefsDialogWidTime *dayBegins = |
501 | addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), | 501 | addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), |
502 | dummy); | 502 | dummy); |
503 | //topLayout->addWidget(dayBegins->label(),2,0); | 503 | //topLayout->addWidget(dayBegins->label(),2,0); |
504 | 504 | ||
505 | //topLayout->addWidget(dayBegins->spinBox(),2,1); | 505 | //topLayout->addWidget(dayBegins->spinBox(),2,1); |
506 | topLayout->addMultiCellWidget(dummy,0,0,0,1); | 506 | topLayout->addMultiCellWidget(dummy,0,0,0,1); |
507 | 507 | ||
508 | topLayout->addWidget(new QLabel(i18n("Default appointment time:"), | 508 | topLayout->addWidget(new QLabel(i18n("Default appointment time:"), |
509 | topFrame),1,0); | 509 | topFrame),1,0); |
510 | mStartTimeSpin = new QSpinBox(0,23,1,topFrame); | 510 | mStartTimeSpin = new QSpinBox(0,23,1,topFrame); |
511 | mStartTimeSpin->setSuffix(":00"); | 511 | mStartTimeSpin->setSuffix(":00"); |
512 | topLayout->addWidget(mStartTimeSpin,1,1); | 512 | topLayout->addWidget(mStartTimeSpin,1,1); |
513 | 513 | ||
514 | topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), | 514 | topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), |
515 | topFrame),2,0); | 515 | topFrame),2,0); |
516 | mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); | 516 | mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); |
517 | mDefaultDurationSpin->setSuffix(":00"); | 517 | mDefaultDurationSpin->setSuffix(":00"); |
518 | topLayout->addWidget(mDefaultDurationSpin,2,1); | 518 | topLayout->addWidget(mDefaultDurationSpin,2,1); |
519 | 519 | ||
520 | QStringList alarmList; | 520 | QStringList alarmList; |
521 | alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") | 521 | alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") |
522 | << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; | 522 | << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; |
523 | topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), | 523 | topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), |
524 | 3,0); | 524 | 3,0); |
525 | mAlarmTimeCombo = new QComboBox(topFrame); | 525 | mAlarmTimeCombo = new QComboBox(topFrame); |
526 | mAlarmTimeCombo->insertStringList(alarmList); | 526 | mAlarmTimeCombo->insertStringList(alarmList); |
527 | topLayout->addWidget(mAlarmTimeCombo,3,1); | 527 | topLayout->addWidget(mAlarmTimeCombo,3,1); |
528 | 528 | ||
529 | 529 | ||
530 | QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, | 530 | QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, |
531 | i18n("Working Hours"), | 531 | i18n("Working Hours"), |
532 | topFrame); | 532 | topFrame); |
533 | topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); | 533 | topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); |
534 | workingHoursGroup->layout()->setSpacing( 0 ); | 534 | workingHoursGroup->layout()->setSpacing( 0 ); |
535 | workingHoursGroup->layout()->setMargin( 4 ); | 535 | workingHoursGroup->layout()->setMargin( 4 ); |
536 | QHBox *workStartBox = new QHBox(workingHoursGroup); | 536 | QHBox *workStartBox = new QHBox(workingHoursGroup); |
537 | // workStartBox->setMargin( 0 ); | 537 | // workStartBox->setMargin( 0 ); |
538 | addWidTime(i18n("Daily starting hour:"), | 538 | addWidTime(i18n("Daily starting hour:"), |
539 | &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); | 539 | &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); |
540 | 540 | ||
541 | QHBox *workEndBox = new QHBox(workingHoursGroup); | 541 | QHBox *workEndBox = new QHBox(workingHoursGroup); |
542 | //workEndBox->setMargin( 0 ); | 542 | //workEndBox->setMargin( 0 ); |
543 | addWidTime(i18n("Daily ending hour:"), | 543 | addWidTime(i18n("Daily ending hour:"), |
544 | &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); | 544 | &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); |
545 | QVBox *excludeBox = new QVBox(workingHoursGroup); | 545 | QVBox *excludeBox = new QVBox(workingHoursGroup); |
546 | //excludeBox->setMargin( 0 ); | 546 | //excludeBox->setMargin( 0 ); |
547 | addWidBool(i18n("Exclude holidays"), | 547 | addWidBool(i18n("Exclude holidays"), |
548 | &(KOPrefs::instance()->mExcludeHolidays),excludeBox); | 548 | &(KOPrefs::instance()->mExcludeHolidays),excludeBox); |
549 | 549 | ||
550 | addWidBool(i18n("Exclude Saturdays"), | 550 | addWidBool(i18n("Exclude Saturdays"), |
551 | &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); | 551 | &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); |
552 | 552 | ||
553 | // KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), | 553 | // KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), |
554 | // &(KOPrefs::instance()->mMarcusBainsShowSeconds), | 554 | // &(KOPrefs::instance()->mMarcusBainsShowSeconds), |
555 | // topFrame); | 555 | // topFrame); |
556 | // topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); | 556 | // topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); |
557 | 557 | ||
558 | // topLayout->setRowStretch(6,1); | 558 | // topLayout->setRowStretch(6,1); |
559 | } | 559 | } |
560 | 560 | ||
561 | 561 | ||
562 | void KOPrefsDialog::setupViewsTab() | 562 | void KOPrefsDialog::setupViewsTab() |
563 | { | 563 | { |
564 | 564 | ||
565 | QFrame *topFrame = addPage(i18n("Views"),0,0); | 565 | QFrame *topFrame = addPage(i18n("Views"),0,0); |
566 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 566 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
567 | 567 | ||
568 | QGridLayout *topLayout = new QGridLayout(topFrame,6,1); | 568 | QGridLayout *topLayout = new QGridLayout(topFrame,6,1); |
569 | topLayout->setSpacing(mSpacingHint); | 569 | topLayout->setSpacing(mSpacingHint); |
570 | topLayout->setMargin(mMarginHint); | 570 | topLayout->setMargin(mMarginHint); |
571 | 571 | ||
572 | // QBoxLayout *dayBeginsLayout = new QHBoxLayout; | 572 | // QBoxLayout *dayBeginsLayout = new QHBoxLayout; |
573 | // topLayout->addLayout(dayBeginsLayout,0,0); | 573 | // topLayout->addLayout(dayBeginsLayout,0,0); |
574 | 574 | ||
575 | // KPrefsDialogWidTime *dayBegins = | 575 | // KPrefsDialogWidTime *dayBegins = |
576 | // addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), | 576 | // addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), |
577 | // topFrame); | 577 | // topFrame); |
578 | // dayBeginsLayout->addWidget(dayBegins->label()); | 578 | // dayBeginsLayout->addWidget(dayBegins->label()); |
579 | // dayBeginsLayout->addStretch(1); | 579 | // dayBeginsLayout->addStretch(1); |
580 | // dayBeginsLayout->addWidget(dayBegins->spinBox()); | 580 | // dayBeginsLayout->addWidget(dayBegins->spinBox()); |
581 | 581 | ||
582 | // QBoxLayout *nextDaysLayout = new QHBoxLayout; | 582 | // QBoxLayout *nextDaysLayout = new QHBoxLayout; |
583 | // topLayout->addLayout(nextDaysLayout,1,0); | 583 | // topLayout->addLayout(nextDaysLayout,1,0); |
584 | // nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); | 584 | // nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); |
585 | // mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); | 585 | // mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); |
586 | // nextDaysLayout->addStretch(1); | 586 | // nextDaysLayout->addStretch(1); |
587 | // nextDaysLayout->addWidget(mNextXDaysSpin); | 587 | // nextDaysLayout->addWidget(mNextXDaysSpin); |
588 | 588 | ||
589 | 589 | ||
590 | int ii = 0; | 590 | int ii = 0; |
591 | KPrefsDialogWidBool *dummy = | 591 | KPrefsDialogWidBool *dummy = |
592 | addWidBool(i18n("Edit item on doubleclick (if not, show)"), | 592 | addWidBool(i18n("Edit item on doubleclick (if not, show)"), |
593 | &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); | 593 | &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); |
594 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 594 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
595 | 595 | ||
596 | 596 | ||
597 | 597 | ||
598 | 598 | ||
599 | 599 | ||
600 | 600 | ||
601 | // topLayout->addWidget(hourSizeGroup,ii++,0); | 601 | // topLayout->addWidget(hourSizeGroup,ii++,0); |
602 | // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); | 602 | // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); |
603 | //topLayout->setRowStretch(11,1); | 603 | //topLayout->setRowStretch(11,1); |
604 | 604 | ||
605 | 605 | ||
606 | 606 | ||
607 | 607 | ||
608 | #if 0 | 608 | #if 0 |
609 | 609 | ||
610 | topFrame = addPage(i18n("ViewChange"),0,0); | 610 | topFrame = addPage(i18n("ViewChange"),0,0); |
611 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 611 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
612 | 612 | ||
613 | topLayout = new QGridLayout(topFrame,6,1); | 613 | topLayout = new QGridLayout(topFrame,6,1); |
614 | topLayout->setSpacing(mSpacingHint); | 614 | topLayout->setSpacing(mSpacingHint); |
615 | topLayout->setMargin(mMarginHint); | 615 | topLayout->setMargin(mMarginHint); |
616 | ii = 0; | 616 | ii = 0; |
617 | 617 | ||
618 | #endif | 618 | #endif |
619 | 619 | ||
620 | dummy = | 620 | dummy = |
621 | addWidBool(i18n("Hold fullscreen on view change"), | 621 | addWidBool(i18n("Hold fullscreen on view change"), |
622 | &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); | 622 | &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); |
623 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 623 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
624 | 624 | ||
625 | dummy = | 625 | dummy = |
626 | addWidBool(i18n("Hold non-fullscreen on view change"), | 626 | addWidBool(i18n("Hold non-fullscreen on view change"), |
627 | &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); | 627 | &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); |
628 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 628 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
629 | 629 | ||
630 | 630 | ||
631 | 631 | ||
632 | KPrefsDialogWidBool *fullViewMonth = | 632 | KPrefsDialogWidBool *fullViewMonth = |
633 | addWidBool(i18n("Next days view uses full window"), | 633 | addWidBool(i18n("Next days view uses full window"), |
634 | &(KOPrefs::instance()->mFullViewMonth),topFrame); | 634 | &(KOPrefs::instance()->mFullViewMonth),topFrame); |
635 | topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); | 635 | topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); |
636 | 636 | ||
637 | 637 | ||
638 | KPrefsDialogWidBool *fullViewTodo = | 638 | KPrefsDialogWidBool *fullViewTodo = |
639 | addWidBool(i18n("Event list view uses full window"), | 639 | addWidBool(i18n("Event list view uses full window"), |
640 | &(KOPrefs::instance()->mFullViewTodo),topFrame); | 640 | &(KOPrefs::instance()->mFullViewTodo),topFrame); |
641 | topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); | 641 | topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); |
642 | dummy = | 642 | dummy = |
643 | addWidBool(i18n("Listview uses monthly timespan"), | 643 | addWidBool(i18n("Listview uses monthly timespan"), |
644 | &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); | 644 | &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); |
645 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 645 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
646 | dummy = | 646 | dummy = |
647 | addWidBool(i18n("Highlight selection in Time Edit"), | 647 | addWidBool(i18n("Highlight selection in Time Edit"), |
648 | &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); | 648 | &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); |
649 | topLayout->addWidget( dummy->checkBox(), ii++,0); | 649 | topLayout->addWidget( dummy->checkBox(), ii++,0); |
650 | 650 | ||
651 | KPrefsDialogWidBool *dailyRecur = | 651 | KPrefsDialogWidBool *dailyRecur = |
652 | addWidBool(i18n("Show events that recur daily in date nav."), | 652 | addWidBool(i18n("Show events that recur daily in date nav."), |
653 | &(KOPrefs::instance()->mDailyRecur),topFrame); | 653 | &(KOPrefs::instance()->mDailyRecur),topFrame); |
654 | topLayout->addWidget(dailyRecur->checkBox(),ii++,0); | 654 | topLayout->addWidget(dailyRecur->checkBox(),ii++,0); |
655 | 655 | ||
656 | KPrefsDialogWidBool *weeklyRecur = | 656 | KPrefsDialogWidBool *weeklyRecur = |
657 | addWidBool(i18n("Show ev. that recur weekly in date nav."), | 657 | addWidBool(i18n("Show ev. that recur weekly in date nav."), |
658 | &(KOPrefs::instance()->mWeeklyRecur),topFrame); | 658 | &(KOPrefs::instance()->mWeeklyRecur),topFrame); |
659 | topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); | 659 | topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); |
660 | 660 | ||
661 | #ifdef DESKTOP_VERSION | 661 | #ifdef DESKTOP_VERSION |
662 | KPrefsDialogWidBool *enableToolTips = | 662 | KPrefsDialogWidBool *enableToolTips = |
663 | addWidBool(i18n("Enable tooltips displaying summary of ev."), | 663 | addWidBool(i18n("Enable tooltips displaying summary of ev."), |
664 | &(KOPrefs::instance()->mEnableToolTips),topFrame); | 664 | &(KOPrefs::instance()->mEnableToolTips),topFrame); |
665 | topLayout->addWidget(enableToolTips->checkBox(),ii++,0); | 665 | topLayout->addWidget(enableToolTips->checkBox(),ii++,0); |
666 | #endif | 666 | #endif |
667 | // ********************************************************* | 667 | // ********************************************************* |
668 | 668 | ||
669 | topFrame = addPage(i18n("Agenda View"),0,0); | 669 | topFrame = addPage(i18n("Agenda View"),0,0); |
670 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 670 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
671 | 671 | ||
672 | topLayout = new QGridLayout(topFrame,5,1); | 672 | topLayout = new QGridLayout(topFrame,5,1); |
673 | topLayout->setSpacing(mSpacingHint); | 673 | topLayout->setSpacing(mSpacingHint); |
674 | topLayout->setMargin(mMarginHint); | 674 | topLayout->setMargin(mMarginHint); |
675 | ii = 0; | 675 | ii = 0; |
676 | 676 | ||
677 | 677 | ||
678 | dummy = | 678 | dummy = |
679 | addWidBool(i18n("Show time in agenda items"), | 679 | addWidBool(i18n("Show time in agenda items"), |
680 | &(KOPrefs::instance()->mShowTimeInAgenda),topFrame); | 680 | &(KOPrefs::instance()->mShowTimeInAgenda),topFrame); |
681 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 681 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
682 | 682 | ||
683 | dummy = | 683 | dummy = |
684 | addWidBool(i18n("Highlight current day in agenda"), | 684 | addWidBool(i18n("Highlight current day in agenda"), |
685 | &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); | 685 | &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); |
686 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 686 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
687 | 687 | ||
688 | dummy = | 688 | dummy = |
689 | addWidBool(i18n("Use light color for highlight current day"), | 689 | addWidBool(i18n("Use light color for highlight current day"), |
690 | &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); | 690 | &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); |
691 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 691 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
692 | 692 | ||
693 | 693 | ||
694 | KPrefsDialogWidBool *marcusBainsEnabled = | 694 | KPrefsDialogWidBool *marcusBainsEnabled = |
695 | addWidBool(i18n("Show current time"), | 695 | addWidBool(i18n("Show current time"), |
696 | &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); | 696 | &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); |
697 | topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); | 697 | topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); |
698 | 698 | ||
699 | 699 | ||
700 | dummy = | 700 | dummy = |
701 | addWidBool(i18n("Set agenda to DayBeginsAt on change"), | 701 | addWidBool(i18n("Set agenda to DayBeginsAt on change"), |
702 | &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); | 702 | &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); |
703 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 703 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
704 | 704 | ||
705 | dummy = | 705 | dummy = |
706 | addWidBool(i18n("Set agenda to current time on change"), | 706 | addWidBool(i18n("Set agenda to current time on change"), |
707 | &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); | 707 | &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); |
708 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 708 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
709 | 709 | ||
710 | 710 | ||
711 | 711 | ||
712 | 712 | ||
713 | 713 | ||
714 | 714 | ||
715 | 715 | ||
716 | topFrame = addPage(i18n("Month View"),0,0); | 716 | topFrame = addPage(i18n("Month View"),0,0); |
717 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 717 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
718 | 718 | ||
719 | topLayout = new QGridLayout(topFrame,5,1); | 719 | topLayout = new QGridLayout(topFrame,5,1); |
720 | topLayout->setSpacing(mSpacingHint); | 720 | topLayout->setSpacing(mSpacingHint); |
721 | topLayout->setMargin(mMarginHint); | 721 | topLayout->setMargin(mMarginHint); |
722 | qDebug("%d %d ",mSpacingHint, mMarginHint ); | 722 | qDebug("%d %d ",mSpacingHint, mMarginHint ); |
723 | ii = 0; | 723 | ii = 0; |
724 | QLabel *lab; | 724 | QLabel *lab; |
725 | QHBox *habo = new QHBox( topFrame ); | 725 | QHBox *habo = new QHBox( topFrame ); |
726 | if ( QApplication::desktop()->width() <= 480 ) { | 726 | if ( QApplication::desktop()->width() <= 480 ) { |
727 | lab = new QLabel ( i18n("Show events that recur "), topFrame ); | 727 | lab = new QLabel ( i18n("Show events that recur "), topFrame ); |
728 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); | 728 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); |
729 | ii++; | 729 | ii++; |
730 | } else { | 730 | } else { |
731 | new QLabel ( i18n("Show events that recur "), habo ); | 731 | new QLabel ( i18n("Show events that recur "), habo ); |
732 | } | 732 | } |
733 | dailyRecur = | 733 | dailyRecur = |
734 | addWidBool(i18n("daily"), | 734 | addWidBool(i18n("daily"), |
735 | &(KOPrefs::instance()->mMonthDailyRecur),habo); | 735 | &(KOPrefs::instance()->mMonthDailyRecur),habo); |
736 | // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); | 736 | // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); |
737 | 737 | ||
738 | weeklyRecur = | 738 | weeklyRecur = |
739 | addWidBool(i18n("weekly"), | 739 | addWidBool(i18n("weekly"), |
740 | &(KOPrefs::instance()->mMonthWeeklyRecur),habo); | 740 | &(KOPrefs::instance()->mMonthWeeklyRecur),habo); |
741 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); | 741 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); |
742 | ii++; | 742 | ii++; |
743 | 743 | ||
744 | 744 | ||
745 | habo = new QHBox( topFrame ); | 745 | habo = new QHBox( topFrame ); |
746 | if ( QApplication::desktop()->width() <= 480 ) { | 746 | if ( QApplication::desktop()->width() <= 480 ) { |
747 | lab = new QLabel (i18n("Show in every cell ") , topFrame ); | 747 | lab = new QLabel (i18n("Show in every cell ") , topFrame ); |
748 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); | 748 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); |
749 | ii++; | 749 | ii++; |
750 | 750 | ||
751 | } else { | 751 | } else { |
752 | new QLabel ( i18n("Show in every cell "), habo ); | 752 | new QLabel ( i18n("Show in every cell "), habo ); |
753 | } | 753 | } |
754 | weeklyRecur = | 754 | weeklyRecur = |
755 | addWidBool(i18n("short month"), | 755 | addWidBool(i18n("short month"), |
756 | &(KOPrefs::instance()->mMonthShowShort),habo); | 756 | &(KOPrefs::instance()->mMonthShowShort),habo); |
757 | weeklyRecur = | 757 | weeklyRecur = |
758 | addWidBool(i18n("icons"), | 758 | addWidBool(i18n("icons"), |
759 | &(KOPrefs::instance()->mMonthShowIcons),habo); | 759 | &(KOPrefs::instance()->mMonthShowIcons),habo); |
760 | 760 | ||
761 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); | 761 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); |
762 | ii++; | 762 | ii++; |
763 | #ifdef DESKTOP_VERSION | 763 | #ifdef DESKTOP_VERSION |
764 | KPrefsDialogWidBool *enableMonthScroll = | 764 | KPrefsDialogWidBool *enableMonthScroll = |
765 | addWidBool(i18n("Enable scrollbars in month view cells"), | 765 | addWidBool(i18n("Enable scrollbars in month view cells"), |
766 | &(KOPrefs::instance()->mEnableMonthScroll),topFrame); | 766 | &(KOPrefs::instance()->mEnableMonthScroll),topFrame); |
767 | topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); | 767 | topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); |
768 | #endif | 768 | #endif |
769 | dummy = | 769 | dummy = |
770 | addWidBool(i18n("Week view mode uses bigger font"), | 770 | addWidBool(i18n("Week view mode uses bigger font"), |
771 | &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame); | 771 | &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame); |
772 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 772 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
773 | dummy = | 773 | dummy = |
774 | addWidBool(i18n("Show Sat/Sun together"), | 774 | addWidBool(i18n("Show Sat/Sun together"), |
775 | &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); | 775 | &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); |
776 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 776 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
777 | 777 | ||
778 | KPrefsDialogWidBool *coloredCategoriesInMonthView = | 778 | KPrefsDialogWidBool *coloredCategoriesInMonthView = |
779 | addWidBool(i18n("Month view uses category colors"), | 779 | addWidBool(i18n("Month view uses category colors"), |
780 | &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); | 780 | &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); |
781 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); | 781 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); |
782 | 782 | ||
783 | dummy = | 783 | dummy = |
784 | addWidBool(i18n("Categorie colors are applied to text"), | 784 | addWidBool(i18n("Categorie colors are applied to text"), |
785 | &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); | 785 | &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); |
786 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 786 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
787 | coloredCategoriesInMonthView = | 787 | coloredCategoriesInMonthView = |
788 | addWidBool(i18n("Month view uses day colors"), | 788 | addWidBool(i18n("Month view uses day colors"), |
789 | &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); | 789 | &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); |
790 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); | 790 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); |
791 | 791 | ||
792 | KPrefsDialogWidColor *holidayColor = | 792 | KPrefsDialogWidColor *holidayColor = |
793 | addWidColor(i18n("Day color odd months"), | 793 | addWidColor(i18n("Day color odd months"), |
794 | &(KOPrefs::instance()->mMonthViewOddColor),topFrame); | 794 | &(KOPrefs::instance()->mMonthViewOddColor),topFrame); |
795 | topLayout->addWidget(holidayColor->label(),ii,0); | 795 | topLayout->addWidget(holidayColor->label(),ii,0); |
796 | topLayout->addWidget(holidayColor->button(),ii++,1); | 796 | topLayout->addWidget(holidayColor->button(),ii++,1); |
797 | 797 | ||
798 | holidayColor = | 798 | holidayColor = |
799 | addWidColor(i18n("Day color even months"), | 799 | addWidColor(i18n("Day color even months"), |
800 | &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); | 800 | &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); |
801 | topLayout->addWidget(holidayColor->label(),ii,0); | 801 | topLayout->addWidget(holidayColor->label(),ii,0); |
802 | topLayout->addWidget(holidayColor->button(),ii++,1); | 802 | topLayout->addWidget(holidayColor->button(),ii++,1); |
803 | 803 | ||
804 | 804 | ||
805 | holidayColor = | 805 | holidayColor = |
806 | addWidColor(i18n("Color for Sundays + category \"Holiday\""), | 806 | addWidColor(i18n("Color for Sundays + category \"Holiday\""), |
807 | &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); | 807 | &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); |
808 | topLayout->addWidget(holidayColor->label(),ii,0); | 808 | topLayout->addWidget(holidayColor->label(),ii,0); |
809 | topLayout->addWidget(holidayColor->button(),ii++,1); | 809 | topLayout->addWidget(holidayColor->button(),ii++,1); |
810 | // *********************** What'sNext View | 810 | // *********************** What'sNext View |
811 | topFrame = addPage(i18n("What's Next View"),0,0); | 811 | topFrame = addPage(i18n("What's Next View"),0,0); |
812 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 812 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
813 | 813 | ||
814 | topLayout = new QGridLayout(topFrame,4,1); | 814 | topLayout = new QGridLayout(topFrame,4,1); |
815 | topLayout->setSpacing(mSpacingHint); | 815 | topLayout->setSpacing(mSpacingHint); |
816 | topLayout->setMargin(mMarginHint); | 816 | topLayout->setMargin(mMarginHint); |
817 | ii = 0; | 817 | ii = 0; |
818 | 818 | ||
819 | 819 | ||
820 | QHBox* hdummy = new QHBox(topFrame); | 820 | QHBox* hdummy = new QHBox(topFrame); |
821 | new QLabel(i18n("Days in What's Next:"),hdummy); | 821 | new QLabel(i18n("Days in What's Next:"),hdummy); |
822 | mWhatsNextSpin = new QSpinBox(1,14,1,hdummy); | 822 | mWhatsNextSpin = new QSpinBox(1,14,1,hdummy); |
823 | 823 | ||
824 | topLayout->addWidget(hdummy,ii++,0); | 824 | topLayout->addWidget(hdummy,ii++,0); |
825 | 825 | ||
826 | QHBox *prioBox = new QHBox(topFrame); | 826 | QHBox *prioBox = new QHBox(topFrame); |
827 | // intervalBox->setSpacing(mSpacingHint); | 827 | // intervalBox->setSpacing(mSpacingHint); |
828 | topLayout->addWidget(prioBox,ii++,0); | 828 | topLayout->addWidget(prioBox,ii++,0); |
829 | QString messa = i18n("Show topmost todo prios in What's Next:"); | 829 | |
830 | 830 | QLabel *prioLabel = new QLabel(i18n("Number of max.displayed todo prios:"), prioBox); | |
831 | if ( QApplication::desktop()->width() < 300 ) | ||
832 | messa = i18n("Show topmost todo prios in What's N.:"); | ||
833 | QLabel *prioLabel = new QLabel(messa, prioBox); | ||
834 | mPrioSpin = new QSpinBox(0,5,1,prioBox); | 831 | mPrioSpin = new QSpinBox(0,5,1,prioBox); |
835 | if ( QApplication::desktop()->width() < 300 ) | 832 | if ( QApplication::desktop()->width() < 300 ) |
836 | mPrioSpin->setFixedWidth( 40 ); | 833 | mPrioSpin->setFixedWidth( 40 ); |
837 | 834 | ||
838 | KPrefsDialogWidBool *passwdk = | 835 | KPrefsDialogWidBool *passwdk = |
839 | 836 | ||
840 | addWidBool(i18n("Show events, that are done in \nWhat's Next view"), | 837 | addWidBool(i18n("Show events, that are done"), |
841 | &(KOPrefs::instance()->mWNViewShowsPast),topFrame); | 838 | &(KOPrefs::instance()->mWNViewShowsPast),topFrame); |
842 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 839 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
843 | passwdk = | 840 | passwdk = |
844 | addWidBool(i18n("Show parent To-Do's in What's Next view"), | 841 | addWidBool(i18n("Show parent To-Do's"), |
845 | &(KOPrefs::instance()->mWNViewShowsParents),topFrame); | 842 | &(KOPrefs::instance()->mWNViewShowsParents),topFrame); |
846 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 843 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
847 | 844 | ||
848 | passwdk = | 845 | passwdk = |
849 | addWidBool(i18n("Show location in What's Next view"), | 846 | addWidBool(i18n("Show location"), |
850 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); | 847 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); |
851 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 848 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
852 | 849 | ||
853 | passwdk = | 850 | passwdk = |
854 | addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"), | 851 | addWidBool(i18n("Show Sync Events in WN+Agenda"), |
855 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); | 852 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); |
856 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 853 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
857 | passwdk = | 854 | passwdk = |
858 | addWidBool(i18n("Use short date in \nWhat's Next/Event view"), | 855 | addWidBool(i18n("Use short date in WN+Event view"), |
859 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); | 856 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); |
860 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 857 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
861 | 858 | ||
862 | 859 | ||
863 | 860 | ||
864 | 861 | ||
865 | // *********************** Todo View | 862 | // *********************** Todo View |
866 | 863 | ||
867 | topFrame = addPage(i18n("Todo View"),0,0); | 864 | topFrame = addPage(i18n("Todo View"),0,0); |
868 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 865 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
869 | 866 | ||
870 | topLayout = new QGridLayout(topFrame,4,1); | 867 | topLayout = new QGridLayout(topFrame,4,1); |
871 | topLayout->setSpacing(mSpacingHint); | 868 | topLayout->setSpacing(mSpacingHint); |
872 | topLayout->setMargin(mMarginHint); | 869 | topLayout->setMargin(mMarginHint); |
873 | ii = 0; | 870 | ii = 0; |
874 | dummy = | 871 | dummy = |
875 | addWidBool(i18n("Hide not running Todos in To-do view"), | 872 | addWidBool(i18n("Hide not running Todos in To-do view"), |
876 | &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); | 873 | &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); |
877 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 874 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
878 | 875 | ||
879 | 876 | ||
880 | KPrefsDialogWidBool *showCompletedTodo = | 877 | KPrefsDialogWidBool *showCompletedTodo = |
881 | addWidBool(i18n("To-do view shows completed Todos"), | 878 | addWidBool(i18n("To-do view shows completed Todos"), |
882 | &(KOPrefs::instance()->mShowCompletedTodo),topFrame); | 879 | &(KOPrefs::instance()->mShowCompletedTodo),topFrame); |
883 | topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); | 880 | topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); |
884 | dummy = | 881 | dummy = |
885 | addWidBool(i18n("To-do view shows complete as 'xx %'"), | 882 | addWidBool(i18n("To-do view shows complete as 'xx %'"), |
886 | &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); | 883 | &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); |
887 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 884 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
888 | 885 | ||
889 | dummy = | 886 | dummy = |
890 | addWidBool(i18n("Small To-do view uses smaller font"), | 887 | addWidBool(i18n("Small To-do view uses smaller font"), |
891 | &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); | 888 | &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); |
892 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 889 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
893 | 890 | ||
894 | 891 | ||
895 | 892 | ||
896 | dummy = | 893 | dummy = |
897 | addWidBool(i18n("Todo view uses category colors"), | 894 | addWidBool(i18n("Todo view uses category colors"), |
898 | &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); | 895 | &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); |
899 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 896 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
900 | 897 | ||
901 | 898 | ||
902 | QWidget* wid = new QWidget( topFrame ); | 899 | QWidget* wid = new QWidget( topFrame ); |
903 | // Todo due today color | 900 | // Todo due today color |
904 | KPrefsDialogWidColor *todoDueTodayColor = | 901 | KPrefsDialogWidColor *todoDueTodayColor = |
905 | addWidColor(i18n("Todo due today color:"), | 902 | addWidColor(i18n("Todo due today color:"), |
906 | &(KOPrefs::instance()->mTodoDueTodayColor),wid); | 903 | &(KOPrefs::instance()->mTodoDueTodayColor),wid); |
907 | QHBoxLayout *widLayout = new QHBoxLayout(wid); | 904 | QHBoxLayout *widLayout = new QHBoxLayout(wid); |
908 | widLayout->addWidget( todoDueTodayColor->label() ); | 905 | widLayout->addWidget( todoDueTodayColor->label() ); |
909 | widLayout->addWidget( todoDueTodayColor->button() ); | 906 | widLayout->addWidget( todoDueTodayColor->button() ); |
910 | topLayout->addWidget(wid,ii++,0); | 907 | topLayout->addWidget(wid,ii++,0); |
911 | //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); | 908 | //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); |
912 | 909 | ||
913 | // Todo overdue color | 910 | // Todo overdue color |
914 | wid = new QWidget( topFrame ); | 911 | wid = new QWidget( topFrame ); |
915 | widLayout = new QHBoxLayout(wid); | 912 | widLayout = new QHBoxLayout(wid); |
916 | KPrefsDialogWidColor *todoOverdueColor = | 913 | KPrefsDialogWidColor *todoOverdueColor = |
917 | addWidColor(i18n("Todo overdue color:"), | 914 | addWidColor(i18n("Todo overdue color:"), |
918 | &(KOPrefs::instance()->mTodoOverdueColor),wid); | 915 | &(KOPrefs::instance()->mTodoOverdueColor),wid); |
919 | widLayout->addWidget(todoOverdueColor->label()); | 916 | widLayout->addWidget(todoOverdueColor->label()); |
920 | widLayout->addWidget(todoOverdueColor->button()); | 917 | widLayout->addWidget(todoOverdueColor->button()); |
921 | topLayout->addWidget(wid,ii++,0); | 918 | topLayout->addWidget(wid,ii++,0); |
922 | 919 | ||
923 | dummy = | 920 | dummy = |
924 | addWidBool(i18n("Colors are applied to text"), | 921 | addWidBool(i18n("Colors are applied to text"), |
925 | &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); | 922 | &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); |
926 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 923 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
927 | 924 | ||
928 | dummy = | 925 | dummy = |
929 | addWidBool(i18n("Allday Agenda view shows todos"), | 926 | addWidBool(i18n("Allday Agenda view shows todos"), |
930 | &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); | 927 | &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); |
931 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 928 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
932 | 929 | ||
933 | 930 | ||
934 | topFrame = addPage(i18n("View Options"),0,0); | 931 | topFrame = addPage(i18n("View Options"),0,0); |
935 | 932 | ||
936 | topLayout = new QGridLayout(topFrame,4,1); | 933 | topLayout = new QGridLayout(topFrame,4,1); |
937 | topLayout->setSpacing(mSpacingHint); | 934 | topLayout->setSpacing(mSpacingHint); |
938 | topLayout->setMargin(mMarginHint); | 935 | topLayout->setMargin(mMarginHint); |
939 | ii = 0; | 936 | ii = 0; |
940 | lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame); | 937 | lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame); |
941 | topLayout->addWidget(lab ,ii++,0); | 938 | topLayout->addWidget(lab ,ii++,0); |
942 | 939 | ||
943 | dummy = addWidBool(i18n("Details"), | 940 | dummy = addWidBool(i18n("Details"), |
944 | &(KOPrefs::instance()->mEVshowDetails),topFrame); | 941 | &(KOPrefs::instance()->mEVshowDetails),topFrame); |
945 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 942 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
946 | dummy = addWidBool(i18n("Created time"), | 943 | dummy = addWidBool(i18n("Created time"), |
947 | &(KOPrefs::instance()->mEVshowCreated),topFrame); | 944 | &(KOPrefs::instance()->mEVshowCreated),topFrame); |
948 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 945 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
949 | dummy = addWidBool(i18n("Last modified time"), | 946 | dummy = addWidBool(i18n("Last modified time"), |
950 | &(KOPrefs::instance()->mEVshowChanged),topFrame); | 947 | &(KOPrefs::instance()->mEVshowChanged),topFrame); |
951 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 948 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
952 | 949 | ||
953 | 950 | ||
954 | lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame); | 951 | lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame); |
955 | topLayout->addWidget(lab ,ii++,0); | 952 | topLayout->addWidget(lab ,ii++,0); |
956 | 953 | ||
957 | dummy = addWidBool(i18n("Details"), | 954 | dummy = addWidBool(i18n("Details"), |
958 | &(KOPrefs::instance()->mWTshowDetails),topFrame); | 955 | &(KOPrefs::instance()->mWTshowDetails),topFrame); |
959 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 956 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
960 | dummy = addWidBool(i18n("Created time"), | 957 | dummy = addWidBool(i18n("Created time"), |
961 | &(KOPrefs::instance()->mWTshowCreated),topFrame); | 958 | &(KOPrefs::instance()->mWTshowCreated),topFrame); |
962 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 959 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
963 | dummy = addWidBool(i18n("Last modified time"), | 960 | dummy = addWidBool(i18n("Last modified time"), |
964 | &(KOPrefs::instance()->mWTshowChanged),topFrame); | 961 | &(KOPrefs::instance()->mWTshowChanged),topFrame); |
965 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 962 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
966 | 963 | ||
967 | 964 | ||
968 | topFrame = addPage(i18n("Alarm"),0,0); | 965 | topFrame = addPage(i18n("Alarm"),0,0); |
969 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 966 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
970 | 967 | ||
971 | topLayout = new QGridLayout(topFrame,2,1); | 968 | topLayout = new QGridLayout(topFrame,2,1); |
972 | topLayout->setSpacing(mSpacingHint); | 969 | topLayout->setSpacing(mSpacingHint); |
973 | topLayout->setMargin(mMarginHint); | 970 | topLayout->setMargin(mMarginHint); |
974 | int iii = 0; | 971 | int iii = 0; |
975 | 972 | ||
976 | dummy = | 973 | dummy = |
977 | addWidBool(i18n("Use internal alarm notification"), | 974 | addWidBool(i18n("Use internal alarm notification"), |
978 | &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); | 975 | &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); |
979 | topLayout->addWidget(dummy->checkBox(),iii++,0); | 976 | topLayout->addWidget(dummy->checkBox(),iii++,0); |
980 | lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); | 977 | lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); |
981 | 978 | ||
982 | topLayout->addWidget(lab ,iii++,0); | 979 | topLayout->addWidget(lab ,iii++,0); |
983 | #ifndef DESKTOP_VERSION | 980 | #ifndef DESKTOP_VERSION |
984 | lab->setAlignment( AlignLeft|WordBreak|AlignTop); | 981 | lab->setAlignment( AlignLeft|WordBreak|AlignTop); |
985 | #else | 982 | #else |
986 | lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | 983 | lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); |
987 | lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); | 984 | lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); |
988 | #endif | 985 | #endif |
989 | 986 | ||
990 | QHBox* dummyBox = new QHBox(topFrame); | 987 | QHBox* dummyBox = new QHBox(topFrame); |
991 | new QLabel(i18n("Play beeps count:"),dummyBox); | 988 | new QLabel(i18n("Play beeps count:"),dummyBox); |
992 | mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); | 989 | mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); |
993 | topLayout->addWidget(dummyBox,iii++,0); | 990 | topLayout->addWidget(dummyBox,iii++,0); |
994 | 991 | ||
995 | dummyBox = new QHBox(topFrame); | 992 | dummyBox = new QHBox(topFrame); |
996 | new QLabel(i18n("Beeps interval in sec:"),dummyBox); | 993 | new QLabel(i18n("Beeps interval in sec:"),dummyBox); |
997 | mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); | 994 | mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); |
998 | topLayout->addWidget(dummyBox,iii++,0); | 995 | topLayout->addWidget(dummyBox,iii++,0); |
999 | 996 | ||
1000 | dummyBox = new QHBox(topFrame); | 997 | dummyBox = new QHBox(topFrame); |
1001 | new QLabel(i18n("Default suspend time in min:"),dummyBox); | 998 | new QLabel(i18n("Default suspend time in min:"),dummyBox); |
1002 | mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); | 999 | mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); |
1003 | topLayout->addWidget(dummyBox,iii++,0); | 1000 | topLayout->addWidget(dummyBox,iii++,0); |
1004 | 1001 | ||
1005 | dummyBox = new QHBox(topFrame); | 1002 | dummyBox = new QHBox(topFrame); |
1006 | new QLabel(i18n("Auto suspend count:"),dummyBox); | 1003 | new QLabel(i18n("Auto suspend count:"),dummyBox); |
1007 | mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); | 1004 | mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); |
1008 | topLayout->addWidget(dummyBox,iii++,0); | 1005 | topLayout->addWidget(dummyBox,iii++,0); |
1009 | 1006 | ||
1010 | 1007 | ||
1011 | 1008 | ||
1012 | 1009 | ||
1013 | 1010 | ||
1014 | 1011 | ||
1015 | 1012 | ||
1016 | QHBox* hbo = new QHBox ( topFrame ); | 1013 | QHBox* hbo = new QHBox ( topFrame ); |
1017 | mDefaultAlarmFile = new QLineEdit(hbo); | 1014 | mDefaultAlarmFile = new QLineEdit(hbo); |
1018 | QPushButton * loadTemplate = new QPushButton(hbo); | 1015 | QPushButton * loadTemplate = new QPushButton(hbo); |
1019 | QPixmap icon; | 1016 | QPixmap icon; |
1020 | if ( QApplication::desktop()->width() < 321 ) | 1017 | if ( QApplication::desktop()->width() < 321 ) |
1021 | icon = SmallIcon("fileimport16"); | 1018 | icon = SmallIcon("fileimport16"); |
1022 | else | 1019 | else |
1023 | icon = SmallIcon("fileimport"); | 1020 | icon = SmallIcon("fileimport"); |
1024 | loadTemplate->setIconSet (icon ) ; | 1021 | loadTemplate->setIconSet (icon ) ; |
1025 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); | 1022 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); |
1026 | int size = loadTemplate->sizeHint().height(); | 1023 | int size = loadTemplate->sizeHint().height(); |
1027 | loadTemplate->setFixedSize( size, size ); | 1024 | loadTemplate->setFixedSize( size, size ); |
1028 | //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); | 1025 | //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); |
1029 | // topLayout->addWidget(lab ,iii++,0); | 1026 | // topLayout->addWidget(lab ,iii++,0); |
1030 | lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); | 1027 | lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); |
1031 | topLayout->addWidget(lab ,iii++,0); | 1028 | topLayout->addWidget(lab ,iii++,0); |
1032 | topLayout->addWidget(hbo,iii++,0); | 1029 | topLayout->addWidget(hbo,iii++,0); |
1033 | // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); | 1030 | // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); |
1034 | 1031 | ||
1035 | // topLayout->addWidget(lab ,iii++,0); | 1032 | // topLayout->addWidget(lab ,iii++,0); |
1036 | // #ifndef DESKTOP_VERSION | 1033 | // #ifndef DESKTOP_VERSION |
1037 | // lab->setAlignment( AlignLeft|WordBreak|AlignTop); | 1034 | // lab->setAlignment( AlignLeft|WordBreak|AlignTop); |
1038 | // #else | 1035 | // #else |
1039 | // lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | 1036 | // lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); |
1040 | // lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); | 1037 | // lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); |
1041 | // #endif | 1038 | // #endif |
1042 | 1039 | ||
1043 | 1040 | ||
1044 | } | 1041 | } |
1045 | 1042 | ||
1046 | void KOPrefsDialog::selectSoundFile() | 1043 | void KOPrefsDialog::selectSoundFile() |
1047 | { | 1044 | { |
1048 | QString fileName = mDefaultAlarmFile->text(); | 1045 | QString fileName = mDefaultAlarmFile->text(); |
1049 | fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); | 1046 | fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); |
1050 | if ( fileName.length() > 0 ) | 1047 | if ( fileName.length() > 0 ) |
1051 | mDefaultAlarmFile->setText( fileName ); | 1048 | mDefaultAlarmFile->setText( fileName ); |
1052 | } | 1049 | } |
1053 | void KOPrefsDialog::setupFontsTab() | 1050 | void KOPrefsDialog::setupFontsTab() |
1054 | { | 1051 | { |
1055 | 1052 | ||
1056 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); | 1053 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); |
1057 | // DesktopIcon("fonts",KIcon::SizeMedium)); | 1054 | // DesktopIcon("fonts",KIcon::SizeMedium)); |
1058 | 1055 | ||
1059 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); | 1056 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); |
1060 | topLayout->setSpacing(1); | 1057 | topLayout->setSpacing(1); |
1061 | topLayout->setMargin(3); | 1058 | topLayout->setMargin(3); |
1062 | KPrefsDialogWidFont * tVFont; | 1059 | KPrefsDialogWidFont * tVFont; |
1063 | int i = 0; | 1060 | int i = 0; |
1064 | KPrefsDialogWidFont *timeLabelsFont = | 1061 | KPrefsDialogWidFont *timeLabelsFont = |
1065 | addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), | 1062 | addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), |
1066 | &(KOPrefs::instance()->mDateNavigatorFont),topFrame); | 1063 | &(KOPrefs::instance()->mDateNavigatorFont),topFrame); |
1067 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 1064 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
1068 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 1065 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
1069 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 1066 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
1070 | ++i; | 1067 | ++i; |
1071 | 1068 | ||
1072 | 1069 | ||
1073 | timeLabelsFont = | 1070 | timeLabelsFont = |
1074 | addWidFont(i18n("Mon 15"),i18n("Date Labels:"), | 1071 | addWidFont(i18n("Mon 15"),i18n("Date Labels:"), |
1075 | &(KOPrefs::instance()->mTimeLabelsFont),topFrame); | 1072 | &(KOPrefs::instance()->mTimeLabelsFont),topFrame); |
1076 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 1073 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
1077 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 1074 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
1078 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 1075 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
1079 | ++i; | 1076 | ++i; |
1080 | 1077 | ||
1081 | KPrefsDialogWidFont *timeBarFont = | 1078 | KPrefsDialogWidFont *timeBarFont = |
1082 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), | 1079 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), |
1083 | &(KOPrefs::instance()->mTimeBarFont),topFrame); | 1080 | &(KOPrefs::instance()->mTimeBarFont),topFrame); |
1084 | topLayout->addWidget(timeBarFont->label(),i,0); | 1081 | topLayout->addWidget(timeBarFont->label(),i,0); |
1085 | topLayout->addWidget(timeBarFont->preview(),i,1); | 1082 | topLayout->addWidget(timeBarFont->preview(),i,1); |
1086 | topLayout->addWidget(timeBarFont->button(),i,2); | 1083 | topLayout->addWidget(timeBarFont->button(),i,2); |
1087 | ++i; | 1084 | ++i; |
1088 | 1085 | ||
1089 | 1086 | ||
1090 | KPrefsDialogWidFont *marcusBainsFont = | 1087 | KPrefsDialogWidFont *marcusBainsFont = |
1091 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), | 1088 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), |
1092 | &(KOPrefs::instance()->mMarcusBainsFont),topFrame); | 1089 | &(KOPrefs::instance()->mMarcusBainsFont),topFrame); |
1093 | topLayout->addWidget(marcusBainsFont->label(),i,0); | 1090 | topLayout->addWidget(marcusBainsFont->label(),i,0); |
1094 | topLayout->addWidget(marcusBainsFont->preview(),i,1); | 1091 | topLayout->addWidget(marcusBainsFont->preview(),i,1); |
1095 | topLayout->addWidget(marcusBainsFont->button(),i,2); | 1092 | topLayout->addWidget(marcusBainsFont->button(),i,2); |
1096 | ++i; | 1093 | ++i; |
1097 | 1094 | ||
1098 | tVFont = | 1095 | tVFont = |
1099 | addWidFont(i18n("Summary"),i18n("Event Viewer:"), | 1096 | addWidFont(i18n("Summary"),i18n("Event Viewer:"), |
1100 | &(KOPrefs::instance()->mEventViewFont),topFrame); | 1097 | &(KOPrefs::instance()->mEventViewFont),topFrame); |
1101 | topLayout->addWidget(tVFont->label(),i,0); | 1098 | topLayout->addWidget(tVFont->label(),i,0); |
1102 | topLayout->addWidget(tVFont->preview(),i,1); | 1099 | topLayout->addWidget(tVFont->preview(),i,1); |
1103 | topLayout->addWidget(tVFont->button(),i,2); | 1100 | topLayout->addWidget(tVFont->button(),i,2); |
1104 | ++i; | 1101 | ++i; |
1105 | 1102 | ||
1106 | 1103 | ||
1107 | 1104 | ||
1108 | tVFont = | 1105 | tVFont = |
1109 | addWidFont(i18n("Details"),i18n("EditorBox:"), | 1106 | addWidFont(i18n("Details"),i18n("EditorBox:"), |
1110 | &(KOPrefs::instance()->mEditBoxFont),topFrame); | 1107 | &(KOPrefs::instance()->mEditBoxFont),topFrame); |
1111 | topLayout->addWidget(tVFont->label(),i,0); | 1108 | topLayout->addWidget(tVFont->label(),i,0); |
1112 | topLayout->addWidget(tVFont->preview(),i,1); | 1109 | topLayout->addWidget(tVFont->preview(),i,1); |
1113 | topLayout->addWidget(tVFont->button(),i,2); | 1110 | topLayout->addWidget(tVFont->button(),i,2); |
1114 | ++i; | 1111 | ++i; |
1115 | 1112 | ||
1116 | 1113 | ||
1117 | 1114 | ||
1118 | topLayout->setColStretch(1,1); | 1115 | topLayout->setColStretch(1,1); |
1119 | topLayout->setRowStretch(4,1); | 1116 | topLayout->setRowStretch(4,1); |
1120 | 1117 | ||
1121 | 1118 | ||
1122 | i = 0; | 1119 | i = 0; |
1123 | topFrame = addPage(i18n("View Fonts"),0, | 1120 | topFrame = addPage(i18n("View Fonts"),0, |
1124 | DesktopIcon("fonts",KIcon::SizeMedium)); | 1121 | DesktopIcon("fonts",KIcon::SizeMedium)); |
1125 | 1122 | ||
1126 | topLayout = new QGridLayout(topFrame,7,3); | 1123 | topLayout = new QGridLayout(topFrame,7,3); |
1127 | topLayout->setSpacing(1); | 1124 | topLayout->setSpacing(1); |
1128 | topLayout->setMargin(3); | 1125 | topLayout->setMargin(3); |
1129 | 1126 | ||
1130 | tVFont = | 1127 | tVFont = |
1131 | addWidFont(i18n("Configure KO"),i18n("What's Next View:"), | 1128 | addWidFont(i18n("Configure KO"),i18n("What's Next View:"), |
1132 | &(KOPrefs::instance()->mWhatsNextFont),topFrame); | 1129 | &(KOPrefs::instance()->mWhatsNextFont),topFrame); |
1133 | topLayout->addWidget(tVFont->label(),i,0); | 1130 | topLayout->addWidget(tVFont->label(),i,0); |
1134 | topLayout->addWidget(tVFont->preview(),i,1); | 1131 | topLayout->addWidget(tVFont->preview(),i,1); |
1135 | topLayout->addWidget(tVFont->button(),i,2); | 1132 | topLayout->addWidget(tVFont->button(),i,2); |
1136 | ++i; | 1133 | ++i; |
1137 | KPrefsDialogWidFont *agendaViewFont = | 1134 | KPrefsDialogWidFont *agendaViewFont = |
1138 | addWidFont(i18n("Event text"),i18n("Agenda view:"), | 1135 | addWidFont(i18n("Event text"),i18n("Agenda view:"), |
1139 | &(KOPrefs::instance()->mAgendaViewFont),topFrame); | 1136 | &(KOPrefs::instance()->mAgendaViewFont),topFrame); |
1140 | topLayout->addWidget(agendaViewFont->label(),i,0); | 1137 | topLayout->addWidget(agendaViewFont->label(),i,0); |
1141 | topLayout->addWidget(agendaViewFont->preview(),i,1); | 1138 | topLayout->addWidget(agendaViewFont->preview(),i,1); |
1142 | topLayout->addWidget(agendaViewFont->button(),i,2); | 1139 | topLayout->addWidget(agendaViewFont->button(),i,2); |
1143 | ++i; | 1140 | ++i; |
1144 | 1141 | ||
1145 | 1142 | ||
1146 | KPrefsDialogWidFont *monthViewFont = | 1143 | KPrefsDialogWidFont *monthViewFont = |
1147 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), | 1144 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), |
1148 | i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); | 1145 | i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); |
1149 | topLayout->addWidget(monthViewFont->label(),i,0); | 1146 | topLayout->addWidget(monthViewFont->label(),i,0); |
1150 | topLayout->addWidget(monthViewFont->preview(),i,1); | 1147 | topLayout->addWidget(monthViewFont->preview(),i,1); |
1151 | topLayout->addWidget(monthViewFont->button(),i,2); | 1148 | topLayout->addWidget(monthViewFont->button(),i,2); |
1152 | ++i; | 1149 | ++i; |
1153 | 1150 | ||
1154 | 1151 | ||
1155 | KPrefsDialogWidFont *lVFont = | 1152 | KPrefsDialogWidFont *lVFont = |
1156 | addWidFont(i18n("Event"),i18n("List View:"), | 1153 | addWidFont(i18n("Event"),i18n("List View:"), |
1157 | &(KOPrefs::instance()->mListViewFont),topFrame); | 1154 | &(KOPrefs::instance()->mListViewFont),topFrame); |
1158 | topLayout->addWidget(lVFont->label(),i,0); | 1155 | topLayout->addWidget(lVFont->label(),i,0); |
1159 | topLayout->addWidget(lVFont->preview(),i,1); | 1156 | topLayout->addWidget(lVFont->preview(),i,1); |
1160 | topLayout->addWidget(lVFont->button(),i,2); | 1157 | topLayout->addWidget(lVFont->button(),i,2); |
1161 | ++i; | 1158 | ++i; |
1162 | 1159 | ||
1163 | 1160 | ||
1164 | tVFont = | 1161 | tVFont = |
1165 | addWidFont(i18n("ToDo"),i18n("ToDoView:"), | 1162 | addWidFont(i18n("ToDo"),i18n("ToDoView:"), |
1166 | &(KOPrefs::instance()->mTodoViewFont),topFrame); | 1163 | &(KOPrefs::instance()->mTodoViewFont),topFrame); |
1167 | topLayout->addWidget(tVFont->label(),i,0); | 1164 | topLayout->addWidget(tVFont->label(),i,0); |
1168 | topLayout->addWidget(tVFont->preview(),i,1); | 1165 | topLayout->addWidget(tVFont->preview(),i,1); |
1169 | topLayout->addWidget(tVFont->button(),i,2); | 1166 | topLayout->addWidget(tVFont->button(),i,2); |
1170 | ++i; | 1167 | ++i; |
1171 | 1168 | ||
1172 | 1169 | ||
1173 | tVFont = | 1170 | tVFont = |
1174 | addWidFont(i18n("Today"),i18n("JournalView:"), | 1171 | addWidFont(i18n("Today"),i18n("JournalView:"), |
1175 | &(KOPrefs::instance()->mJornalViewFont),topFrame); | 1172 | &(KOPrefs::instance()->mJornalViewFont),topFrame); |
1176 | topLayout->addWidget(tVFont->label(),i,0); | 1173 | topLayout->addWidget(tVFont->label(),i,0); |
1177 | topLayout->addWidget(tVFont->preview(),i,1); | 1174 | topLayout->addWidget(tVFont->preview(),i,1); |
1178 | topLayout->addWidget(tVFont->button(),i,2); | 1175 | topLayout->addWidget(tVFont->button(),i,2); |
1179 | ++i; | 1176 | ++i; |
1180 | 1177 | ||
1181 | 1178 | ||
1182 | 1179 | ||
1183 | 1180 | ||
1184 | topLayout->setColStretch(1,1); | 1181 | topLayout->setColStretch(1,1); |
1185 | topLayout->setRowStretch(4,1); | 1182 | topLayout->setRowStretch(4,1); |
1186 | 1183 | ||
1187 | 1184 | ||
1188 | 1185 | ||
1189 | 1186 | ||
1190 | } | 1187 | } |
1191 | 1188 | ||
1192 | void KOPrefsDialog::setupColorsTab() | 1189 | void KOPrefsDialog::setupColorsTab() |
1193 | { | 1190 | { |
1194 | QFrame *topFrame = addPage(i18n("Colors"),0,0); | 1191 | QFrame *topFrame = addPage(i18n("Colors"),0,0); |
1195 | // DesktopIcon("colorize",KIcon::SizeMedium)); | 1192 | // DesktopIcon("colorize",KIcon::SizeMedium)); |
1196 | 1193 | ||
1197 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); | 1194 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); |
1198 | // topLayout->setSpacing(mSpacingHint); | 1195 | // topLayout->setSpacing(mSpacingHint); |
1199 | // topLayout->setMargin(mMarginHint); | 1196 | // topLayout->setMargin(mMarginHint); |
1200 | 1197 | ||
1201 | topLayout->setSpacing(2); | 1198 | topLayout->setSpacing(2); |
1202 | topLayout->setMargin(3); | 1199 | topLayout->setMargin(3); |
1203 | 1200 | ||
1204 | int ii = 1; | 1201 | int ii = 1; |
1205 | QGroupBox *categoryGroup ; | 1202 | QGroupBox *categoryGroup ; |
1206 | 1203 | ||
1207 | categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), | 1204 | categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), |
1208 | topFrame); | 1205 | topFrame); |
1209 | topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); | 1206 | topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); |
1210 | 1207 | ||
1211 | mCategoryCombo = new QComboBox(categoryGroup); | 1208 | mCategoryCombo = new QComboBox(categoryGroup); |
1212 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); | 1209 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); |
1213 | connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); | 1210 | connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); |
1214 | 1211 | ||
1215 | mCategoryButton = new KColorButton(categoryGroup); | 1212 | mCategoryButton = new KColorButton(categoryGroup); |
1216 | connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); | 1213 | connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); |
1217 | updateCategoryColor(); | 1214 | updateCategoryColor(); |
1218 | 1215 | ||
1219 | 1216 | ||
1220 | // Holiday Color | 1217 | // Holiday Color |
1221 | 1218 | ||
1222 | KPrefsDialogWidColor *holidayColor = | 1219 | KPrefsDialogWidColor *holidayColor = |
1223 | addWidColor(i18n("Holiday color:"), | 1220 | addWidColor(i18n("Holiday color:"), |
1224 | &(KOPrefs::instance()->mHolidayColor),topFrame); | 1221 | &(KOPrefs::instance()->mHolidayColor),topFrame); |
1225 | topLayout->addWidget(holidayColor->label(),ii,0); | 1222 | topLayout->addWidget(holidayColor->label(),ii,0); |
1226 | topLayout->addWidget(holidayColor->button(),ii++,1); | 1223 | topLayout->addWidget(holidayColor->button(),ii++,1); |
1227 | 1224 | ||
1228 | // Highlight Color | 1225 | // Highlight Color |
1229 | KPrefsDialogWidColor *highlightColor = | 1226 | KPrefsDialogWidColor *highlightColor = |
1230 | addWidColor(i18n("Highlight color:"), | 1227 | addWidColor(i18n("Highlight color:"), |
1231 | &(KOPrefs::instance()->mHighlightColor),topFrame); | 1228 | &(KOPrefs::instance()->mHighlightColor),topFrame); |
1232 | topLayout->addWidget(highlightColor->label(),ii,0); | 1229 | topLayout->addWidget(highlightColor->label(),ii,0); |
1233 | topLayout->addWidget(highlightColor->button(),ii++,1); | 1230 | topLayout->addWidget(highlightColor->button(),ii++,1); |
1234 | 1231 | ||
1235 | // Event color | 1232 | // Event color |
1236 | KPrefsDialogWidColor *eventColor = | 1233 | KPrefsDialogWidColor *eventColor = |
1237 | addWidColor(i18n("Default event color:"), | 1234 | addWidColor(i18n("Default event color:"), |
1238 | &(KOPrefs::instance()->mEventColor),topFrame); | 1235 | &(KOPrefs::instance()->mEventColor),topFrame); |
1239 | topLayout->addWidget(eventColor->label(),ii,0); | 1236 | topLayout->addWidget(eventColor->label(),ii,0); |
1240 | topLayout->addWidget(eventColor->button(),ii++,1); | 1237 | topLayout->addWidget(eventColor->button(),ii++,1); |
1241 | eventColor = | 1238 | eventColor = |
1242 | addWidColor(i18n("Default todo done color:"), | 1239 | addWidColor(i18n("Default todo done color:"), |
1243 | &(KOPrefs::instance()->mTodoDoneColor),topFrame); | 1240 | &(KOPrefs::instance()->mTodoDoneColor),topFrame); |
1244 | topLayout->addWidget(eventColor->label(),ii,0); | 1241 | topLayout->addWidget(eventColor->label(),ii,0); |
1245 | topLayout->addWidget(eventColor->button(),ii++,1); | 1242 | topLayout->addWidget(eventColor->button(),ii++,1); |
1246 | 1243 | ||
1247 | 1244 | ||
1248 | // agenda view background color | 1245 | // agenda view background color |
1249 | KPrefsDialogWidColor *agendaBgColor = | 1246 | KPrefsDialogWidColor *agendaBgColor = |
1250 | addWidColor(i18n("Agenda view background color:"), | 1247 | addWidColor(i18n("Agenda view background color:"), |
1251 | &(KOPrefs::instance()->mAgendaBgColor),topFrame); | 1248 | &(KOPrefs::instance()->mAgendaBgColor),topFrame); |
1252 | topLayout->addWidget(agendaBgColor->label(),ii,0); | 1249 | topLayout->addWidget(agendaBgColor->label(),ii,0); |
1253 | topLayout->addWidget(agendaBgColor->button(),ii++,1); | 1250 | topLayout->addWidget(agendaBgColor->button(),ii++,1); |
1254 | 1251 | ||
1255 | // working hours color | 1252 | // working hours color |
1256 | KPrefsDialogWidColor *workingHoursColor = | 1253 | KPrefsDialogWidColor *workingHoursColor = |
1257 | addWidColor(i18n("Working hours color:"), | 1254 | addWidColor(i18n("Working hours color:"), |
1258 | &(KOPrefs::instance()->mWorkingHoursColor),topFrame); | 1255 | &(KOPrefs::instance()->mWorkingHoursColor),topFrame); |
1259 | topLayout->addWidget(workingHoursColor->label(),ii,0); | 1256 | topLayout->addWidget(workingHoursColor->label(),ii,0); |
1260 | topLayout->addWidget(workingHoursColor->button(),ii++,1); | 1257 | topLayout->addWidget(workingHoursColor->button(),ii++,1); |
1261 | 1258 | ||
1262 | KPrefsDialogWidBool *sb = | 1259 | KPrefsDialogWidBool *sb = |
1263 | addWidBool(i18n("Use colors for application:"), | 1260 | addWidBool(i18n("Use colors for application:"), |
1264 | &(KOPrefs::instance()->mUseAppColors),topFrame); | 1261 | &(KOPrefs::instance()->mUseAppColors),topFrame); |
1265 | topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); | 1262 | topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); |
1266 | 1263 | ||
1267 | ii++; | 1264 | ii++; |
1268 | KPrefsDialogWidColor * workingHoursColor1 = | 1265 | KPrefsDialogWidColor * workingHoursColor1 = |
1269 | addWidColor(i18n("Buttons, menus, etc.:"), | 1266 | addWidColor(i18n("Buttons, menus, etc.:"), |
1270 | &(KOPrefs::instance()->mAppColor1),topFrame); | 1267 | &(KOPrefs::instance()->mAppColor1),topFrame); |
1271 | topLayout->addWidget(workingHoursColor1->label(),ii,0); | 1268 | topLayout->addWidget(workingHoursColor1->label(),ii,0); |
1272 | topLayout->addWidget(workingHoursColor1->button(),ii++,1); | 1269 | topLayout->addWidget(workingHoursColor1->button(),ii++,1); |
1273 | 1270 | ||
1274 | KPrefsDialogWidColor * workingHoursColor2 = | 1271 | KPrefsDialogWidColor * workingHoursColor2 = |
1275 | addWidColor(i18n("Frames, labels, etc.:"), | 1272 | addWidColor(i18n("Frames, labels, etc.:"), |
1276 | &(KOPrefs::instance()->mAppColor2),topFrame); | 1273 | &(KOPrefs::instance()->mAppColor2),topFrame); |
1277 | topLayout->addWidget(workingHoursColor2->label(),ii,0); | 1274 | topLayout->addWidget(workingHoursColor2->label(),ii,0); |
1278 | topLayout->addWidget(workingHoursColor2->button(),ii++,1); | 1275 | topLayout->addWidget(workingHoursColor2->button(),ii++,1); |
1279 | 1276 | ||
1280 | 1277 | ||
1281 | 1278 | ||
1282 | } | 1279 | } |
1283 | 1280 | ||
1284 | void KOPrefsDialog::setCategoryColor() | 1281 | void KOPrefsDialog::setCategoryColor() |
1285 | { | 1282 | { |
1286 | mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); | 1283 | mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); |
1287 | } | 1284 | } |
1288 | 1285 | ||
1289 | void KOPrefsDialog::updateCategoryColor() | 1286 | void KOPrefsDialog::updateCategoryColor() |
1290 | { | 1287 | { |
1291 | QString cat = mCategoryCombo->currentText(); | 1288 | QString cat = mCategoryCombo->currentText(); |
1292 | QColor *color = mCategoryDict.find(cat); | 1289 | QColor *color = mCategoryDict.find(cat); |
1293 | if (!color) { | 1290 | if (!color) { |
1294 | color = KOPrefs::instance()->categoryColor(cat); | 1291 | color = KOPrefs::instance()->categoryColor(cat); |
1295 | } | 1292 | } |
1296 | if (color) { | 1293 | if (color) { |
1297 | mCategoryButton->setColor(*color); | 1294 | mCategoryButton->setColor(*color); |
1298 | } | 1295 | } |
1299 | } | 1296 | } |
1300 | 1297 | ||
1301 | void KOPrefsDialog::setupPrinterTab() | 1298 | void KOPrefsDialog::setupPrinterTab() |
1302 | { | 1299 | { |
1303 | mPrinterTab = addPage(i18n("Printing"),0, | 1300 | mPrinterTab = addPage(i18n("Printing"),0, |
1304 | DesktopIcon("fileprint",KIcon::SizeMedium)); | 1301 | DesktopIcon("fileprint",KIcon::SizeMedium)); |
1305 | 1302 | ||
1306 | QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); | 1303 | QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); |
1307 | topLayout->setSpacing(mSpacingHint); | 1304 | topLayout->setSpacing(mSpacingHint); |
1308 | topLayout->setMargin(mMarginHint); | 1305 | topLayout->setMargin(mMarginHint); |
1309 | 1306 | ||
1310 | topLayout->setRowStretch(4,1); | 1307 | topLayout->setRowStretch(4,1); |
1311 | } | 1308 | } |
1312 | 1309 | ||
1313 | void KOPrefsDialog::setupGroupSchedulingTab() | 1310 | void KOPrefsDialog::setupGroupSchedulingTab() |
1314 | { | 1311 | { |
1315 | #if 0 | 1312 | #if 0 |
1316 | QFrame *topFrame = addPage(i18n("Group Scheduling"),0, | 1313 | QFrame *topFrame = addPage(i18n("Group Scheduling"),0, |
1317 | DesktopIcon("personal",KIcon::SizeMedium)); | 1314 | DesktopIcon("personal",KIcon::SizeMedium)); |
1318 | 1315 | ||
1319 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 1316 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
1320 | topLayout->setSpacing(mSpacingHint); | 1317 | topLayout->setSpacing(mSpacingHint); |
1321 | topLayout->setMargin(mMarginHint); | 1318 | topLayout->setMargin(mMarginHint); |
1322 | 1319 | ||
1323 | #if 0 | 1320 | #if 0 |
1324 | KPrefsDialogWidRadios *schedulerGroup = | 1321 | KPrefsDialogWidRadios *schedulerGroup = |
1325 | addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), | 1322 | addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), |
1326 | topFrame); | 1323 | topFrame); |
1327 | schedulerGroup->addRadio("Dummy"); // Only for debugging | 1324 | schedulerGroup->addRadio("Dummy"); // Only for debugging |
1328 | schedulerGroup->addRadio(i18n("Mail client")); | 1325 | schedulerGroup->addRadio(i18n("Mail client")); |
1329 | 1326 | ||
1330 | topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); | 1327 | topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); |
1331 | #endif | 1328 | #endif |
1332 | 1329 | ||
1333 | KPrefsDialogWidRadios *sendGroup = | 1330 | KPrefsDialogWidRadios *sendGroup = |
1334 | addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), | 1331 | addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), |
1335 | topFrame); | 1332 | topFrame); |
1336 | sendGroup->addRadio(i18n("Send to outbox")); | 1333 | sendGroup->addRadio(i18n("Send to outbox")); |
1337 | sendGroup->addRadio(i18n("Send directly")); | 1334 | sendGroup->addRadio(i18n("Send directly")); |
1338 | 1335 | ||
1339 | topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); | 1336 | topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); |
1340 | 1337 | ||
1341 | topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); | 1338 | topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); |
1342 | mAMails = new QListView(topFrame); | 1339 | mAMails = new QListView(topFrame); |
1343 | mAMails->addColumn(i18n("Email"),300); | 1340 | mAMails->addColumn(i18n("Email"),300); |
1344 | topLayout->addMultiCellWidget(mAMails,3,3,0,1); | 1341 | topLayout->addMultiCellWidget(mAMails,3,3,0,1); |
1345 | 1342 | ||
1346 | topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); | 1343 | topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); |
1347 | aEmailsEdit = new QLineEdit(topFrame); | 1344 | aEmailsEdit = new QLineEdit(topFrame); |
1348 | aEmailsEdit->setEnabled(false); | 1345 | aEmailsEdit->setEnabled(false); |
1349 | topLayout->addWidget(aEmailsEdit,4,1); | 1346 | topLayout->addWidget(aEmailsEdit,4,1); |
1350 | 1347 | ||
1351 | QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); | 1348 | QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); |
1352 | topLayout->addWidget(add,5,0); | 1349 | topLayout->addWidget(add,5,0); |
1353 | QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); | 1350 | QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); |
1354 | topLayout->addWidget(del,5,1); | 1351 | topLayout->addWidget(del,5,1); |
1355 | 1352 | ||
1356 | //topLayout->setRowStretch(2,1); | 1353 | //topLayout->setRowStretch(2,1); |
1357 | connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); | 1354 | connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); |
1358 | connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); | 1355 | connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); |
1359 | connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); | 1356 | connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); |
1360 | connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); | 1357 | connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); |
1361 | #endif | 1358 | #endif |
1362 | } | 1359 | } |
1363 | 1360 | ||
1364 | void KOPrefsDialog::setupGroupAutomationTab() | 1361 | void KOPrefsDialog::setupGroupAutomationTab() |
1365 | { | 1362 | { |
1366 | return; | 1363 | return; |
1367 | QFrame *topFrame = addPage(i18n("Group Automation"),0, | 1364 | QFrame *topFrame = addPage(i18n("Group Automation"),0, |
1368 | DesktopIcon("personal",KIcon::SizeMedium)); | 1365 | DesktopIcon("personal",KIcon::SizeMedium)); |
1369 | 1366 | ||
1370 | QGridLayout *topLayout = new QGridLayout(topFrame,5,1); | 1367 | QGridLayout *topLayout = new QGridLayout(topFrame,5,1); |
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index db60383..7a945e3 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp | |||
@@ -1,460 +1,466 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 1998 Preston Brown | 3 | Copyright (c) 1998 Preston Brown |
4 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 4 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or | 8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | 9 | (at your option) any later version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, | 11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include <qcheckbox.h> | 26 | #include <qcheckbox.h> |
27 | #include <qgroupbox.h> | 27 | #include <qgroupbox.h> |
28 | #include <qlabel.h> | 28 | #include <qlabel.h> |
29 | #include <qlistview.h> | 29 | #include <qlistview.h> |
30 | #include <qwhatsthis.h> | 30 | #include <qwhatsthis.h> |
31 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
32 | #include <qpushbutton.h> | 32 | #include <qpushbutton.h> |
33 | 33 | ||
34 | #include <klocale.h> | 34 | #include <klocale.h> |
35 | #include <kmessagebox.h> | 35 | #include <kmessagebox.h> |
36 | 36 | ||
37 | #include <libkdepim/kdateedit.h> | 37 | #include <libkdepim/kdateedit.h> |
38 | 38 | ||
39 | #include "koglobals.h" | 39 | #include "koglobals.h" |
40 | #include "koprefs.h" | 40 | #include "koprefs.h" |
41 | #include "klineedit.h" | 41 | #include "klineedit.h" |
42 | 42 | ||
43 | #include "calendarview.h" | 43 | #include "calendarview.h" |
44 | #include "koviewmanager.h" | 44 | #include "koviewmanager.h" |
45 | #include "searchdialog.h" | 45 | #include "searchdialog.h" |
46 | 46 | ||
47 | SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) | 47 | SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) |
48 | : QVBox( 0 ) | 48 | : QVBox( 0 ) |
49 | 49 | ||
50 | { | 50 | { |
51 | mCalendar = calendar; | 51 | mCalendar = calendar; |
52 | QFrame *topFrame = new QFrame( this ) ;//plainPage(); | 52 | QFrame *topFrame = new QFrame( this ) ;//plainPage(); |
53 | QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint()); | 53 | QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint()); |
54 | 54 | ||
55 | // Search expression | 55 | // Search expression |
56 | QHBoxLayout *subLayout = new QHBoxLayout(); | 56 | QHBoxLayout *subLayout = new QHBoxLayout(); |
57 | layout->addLayout(subLayout); | 57 | layout->addLayout(subLayout); |
58 | searchLabel = new QLabel(topFrame); | 58 | searchLabel = new QLabel(topFrame); |
59 | searchLabel->setText(i18n("Search for:")); | 59 | searchLabel->setText(i18n("Search for:")); |
60 | subLayout->addWidget(searchLabel); | 60 | subLayout->addWidget(searchLabel); |
61 | 61 | ||
62 | searchEdit = new KLineEdit(topFrame); | 62 | searchEdit = new KLineEdit(topFrame); |
63 | subLayout->addWidget(searchEdit); | 63 | subLayout->addWidget(searchEdit); |
64 | QPushButton *OkButton = new QPushButton( i18n("&Find"), topFrame ); | 64 | QPushButton *OkButton = new QPushButton( i18n("&Find"), topFrame ); |
65 | //OkButton->setDefault( true ); | 65 | //OkButton->setDefault( true ); |
66 | connect(OkButton,SIGNAL(clicked()),SLOT(doSearch())); | 66 | connect(OkButton,SIGNAL(clicked()),SLOT(doSearch())); |
67 | subLayout->addWidget(OkButton); | 67 | subLayout->addWidget(OkButton); |
68 | searchEdit->setText("*"); // Find all events by default | 68 | searchEdit->setText("*"); // Find all events by default |
69 | searchEdit->setFocus(); | 69 | searchEdit->setFocus(); |
70 | connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); | 70 | connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); |
71 | connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); | 71 | connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); |
72 | // Subjects to search | 72 | // Subjects to search |
73 | // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), | 73 | // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), |
74 | // topFrame); | 74 | // topFrame); |
75 | 75 | ||
76 | QHBox *incidenceGroup = new QHBox( topFrame ); | 76 | QHBox *incidenceGroup = new QHBox( topFrame ); |
77 | layout->addWidget(incidenceGroup); | 77 | layout->addWidget(incidenceGroup); |
78 | 78 | ||
79 | mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); | 79 | mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); |
80 | //mSearchEvent->setChecked(true); | 80 | //mSearchEvent->setChecked(true); |
81 | mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); | 81 | mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); |
82 | mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); | 82 | mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); |
83 | 83 | ||
84 | QHBox *subjectGroup = new QHBox( topFrame ); | 84 | QHBox *subjectGroup = new QHBox( topFrame ); |
85 | layout->addWidget(subjectGroup); | 85 | layout->addWidget(subjectGroup); |
86 | 86 | ||
87 | mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); | 87 | mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); |
88 | mSummaryCheck->setChecked(true); | 88 | mSummaryCheck->setChecked(true); |
89 | mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup); | 89 | mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup); |
90 | mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); | 90 | mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); |
91 | 91 | ||
92 | QHBox *attendeeGroup = new QHBox( topFrame ); | 92 | QHBox *attendeeGroup = new QHBox( topFrame ); |
93 | layout->addWidget(attendeeGroup ); | 93 | layout->addWidget(attendeeGroup ); |
94 | new QLabel( i18n("Attendee:"),attendeeGroup ); | 94 | new QLabel( i18n("Attendee:"),attendeeGroup ); |
95 | mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); | 95 | mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); |
96 | mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); | 96 | mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); |
97 | // Date range | 97 | // Date range |
98 | // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), | 98 | // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), |
99 | // topFrame); | 99 | // topFrame); |
100 | // layout->addWidget(rangeGroup); | 100 | // layout->addWidget(rangeGroup); |
101 | 101 | ||
102 | QWidget *rangeWidget = new QWidget(topFrame); | 102 | QWidget *rangeWidget = new QWidget(topFrame); |
103 | QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint()); | 103 | QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint()); |
104 | rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); | 104 | rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); |
105 | mStartDate = new KDateEdit(rangeWidget); | 105 | mStartDate = new KDateEdit(rangeWidget); |
106 | rangeLayout->addWidget(mStartDate); | 106 | rangeLayout->addWidget(mStartDate); |
107 | rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); | 107 | rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); |
108 | mEndDate = new KDateEdit(rangeWidget); | 108 | mEndDate = new KDateEdit(rangeWidget); |
109 | mEndDate->setDate(QDate::currentDate().addDays(365)); | 109 | mEndDate->setDate(QDate::currentDate().addDays(365)); |
110 | rangeLayout->addWidget(mEndDate); | 110 | rangeLayout->addWidget(mEndDate); |
111 | QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); | 111 | QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); |
112 | rangeLayout->addWidget( (QWidget*)wt ); | 112 | rangeLayout->addWidget( (QWidget*)wt ); |
113 | layout->addWidget(rangeWidget); | 113 | layout->addWidget(rangeWidget); |
114 | // Results list view | 114 | // Results list view |
115 | listView = new KOListView(mCalendar,topFrame); | 115 | listView = new KOListView(mCalendar,topFrame); |
116 | layout->addWidget(listView); | 116 | layout->addWidget(listView); |
117 | 117 | ||
118 | listView->readSettings(KOGlobals::config(),"SearchListView Layout"); | 118 | listView->readSettings(KOGlobals::config(),"SearchListView Layout"); |
119 | connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList())); | 119 | connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList())); |
120 | 120 | ||
121 | setCaption( i18n("KO/Pi Find: ")); | 121 | setCaption( i18n("KO/Pi Find: ")); |
122 | #ifdef DESKTOP_VERSION | 122 | #ifdef DESKTOP_VERSION |
123 | OkButton = new QPushButton( i18n("Close"), this ); | 123 | OkButton = new QPushButton( i18n("Close"), this ); |
124 | connect(OkButton,SIGNAL(clicked()),SLOT(hide())); | 124 | connect(OkButton,SIGNAL(clicked()),SLOT(hide())); |
125 | #endif | 125 | #endif |
126 | } | 126 | } |
127 | 127 | ||
128 | SearchDialog::~SearchDialog() | 128 | SearchDialog::~SearchDialog() |
129 | { | 129 | { |
130 | 130 | ||
131 | } | 131 | } |
132 | void SearchDialog::raiseAndSelect() | 132 | void SearchDialog::raiseAndSelect() |
133 | { | 133 | { |
134 | 134 | ||
135 | static int currentState = 0; | 135 | static int currentState = 0; |
136 | 136 | ||
137 | if ( !mSearchJournal->isChecked() && !mSearchTodo->isChecked() && !mSearchEvent->isChecked() ) | 137 | if ( !mSearchJournal->isChecked() && !mSearchTodo->isChecked() && !mSearchEvent->isChecked() ) |
138 | currentState = 0; | 138 | currentState = 0; |
139 | int newState = 0; | 139 | int newState = 0; |
140 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { | 140 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { |
141 | newState = VIEW_J_VIEW; | 141 | newState = VIEW_J_VIEW; |
142 | } | 142 | } |
143 | else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { | 143 | else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { |
144 | newState = VIEW_T_VIEW; | 144 | newState = VIEW_T_VIEW; |
145 | } | 145 | } |
146 | else { | 146 | else { |
147 | newState = VIEW_A_VIEW; | 147 | newState = VIEW_A_VIEW; |
148 | } | 148 | } |
149 | if ( newState != currentState ) { | 149 | if ( newState != currentState ) { |
150 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { | 150 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { |
151 | if ( ! mSearchJournal->isChecked() ) { | 151 | if ( ! mSearchJournal->isChecked() ) { |
152 | mSearchJournal->setChecked( true ); | 152 | mSearchJournal->setChecked( true ); |
153 | mSearchTodo->setChecked( false ); | 153 | mSearchTodo->setChecked( false ); |
154 | mSearchEvent->setChecked( false ); | 154 | mSearchEvent->setChecked( false ); |
155 | } | 155 | } |
156 | } | 156 | } |
157 | else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { | 157 | else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { |
158 | if ( ! mSearchTodo->isChecked() ) { | 158 | if ( ! mSearchTodo->isChecked() ) { |
159 | mSearchTodo->setChecked( true ); | 159 | mSearchTodo->setChecked( true ); |
160 | mSearchJournal->setChecked( false ); | 160 | mSearchJournal->setChecked( false ); |
161 | mSearchEvent->setChecked( false ); | 161 | mSearchEvent->setChecked( false ); |
162 | } | 162 | } |
163 | } | 163 | } |
164 | else { | 164 | else { |
165 | if ( ! mSearchEvent->isChecked() ) { | 165 | if ( ! mSearchEvent->isChecked() ) { |
166 | mSearchEvent->setChecked( true ); | 166 | mSearchEvent->setChecked( true ); |
167 | mSearchJournal->setChecked( false ); | 167 | mSearchJournal->setChecked( false ); |
168 | mSearchTodo->setChecked( false ); | 168 | mSearchTodo->setChecked( false ); |
169 | } | 169 | } |
170 | } | 170 | } |
171 | } | 171 | } |
172 | currentState = newState; | 172 | currentState = newState; |
173 | raise(); | 173 | raise(); |
174 | } | 174 | } |
175 | void SearchDialog::setFocusToList() | 175 | void SearchDialog::setFocusToList() |
176 | { | 176 | { |
177 | listView->resetFocus(); | 177 | listView->resetFocus(); |
178 | } | 178 | } |
179 | void SearchDialog::accept() | 179 | void SearchDialog::accept() |
180 | { | 180 | { |
181 | doSearch(); | 181 | doSearch(); |
182 | } | 182 | } |
183 | void SearchDialog::updateList() | 183 | void SearchDialog::updateList() |
184 | { | 184 | { |
185 | //listView->updateList(); | 185 | //listView->updateList(); |
186 | if ( isVisible() ) { | 186 | if ( isVisible() ) { |
187 | updateView(); | 187 | updateView(); |
188 | //qDebug("SearchDialog::updated "); | 188 | //qDebug("SearchDialog::updated "); |
189 | } | 189 | } |
190 | else { | 190 | else { |
191 | listView->clear(); | 191 | listView->clear(); |
192 | //qDebug("SearchDialog::cleared "); | 192 | //qDebug("SearchDialog::cleared "); |
193 | 193 | ||
194 | } | 194 | } |
195 | } | 195 | } |
196 | void SearchDialog::searchTextChanged( const QString &_text ) | 196 | void SearchDialog::searchTextChanged( const QString &_text ) |
197 | { | 197 | { |
198 | #if 0 | 198 | #if 0 |
199 | enableButton( KDialogBase::User1, !_text.isEmpty() ); | 199 | enableButton( KDialogBase::User1, !_text.isEmpty() ); |
200 | #endif | 200 | #endif |
201 | } | 201 | } |
202 | 202 | ||
203 | void SearchDialog::doSearch() | 203 | void SearchDialog::doSearch() |
204 | { | 204 | { |
205 | QRegExp re; | 205 | QRegExp re; |
206 | 206 | ||
207 | re.setWildcard(true); // most people understand these better. | 207 | re.setWildcard(true); // most people understand these better. |
208 | re.setCaseSensitive(false); | 208 | re.setCaseSensitive(false); |
209 | re.setPattern(searchEdit->text()); | 209 | QString st = searchEdit->text(); |
210 | if ( st.right(1) != "*") | ||
211 | st += "*"; | ||
212 | re.setPattern(st); | ||
210 | if (!mSearchEvent->isChecked() && !mSearchTodo->isChecked() && !mSearchJournal->isChecked() ) { | 213 | if (!mSearchEvent->isChecked() && !mSearchTodo->isChecked() && !mSearchJournal->isChecked() ) { |
211 | KMessageBox::sorry(this, | 214 | KMessageBox::sorry(this, |
212 | i18n("Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals")); | 215 | i18n("Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals")); |
213 | return; | 216 | return; |
214 | } | 217 | } |
215 | if (!re.isValid() ) { | 218 | if (!re.isValid() ) { |
216 | KMessageBox::sorry(this, | 219 | KMessageBox::sorry(this, |
217 | i18n("Invalid search expression,\ncannot perform " | 220 | i18n("Invalid search expression,\ncannot perform " |
218 | "the search.\nPlease enter a search expression\n" | 221 | "the search.\nPlease enter a search expression\n" |
219 | "using the wildcard characters\n '*' and '?'" | 222 | "using the wildcard characters\n '*' and '?'" |
220 | "where needed.")); | 223 | "where needed.")); |
221 | return; | 224 | return; |
222 | } | 225 | } |
223 | 226 | ||
224 | search(re); | 227 | search(re); |
225 | 228 | ||
226 | listView->setStartDate( mStartDate->date() ); | 229 | listView->setStartDate( mStartDate->date() ); |
227 | listView->showEvents(mMatchedEvents); | 230 | listView->showEvents(mMatchedEvents); |
228 | listView->addTodos(mMatchedTodos); | 231 | listView->addTodos(mMatchedTodos); |
229 | listView->addJournals(mMatchedJournals); | 232 | listView->addJournals(mMatchedJournals); |
230 | 233 | ||
231 | if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) { | 234 | if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) { |
232 | setCaption(i18n("No items found. Use '*' and '?' where needed.")); | 235 | setCaption(i18n("No items found. Use '*' and '?' where needed.")); |
233 | } else { | 236 | } else { |
234 | QString mess; | 237 | QString mess; |
235 | mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() ); | 238 | mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() ); |
236 | setCaption( i18n("KO/Pi Find: ") + mess); | 239 | setCaption( i18n("KO/Pi Find: ") + mess); |
237 | 240 | ||
238 | } | 241 | } |
239 | searchEdit->setFocus(); | 242 | searchEdit->setFocus(); |
240 | } | 243 | } |
241 | void SearchDialog::updateConfig() | 244 | void SearchDialog::updateConfig() |
242 | { | 245 | { |
243 | listView->updateConfig(); | 246 | listView->updateConfig(); |
244 | } | 247 | } |
245 | void SearchDialog::updateView() | 248 | void SearchDialog::updateView() |
246 | { | 249 | { |
247 | //qDebug("SearchDialog::updateView() %d ", isVisible()); | 250 | //qDebug("SearchDialog::updateView() %d ", isVisible()); |
248 | QRegExp re; | 251 | QRegExp re; |
249 | re.setWildcard(true); // most people understand these better. | 252 | re.setWildcard(true); // most people understand these better. |
250 | re.setCaseSensitive(false); | 253 | re.setCaseSensitive(false); |
251 | re.setPattern(searchEdit->text()); | 254 | QString st = searchEdit->text(); |
255 | if ( st.right(1) != "*") | ||
256 | st += "*"; | ||
257 | re.setPattern(st); | ||
252 | if (re.isValid()) { | 258 | if (re.isValid()) { |
253 | search(re); | 259 | search(re); |
254 | } else { | 260 | } else { |
255 | mMatchedEvents.clear(); | 261 | mMatchedEvents.clear(); |
256 | mMatchedTodos.clear(); | 262 | mMatchedTodos.clear(); |
257 | mMatchedJournals.clear(); | 263 | mMatchedJournals.clear(); |
258 | } | 264 | } |
259 | listView->setStartDate( mStartDate->date() ); | 265 | listView->setStartDate( mStartDate->date() ); |
260 | listView->showEvents(mMatchedEvents); | 266 | listView->showEvents(mMatchedEvents); |
261 | listView->addTodos(mMatchedTodos); | 267 | listView->addTodos(mMatchedTodos); |
262 | listView->addJournals(mMatchedJournals); | 268 | listView->addJournals(mMatchedJournals); |
263 | } | 269 | } |
264 | 270 | ||
265 | void SearchDialog::search(const QRegExp &re) | 271 | void SearchDialog::search(const QRegExp &re) |
266 | { | 272 | { |
267 | QPtrList<Event> events = mCalendar->events( mStartDate->date(), | 273 | QPtrList<Event> events = mCalendar->events( mStartDate->date(), |
268 | mEndDate->date(), | 274 | mEndDate->date(), |
269 | false /*mInclusiveCheck->isChecked()*/ ); | 275 | false /*mInclusiveCheck->isChecked()*/ ); |
270 | 276 | ||
271 | mMatchedEvents.clear(); | 277 | mMatchedEvents.clear(); |
272 | if ( mSearchEvent->isChecked() ) { | 278 | if ( mSearchEvent->isChecked() ) { |
273 | Event *ev; | 279 | Event *ev; |
274 | for(ev=events.first();ev;ev=events.next()) { | 280 | for(ev=events.first();ev;ev=events.next()) { |
275 | if (mSummaryCheck->isChecked()) { | 281 | if (mSummaryCheck->isChecked()) { |
276 | #if QT_VERSION >= 0x030000 | 282 | #if QT_VERSION >= 0x030000 |
277 | if (re.search(ev->summary()) != -1) | 283 | if (re.search(ev->summary()) != -1) |
278 | #else | 284 | #else |
279 | if (re.match(ev->summary()) != -1) | 285 | if (re.match(ev->summary()) != -1) |
280 | #endif | 286 | #endif |
281 | { | 287 | { |
282 | mMatchedEvents.append(ev); | 288 | mMatchedEvents.append(ev); |
283 | continue; | 289 | continue; |
284 | } | 290 | } |
285 | #if QT_VERSION >= 0x030000 | 291 | #if QT_VERSION >= 0x030000 |
286 | if (re.search(ev->location()) != -1) | 292 | if (re.search(ev->location()) != -1) |
287 | #else | 293 | #else |
288 | if (re.match(ev->location()) != -1) | 294 | if (re.match(ev->location()) != -1) |
289 | #endif | 295 | #endif |
290 | { | 296 | { |
291 | mMatchedEvents.append(ev); | 297 | mMatchedEvents.append(ev); |
292 | continue; | 298 | continue; |
293 | } | 299 | } |
294 | } | 300 | } |
295 | if (mDescriptionCheck->isChecked()) { | 301 | if (mDescriptionCheck->isChecked()) { |
296 | #if QT_VERSION >= 0x030000 | 302 | #if QT_VERSION >= 0x030000 |
297 | if (re.search(ev->description()) != -1) | 303 | if (re.search(ev->description()) != -1) |
298 | #else | 304 | #else |
299 | if (re.match(ev->description()) != -1) | 305 | if (re.match(ev->description()) != -1) |
300 | #endif | 306 | #endif |
301 | { | 307 | { |
302 | mMatchedEvents.append(ev); | 308 | mMatchedEvents.append(ev); |
303 | continue; | 309 | continue; |
304 | } | 310 | } |
305 | } | 311 | } |
306 | if (mCategoryCheck->isChecked()) { | 312 | if (mCategoryCheck->isChecked()) { |
307 | #if QT_VERSION >= 0x030000 | 313 | #if QT_VERSION >= 0x030000 |
308 | if (re.search(ev->categoriesStr()) != -1) | 314 | if (re.search(ev->categoriesStr()) != -1) |
309 | #else | 315 | #else |
310 | if (re.match(ev->categoriesStr()) != -1) | 316 | if (re.match(ev->categoriesStr()) != -1) |
311 | #endif | 317 | #endif |
312 | { | 318 | { |
313 | mMatchedEvents.append(ev); | 319 | mMatchedEvents.append(ev); |
314 | continue; | 320 | continue; |
315 | } | 321 | } |
316 | } | 322 | } |
317 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { | 323 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { |
318 | QPtrList<Attendee> tmpAList = ev->attendees(); | 324 | QPtrList<Attendee> tmpAList = ev->attendees(); |
319 | Attendee *a; | 325 | Attendee *a; |
320 | for (a = tmpAList.first(); a; a = tmpAList.next()) { | 326 | for (a = tmpAList.first(); a; a = tmpAList.next()) { |
321 | if (mSearchAName->isChecked()) { | 327 | if (mSearchAName->isChecked()) { |
322 | #if QT_VERSION >= 0x030000 | 328 | #if QT_VERSION >= 0x030000 |
323 | if (re.search(a->name()) != -1) | 329 | if (re.search(a->name()) != -1) |
324 | #else | 330 | #else |
325 | if (re.match(a->name()) != -1) | 331 | if (re.match(a->name()) != -1) |
326 | #endif | 332 | #endif |
327 | { | 333 | { |
328 | mMatchedEvents.append(ev); | 334 | mMatchedEvents.append(ev); |
329 | break; | 335 | break; |
330 | } | 336 | } |
331 | } | 337 | } |
332 | if (mSearchAEmail->isChecked()) { | 338 | if (mSearchAEmail->isChecked()) { |
333 | #if QT_VERSION >= 0x030000 | 339 | #if QT_VERSION >= 0x030000 |
334 | if (re.search(a->email()) != -1) | 340 | if (re.search(a->email()) != -1) |
335 | #else | 341 | #else |
336 | if (re.match(a->email()) != -1) | 342 | if (re.match(a->email()) != -1) |
337 | #endif | 343 | #endif |
338 | { | 344 | { |
339 | mMatchedEvents.append(ev); | 345 | mMatchedEvents.append(ev); |
340 | break; | 346 | break; |
341 | } | 347 | } |
342 | } | 348 | } |
343 | } | 349 | } |
344 | } | 350 | } |
345 | } | 351 | } |
346 | } | 352 | } |
347 | QPtrList<Todo> todos = mCalendar->todos( ); | 353 | QPtrList<Todo> todos = mCalendar->todos( ); |
348 | mMatchedTodos.clear(); | 354 | mMatchedTodos.clear(); |
349 | if ( mSearchTodo->isChecked() ) { | 355 | if ( mSearchTodo->isChecked() ) { |
350 | Todo *tod; | 356 | Todo *tod; |
351 | for(tod=todos.first();tod;tod=todos.next()) { | 357 | for(tod=todos.first();tod;tod=todos.next()) { |
352 | if (mSummaryCheck->isChecked()) { | 358 | if (mSummaryCheck->isChecked()) { |
353 | #if QT_VERSION >= 0x030000 | 359 | #if QT_VERSION >= 0x030000 |
354 | if (re.search(tod->summary()) != -1) | 360 | if (re.search(tod->summary()) != -1) |
355 | #else | 361 | #else |
356 | if (re.match(tod->summary()) != -1) | 362 | if (re.match(tod->summary()) != -1) |
357 | #endif | 363 | #endif |
358 | { | 364 | { |
359 | mMatchedTodos.append(tod); | 365 | mMatchedTodos.append(tod); |
360 | continue; | 366 | continue; |
361 | } | 367 | } |
362 | } | 368 | } |
363 | if (mDescriptionCheck->isChecked()) { | 369 | if (mDescriptionCheck->isChecked()) { |
364 | #if QT_VERSION >= 0x030000 | 370 | #if QT_VERSION >= 0x030000 |
365 | if (re.search(tod->description()) != -1) | 371 | if (re.search(tod->description()) != -1) |
366 | #else | 372 | #else |
367 | if (re.match(tod->description()) != -1) | 373 | if (re.match(tod->description()) != -1) |
368 | #endif | 374 | #endif |
369 | { | 375 | { |
370 | mMatchedTodos.append(tod); | 376 | mMatchedTodos.append(tod); |
371 | continue; | 377 | continue; |
372 | } | 378 | } |
373 | } | 379 | } |
374 | if (mCategoryCheck->isChecked()) { | 380 | if (mCategoryCheck->isChecked()) { |
375 | #if QT_VERSION >= 0x030000 | 381 | #if QT_VERSION >= 0x030000 |
376 | if (re.search(tod->categoriesStr()) != -1) | 382 | if (re.search(tod->categoriesStr()) != -1) |
377 | #else | 383 | #else |
378 | if (re.match(tod->categoriesStr()) != -1) | 384 | if (re.match(tod->categoriesStr()) != -1) |
379 | #endif | 385 | #endif |
380 | { | 386 | { |
381 | mMatchedTodos.append(tod); | 387 | mMatchedTodos.append(tod); |
382 | continue; | 388 | continue; |
383 | } | 389 | } |
384 | } | 390 | } |
385 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { | 391 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { |
386 | QPtrList<Attendee> tmpAList = tod->attendees(); | 392 | QPtrList<Attendee> tmpAList = tod->attendees(); |
387 | Attendee *a; | 393 | Attendee *a; |
388 | for (a = tmpAList.first(); a; a = tmpAList.next()) { | 394 | for (a = tmpAList.first(); a; a = tmpAList.next()) { |
389 | if (mSearchAName->isChecked()) { | 395 | if (mSearchAName->isChecked()) { |
390 | #if QT_VERSION >= 0x030000 | 396 | #if QT_VERSION >= 0x030000 |
391 | if (re.search(a->name()) != -1) | 397 | if (re.search(a->name()) != -1) |
392 | #else | 398 | #else |
393 | if (re.match(a->name()) != -1) | 399 | if (re.match(a->name()) != -1) |
394 | #endif | 400 | #endif |
395 | { | 401 | { |
396 | mMatchedTodos.append(tod); | 402 | mMatchedTodos.append(tod); |
397 | break; | 403 | break; |
398 | } | 404 | } |
399 | } | 405 | } |
400 | if (mSearchAEmail->isChecked()) { | 406 | if (mSearchAEmail->isChecked()) { |
401 | #if QT_VERSION >= 0x030000 | 407 | #if QT_VERSION >= 0x030000 |
402 | if (re.search(a->email()) != -1) | 408 | if (re.search(a->email()) != -1) |
403 | #else | 409 | #else |
404 | if (re.match(a->email()) != -1) | 410 | if (re.match(a->email()) != -1) |
405 | #endif | 411 | #endif |
406 | { | 412 | { |
407 | mMatchedTodos.append(tod); | 413 | mMatchedTodos.append(tod); |
408 | break; | 414 | break; |
409 | } | 415 | } |
410 | } | 416 | } |
411 | } | 417 | } |
412 | } | 418 | } |
413 | } | 419 | } |
414 | } | 420 | } |
415 | mMatchedJournals.clear(); | 421 | mMatchedJournals.clear(); |
416 | if (mSearchJournal->isChecked() ) { | 422 | if (mSearchJournal->isChecked() ) { |
417 | QPtrList<Journal> journals = mCalendar->journals( ); | 423 | QPtrList<Journal> journals = mCalendar->journals( ); |
418 | Journal* journ; | 424 | Journal* journ; |
419 | 425 | ||
420 | for(journ=journals.first();journ;journ=journals.next()) { | 426 | for(journ=journals.first();journ;journ=journals.next()) { |
421 | if ( journ->dtStart().date() <= mEndDate->date() | 427 | if ( journ->dtStart().date() <= mEndDate->date() |
422 | &&journ->dtStart().date() >= mStartDate->date()) { | 428 | &&journ->dtStart().date() >= mStartDate->date()) { |
423 | #if QT_VERSION >= 0x030000 | 429 | #if QT_VERSION >= 0x030000 |
424 | if (re.search(journ->description()) != -1) | 430 | if (re.search(journ->description()) != -1) |
425 | #else | 431 | #else |
426 | if (re.match(journ->description()) != -1) | 432 | if (re.match(journ->description()) != -1) |
427 | #endif | 433 | #endif |
428 | { | 434 | { |
429 | mMatchedJournals.append(journ); | 435 | mMatchedJournals.append(journ); |
430 | continue; | 436 | continue; |
431 | } | 437 | } |
432 | } | 438 | } |
433 | } | 439 | } |
434 | } | 440 | } |
435 | 441 | ||
436 | } | 442 | } |
437 | 443 | ||
438 | void SearchDialog::keyPressEvent ( QKeyEvent *e) | 444 | void SearchDialog::keyPressEvent ( QKeyEvent *e) |
439 | { | 445 | { |
440 | switch ( e->key() ) { | 446 | switch ( e->key() ) { |
441 | case Qt::Key_Escape: | 447 | case Qt::Key_Escape: |
442 | hide(); | 448 | hide(); |
443 | break; | 449 | break; |
444 | case Qt::Key_F: | 450 | case Qt::Key_F: |
445 | if ( e->state() == Qt::ControlButton ) { | 451 | if ( e->state() == Qt::ControlButton ) { |
446 | qDebug("full "); | 452 | qDebug("full "); |
447 | 453 | ||
448 | } | 454 | } |
449 | break; | 455 | break; |
450 | case Qt::Key_Return: | 456 | case Qt::Key_Return: |
451 | case Qt::Key_Enter: | 457 | case Qt::Key_Enter: |
452 | doSearch(); | 458 | doSearch(); |
453 | break; | 459 | break; |
454 | 460 | ||
455 | default: | 461 | default: |
456 | e->ignore(); | 462 | e->ignore(); |
457 | } | 463 | } |
458 | } | 464 | } |
459 | 465 | ||
460 | //mMatchedJournals; | 466 | //mMatchedJournals; |