summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-15 11:29:40 (UTC)
committer zautrix <zautrix>2005-03-15 11:29:40 (UTC)
commit79b580aacaa1626ccb8c2657796051bf79701e2d (patch) (side-by-side diff)
tree3c2d7d61a945e5abb77eb542b943d8b1d5c0d029
parent6b748e1b7b4213871a5866a9af50e99800d2a704 (diff)
downloadkdepimpi-79b580aacaa1626ccb8c2657796051bf79701e2d.zip
kdepimpi-79b580aacaa1626ccb8c2657796051bf79701e2d.tar.gz
kdepimpi-79b580aacaa1626ccb8c2657796051bf79701e2d.tar.bz2
monthview tooltip sort fixed
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/komonthview.cpp22
-rw-r--r--korganizer/komonthview.h2
2 files changed, 13 insertions, 11 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 4bf9dea..004ff50 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -488,29 +488,29 @@ void MonthViewCell::startUpdateCell()
} else {
mItemList->setLineWidth( 1 );
}
mItemList->clear();
#ifdef DESKTOP_VERSION
QToolTip::remove(this);
#endif
- mToolTip = "";
+ mToolTip.clear();
//qApp->processEvents();
if ( !mHolidayString.isEmpty() ) {
MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString );
item->setPalette( mHolidayPalette );
mItemList->insertItem( item );
- mToolTip += mHolidayString+"\n";
+ mToolTip.append ( mHolidayString );
}
}
void MonthViewCell::insertEvent(Event *event)
{
-
+ QString mToolTipText;
mItemList->setFocusPolicy(WheelFocus);
if ( !(event->doesRecur() == Recurrence::rNone) ) {
if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily )
return;
else
if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly )
return;
}
@@ -547,26 +547,26 @@ void MonthViewCell::insertEvent(Event *event)
if ( !event->doesFloat() ) {
if ( mDate == event->dtStart().date () )
time = KGlobal::locale()->formatTime(event->dtStart().time())+" ";
else if ( mDate == event->dtEnd().date () )
time = KGlobal::locale()->formatTime(event->dtEnd().time())+" ";
}
text = time + event->summary();
- mToolTip += prefix + text;
+ mToolTipText += prefix + text;
} else {
if (event->doesFloat()) {
text = event->summary();
- mToolTip += text;
+ mToolTipText += text;
}
else {
text = KGlobal::locale()->formatTime(event->dtStart().time());
text += " " + event->summary();
- mToolTip += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary();
+ mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary();
}
}
MonthViewItem *item = new MonthViewItem( event, mDate, text );
QPalette pal;
if (KOPrefs::instance()->mMonthViewUsesCategoryColor) {
QStringList categories = event->categories();
QString cat = categories.first();
@@ -601,17 +601,17 @@ void MonthViewCell::insertEvent(Event *event)
item->setReply(true && multiday < 2);
else
item->setReply(false);
} else
item->setReply(false);
#endif
item->setMultiDay( multiday );
mItemList->insertItem( item );
- mToolTip += "\n";
+ mToolTip.append( mToolTipText );
}
void MonthViewCell::insertTodo(Todo *todo)
{
mItemList->setFocusPolicy(WheelFocus);
QString text;
if (todo->hasDueDate()) {
if (!todo->doesFloat()) {
text += KGlobal::locale()->formatTime(todo->dtDue().time());
@@ -645,23 +645,25 @@ void MonthViewCell::insertTodo(Todo *todo)
} else {
pal = mStandardPalette ;
}
item->setPalette( pal );
item->setRecur( todo->recurrence()->doesRecur() );
item->setAlarm( todo->isAlarmEnabled() );
item->setMoreInfo( todo->description().length() > 0 );
mItemList->insertItem( item );
- mToolTip += text+"\n";
+ mToolTip.append( text );
}
void MonthViewCell::finishUpdateCell()
{
#ifdef DESKTOP_VERSION
- if (mToolTip != "")
- QToolTip::add(this,mToolTip,toolTipGroup(),"");
+ if (mToolTip.count() > 0 ) {
+ mToolTip.sort();
+ QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),"");
+ }
#endif
mItemList->sort();
//setMyPalette();
setMyPalette();
QString text;
bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog;
if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) {
text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " ";
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index fd8cbf2..a92421b 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -162,17 +162,17 @@ class MonthViewCell : public QWidget
static QToolTipGroup *toolTipGroup();
#endif
signals:
void defaultAction( Incidence * );
void newEventSignal( QDateTime );
void showDaySignal( QDate );
protected:
- QString mToolTip;
+ QStringList mToolTip;
void resizeEvent( QResizeEvent * );
public slots:
void showDay();
protected slots:
void defaultAction( QListBoxItem * );