diff --git a/configuredialog.cpp b/configuredialog.cpp index 01cb720e8..18f0f0c45 100644 --- a/configuredialog.cpp +++ b/configuredialog.cpp @@ -1516,6 +1516,7 @@ static const struct { { "list-new-font", I18N_NOOP("Message List - New Messages"), true, false }, { "list-unread-font", I18N_NOOP("Message List - Unread Messages"), true, false }, { "list-important-font", I18N_NOOP("Message List - Important Messages"), true, false }, + { "list-todo-font", I18N_NOOP("Message List - Todo Messages"), true, false }, { "list-date-font", I18N_NOOP("Message List - Date Field"), true, false }, { "folder-font", I18N_NOOP("Folder List"), true, false }, { "quote1-font", I18N_NOOP("Quoted Text - First Level"), false, false }, @@ -1690,6 +1691,7 @@ static const struct { { "NewMessage", I18N_NOOP("New Message") }, { "UnreadMessage", I18N_NOOP("Unread Message") }, { "FlagMessage", I18N_NOOP("Important Message") }, + { "TodoMessage", I18N_NOOP("Todo Message") }, { "PGPMessageEncr", I18N_NOOP("OpenPGP Message - Encrypted") }, { "PGPMessageOkKeyOk", I18N_NOOP("OpenPGP Message - Valid Signature with Trusted Key") }, { "PGPMessageOkKeyBad", I18N_NOOP("OpenPGP Message - Valid Signature with Untrusted Key") }, diff --git a/configuredialog_p.h b/configuredialog_p.h index 7382f73d1..819a2fec0 100644 --- a/configuredialog_p.h +++ b/configuredialog_p.h @@ -429,7 +429,7 @@ private: KFontChooser *mFontChooser; int mActiveFontIndex; - QFont mFont[13]; + QFont mFont[14]; }; class AppearancePageColorsTab : public ConfigModuleTab { diff --git a/headeritem.cpp b/headeritem.cpp index 8d3755fe2..d60802368 100644 --- a/headeritem.cpp +++ b/headeritem.cpp @@ -97,7 +97,7 @@ void HeaderItem::irefresh() KMMsgBase *mMsgBase = headers->folder()->getMsgBase( mMsgId ); if (mMsgBase->isNew() || mMsgBase->isUnread() - || mMsgBase->isImportant() || mMsgBase->isWatched() ) { + || mMsgBase->isImportant() || mMsgBase->isTodo() || mMsgBase->isWatched() ) { setOpen(true); HeaderItem * topOfThread = this; while(topOfThread->parent()) @@ -247,7 +247,6 @@ const QPixmap *HeaderItem::statusIcon(KMMsgBase *msgBase) const // a queued or sent mail is usually also read if ( msgBase->isQueued() ) return KMHeaders::pixQueued; - if ( msgBase->isTodo() ) return KMHeaders::pixTodo; if ( msgBase->isSent() ) return KMHeaders::pixSent; if ( msgBase->isNew() ) return KMHeaders::pixNew; @@ -303,6 +302,9 @@ const QPixmap *HeaderItem::pixmap(int col) const if ( !headers->mPaintInfo.showImportant ) if ( msgBase->isImportant() ) pixmaps << *KMHeaders::pixFlag; + if ( !headers->mPaintInfo.showTodo ) + if ( msgBase->isTodo() ) pixmaps << *KMHeaders::pixTodo; + static QPixmap mergedpix; mergedpix = pixmapMerge( pixmaps ); return &mergedpix; @@ -318,6 +320,10 @@ const QPixmap *HeaderItem::pixmap(int col) const if ( msgBase->isImportant() ) return KMHeaders::pixFlag; } + else if ( col == headers->paintInfo()->todoCol ) { + if ( msgBase->isTodo() ) + return KMHeaders::pixTodo; + } else if ( col == headers->paintInfo()->spamHamCol ) { if ( msgBase->isSpam() ) return KMHeaders::pixSpam; if ( msgBase->isHam() ) return KMHeaders::pixHam; @@ -350,8 +356,13 @@ void HeaderItem::paintCell( QPainter * p, const QColorGroup & cg, QFont font = p->font(); int weight = font.weight(); - // for color and font family "important" overrides "new" overrides "unread", - // for the weight we use the maximal weight + // for color and font family "important" overrides "new" overrides "unread" + // overrides "todo" for the weight we use the maximal weight + if ( mMsgBase->isTodo() ) { + color = const_cast( &headers->paintInfo()->colTodo ); + font = headers->todoFont(); + weight = QMAX( weight, font.weight() ); + } if ( mMsgBase->isUnread() ) { color = const_cast( &headers->paintInfo()->colUnread ); font = headers->unreadFont(); @@ -362,6 +373,7 @@ void HeaderItem::paintCell( QPainter * p, const QColorGroup & cg, font = headers->newFont(); weight = QMAX( weight, font.weight() ); } + if ( mMsgBase->isImportant() ) { color = const_cast( &headers->paintInfo()->colFlag ); font = headers->importantFont(); @@ -461,6 +473,10 @@ QString HeaderItem::generate_key( KMHeaders *headers, QString s(msg->isImportant() ? "1" : "0"); return ret + s + sortArrival; } + else if ( column == paintInfo->todoCol ) { + QString s( msg->isTodo() ? "1": "0" ); + return ret + s + sortArrival; + } else if (column == paintInfo->spamHamCol) { QString s((msg->isSpam() || msg->isHam()) ? "1" : "0"); return ret + s + sortArrival; @@ -527,6 +543,7 @@ int HeaderItem::compare( QListViewItem *i, int col, bool ascending ) const ( col == headers->paintInfo()->sizeCol ) || ( col == headers->paintInfo()->attachmentCol ) || ( col == headers->paintInfo()->importantCol ) || + ( col == headers->paintInfo()->todoCol ) || ( col == headers->paintInfo()->spamHamCol ) || ( col == headers->paintInfo()->signedCol ) || ( col == headers->paintInfo()->cryptoCol ) || diff --git a/kmheaders.cpp b/kmheaders.cpp index 16896bbff..0389e5fdc 100644 --- a/kmheaders.cpp +++ b/kmheaders.cpp @@ -121,6 +121,7 @@ KMHeaders::KMHeaders(KMMainWidget *aOwner, QWidget *parent, mPopup->setCheckable(true); mPopup->insertItem(i18n("Status"), KPaintInfo::COL_STATUS); mPopup->insertItem(i18n("Important"), KPaintInfo::COL_IMPORTANT); + mPopup->insertItem(i18n("Todo"), KPaintInfo::COL_TODO); mPopup->insertItem(i18n("Attachment"), KPaintInfo::COL_ATTACHMENT); mPopup->insertItem(i18n("Spam/Ham"), KPaintInfo::COL_SPAM_HAM); mPopup->insertItem(i18n("Watched/Ignored"), KPaintInfo::COL_WATCHED_IGNORED); @@ -179,6 +180,7 @@ KMHeaders::KMHeaders(KMMainWidget *aOwner, QWidget *parent, mPaintInfo.statusCol = addColumn( *pixNew , "", 0 ); mPaintInfo.importantCol = addColumn( *pixFlag , "", 0 ); + mPaintInfo.todoCol = addColumn( *pixTodo , "", 0 ); mPaintInfo.attachmentCol = addColumn( *pixAttachment , "", 0 ); mPaintInfo.spamHamCol = addColumn( *pixSpam , "", 0 ); mPaintInfo.watchedIgnoredCol = addColumn( *pixWatched , "", 0 ); @@ -271,6 +273,13 @@ void KMHeaders::slotToggleColumn(int id, int mode) width = pixFlag->width(); break; } + case KPaintInfo::COL_TODO: + { + show = &mPaintInfo.showTodo; + col = &mPaintInfo.todoCol; + width = pixTodo->width(); + break; + } case KPaintInfo::COL_SPAM_HAM: { show = &mPaintInfo.showSpamHam; @@ -384,8 +393,9 @@ void KMHeaders::readColorConfig (void) QColor c3=QColor("blue"); QColor c4=QColor(kapp->palette().active().base()); QColor c5=QColor(0,0x7F,0); - QColor c6=KGlobalSettings::alternateBackgroundColor(); - + QColor c6=QColor(0,0x98,0); + QColor c7=KGlobalSettings::alternateBackgroundColor(); + if (!config->readBoolEntry("defaultColors",true)) { mPaintInfo.colFore = config->readColorEntry("ForegroundColor",&c1); mPaintInfo.colBack = config->readColorEntry("BackgroundColor",&c4); @@ -396,7 +406,8 @@ void KMHeaders::readColorConfig (void) mPaintInfo.colNew = config->readColorEntry("NewMessage",&c2); mPaintInfo.colUnread = config->readColorEntry("UnreadMessage",&c3); mPaintInfo.colFlag = config->readColorEntry("FlagMessage",&c5); - c6 = config->readColorEntry("AltBackgroundColor",&c6); + mPaintInfo.colTodo = config->readColorEntry("TodoMessage",&c6); + c7 = config->readColorEntry("AltBackgroundColor",&c7); } else { mPaintInfo.colFore = c1; @@ -408,8 +419,9 @@ void KMHeaders::readColorConfig (void) mPaintInfo.colNew = c2; mPaintInfo.colUnread = c3; mPaintInfo.colFlag = c5; + mPaintInfo.colTodo = c6; } - setAlternateBackground(c6); + setAlternateBackground(c7); } //----------------------------------------------------------------------------- @@ -439,6 +451,9 @@ void KMHeaders::readConfig (void) show = config->readBoolEntry("showImportantColumn"); slotToggleColumn(KPaintInfo::COL_IMPORTANT, show); + show = config->readBoolEntry("showTodoColumn"); + slotToggleColumn(KPaintInfo::COL_TODO, show); + show = config->readBoolEntry("showSpamHamColumn"); slotToggleColumn(KPaintInfo::COL_SPAM_HAM, show); @@ -479,10 +494,11 @@ void KMHeaders::readConfig (void) mNewFont = config->readFontEntry( "list-new-font", &listFont ); mUnreadFont = config->readFontEntry( "list-unread-font", &listFont ); mImportantFont = config->readFontEntry( "list-important-font", &listFont ); + mTodoFont = config->readFontEntry( "list-todo-font", &listFont ); mDateFont = KGlobalSettings::fixedFont(); mDateFont = config->readFontEntry( "list-date-font", &mDateFont ); } else { - mNewFont= mUnreadFont = mImportantFont = mDateFont = + mNewFont= mUnreadFont = mImportantFont = mDateFont = mTodoFont = KGlobalSettings::generalFont(); setFont( mDateFont ); } @@ -590,6 +606,7 @@ void KMHeaders::writeConfig (void) config->writeEntry("showMessageSize" , mPaintInfo.showSize); config->writeEntry("showAttachmentColumn" , mPaintInfo.showAttachment); config->writeEntry("showImportantColumn" , mPaintInfo.showImportant); + config->writeEntry("showTodoColumn" , mPaintInfo.showTodo); config->writeEntry("showSpamHamColumn" , mPaintInfo.showSpamHam); config->writeEntry("showWatchedIgnoredColumn", mPaintInfo.showWatchedIgnored); config->writeEntry("showStatusColumn" , mPaintInfo.showStatus); diff --git a/kmheaders.h b/kmheaders.h index d5c848a0b..193e829eb 100644 --- a/kmheaders.h +++ b/kmheaders.h @@ -178,6 +178,7 @@ public: QFont newFont() const { return mNewFont; } QFont unreadFont() const { return mUnreadFont; } QFont importantFont() const { return mImportantFont; } + QFont todoFont() const { return mTodoFont; } QFont dateFont() const { return mDateFont; } signals: @@ -413,7 +414,7 @@ private: /** Current colours and backing pixmap */ KPaintInfo mPaintInfo; - QFont mNewFont, mUnreadFont, mImportantFont, mDateFont; + QFont mNewFont, mUnreadFont, mImportantFont, mDateFont,mTodoFont; /** Icons shown in header */ static QIconSet *up, *down;