From 81158fa914f6d0f3aeb049d28d2ecfb5f5c0e261 Mon Sep 17 00:00:00 2001 From: zautrix Date: Fri, 22 Apr 2005 13:00:34 +0000 Subject: fixes --- (limited to 'korganizer') diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 53ebdb2..4366265 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -200,23 +200,56 @@ QString KODayMatrix::getWhatsThisText( QPoint p ) } if ( !event->location().isEmpty() ) mToolTipText += " (" + event->location() + ")"; -#if QT_VERSION >= 0x030000 - mToolTipText.replace( '<' , "<" ); - mToolTipText.replace( '>' , ">" ); -#else - if ( mToolTipText.find ('<') >= 0 ) { - mToolTipText.replace( QRegExp("<") , "<" ); - } - if ( mToolTipText.find ('>') >= 0 ) { - mToolTipText.replace( QRegExp(">") , ">" ); - } -#endif //qDebug("TTT: %s ", mToolTipText.latin1()); - mToolTip.append( mToolTipText ); + mToolTip.append( deTag( mToolTipText ) ); + } + if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { + QPtrList todolist = mCalendar->todos(mDate); + Todo *todo; + for(todo=todolist.first();todo != 0;todo=todolist.next()) { + QString mToolTipText; + if ( !todo->doesFloat() ) + mToolTipText += KGlobal::locale()->formatTime(todo->dtDue().time())+" "; + mToolTipText += todo->summary(); + if ( !todo->location().isEmpty() ) + mToolTipText += " (" + todo->location() + ")"; + mToolTipText = deTag( mToolTipText); + mToolTipText = "" + i18n("Todo: ") + ""+ mToolTipText; + mToolTip.append( mToolTipText ); + } } mToolTip.sort(); + if (KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { + Journal *j = mCalendar->journal( mDate ); + if ( j ) { + QString mToolTipText = j->description().left(100); + if ( j->description().length() > 100 ) + mToolTipText += " ..."; + mToolTipText = deTag( mToolTipText); + mToolTipText = "" + i18n("Journal: ") + ""+ mToolTipText; + mToolTip.append( mToolTipText ); + } + } return ""+KGlobal::locale()->formatDate(days[tmp]) + "
" + mToolTip.join("
"); } + + +QString KODayMatrix::deTag( QString mToolTipText ) +{ + +#if QT_VERSION >= 0x030000 + mToolTipText.replace( '<' , "<" ); + mToolTipText.replace( '>' , ">" ); +#else + if ( mToolTipText.find ('<') >= 0 ) { + mToolTipText.replace( QRegExp("<") , "<" ); + } + if ( mToolTipText.find ('>') >= 0 ) { + mToolTipText.replace( QRegExp(">") , ">" ); + } +#endif + return mToolTipText; +} void KODayMatrix::setCalendar( Calendar *cal ) { mCalendar = cal; diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h index a3216d6..b96e08f 100644 --- a/korganizer/kodaymatrix.h +++ b/korganizer/kodaymatrix.h @@ -207,6 +207,7 @@ signals: void eventDropped(Event *event); protected: + QString deTag( QString mToolTipText ); void paintEvent(QPaintEvent *ev); -- cgit v0.9.0.2