author | zautrix <zautrix> | 2005-04-05 15:46:34 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-05 15:46:34 (UTC) |
commit | 8734ae4789ed411cb546edd304816a77c431a2bf (patch) (unidiff) | |
tree | 8fc66d9dfb9baf6ef62278dd58d49f6156c0414f /korganizer | |
parent | 637415693af8fe9974b45c355ecfdd0745617ac3 (diff) | |
download | kdepimpi-8734ae4789ed411cb546edd304816a77c431a2bf.zip kdepimpi-8734ae4789ed411cb546edd304816a77c431a2bf.tar.gz kdepimpi-8734ae4789ed411cb546edd304816a77c431a2bf.tar.bz2 |
urgs. bug fixes
-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 | |||
@@ -1114,137 +1114,137 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
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 | |||
@@ -733,222 +733,219 @@ void KOPrefsDialog::setupViewsTab() | |||
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); |
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index db60383..7a945e3 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp | |||
@@ -113,235 +113,241 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) | |||
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( ); |