From: Alexander von Renteln Date: Tue, 8 Apr 2008 10:29:03 +0000 (+0000) Subject: -tooltip in the buffer list is now translatable X-Git-Tag: 0.2.0-alpha5~8 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=8a91d275138941cc91704dd462efaf70c5f9732c -tooltip in the buffer list is now translatable -fixed strange formating issue (extra lines between channel name and the rest in windows) --- diff --git a/src/client/networkmodel.cpp b/src/client/networkmodel.cpp index e40c5055..5b2f953e 100644 --- a/src/client/networkmodel.cpp +++ b/src/client/networkmodel.cpp @@ -288,14 +288,14 @@ QString BufferItem::toolTip(int column) const { switch(bufferType()) { case BufferInfo::StatusBuffer: { QString netName = Client::network(bufferInfo().networkId())->networkName(); - toolTip.append(QString("Status buffer from %1").arg(netName)); + toolTip.append(tr("Status buffer from %1").arg(netName)); break; } case BufferInfo::ChannelBuffer: - toolTip.append(QString("

Channel %1

").arg(bufferName())); + toolTip.append(tr("Channel %1").arg(bufferName())); if(isActive()) { //TODO: add channel modes - toolTip.append(QString("Users: %1").arg(nickCount())); + toolTip.append(tr("Users: %1").arg(nickCount())); BufferSettings s; bool showTopic = s.value("DisplayTopicInTooltip", QVariant(false)).toBool(); @@ -305,23 +305,23 @@ QString BufferItem::toolTip(int column) const { _topic.replace(QString("<"), QString("<")); _topic.replace(QString(">"), QString(">")); toolTip.append(QString(" ")); - toolTip.append(QString("Topic: %1").arg(_topic)); + toolTip.append(tr("Topic: %1").arg(_topic)); } } } else { - toolTip.append(QString("Not active
Double-click to join")); + toolTip.append(tr("Not active
Double-click to join")); } break; case BufferInfo::QueryBuffer: - toolTip.append(QString("Query with %1").arg(bufferName())); - if(topic() != "") toolTip.append(QString("Away Message: %1").arg(topic())); + toolTip.append(tr("Query with %1").arg(bufferName())); + if(topic() != "") toolTip.append(tr("Away Message: %1").arg(topic())); break; default: //this should not happen - toolTip.append(QString("%1 - %2").arg(bufferInfo().bufferId().toInt()).arg(bufferName())); + toolTip.append(tr("%1 - %2").arg(bufferInfo().bufferId().toInt()).arg(bufferName())); break; } - return QString("

%1

").arg(toolTip.join("
")); + return tr("

%1

").arg(toolTip.join("
")); } /* diff --git a/src/uisupport/bufferviewfilter.cpp b/src/uisupport/bufferviewfilter.cpp index af1686e0..a4ece414 100644 --- a/src/uisupport/bufferviewfilter.cpp +++ b/src/uisupport/bufferviewfilter.cpp @@ -171,19 +171,17 @@ QVariant BufferViewFilter::foreground(const QModelIndex &index) const { QVariant otherActivity = s.value("otherActivityFG", QVariant(QColor(Qt::darkGreen))); if(!index.data(NetworkModel::ItemActiveRole).toBool()) - return inactiveActivity.value(); + return inactiveActivity; Buffer::ActivityLevel activity = (Buffer::ActivityLevel)index.data(NetworkModel::BufferActivityRole).toInt(); if(activity & Buffer::Highlight) - return highlightActivity.value(); + return highlightActivity; if(activity & Buffer::NewMessage) - return newMessageActivity.value(); + return newMessageActivity; if(activity & Buffer::OtherActivity) - return otherActivity.value(); - - return noActivity.value(); - - // FIXME:: make colors configurable; + return otherActivity; + + return noActivity; }