author | zautrix <zautrix> | 2005-04-02 14:07:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-02 14:07:31 (UTC) |
commit | b0d17f8f2ef9b09b7d8b8aa0f6cc34f400f8fddd (patch) (side-by-side diff) | |
tree | 942bcf89b35cf165e9147c1e4a5efa817c48007f /korganizer | |
parent | 997e7660a81baa2b8aeb1b66a3cc3ebe54e00ebe (diff) | |
download | kdepimpi-b0d17f8f2ef9b09b7d8b8aa0f6cc34f400f8fddd.zip kdepimpi-b0d17f8f2ef9b09b7d8b8aa0f6cc34f400f8fddd.tar.gz kdepimpi-b0d17f8f2ef9b09b7d8b8aa0f6cc34f400f8fddd.tar.bz2 |
fixes
-rw-r--r-- | korganizer/koeventviewer.cpp | 14 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 14 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 26 |
3 files changed, 41 insertions, 13 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index dbe0668..bdad248 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp @@ -370,8 +370,7 @@ void KOEventViewer::appendEvent(Event *event, int mode ) if (event->isAlarmEnabled()) { Alarm *alarm =event->alarms().first() ; QDateTime t = alarm->time(); - int min = t.secsTo( event->dtStart() )/60; - QString s =i18n("( %1 min before )").arg( min ); + QString s =i18n("( %1 before )").arg( alarm->offsetText() ); addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); //addTag("p",s); @@ -469,6 +468,17 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); mMailSubject += i18n(" - " )+event->dtDueStr( true ); } + + + if (event->isAlarmEnabled()) { + Alarm *alarm =event->alarms().first() ; + QDateTime t = alarm->time(); + QString s =i18n("( %1 before )").arg( alarm->offsetText() ); + addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); + addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); + //addTag("p",s); + } + addTag("b",i18n("Access: ")); mText.append(event->secrecyStr()+"<br>"); if ( KOPrefs::instance()->mEVshowDetails ) { diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 15e094d..e0e138e 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp @@ -120,7 +120,11 @@ bool ListItemVisitor::visit(Event *e) mItem->setText(2,e->dtStartTimeStr()); mItem->setText(3,end); mItem->setText(4,e->dtEndTimeStr()); - mItem->setText(5,e->isAlarmEnabled() ? i18n("Yes") : i18n("No")); + if ( e->isAlarmEnabled() ) { + mItem->setText(5,e->alarms().first()->offsetText() ); + } else { + mItem->setText(5, i18n("No")); + } mItem->setText(6, e->recurrence()->recurrenceText()); mItem->setText(7,"---"); mItem->setText(8,"---"); @@ -154,8 +158,12 @@ bool ListItemVisitor::visit(Todo *t) mItem->setText(2,"---"); } mItem->setText(3,"---"); - mItem->setText(4,"---"); - mItem->setText(5,t->isAlarmEnabled() ? i18n("Yes") : i18n("No")); + mItem->setText(4,"---"); + if ( t->isAlarmEnabled() ) { + mItem->setText(5,t->alarms().first()->offsetText() ); + } else { + mItem->setText(5, i18n("No")); + } mItem->setText(6, t->recurrence()->recurrenceText()); if (t->hasDueDate()) { mItem->setText(7,t->dtDueDateStr()); diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 0a315cb..01cf0ff 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -218,10 +218,12 @@ void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() ); if (X > header()->sectionPos(0) + treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + - itemMargin() || + itemMargin() +i->height()|| X < header()->sectionPos(0)) { rootClicked = false; } + } else { + rootClicked = false; } #ifndef KORG_NODND mMousePressed = false; @@ -730,9 +732,9 @@ void KOTodoView::storeCurrentItem() KOTodoViewItem* activeItemAbove = (KOTodoViewItem*)mActiveItem->itemAbove (); if ( activeItemAbove ) mCurItemAbove = activeItemAbove->todo(); - while ( mActiveItem->parent() != 0 ) - mActiveItem = (KOTodoViewItem*)mActiveItem->parent(); - mCurItemRootParent = mActiveItem->todo(); + mCurItemRootParent = mCurItem; + while ( mCurItemRootParent->relatedTo() != 0 ) + mCurItemRootParent = mCurItemRootParent->relatedTo(); } mActiveItem = 0; } @@ -759,10 +761,10 @@ void KOTodoView::resetCurrentItem() item = (KOTodoViewItem*)item->itemBelow(); } if ( ! foundItem ) { - if ( foundItemAbove ) - foundItem = foundItemAbove; - else + if ( foundItemRoot ) foundItem = foundItemRoot; + else + foundItem = foundItemAbove; } } if ( foundItem ) { @@ -1205,8 +1207,11 @@ void KOTodoView::setAllOpen() isFlatDisplay = false; mPopupMenu->setItemChecked( 8,false ); updateView(); + } else { + storeCurrentItem(); } setOpen(mTodoListView->firstChild(), true); + resetCurrentItem(); } void KOTodoView::setAllClose() { @@ -1214,8 +1219,11 @@ void KOTodoView::setAllClose() isFlatDisplay = false; mPopupMenu->setItemChecked( 8,false ); updateView(); + } else { + storeCurrentItem(); } setOpen(mTodoListView->firstChild(), false); + resetCurrentItem(); } void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) { @@ -1254,8 +1262,10 @@ void KOTodoView::setAllFlat() mPopupMenu->setItemChecked( 8,false ); updateView(); return; - } + } + storeCurrentItem(); displayAllFlat(); + resetCurrentItem(); } void KOTodoView::purgeCompleted() |