summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressee.cpp17
-rw-r--r--kabc/addressee.h3
-rw-r--r--kabc/field.cpp6
-rw-r--r--kalarmd/simplealarmdaemonimpl.cpp2
-rw-r--r--korganizer/koagendaitem.cpp28
-rw-r--r--korganizer/komonthview.cpp21
6 files changed, 36 insertions, 41 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index 7f592e9..155ce24 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -30,49 +30,48 @@ $Id$
#include <ksharedptr.h>
#include <kdebug.h>
#include <kapplication.h>
#include <klocale.h>
#include <kidmanager.h>
//US
#include <kstandarddirs.h>
#include <libkcal/syncdefines.h>
//US #include "resource.h"
#include "addressee.h"
using namespace KABC;
static bool matchBinaryPattern( int value, int pattern );
static bool matchBinaryPatternA( int value, int pattern );
static bool matchBinaryPatternP( int value, int pattern );
struct Addressee::AddresseeData : public KShared
{
QString uid;
QString name;
QString formattedName;
- QString defaultFormattedName;
QString familyName;
QString givenName;
QString additionalName;
QString prefix;
QString suffix;
QString nickName;
QDateTime birthday;
QString mailer;
TimeZone timeZone;
Geo geo;
QString title;
QString role;
QString organization;
QString note;
QString productId;
QDateTime revision;
QString sortString;
QString externalUID;
QString originalExternalUID;
KURL url;
Secrecy secrecy;
Picture logo;
Picture photo;
Sound sound;
@@ -727,75 +726,59 @@ void Addressee::setName( const QString &name )
if ( name == mData->name ) return;
detach();
mData->empty = false;
mData->name = name;
}
QString Addressee::name() const
{
return mData->name;
}
QString Addressee::nameLabel()
{
return i18n("Name");
}
void Addressee::setFormattedName( const QString &formattedName )
{
if ( formattedName == mData->formattedName ) return;
detach();
mData->empty = false;
mData->formattedName = formattedName;
}
-void Addressee::setDefaultFormattedName( const QString &formattedName )
-{
- if ( formattedName == mData->defaultFormattedName ) return;
- detach();
- mData->empty = false;
- mData->defaultFormattedName = formattedName;
-}
QString Addressee::formattedName() const
{
return mData->formattedName;
}
-QString Addressee::defaultFormattedName() const
-{
- return mData->defaultFormattedName;
-}
QString Addressee::formattedNameLabel()
{
return i18n("Formatted Name");
}
-QString Addressee::defaultFormattedNameLabel()
-{
- return i18n("Def.Formatted Name");
-}
-
void Addressee::setFamilyName( const QString &familyName )
{
if ( familyName == mData->familyName ) return;
detach();
mData->empty = false;
mData->familyName = familyName;
}
QString Addressee::familyName() const
{
return mData->familyName;
}
QString Addressee::familyNameLabel()
{
return i18n("Family Name");
}
void Addressee::setGivenName( const QString &givenName )
{
if ( givenName == mData->givenName ) return;
detach();
diff --git a/kabc/addressee.h b/kabc/addressee.h
index 0d688f8..a2fbcf5 100644
--- a/kabc/addressee.h
+++ b/kabc/addressee.h
@@ -133,59 +133,56 @@ class Addressee
*/
const QString uid() const;
/**
Return translated label for uid field.
*/
static QString uidLabel();
/**
Set name.
*/
void setName( const QString &name );
/**
Return name.
*/
QString name() const;
/**
Return translated label for name field.
*/
static QString nameLabel();
/**
Set formatted name.
*/
void setFormattedName( const QString &formattedName );
- void setDefaultFormattedName( const QString &formattedName );
/**
Return formatted name.
*/
QString formattedName() const;
- QString defaultFormattedName() const;
/**
Return translated label for formattedName field.
*/
static QString formattedNameLabel();
- static QString defaultFormattedNameLabel();
/**
Set family name.
*/
void setFamilyName( const QString &familyName );
/**
Return family name.
*/
QString familyName() const;
/**
Return translated label for familyName field.
*/
static QString familyNameLabel();
/**
Set given name.
*/
void setGivenName( const QString &givenName );
/**
Return given name.
*/
QString givenName() const;
/**
Return translated label for givenName field.
diff --git a/kabc/field.cpp b/kabc/field.cpp
index 5c561c3..fd51026 100644
--- a/kabc/field.cpp
+++ b/kabc/field.cpp
@@ -66,92 +66,89 @@ class Field::FieldImpl
HomeAddressLabel,
BusinessAddressStreet,
BusinessAddressLocality,
BusinessAddressRegion,
BusinessAddressPostalCode,
BusinessAddressCountry,
BusinessAddressLabel,
HomePhone,
BusinessPhone,
MobilePhone,
HomeFax,
BusinessFax,
CarPhone,
Isdn,
Pager,
Email,
Mailer,
Title,
Role,
Organization,
Note,
Url,
Resource,
Sip,
- DefaultFormattedName,
MobileWorkPhone,
MobileHomePhone
};
int fieldId() { return mFieldId; }
int category() { return mCategory; }
QString label() { return mLabel; }
QString key() { return mKey; }
QString app() { return mApp; }
private:
int mFieldId;
int mCategory;
QString mLabel;
QString mKey;
QString mApp;
};
Field::List Field::mAllFields;
Field::List Field::mDefaultFields;
Field::List Field::mCustomFields;
Field::Field( FieldImpl *impl )
{
mImpl = impl;
}
Field::~Field()
{
delete mImpl;
}
QString Field::label()
{
switch ( mImpl->fieldId() ) {
case FieldImpl::FormattedName:
return Addressee::formattedNameLabel();
- case FieldImpl::DefaultFormattedName:
- return Addressee::defaultFormattedNameLabel();
case FieldImpl::FamilyName:
return Addressee::familyNameLabel();
case FieldImpl::GivenName:
return Addressee::givenNameLabel();
case FieldImpl::AdditionalName:
return Addressee::additionalNameLabel();
case FieldImpl::Prefix:
return Addressee::prefixLabel();
case FieldImpl::Suffix:
return Addressee::suffixLabel();
case FieldImpl::NickName:
return Addressee::nickNameLabel();
case FieldImpl::Birthday:
return Addressee::birthdayLabel();
case FieldImpl::HomeAddressStreet:
return Addressee::homeAddressStreetLabel();
case FieldImpl::HomeAddressLocality:
return Addressee::homeAddressLocalityLabel();
case FieldImpl::HomeAddressRegion:
return Addressee::homeAddressRegionLabel();
case FieldImpl::HomeAddressPostalCode:
return Addressee::homeAddressPostalCodeLabel();
case FieldImpl::HomeAddressCountry:
return Addressee::homeAddressCountryLabel();
@@ -227,50 +224,48 @@ QString Field::categoryLabel( int category )
case All:
return i18n("All");
case Frequent:
return i18n("Frequent");
case Address:
return i18n("Address");
case Email:
return i18n("Email");
case Personal:
return i18n("Personal");
case Organization:
return i18n("Organization");
case CustomCategory:
return i18n("Custom");
default:
return i18n("Undefined");
}
}
QString Field::value( const KABC::Addressee &a )
{
switch ( mImpl->fieldId() ) {
case FieldImpl::FormattedName:
return a.formattedName();
- case FieldImpl::DefaultFormattedName:
- return a.defaultFormattedName();
case FieldImpl::FamilyName:
return a.familyName();
case FieldImpl::GivenName:
return a.givenName();
case FieldImpl::AdditionalName:
return a.additionalName();
case FieldImpl::Prefix:
return a.prefix();
case FieldImpl::Suffix:
return a.suffix();
case FieldImpl::NickName:
return a.nickName();
case FieldImpl::Mailer:
return a.mailer();
case FieldImpl::Title:
return a.title();
case FieldImpl::Role:
return a.role();
case FieldImpl::Organization:
return a.organization();
case FieldImpl::Note:
return a.note();
case FieldImpl::Email:
return a.preferredEmail();
@@ -387,49 +382,48 @@ bool Field::setValue( KABC::Addressee &a, const QString &value )
// But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ?
{
QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate
a.setBirthday(dt);
}
return true;
case FieldImpl::CustomField:
a.insertCustom( mImpl->app(), mImpl->key(), value );
//US never copy the resourcename back to the adressee.
case FieldImpl::Resource:
default:
return false;
}
}
bool Field::isCustom()
{
return mImpl->fieldId() == FieldImpl::CustomField;
}
Field::List Field::allFields()
{
if ( mAllFields.isEmpty() ) {
createField( FieldImpl::FormattedName, Frequent );
- createField( FieldImpl::DefaultFormattedName, Frequent );
createField( FieldImpl::FamilyName, Frequent );
createField( FieldImpl::GivenName, Frequent );
createField( FieldImpl::AdditionalName );
createField( FieldImpl::Prefix );
createField( FieldImpl::Suffix );
createField( FieldImpl::NickName, Personal );
createField( FieldImpl::Birthday, Personal );
createField( FieldImpl::Category );
createField( FieldImpl::HomeAddressStreet, Address|Personal );
createField( FieldImpl::HomeAddressLocality, Address|Personal );
createField( FieldImpl::HomeAddressRegion, Address|Personal );
createField( FieldImpl::HomeAddressPostalCode, Address|Personal );
createField( FieldImpl::HomeAddressCountry, Address|Personal );
createField( FieldImpl::HomeAddressLabel, Address|Personal );
createField( FieldImpl::BusinessAddressStreet, Address|Organization );
createField( FieldImpl::BusinessAddressLocality, Address|Organization );
createField( FieldImpl::BusinessAddressRegion, Address|Organization );
createField( FieldImpl::BusinessAddressPostalCode, Address|Organization );
createField( FieldImpl::BusinessAddressCountry, Address|Organization );
createField( FieldImpl::BusinessAddressLabel, Address|Organization );
createField( FieldImpl::HomePhone, Personal|Frequent );
createField( FieldImpl::BusinessPhone, Organization|Frequent );
createField( FieldImpl::MobilePhone, Frequent );
createField( FieldImpl::MobileHomePhone, Frequent );
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp
index b3da428..294ce7d 100644
--- a/kalarmd/simplealarmdaemonimpl.cpp
+++ b/kalarmd/simplealarmdaemonimpl.cpp
@@ -35,49 +35,49 @@
#include <qpushbutton.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qdialog.h>
#define protected public
#include <qspinbox.h>
#undef protected
#include <qtextstream.h>
#include <qtopia/qcopenvelope_qws.h>
#include <qtopia/alarmserver.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent )
: QLabel( parent )
{
mAlarmDialog = new AlarmDialog( 0 );
mPopUp = new QPopupMenu( this );
mPopUp->insertItem( "What's Next?", this, SLOT ( showWN() ) );
mPopUp->insertItem( "Next Days!", this, SLOT ( showKO() ) );
mPopUp->insertSeparator();
- mPopUp->insertItem( "What's Todo?", this, SLOT ( showTodo() ) );
+ mPopUp->insertItem( "Todo List", this, SLOT ( showTodo() ) );
mPopUp->insertSeparator();
mPopUp->insertItem( "Addresses", this, SLOT ( showAdd() ) );
mPopUp->insertSeparator();
mPopUp->insertItem( "Edit Journal", this, SLOT ( writeJournal() ) );
mPopUp->insertItem( "New Event", this, SLOT ( newEvent() ) );
mPopUp->insertItem( "New Todo", this, SLOT ( newTodo() ) );
mPopUp->insertItem( "New Mail", this, SLOT ( newMail() ) );
mPopUp->insertSeparator();
mPopUp->insertItem( "Multi Sync", this, SLOT ( ringSync() ) );
mTimerPopUp = new QPopupMenu( this );
QFont fon = mTimerPopUp->font();
fon.setPointSize( fon.pointSize() *3/2 );
mTimerPopUp->setFont( fon );
mBeepPopUp = new QPopupMenu( this );
mSoundPopUp = new QPopupMenu( this );
mPausePopUp = new QPopupMenu( this );
QPopupMenu* savePopUp = new QPopupMenu( this );
savePopUp->insertItem( "Save", 0 );
savePopUp->insertItem( "Load", 1 );
mSoundPopUp->insertItem( "Buzzer", 0 );
mSoundPopUp->insertItem( "Wav file", 1 );
mPausePopUp->insertItem( " 1 sec", 1 );
mPausePopUp->insertItem( " 2 sec", 2 );
mPausePopUp->insertItem( " 3 sec", 3 );
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 23afe7a..e545ca8 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -422,64 +422,73 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint )
//qDebug("%d %d %d %d ", x, yy, w, h );
if ( mIncidence->cancelled() ){
small = ( height() < 20 );
if ( ! small ) {
QFontMetrics fm ( paint->font() );
paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2);
}
}
pa.end();
}
void KOAgendaItem::resizePixmap( int w , int h )
{
paintPix()->resize( w, h );
paintPixSel()->resize( w, h );
}
QPixmap * KOAgendaItem::paintPix()
{
static QPixmap* mPaintPix = 0;
- if ( ! mPaintPix )
- mPaintPix = new QPixmap(1,1);
+ if ( ! mPaintPix ) {
+ int w = QApplication::desktop()->width();
+ int h = QApplication::desktop()->height();
+ mPaintPix = new QPixmap(w,h);
+ }
return mPaintPix ;
}
QPixmap * KOAgendaItem::paintPixAllday()
{
static QPixmap* mPaintPixA = 0;
- if ( ! mPaintPixA )
- mPaintPixA = new QPixmap(1,1);
+ if ( ! mPaintPixA ) {
+ int w = QApplication::desktop()->width();
+ int h = QApplication::desktop()->height()/3;
+ mPaintPixA = new QPixmap(w,h);
+ }
return mPaintPixA ;
}
QPixmap * KOAgendaItem::paintPixSel()
{
static QPixmap* mPaintPixSel = 0;
- if ( ! mPaintPixSel )
- mPaintPixSel = new QPixmap(1,1);
+ if ( ! mPaintPixSel ) {
+ int w = QApplication::desktop()->width();
+ int h = QApplication::desktop()->height();
+ mPaintPixSel = new QPixmap(w,h);
+ }
return mPaintPixSel ;
}
void KOAgendaItem::paintEvent ( QPaintEvent *e )
{
if ( globalFlagBlockAgendaItemPaint )
return;
if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 )
return;
int yy;
if ( mAllDay )
yy = y();
else
yy = mCellYTop * ( height() / cellHeight() );
int xx = x();
if ( xPaintCoord != xx || yPaintCoord != yy ||
wPaintCoord != width() || hPaintCoord != height()) {
xPaintCoord= xx;
yPaintCoord = yy;
wPaintCoord = width();
hPaintCoord = height();
globalFlagBlockAgendaItemUpdate = 0;
paintMe( mSelected );
@@ -504,107 +513,106 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e )
}
xx += rx;
if ( xx < 0 ) {
rw = rw + xx;
rx -= xx;
xx = 0;
if ( rw <= 1 ) {
//qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1());
return;
}
}
if ( paintFrom->width() < xx+rw ) {
rw = paintFrom->width() - xx;
if ( rw <= 1 ) {
//qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() );
return;
}
}
//qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh);
bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP);
}
void KOAgendaItem::computeText()
{
-
mDisplayedText = mIncidence->summary();
if ( (mIncidence->type() == "Todo") ) {
if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) {
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())+")";
}
} else {
if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda)
- mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ;
+ mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + " - " + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ;
if ( mAllDay ) {
if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) {
mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ;
}
}
}
if ( !mIncidence->location().isEmpty() ) {
if ( mAllDay )
mDisplayedText += " (";
else
mDisplayedText += "\n(";
mDisplayedText += mIncidence->location() +")";
}
-
+#ifdef DESKTOP_VERSION
QString tipText = mIncidence->summary();
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();
if (((Todo*)mIncidence)->hasDueDate())
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();
if (((Todo*)mIncidence)->hasDueDate())
tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueDateStr();
}
if (!mIncidence->location().isEmpty()) {
tipText += "\n"+i18n("Location: ")+mIncidence->location();
}
QToolTip::add(this,tipText,toolTipGroup(),"");
-
+#endif
}
void KOAgendaItem::updateItem()
{
computeText();
//qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y());
paintMe( mSelected );
repaint( false);
}
void KOAgendaItem::resizeEvent ( QResizeEvent *ev )
{
//qDebug("KOAgendaItem::resizeEvent %s ", mIncidence->summary().latin1());
paintMe( mSelected );
repaint( false );
}
/*
Return height of item in units of agenda cells
*/
int KOAgendaItem::cellHeight()
{
int ret = mCellYBottom - mCellYTop + 1;
if ( ret <= 0 ) {
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 4dfb9df..65d6acf 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -620,106 +620,116 @@ void MonthViewCell::startUpdateCell()
while ( CurrentAvailItem ) {
MonthViewItem *item = CurrentAvailItem;
CurrentAvailItem = (MonthViewItem *)item->next();
mAvailItemList.append( item );
takeItem ( item );
}
#ifdef DESKTOP_VERSION
QToolTip::remove(this);
#endif
mToolTip.clear();
//qApp->processEvents();
#if 0
if ( !mHolidayString.isEmpty() ) {
MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString );
item->setPalette( mHolidayPalette );
insertItem( item );
mToolTip.append ( mHolidayString );
}
#endif
}
int MonthViewCell::insertEvent(Event *event)
{
+ bool useToolTips = true;
+#ifndef DEKSTOP_VERSION
+ useToolTips = false;
+#endif
QString mToolTipText;
setFocusPolicy(WheelFocus);
if ( !(event->doesRecur() == Recurrence::rNone) ) {
if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily )
return mdayCount;
else
if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly )
return mdayCount;
}
if ( event->isHoliday()) {
setHoliday( true );
if ( mDate.dayOfWeek() == 7 )
setLineWidth( 3 );
}
QString text;
int multiday = 0;// 1 = start, 2 = midddle, 3 = end day
if (event->isMultiDay()) {
QString prefix = "<->";multiday = 2;
QString time;
if ( event->doesRecur() ) {
if ( event->recursOn( mDate) ) {
prefix ="->" ;multiday = 1;
}
else {
int days = event->dtStart().date().daysTo ( event->dtEnd().date() );
if ( event->recursOn( mDate.addDays( -days)) ) {
prefix ="<-" ;multiday = 3;
}
}
} else {
if (mDate == event->dtStart().date()) {
prefix ="->" ;multiday = 1;
} else if (mDate == event->dtEnd().date()) {
prefix ="<-" ;multiday = 3;
}
}
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();
- mToolTipText += prefix + text;
+ if ( useToolTips )
+ mToolTipText += prefix + text;
} else {
if (event->doesFloat()) {
text = event->summary();
- mToolTipText += text;
+ if ( useToolTips )
+ mToolTipText += text;
}
else {
text = KGlobal::locale()->formatTime(event->dtStart().time());
text += " " + event->summary();
- mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary();
+ if ( useToolTips )
+ mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary();
}
}
+ if ( useToolTips && ! event->location().isEmpty() ) {
+ mToolTipText += " (" + event->location() +")";
+ }
MonthViewItem *item ;
if ( mAvailItemList.count() ) {
item = mAvailItemList.first();
mAvailItemList.remove( item );
item->recycle( event, mDate, text );
} else {
item = new MonthViewItem( event, mDate, text );
}
QPalette pal;
if (KOPrefs::instance()->mMonthViewUsesCategoryColor) {
QStringList categories = event->categories();
QString cat = categories.first();
if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) {
pal = getPalette();
if (cat.isEmpty()) {
pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor);
} else {
pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat)));
}
} else {
if (cat.isEmpty()) {
@@ -743,49 +753,50 @@ int MonthViewCell::insertEvent(Event *event)
if ( me->status() == Attendee::NeedsAction && me->RSVP())
item->setReply(true && multiday < 2);
else
item->setReply(false);
} else
item->setReply(false);
#endif
item->setMultiDay( multiday );
if ( multiday ) {
insertItem( item ,mdayCount);
++mdayCount;
} else {
uint i;
int pos = mdayCount;
for ( i = mdayCount; i < count();++i ) {
QListBoxItem* it = this->item ( i );
if ( text < it->text() ) {
pos = i;
break;
}
++pos;
}
insertItem( item ,pos);
}
- mToolTip.append( mToolTipText );
+ if ( useToolTips )
+ mToolTip.append( mToolTipText );
return mdayCount;
}
void MonthViewCell::insertTodo(Todo *todo)
{
setFocusPolicy(WheelFocus);
QString text;
if (todo->hasDueDate()) {
if (!todo->doesFloat()) {
text += KGlobal::locale()->formatTime(todo->dtDue().time());
text += " ";
}
}
text += todo->summary();
MonthViewItem *item ;
if ( mAvailItemList.count() ) {
item = mAvailItemList.first();
mAvailItemList.remove( item );
item->recycle( todo, mDate, text );
} else {
item = new MonthViewItem( todo, mDate, text );
}
//MonthViewItem *item = new MonthViewItem( todo, mDate, text );
//item->setPalette( mStandardPalette );
QPalette pal;
@@ -795,49 +806,51 @@ void MonthViewCell::insertTodo(Todo *todo)
if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) {
pal = getPalette();
if (cat.isEmpty()) {
pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor);
} else {
pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat)));
}
} else {
if (cat.isEmpty()) {
pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor);
} else {
pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat)));
}
}
} else {
pal = mStandardPalette ;
}
item->setPalette( pal );
item->setRecur( todo->recurrence()->doesRecur() );
item->setAlarm( todo->isAlarmEnabled() );
item->setMoreInfo( todo->description().length() > 0 );
insertItem( item , count());
+#ifdef DESKTOP_VERSION
mToolTip.append( text );
+#endif
}
void MonthViewCell::repaintfinishUpdateCell()
{
MonthViewItem *mitem = (MonthViewItem*) firstItem ();
while ( mitem ) {
mitem->setBlockRepaint( false );
updateItem ( mitem );
mitem = (MonthViewItem *)mitem->next();
}
}
void MonthViewCell::finishUpdateCell()
{
#ifdef DESKTOP_VERSION
if (mToolTip.count() > 0 ) {
mToolTip.sort();
QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),"");
}
#endif
//sort();
//setMyPalette();
setMyPalette();