summaryrefslogtreecommitdiffstats
path: root/korganizer/koagendaitem.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
commitcc29364f06178f8f6b457384f2ec37a042bd9d43 (patch)
tree7c77a3184c698bbf9d98cef09fb1ba8124daceba /korganizer/koagendaitem.cpp
parent4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff)
downloadtdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz
tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed * Added journal read support to the CalDAV resource * Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'korganizer/koagendaitem.cpp')
-rw-r--r--korganizer/koagendaitem.cpp84
1 files changed, 53 insertions, 31 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 629f59c31..de1f4ef87 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -63,12 +63,16 @@ TQPixmap *KOAgendaItem::organizerPxmp = 0;
//--------------------------------------------------------------------------
-KOAgendaItem::KOAgendaItem( Incidence *incidence, const TQDate &qd, TQWidget *parent,
+KOAgendaItem::KOAgendaItem( Calendar *calendar, Incidence *incidence,
+ const TQDate &qd, TQWidget *parent,
+ int itemPos, int itemCount,
const char *name, WFlags f ) :
- TQWidget( parent, name, f ), mIncidence( incidence ), mDate( qd ),
+ TQWidget( parent, name, f ), mCalendar( calendar ), mIncidence( incidence ), mDate( qd ),
mLabelText( mIncidence->summary() ), mIconAlarm( false ),
mIconRecur( false ), mIconReadonly( false ), mIconReply( false ),
mIconGroup( false ), mIconGroupTentative( false ), mIconOrganizer( false ),
+ mSpecialEvent( false ),
+ mItemPos( itemPos ), mItemCount( itemCount ),
mMultiItemInfo( 0 ), mStartMoveInfo( 0 )
{
setBackgroundMode( Qt::NoBackground );
@@ -83,7 +87,7 @@ KOAgendaItem::KOAgendaItem( Incidence *incidence, const TQDate &qd, TQWidget *pa
mSelected = true;
select( false );
- KOIncidenceToolTip::add( this, incidence, toolTipGroup() );
+ KOIncidenceToolTip::add( this, mCalendar, incidence, mDate, toolTipGroup() );
setAcceptDrops( true );
}
@@ -93,7 +97,7 @@ void KOAgendaItem::updateIcons()
mIconReadonly = mIncidence->isReadOnly();
mIconRecur = mIncidence->doesRecur();
mIconAlarm = mIncidence->isAlarmEnabled();
- if ( mIncidence->attendeeCount() > 0 ) {
+ if ( mIncidence->attendeeCount() > 1 ) {
if ( KOPrefs::instance()->thatIsMe( mIncidence->organizer().email() ) ) {
mIconReply = false;
mIconGroup = false;
@@ -171,7 +175,6 @@ bool KOAgendaItem::setIncidence( Incidence *i )
return true;
}
-
/*
Return height of item in units of agenda cells
*/
@@ -217,10 +220,12 @@ void KOAgendaItem::setCellY( int YTop, int YBottom )
mCellYBottom = YBottom;
}
-void KOAgendaItem::setMultiItem(KOAgendaItem *first, KOAgendaItem *prev,
- KOAgendaItem *next, KOAgendaItem *last)
+void KOAgendaItem::setMultiItem( KOAgendaItem *first, KOAgendaItem *prev,
+ KOAgendaItem *next, KOAgendaItem *last )
{
- if (!mMultiItemInfo) mMultiItemInfo=new MultiItemInfo;
+ if ( !mMultiItemInfo ) {
+ mMultiItemInfo = new MultiItemInfo;
+ }
mMultiItemInfo->mFirstMultiItem = first;
mMultiItemInfo->mPrevMultiItem = prev;
mMultiItemInfo->mNextMultiItem = next;
@@ -575,18 +580,16 @@ void KOAgendaItem::dropEvent( TQDropEvent *e )
}
#ifndef KORG_NOKABC
- TQString vcards;
- KABC::VCardConverter converter;
-
- KVCardDrag::decode( e, vcards );
- KABC::Addressee::List list = converter.parseVCards( vcards );
- KABC::Addressee::List::Iterator it;
- for ( it = list.begin(); it != list.end(); ++it ) {
- TQString em( (*it).fullEmail() );
- if (em.isEmpty()) {
- em=(*it).realName();
+ KABC::Addressee::List list;
+ if ( KVCardDrag::decode( e, list ) ) {
+ KABC::Addressee::List::Iterator it;
+ for ( it = list.begin(); it != list.end(); ++it ) {
+ TQString em( (*it).fullEmail() );
+ if ( em.isEmpty() ) {
+ em = (*it).realName();
+ }
+ addAttendee( em );
}
- addAttendee( em );
}
#else
if( decoded ) {
@@ -665,11 +668,21 @@ static void conditionalPaint( TQPainter *p, bool cond, int &x, int ft,
void KOAgendaItem::paintEventIcon( TQPainter *p, int &x, int ft )
{
if ( !mIncidence ) return;
- static const TQPixmap eventPxmp =
- KOGlobals::self()->smallIcon( "appointment" );
- if ( mIncidence->type() != "Event" )
- return;
- conditionalPaint( p, true, x, ft, eventPxmp );
+
+ if ( mIncidence->type() == "Event" ) {
+ TQPixmap eventPxmp;
+ if ( mIncidence->customProperty( "KABC", "BIRTHDAY" ) == "YES" ) {
+ mSpecialEvent = true;
+ if ( mIncidence->customProperty( "KABC", "ANNIVERSARY" ) == "YES" ) {
+ eventPxmp = KOGlobals::self()->smallIcon( "calendaranniversary" );
+ } else {
+ eventPxmp = KOGlobals::self()->smallIcon( "calendarbirthday" );
+ }
+ conditionalPaint( p, true, x, ft, eventPxmp );
+ }
+ // per kolab/issue4349 we don't draw a regular appointment icon (to save space)
+ }
+
}
void KOAgendaItem::paintTodoIcon( TQPainter *p, int &x, int ft )
@@ -702,9 +715,11 @@ void KOAgendaItem::paintIcons( TQPainter *p, int &x, int ft )
{
paintEventIcon( p, x, ft );
paintTodoIcon( p, x, ft );
- paintAlarmIcon( p, x, ft );
- conditionalPaint( p, mIconRecur, x, ft, *recurPxmp );
- conditionalPaint( p, mIconReadonly, x, ft, *readonlyPxmp );
+ if ( !mSpecialEvent ) {
+ paintAlarmIcon( p, x, ft );
+ }
+ conditionalPaint( p, mIconRecur && !mSpecialEvent, x, ft, *recurPxmp );
+ conditionalPaint( p, mIconReadonly && !mSpecialEvent, x, ft, *readonlyPxmp );
conditionalPaint( p, mIconReply, x, ft, *replyPxmp );
conditionalPaint( p, mIconGroup, x, ft, *groupPxmp );
conditionalPaint( p, mIconGroupTentative, x, ft, *groupPxmpTentative );
@@ -762,7 +777,7 @@ void KOAgendaItem::paintEvent( TQPaintEvent *ev )
TQStringList categories = mIncidence->categories();
TQString cat = categories.first();
if (cat.isEmpty())
- categoryColor = KOPrefs::instance()->mEventColor;
+ categoryColor = KOPrefs::instance()->unsetCategoryColor();
else
categoryColor = *(KOPrefs::instance()->categoryColor(cat));
@@ -770,9 +785,6 @@ void KOAgendaItem::paintEvent( TQPaintEvent *ev )
if ( !resourceColor.isValid() )
resourceColor = categoryColor;
- if (!KOPrefs::instance()->hasCategoryColor(cat))
- categoryColor = resourceColor;
-
TQColor frameColor;
if ( KOPrefs::instance()->agendaViewColors() == KOPrefs::ResourceOnly ||
KOPrefs::instance()->agendaViewColors() == KOPrefs::CategoryInsideResourceOutside ) {
@@ -790,6 +802,16 @@ void KOAgendaItem::paintEvent( TQPaintEvent *ev )
}
}
+ if ( cat.isEmpty() &&
+ KOPrefs::instance()->agendaViewColors() == KOPrefs::ResourceInsideCategoryOutside ) {
+ frameColor = bgColor;
+ }
+
+ if ( cat.isEmpty() &&
+ KOPrefs::instance()->agendaViewColors() == KOPrefs::CategoryInsideResourceOutside ) {
+ bgColor = frameColor;
+ }
+
if ( mSelected ) {
frameColor = TQColor( 85 + frameColor.red() * 2/3,
85 + frameColor.green() * 2/3,