Adapt to new topic message type
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 6 Aug 2009 20:48:19 +0000 (22:48 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 6 Aug 2009 20:48:19 +0000 (22:48 +0200)
data/default.qss
src/qtui/qtuistyle.cpp
src/uisupport/qssparser.cpp
src/uisupport/uistyle.cpp
src/uisupport/uistyle.h

index 281cb66..22d2401 100644 (file)
@@ -84,6 +84,7 @@ ChatLine#server { foreground: #916409; }
 ChatLine#info { foreground: #916409; }
 ChatLine#error { foreground: #916409; }
 ChatLine#daychange { 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; }
 
 // BufferView Colors
 ChatListItem[state="inactive"] { foreground: #a0a0a4; }
index 2e505a6..26c9048 100644 (file)
@@ -81,6 +81,7 @@ void QtUiStyle::generateSettingsQss() const {
         << msgTypeQss("info", "ServerMsg", s)
         << msgTypeQss("error", "ErrorMsg", s)
         << msgTypeQss("daychange", "ServerMsg", s)
         << msgTypeQss("info", "ServerMsg", s)
         << msgTypeQss("error", "ErrorMsg", s)
         << msgTypeQss("daychange", "ServerMsg", s)
+        << msgTypeQss("topic", "CommandMsg", s)
         << "\n";
   }
 
         << "\n";
   }
 
index ccb2204..d8af2dc 100644 (file)
@@ -222,6 +222,8 @@ quint64 QssParser::parseFormatType(const QString &decl) {
       fmtType |= UiStyle::ErrorMsg;
     else if(msgType == "daychange")
       fmtType |= UiStyle::DayChangeMsg;
       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);
     }
     else {
       qWarning() << Q_FUNC_INFO << tr("Invalid message type in %1").arg(decl);
     }
index 555f877..18934d6 100644 (file)
@@ -394,6 +394,8 @@ UiStyle::FormatType UiStyle::formatType(Message::Type msgType) {
       return ErrorMsg;
     case Message::DayChange:
       return DayChangeMsg;
       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;
   }
   //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;
       //: 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);
   }
     default:
       t = tr("[%1]").arg(txt);
   }
@@ -672,6 +677,8 @@ QString UiStyle::StyledMessage::decoratedSender() const {
       return tr("*"); break;
     case Message::DayChange:
       return tr("-"); break;
       return tr("*"); break;
     case Message::DayChange:
       return tr("-"); break;
+    case Message::Topic:
+      return tr("*"); break;
     default:
       return tr("%1").arg(plainSender());
   }
     default:
       return tr("%1").arg(plainSender());
   }
index 5b96bed..f10dd4c 100644 (file)
@@ -69,6 +69,7 @@ public:
     InfoMsg         = 0x0000000c,
     ErrorMsg        = 0x0000000d,
     DayChangeMsg    = 0x0000000e,
     InfoMsg         = 0x0000000c,
     ErrorMsg        = 0x0000000d,
     DayChangeMsg    = 0x0000000e,
+    TopicMsg        = 0x0000000f,
 
     // Standard Formats
     Bold            = 0x00000100,
 
     // Standard Formats
     Bold            = 0x00000100,