summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-04-05 15:46:34 (UTC)
committer zautrix <zautrix>2005-04-05 15:46:34 (UTC)
commit8734ae4789ed411cb546edd304816a77c431a2bf (patch) (unidiff)
tree8fc66d9dfb9baf6ef62278dd58d49f6156c0414f /korganizer
parent637415693af8fe9974b45c355ecfdd0745617ac3 (diff)
downloadkdepimpi-8734ae4789ed411cb546edd304816a77c431a2bf.zip
kdepimpi-8734ae4789ed411cb546edd304816a77c431a2bf.tar.gz
kdepimpi-8734ae4789ed411cb546edd304816a77c431a2bf.tar.bz2
urgs. bug fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kolistview.cpp10
-rw-r--r--korganizer/koprefsdialog.cpp17
-rw-r--r--korganizer/searchdialog.cpp12
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
@@ -1186,65 +1186,65 @@ void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
1186#if 0 1186#if 0
1187void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) 1187void 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}
1198void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) 1198void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e)
1199{ 1199{
1200 KListView::contentsMouseReleaseEvent(e); 1200 KListView::contentsMouseReleaseEvent(e);
1201} 1201}
1202void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) 1202void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e)
1203{ 1203{
1204 KListView::contentsMouseMoveEvent(e); 1204 KListView::contentsMouseMoveEvent(e);
1205} 1205}
1206#endif 1206#endif
1207void KOListViewListView::popupMenu() 1207void 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}
1214void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) 1214void 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}
1231void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) 1231void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e)
1232{ 1232{
1233 mPopupTimer->stop(); 1233 mPopupTimer->stop();
1234 KListView::contentsMouseReleaseEvent(e); 1234 KListView::contentsMouseReleaseEvent(e);
1235} 1235}
1236void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) 1236void 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
@@ -805,78 +805,75 @@ void KOPrefsDialog::setupViewsTab()
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;
874dummy = 871dummy =
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);
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index db60383..7a945e3 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -185,91 +185,97 @@ void SearchDialog::updateList()
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}
196void SearchDialog::searchTextChanged( const QString &_text ) 196void 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
203void SearchDialog::doSearch() 203void 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}
241void SearchDialog::updateConfig() 244void SearchDialog::updateConfig()
242{ 245{
243 listView->updateConfig(); 246 listView->updateConfig();
244} 247}
245void SearchDialog::updateView() 248void 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
265void SearchDialog::search(const QRegExp &re) 271void 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()) {