-rw-r--r-- | korganizer/koagenda.cpp | 35 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 7 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 4 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 4 | ||||
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 1 |
5 files changed, 29 insertions, 22 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 0aef929..ffa2678 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -417,102 +417,107 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
417 | int selectionYTop = mSelectionYTop; | 417 | int selectionYTop = mSelectionYTop; |
418 | int gridSpacingX = mGridSpacingX; | 418 | int gridSpacingX = mGridSpacingX; |
419 | int selectionHeight = mSelectionHeight; | 419 | int selectionHeight = mSelectionHeight; |
420 | clearSelection(); | 420 | clearSelection(); |
421 | repaintContents( selectionCellX, selectionYTop, | 421 | repaintContents( selectionCellX, selectionYTop, |
422 | gridSpacingX, selectionHeight,false ); | 422 | gridSpacingX, selectionHeight,false ); |
423 | } | 423 | } |
424 | selectItem(mActionItem); | 424 | selectItem(mActionItem); |
425 | Incidence *incidence = mActionItem->incidence(); | 425 | Incidence *incidence = mActionItem->incidence(); |
426 | if ( incidence->isReadOnly() /*|| incidence->recurrence()->doesRecur() */) { | 426 | if ( incidence->isReadOnly() /*|| incidence->recurrence()->doesRecur() */) { |
427 | mActionItem = 0; | 427 | mActionItem = 0; |
428 | } else { | 428 | } else { |
429 | startItemAction(viewportPos); | 429 | startItemAction(viewportPos); |
430 | startX = viewportPos.x(); | 430 | startX = viewportPos.x(); |
431 | startY = viewportPos.y(); | 431 | startY = viewportPos.y(); |
432 | block = true; | 432 | block = true; |
433 | } | 433 | } |
434 | } | 434 | } |
435 | } | 435 | } |
436 | } else { | 436 | } else { |
437 | selectItem(0); | 437 | selectItem(0); |
438 | mActionItem = 0; | 438 | mActionItem = 0; |
439 | if (me->button() == RightButton ) { | 439 | if (me->button() == RightButton ) { |
440 | blockNewEvent = true; | 440 | blockNewEvent = true; |
441 | //qDebug("right "); | 441 | block = false; |
442 | int x,y; | ||
443 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | ||
444 | int gx,gy; | ||
445 | contentsToGrid(x,y,gx,gy); | ||
446 | mStartCellX = gx; | ||
447 | mStartCellY = gy; | ||
448 | mCurrentCellX = gx; | ||
449 | mCurrentCellY = gy; | ||
450 | mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); | ||
451 | |||
452 | } else { | 442 | } else { |
453 | blockNewEvent = false; | 443 | blockNewEvent = false; |
454 | setCursor(arrowCursor); | 444 | setCursor(arrowCursor); |
455 | startSelectAction(viewportPos); | 445 | startSelectAction(viewportPos); |
456 | } | 446 | } |
457 | } | 447 | } |
458 | break; | 448 | break; |
459 | 449 | ||
460 | case QEvent::MouseButtonRelease: | 450 | case QEvent::MouseButtonRelease: |
461 | //qDebug("QEvent::MouseButtonRelease: "); | 451 | //qDebug("QEvent::MouseButtonRelease: %d",blockNewEvent ); |
462 | if (me->button() == RightButton && block ) { | 452 | if (me->button() == RightButton && blockNewEvent && !block) { |
453 | int x,y; | ||
454 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | ||
455 | int gx,gy; | ||
456 | contentsToGrid(x,y,gx,gy); | ||
457 | if ( mCurrentCellY < mStartCellY +1 ) { | ||
458 | //qDebug("mCurrentCellY %d mStartCellY %d ", mCurrentCellY,mStartCellY); | ||
459 | mCurrentCellX = gx; | ||
460 | mCurrentCellY = gy; | ||
461 | mStartCellX = gx; | ||
462 | mStartCellY = gy; | ||
463 | mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); | ||
464 | break; | ||
465 | } else { | ||
466 | blockNewEvent = false; | ||
467 | } | ||
468 | } else if (me->button() == RightButton && block ) { | ||
463 | if (object != viewport()) { | 469 | if (object != viewport()) { |
464 | mClickedItem = (KOAgendaItem *)object; | 470 | mClickedItem = (KOAgendaItem *)object; |
465 | if (mActionItem ) { | 471 | if (mActionItem ) { |
466 | endItemAction(); | 472 | endItemAction(); |
467 | } | 473 | } |
468 | if (mClickedItem) { | 474 | if (mClickedItem) { |
469 | selectItem(mClickedItem); | 475 | selectItem(mClickedItem); |
470 | emit showIncidencePopupSignal(mClickedItem->incidence()); | 476 | emit showIncidencePopupSignal(mClickedItem->incidence()); |
471 | } | 477 | } |
472 | } | 478 | } |
473 | break; | 479 | break; |
474 | } | 480 | } |
475 | block = true; | 481 | block = true; |
476 | if (mActionItem) { | 482 | if (mActionItem) { |
477 | QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); | 483 | QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); |
478 | //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); | 484 | //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); |
479 | if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { | 485 | if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { |
480 | mScrollUpTimer.stop(); | 486 | mScrollUpTimer.stop(); |
481 | mScrollDownTimer.stop(); | 487 | mScrollDownTimer.stop(); |
482 | mActionItem->resetMove(); | 488 | mActionItem->resetMove(); |
483 | placeSubCells( mActionItem ); | 489 | placeSubCells( mActionItem ); |
484 | // emit startDragSignal( mActionItem->incidence() ); | 490 | // emit startDragSignal( mActionItem->incidence() ); |
485 | setCursor( arrowCursor ); | 491 | setCursor( arrowCursor ); |
486 | mActionItem = 0; | 492 | mActionItem = 0; |
487 | mActionType = NOP; | 493 | mActionType = NOP; |
488 | mItemMoved = 0; | 494 | mItemMoved = 0; |
489 | return true; | 495 | return true; |
490 | } | 496 | } |
491 | endItemAction(); | 497 | endItemAction(); |
492 | } else if ( mActionType == SELECT ) { | 498 | } else if ( mActionType == SELECT ) { |
493 | if (me->button() == RightButton ) { | 499 | if (me->button() == RightButton ) { |
494 | |||
495 | } else { | 500 | } else { |
496 | endSelectAction( !blockNewEvent ); | 501 | endSelectAction( !blockNewEvent ); |
497 | } | 502 | } |
498 | } | 503 | } |
499 | break; | 504 | break; |
500 | 505 | ||
501 | case QEvent::MouseMove: | 506 | case QEvent::MouseMove: |
502 | if (object != viewport()) { | 507 | if (object != viewport()) { |
503 | KOAgendaItem *moveItem = (KOAgendaItem *)object; | 508 | KOAgendaItem *moveItem = (KOAgendaItem *)object; |
504 | //qDebug("moveItem %d ",moveItem ); | 509 | //qDebug("moveItem %d ",moveItem ); |
505 | if (!moveItem->incidence()->isReadOnly() /*&& | 510 | if (!moveItem->incidence()->isReadOnly() /*&& |
506 | !moveItem->incidence()->recurrence()->doesRecur()*/ ) | 511 | !moveItem->incidence()->recurrence()->doesRecur()*/ ) |
507 | if (!mActionItem) | 512 | if (!mActionItem) |
508 | setNoActionCursor(moveItem,viewportPos); | 513 | setNoActionCursor(moveItem,viewportPos); |
509 | else { | 514 | else { |
510 | if ( block ) { | 515 | if ( block ) { |
511 | int dX, dY; | 516 | int dX, dY; |
512 | dX = startX - viewportPos.x(); | 517 | dX = startX - viewportPos.x(); |
513 | if ( dX < 0 ) | 518 | if ( dX < 0 ) |
514 | dX = -dX; | 519 | dX = -dX; |
515 | dY = viewportPos.y() - startY; | 520 | dY = viewportPos.y() - startY; |
516 | if ( dY < 0 ) | 521 | if ( dY < 0 ) |
517 | dY = -dY; | 522 | dY = -dY; |
518 | int diff = 30; | 523 | int diff = 30; |
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 060b4c4..faa2c21 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -127,50 +127,49 @@ QColor KODayMatrix::getShadedColor(QColor color) | |||
127 | s = s/4; | 127 | s = s/4; |
128 | v = 192+v/4; | 128 | v = 192+v/4; |
129 | shaded.setHsv(h,s,v); | 129 | shaded.setHsv(h,s,v); |
130 | 130 | ||
131 | return shaded; | 131 | return shaded; |
132 | } | 132 | } |
133 | 133 | ||
134 | KODayMatrix::~KODayMatrix() | 134 | KODayMatrix::~KODayMatrix() |
135 | { | 135 | { |
136 | delete [] days; | 136 | delete [] days; |
137 | delete [] daylbls; | 137 | delete [] daylbls; |
138 | delete [] events; | 138 | delete [] events; |
139 | delete mToolTip; | 139 | delete mToolTip; |
140 | } | 140 | } |
141 | 141 | ||
142 | /* | 142 | /* |
143 | void KODayMatrix::setStartDate(QDate start) | 143 | void KODayMatrix::setStartDate(QDate start) |
144 | { | 144 | { |
145 | updateView(start); | 145 | updateView(start); |
146 | } | 146 | } |
147 | */ | 147 | */ |
148 | 148 | ||
149 | void KODayMatrix::addSelectedDaysTo(DateList& selDays) | 149 | void KODayMatrix::addSelectedDaysTo(DateList& selDays) |
150 | { | 150 | { |
151 | kdDebug() << "KODayMatrix::addSelectedDaysTo() - " << "mSelStart:" << mSelStart << endl; | 151 | |
152 | |||
153 | if (mSelStart == NOSELECTION) { | 152 | if (mSelStart == NOSELECTION) { |
154 | return; | 153 | return; |
155 | } | 154 | } |
156 | 155 | ||
157 | //cope with selection being out of matrix limits at top (< 0) | 156 | //cope with selection being out of matrix limits at top (< 0) |
158 | int i0 = mSelStart; | 157 | int i0 = mSelStart; |
159 | if (i0 < 0) { | 158 | if (i0 < 0) { |
160 | for (int i = i0; i < 0; i++) { | 159 | for (int i = i0; i < 0; i++) { |
161 | selDays.append(days[0].addDays(i)); | 160 | selDays.append(days[0].addDays(i)); |
162 | } | 161 | } |
163 | i0 = 0; | 162 | i0 = 0; |
164 | } | 163 | } |
165 | 164 | ||
166 | //cope with selection being out of matrix limits at bottom (> NUMDAYS-1) | 165 | //cope with selection being out of matrix limits at bottom (> NUMDAYS-1) |
167 | if (mSelEnd > NUMDAYS-1) { | 166 | if (mSelEnd > NUMDAYS-1) { |
168 | for (int i = i0; i <= NUMDAYS-1; i++) { | 167 | for (int i = i0; i <= NUMDAYS-1; i++) { |
169 | selDays.append(days[i]); | 168 | selDays.append(days[i]); |
170 | } | 169 | } |
171 | for (int i = NUMDAYS; i < mSelEnd; i++) { | 170 | for (int i = NUMDAYS; i < mSelEnd; i++) { |
172 | selDays.append(days[0].addDays(i)); | 171 | selDays.append(days[0].addDays(i)); |
173 | } | 172 | } |
174 | 173 | ||
175 | // apply normal routine to selection being entirely within matrix limits | 174 | // apply normal routine to selection being entirely within matrix limits |
176 | } else { | 175 | } else { |
@@ -268,51 +267,51 @@ void KODayMatrix::updateView(QDate actdate) | |||
268 | //flag to indicate if the starting day of the matrix has changed by this call | 267 | //flag to indicate if the starting day of the matrix has changed by this call |
269 | //mDayChanged = false; | 268 | //mDayChanged = false; |
270 | // if a new startdate is to be set then apply Cornelius's calculation | 269 | // if a new startdate is to be set then apply Cornelius's calculation |
271 | // of the first day to be shown | 270 | // of the first day to be shown |
272 | if (actdate != startdate) { | 271 | if (actdate != startdate) { |
273 | // reset index of selection according to shift of starting date from startdate to actdate | 272 | // reset index of selection according to shift of starting date from startdate to actdate |
274 | if (mSelStart != NOSELECTION) { | 273 | if (mSelStart != NOSELECTION) { |
275 | int tmp = actdate.daysTo(startdate); | 274 | int tmp = actdate.daysTo(startdate); |
276 | //kdDebug() << "Shift of Selection1: " << mSelStart << " - " << mSelEnd << " -> " << tmp << "(" << offset << ")" << endl; | 275 | //kdDebug() << "Shift of Selection1: " << mSelStart << " - " << mSelEnd << " -> " << tmp << "(" << offset << ")" << endl; |
277 | // shift selection if new one would be visible at least partly ! | 276 | // shift selection if new one would be visible at least partly ! |
278 | 277 | ||
279 | if (mSelStart+tmp < NUMDAYS && mSelEnd+tmp >= 0) { | 278 | if (mSelStart+tmp < NUMDAYS && mSelEnd+tmp >= 0) { |
280 | // nested if is required for next X display pushed from a different month - correction required | 279 | // nested if is required for next X display pushed from a different month - correction required |
281 | // otherwise, for month forward and backward, it must be avoided | 280 | // otherwise, for month forward and backward, it must be avoided |
282 | if( mSelStart > NUMDAYS || mSelStart < 0 ) | 281 | if( mSelStart > NUMDAYS || mSelStart < 0 ) |
283 | mSelStart = mSelStart + tmp; | 282 | mSelStart = mSelStart + tmp; |
284 | if( mSelEnd > NUMDAYS || mSelEnd < 0 ) | 283 | if( mSelEnd > NUMDAYS || mSelEnd < 0 ) |
285 | mSelEnd = mSelEnd + tmp; | 284 | mSelEnd = mSelEnd + tmp; |
286 | } | 285 | } |
287 | } | 286 | } |
288 | 287 | ||
289 | startdate = actdate; | 288 | startdate = actdate; |
290 | mDayChanged = true; | 289 | mDayChanged = true; |
291 | } | 290 | } |
292 | qDebug("restart Timer %d", mDayChanged ); | 291 | qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() ); |
293 | static int iii = 0; | 292 | static int iii = 0; |
294 | if ( iii < 5 ) { | 293 | if ( iii < 2 ) { |
295 | ++iii; | 294 | ++iii; |
296 | updateViewTimed(); | 295 | updateViewTimed(); |
297 | } else { | 296 | } else { |
298 | if ( !isVisible() ) { | 297 | if ( !isVisible() ) { |
299 | mUpdateTimer->start( 2000 ); | 298 | mUpdateTimer->start( 2000 ); |
300 | } else { | 299 | } else { |
301 | if ( mDayChanged ) { | 300 | if ( mDayChanged ) { |
302 | mUpdateTimer->start( 250 ); | 301 | mUpdateTimer->start( 250 ); |
303 | } else { | 302 | } else { |
304 | mRepaintTimer->start( 250 ); | 303 | mRepaintTimer->start( 250 ); |
305 | mUpdateTimer->start( 2000 ); | 304 | mUpdateTimer->start( 2000 ); |
306 | } | 305 | } |
307 | } | 306 | } |
308 | } | 307 | } |
309 | 308 | ||
310 | } | 309 | } |
311 | 310 | ||
312 | const QDate& KODayMatrix::getDate(int offset) | 311 | const QDate& KODayMatrix::getDate(int offset) |
313 | { | 312 | { |
314 | if (offset < 0 || offset > NUMDAYS-1) { | 313 | if (offset < 0 || offset > NUMDAYS-1) { |
315 | qDebug("Wrong offset2 "); | 314 | qDebug("Wrong offset2 "); |
316 | return days[0]; | 315 | return days[0]; |
317 | } | 316 | } |
318 | return days[offset]; | 317 | return days[offset]; |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 2f5259f..8d8fc2a 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -732,65 +732,65 @@ void KOTodoView::showDates(const QDate &, const QDate &) | |||
732 | void KOTodoView::showEvents(QPtrList<Event>) | 732 | void KOTodoView::showEvents(QPtrList<Event>) |
733 | { | 733 | { |
734 | kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; | 734 | kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; |
735 | } | 735 | } |
736 | 736 | ||
737 | void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, | 737 | void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, |
738 | const QDate &td) | 738 | const QDate &td) |
739 | { | 739 | { |
740 | #ifndef KORG_NOPRINTER | 740 | #ifndef KORG_NOPRINTER |
741 | calPrinter->preview(CalPrinter::Todolist, fd, td); | 741 | calPrinter->preview(CalPrinter::Todolist, fd, td); |
742 | #endif | 742 | #endif |
743 | } | 743 | } |
744 | 744 | ||
745 | void KOTodoView::editItem(QListViewItem *item ) | 745 | void KOTodoView::editItem(QListViewItem *item ) |
746 | { | 746 | { |
747 | // qDebug("editItem(QListViewItem *item ) "); | 747 | // qDebug("editItem(QListViewItem *item ) "); |
748 | emit editTodoSignal(((KOTodoViewItem *)item)->todo()); | 748 | emit editTodoSignal(((KOTodoViewItem *)item)->todo()); |
749 | } | 749 | } |
750 | 750 | ||
751 | void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) | 751 | void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) |
752 | { | 752 | { |
753 | emit showTodoSignal(((KOTodoViewItem *)item)->todo()); | 753 | emit showTodoSignal(((KOTodoViewItem *)item)->todo()); |
754 | } | 754 | } |
755 | 755 | ||
756 | void KOTodoView::popupMenu(QListViewItem *item,const QPoint &,int column) | 756 | void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column) |
757 | { | 757 | { |
758 | pendingSubtodo = 0; | 758 | pendingSubtodo = 0; |
759 | mActiveItem = (KOTodoViewItem *)item; | 759 | mActiveItem = (KOTodoViewItem *)item; |
760 | if (item) { | 760 | if (item) { |
761 | switch (column){ | 761 | switch (column){ |
762 | case 1: | 762 | case 1: |
763 | mPriorityPopupMenu->popup(QCursor::pos ()); break; | 763 | mPriorityPopupMenu->popup(QCursor::pos ()); break; |
764 | case 2: | 764 | case 2: |
765 | mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; | 765 | mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; |
766 | case 3: | 766 | case 3: |
767 | moveTodo(); | 767 | moveTodo(); |
768 | break; | 768 | break; |
769 | case 8: | 769 | case 8: |
770 | getCategoryPopupMenu((KOTodoViewItem *)item)->popup(QCursor::pos ()); break; | 770 | getCategoryPopupMenu((KOTodoViewItem *)item)->popup(QCursor::pos ()); break; |
771 | default: | 771 | default: |
772 | mItemPopupMenu->popup(QCursor::pos()); | 772 | mItemPopupMenu->popup(QCursor::pos()); |
773 | } | 773 | } |
774 | } else mPopupMenu->popup(QCursor::pos()); | 774 | } else mPopupMenu->popup(QCursor::pos()); |
775 | } | 775 | } |
776 | void KOTodoView::newTodo() | 776 | void KOTodoView::newTodo() |
777 | { | 777 | { |
778 | emit newTodoSignal(); | 778 | emit newTodoSignal(); |
779 | } | 779 | } |
780 | 780 | ||
781 | void KOTodoView::newSubTodo() | 781 | void KOTodoView::newSubTodo() |
782 | { | 782 | { |
783 | if (mActiveItem) { | 783 | if (mActiveItem) { |
784 | emit newSubTodoSignal(mActiveItem->todo()); | 784 | emit newSubTodoSignal(mActiveItem->todo()); |
785 | } | 785 | } |
786 | } | 786 | } |
787 | void KOTodoView::unparentTodo() | 787 | void KOTodoView::unparentTodo() |
788 | { | 788 | { |
789 | if (mActiveItem) { | 789 | if (mActiveItem) { |
790 | emit unparentTodoSignal(mActiveItem->todo()); | 790 | emit unparentTodoSignal(mActiveItem->todo()); |
791 | } | 791 | } |
792 | } | 792 | } |
793 | 793 | ||
794 | void KOTodoView::reparentTodo() | 794 | void KOTodoView::reparentTodo() |
795 | { | 795 | { |
796 | if (mActiveItem) { | 796 | if (mActiveItem) { |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 4c03f9a..35774d6 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -96,51 +96,53 @@ void KOViewManager::readSettings(KConfig *config) | |||
96 | else { | 96 | else { |
97 | showAgendaView(); | 97 | showAgendaView(); |
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | 101 | ||
102 | void KOViewManager::showDateView( int view, QDate date) | 102 | void KOViewManager::showDateView( int view, QDate date) |
103 | { | 103 | { |
104 | 104 | ||
105 | //qDebug("date %d %s", view, date.toString().latin1()); | 105 | //qDebug("date %d %s", view, date.toString().latin1()); |
106 | #if 0 | 106 | #if 0 |
107 | mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 ); | 107 | mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 ); |
108 | mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next Week"),4 ); | 108 | mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next Week"),4 ); |
109 | mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Two Weeks"),5 ); | 109 | mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Two Weeks"),5 ); |
110 | mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Month"),6 ); | 110 | mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Month"),6 ); |
111 | mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); | 111 | mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); |
112 | #endif | 112 | #endif |
113 | if ( view == 3 ) { | 113 | if ( view == 3 ) { |
114 | mMainView->showDay( date ); | 114 | mMainView->showDay( date ); |
115 | } else if (view == 4 ) { | 115 | } else if (view == 4 ) { |
116 | mMainView->dateNavigator()->selectDates( date, 7 ); | 116 | mMainView->dateNavigator()->selectDates( date, 7 ); |
117 | } else if (view == 5 ) { | 117 | } else if (view == 5 ) { |
118 | mMainView->dateNavigator()->selectDates( date, 14); | 118 | mMainView->dateNavigator()->selectDates( date, 14); |
119 | } else if (view == 6 ) { | 119 | } else if (view == 6 ) { |
120 | showMonthView(); | 120 | mMainView->dateNavigator()->blockSignals( true ); |
121 | mMainView->dateNavigator()->selectMonthByDate( date ); | 121 | mMainView->dateNavigator()->selectMonthByDate( date ); |
122 | mMainView->dateNavigator()->selectDate( date ); | 122 | mMainView->dateNavigator()->selectDate( date ); |
123 | mMainView->dateNavigator()->blockSignals( false ); | ||
124 | showMonthView(); | ||
123 | } else if (view == 7 ) { | 125 | } else if (view == 7 ) { |
124 | mMainView->dateNavigator()->selectDate( date ); | 126 | mMainView->dateNavigator()->selectDate( date ); |
125 | showJournalView(); | 127 | showJournalView(); |
126 | } else if (view == 8 ) { | 128 | } else if (view == 8 ) { |
127 | globalFlagBlockAgenda = 1; | 129 | globalFlagBlockAgenda = 1; |
128 | if ( mCurrentAgendaView != 3 ) | 130 | if ( mCurrentAgendaView != 3 ) |
129 | mCurrentAgendaView = -1; | 131 | mCurrentAgendaView = -1; |
130 | showAgendaView(KOPrefs::instance()->mFullViewMonth); | 132 | showAgendaView(KOPrefs::instance()->mFullViewMonth); |
131 | globalFlagBlockAgenda = 2; | 133 | globalFlagBlockAgenda = 2; |
132 | mMainView->dateNavigator()->selectDates( date , | 134 | mMainView->dateNavigator()->selectDates( date , |
133 | KOPrefs::instance()->mNextXDays ); | 135 | KOPrefs::instance()->mNextXDays ); |
134 | mFlagShowNextxDays = true; | 136 | mFlagShowNextxDays = true; |
135 | mCurrentAgendaView = 3 ; | 137 | mCurrentAgendaView = 3 ; |
136 | } | 138 | } |
137 | 139 | ||
138 | #if 0 | 140 | #if 0 |
139 | dateNavigator()->blockSignals( true ); | 141 | dateNavigator()->blockSignals( true ); |
140 | dateNavigator()->selectDate( d ); | 142 | dateNavigator()->selectDate( d ); |
141 | dateNavigator()->blockSignals( false ); | 143 | dateNavigator()->blockSignals( false ); |
142 | mViewManager->showDayView(); | 144 | mViewManager->showDayView(); |
143 | #endif | 145 | #endif |
144 | 146 | ||
145 | } | 147 | } |
146 | 148 | ||
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index d7ff9f2..10665f4 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp | |||
@@ -156,48 +156,49 @@ void KOWhatsNextView::updateConfig() | |||
156 | setFont( KOPrefs::instance()->mWhatsNextFont ); | 156 | setFont( KOPrefs::instance()->mWhatsNextFont ); |
157 | updateView(); | 157 | updateView(); |
158 | 158 | ||
159 | } | 159 | } |
160 | void KOWhatsNextView::showEvent ( QShowEvent * e ) | 160 | void KOWhatsNextView::showEvent ( QShowEvent * e ) |
161 | { | 161 | { |
162 | //qDebug("KOWhatsNextView::showEvent "); | 162 | //qDebug("KOWhatsNextView::showEvent "); |
163 | restartTimer(); | 163 | restartTimer(); |
164 | QWidget::showEvent ( e ); | 164 | QWidget::showEvent ( e ); |
165 | } | 165 | } |
166 | void KOWhatsNextView::hideEvent ( QHideEvent * e) | 166 | void KOWhatsNextView::hideEvent ( QHideEvent * e) |
167 | { | 167 | { |
168 | //qDebug(" KOWhatsNextView::hideEvent"); | 168 | //qDebug(" KOWhatsNextView::hideEvent"); |
169 | mTimer->stop(); | 169 | mTimer->stop(); |
170 | QWidget::hideEvent ( e ); | 170 | QWidget::hideEvent ( e ); |
171 | } | 171 | } |
172 | void KOWhatsNextView::restartTimer() | 172 | void KOWhatsNextView::restartTimer() |
173 | { | 173 | { |
174 | //qDebug("KOWhatsNextView::restartTimer() "); | 174 | //qDebug("KOWhatsNextView::restartTimer() "); |
175 | mTimer->start( 300000 ); | 175 | mTimer->start( 300000 ); |
176 | //mTimer->start( 5000 ); | 176 | //mTimer->start( 5000 ); |
177 | } | 177 | } |
178 | void KOWhatsNextView::updateView() | 178 | void KOWhatsNextView::updateView() |
179 | { | 179 | { |
180 | //qDebug("KOWhatsNextView::updateView() "); | ||
180 | if ( mTimer->isActive() ) | 181 | if ( mTimer->isActive() ) |
181 | restartTimer(); | 182 | restartTimer(); |
182 | //qDebug("KOWhatsNextView::updateView() "); | 183 | //qDebug("KOWhatsNextView::updateView() "); |
183 | // mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate())); | 184 | // mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate())); |
184 | KIconLoader kil("korganizer"); | 185 | KIconLoader kil("korganizer"); |
185 | QString ipath;// = new QString(); | 186 | QString ipath;// = new QString(); |
186 | // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath); | 187 | // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath); |
187 | //<big><big><strong>" + date + "</strong></big></big>\n"; | 188 | //<big><big><strong>" + date + "</strong></big></big>\n"; |
188 | mText = "<table width=\"100%\">\n"; | 189 | mText = "<table width=\"100%\">\n"; |
189 | //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; | 190 | //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; |
190 | #ifdef DESKTOP_VERSION | 191 | #ifdef DESKTOP_VERSION |
191 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>"; | 192 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>"; |
192 | #else | 193 | #else |
193 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>"; | 194 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>"; |
194 | #endif | 195 | #endif |
195 | // mText += "<img src=\""; | 196 | // mText += "<img src=\""; |
196 | // mText += ipath; | 197 | // mText += ipath; |
197 | // mText += "\">"; | 198 | // mText += "\">"; |
198 | mEventDate = QDate::currentDate(); | 199 | mEventDate = QDate::currentDate(); |
199 | #ifdef DESKTOP_VERSION | 200 | #ifdef DESKTOP_VERSION |
200 | mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h1>"; | 201 | mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h1>"; |
201 | #else | 202 | #else |
202 | mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>"; | 203 | mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>"; |
203 | #endif | 204 | #endif |