From: Manuel Nickschas Date: Thu, 6 Aug 2009 20:48:19 +0000 (+0200) Subject: Adapt to new topic message type X-Git-Tag: 0.5-rc1~79 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=7f8c674b003c9f48c1c11cd7dee257a807f99d7c Adapt to new topic message type --- diff --git a/data/default.qss b/data/default.qss index 281cb66d..22d24019 100644 --- a/data/default.qss +++ b/data/default.qss @@ -84,6 +84,7 @@ ChatLine#server { foreground: #916409; } ChatLine#info { foreground: #916409; } ChatLine#error { foreground: #916409; } ChatLine#daychange { foreground: #916409; } +ChatLine#topic { foreground: #960096; } // BufferView Colors ChatListItem[state="inactive"] { foreground: #a0a0a4; } diff --git a/src/qtui/qtuistyle.cpp b/src/qtui/qtuistyle.cpp index 2e505a69..26c90482 100644 --- a/src/qtui/qtuistyle.cpp +++ b/src/qtui/qtuistyle.cpp @@ -81,6 +81,7 @@ void QtUiStyle::generateSettingsQss() const { << msgTypeQss("info", "ServerMsg", s) << msgTypeQss("error", "ErrorMsg", s) << msgTypeQss("daychange", "ServerMsg", s) + << msgTypeQss("topic", "CommandMsg", s) << "\n"; } diff --git a/src/uisupport/qssparser.cpp b/src/uisupport/qssparser.cpp index ccb22041..d8af2dc6 100644 --- a/src/uisupport/qssparser.cpp +++ b/src/uisupport/qssparser.cpp @@ -222,6 +222,8 @@ quint64 QssParser::parseFormatType(const QString &decl) { fmtType |= UiStyle::ErrorMsg; else if(msgType == "daychange") fmtType |= UiStyle::DayChangeMsg; + else if(msgType == "topic") + fmtType |= UiStyle::TopicMsg; else { qWarning() << Q_FUNC_INFO << tr("Invalid message type in %1").arg(decl); } diff --git a/src/uisupport/uistyle.cpp b/src/uisupport/uistyle.cpp index 555f8770..18934d6d 100644 --- a/src/uisupport/uistyle.cpp +++ b/src/uisupport/uistyle.cpp @@ -394,6 +394,8 @@ UiStyle::FormatType UiStyle::formatType(Message::Type msgType) { return ErrorMsg; case Message::DayChange: return DayChangeMsg; + case Message::Topic: + return TopicMsg; } //Q_ASSERT(false); // we need to handle all message types qWarning() << Q_FUNC_INFO << "Unknown message type:" << msgType; @@ -608,6 +610,9 @@ void UiStyle::StyledMessage::style() const { //: Day Change Message t = tr("{Day changed to %1}").arg(timestamp().toString()); break; + case Message::Topic: + //: Topic Message + t = tr("%1").arg(txt); break; default: t = tr("[%1]").arg(txt); } @@ -672,6 +677,8 @@ QString UiStyle::StyledMessage::decoratedSender() const { return tr("*"); break; case Message::DayChange: return tr("-"); break; + case Message::Topic: + return tr("*"); break; default: return tr("%1").arg(plainSender()); } diff --git a/src/uisupport/uistyle.h b/src/uisupport/uistyle.h index 5b96bedb..f10dd4c7 100644 --- a/src/uisupport/uistyle.h +++ b/src/uisupport/uistyle.h @@ -69,6 +69,7 @@ public: InfoMsg = 0x0000000c, ErrorMsg = 0x0000000d, DayChangeMsg = 0x0000000e, + TopicMsg = 0x0000000f, // Standard Formats Bold = 0x00000100,