X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fnetworkmodel.cpp;h=a72b71e9e942b55ceb84bc993319649b3e5ecf95;hb=e8903b1f19c183a537d7b31b7fd709dde1a69ef5;hp=05340a36becd126398b10aea92ef9d0d0a217df2;hpb=bd1a18355495899b5ce3003599a67e1ea7ca01cc;p=quassel.git diff --git a/src/client/networkmodel.cpp b/src/client/networkmodel.cpp index 05340a36..a72b71e9 100644 --- a/src/client/networkmodel.cpp +++ b/src/client/networkmodel.cpp @@ -282,6 +282,37 @@ void BufferItem::userModeChanged(IrcUser *ircUser) { addUserToCategory(ircUser); } +QString BufferItem::toolTip(int column) const { + Q_UNUSED(column); + QStringList toolTip; + + switch(bufferType()) { + case BufferInfo::StatusBuffer: { + QString netName = Client::network(bufferInfo().networkId())->networkName(); + toolTip.append(QString("Status buffer from %1").arg(netName)); + break; + } + case BufferInfo::ChannelBuffer: + toolTip.append(QString("Channel %1").arg(bufferName())); + if(isActive()) { + toolTip.append(QString("Topic: %1").arg(topic())); + toolTip.append(QString("Users: %1").arg(nickCount())); + } else { + toolTip.append(QString("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())); + break; + default: //this should not happen + toolTip.append(QString("%1 - %2").arg(bufferInfo().bufferId().toInt()).arg(bufferName())); + break; + } + + return QString("

%1

").arg(toolTip.join("
")); +} + /* void BufferItem::setLastMsgInsert(QDateTime msgDate) { if(msgDate.isValid() && msgDate > _lastMsgInsert) @@ -405,6 +436,18 @@ void NetworkItem::setCurrentServer(const QString &serverName) { emit dataChanged(1); } + +QString NetworkItem::toolTip(int column) const { + Q_UNUSED(column); + + QStringList toolTip(QString("%1").arg(networkName())); + toolTip.append(QString("Server: %1").arg(currentServer())); + toolTip.append(QString("Users: %1").arg(nickCount())); + + return QString("

%1

").arg(toolTip.join("
")); +} + + /***************************************** * User Category Items (like @vh etc.) *****************************************/ @@ -484,6 +527,8 @@ IrcUserItem::IrcUserItem(IrcUser *ircUser, AbstractTreeItem *parent) connect(ircUser, SIGNAL(nickSet(QString)), this, SLOT(setNick(QString))); + connect(ircUser, SIGNAL(awaySet(bool)), + this, SLOT(setAway(bool))); } QString IrcUserItem::nickName() const { @@ -567,6 +612,11 @@ void IrcUserItem::setNick(QString newNick) { emit dataChanged(0); } +void IrcUserItem::setAway(bool away) { + Q_UNUSED(away); + emit dataChanged(0); +} + /***************************************** * NetworkModel *****************************************/