summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp53
1 files changed, 31 insertions, 22 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 62281d4..39355b4 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -109,34 +109,12 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd )
setSubCell(0);
setSubCells(1);
setMultiItem(0,0,0);
startMove();
mSelected = true;
select(false);
- QString tipText = mIncidence->summary();
- // QToolTip::add(this,tipText);
- QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence ));
- if ( !mIncidence->doesFloat() )
- if ( mIncidence->type() == "Event" ) {
- if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) {
- tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr();
- tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr();
- }
- else {
- tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr();
- tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr();
- }
- }
- else if ( mIncidence->type() == "Todo" ) {
- tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueTimeStr();
- }
-
- if (!mIncidence->location().isEmpty()) {
- tipText += "\n"+i18n("Location: ")+mIncidence->location();
- }
- QToolTip::add(this,tipText,toolTipGroup(),"");
QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont);
mFontPixelSize = fontinf.height();;
hide();
xPaintCoord = -1;
yPaintCoord = -1;
}
@@ -485,12 +463,13 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e )
paintFrom = paintPix();
}
bitBlt (this, rx, ry, paintFrom, x()+rx ,yPaintCoord+ry, rw, rh ,CopyROP);
}
void KOAgendaItem::computeText()
{
+
mDisplayedText = mIncidence->summary();
if ( (mIncidence->type() == "Todo") ) {
if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() )
mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")";
else if ( !(mIncidence->doesFloat()))
mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")";
@@ -513,12 +492,42 @@ void KOAgendaItem::computeText()
if ( mAllDay )
mDisplayedText += " (";
else
mDisplayedText += "\n(";
mDisplayedText += mIncidence->location() +")";
}
+
+ QString tipText = mIncidence->summary();
+ QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence ));
+ if ( !mIncidence->doesFloat() ) {
+ if ( mIncidence->type() == "Event" ) {
+ if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) {
+ tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr();
+ tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr();
+ }
+ else {
+ tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr();
+ tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr();
+ }
+ }
+ else if ( mIncidence->type() == "Todo" ) {
+ if (mIncidence->hasStartDate())
+ tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartStr();
+ tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueStr();
+ }
+ } else if ( mIncidence->type() == "Todo" ) {
+ if (mIncidence->hasStartDate())
+ tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartDateStr();
+ tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueDateStr();
+ }
+
+ if (!mIncidence->location().isEmpty()) {
+ tipText += "\n"+i18n("Location: ")+mIncidence->location();
+ }
+ QToolTip::add(this,tipText,toolTipGroup(),"");
+
}
void KOAgendaItem::updateItem()
{
computeText();
//qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y());