/*
this is actually fugly! :) - EgS
if anyone else wonders what this does: it takes the TreeItem related to the buffer out of the parents child list
- there for we need to know the childs index
+ therefore we need to know the childs index
*/
QTreeWidgetItem *item = bufitems[b]->parent()->takeChild(bufitems[b]->parent()->indexOfChild(bufitems[b]));
delete item;
}
}
+void NetworkView::bufferActivity(uint level, Buffer *b) {
+ QColor c;
+ if(bufitems.contains(b) and b != currentBuffer) {
+ if(level & Highlight) {
+ c = QColor(Qt::red);
+ } else if(level & NewMessage) {
+ c = QColor(Qt::darkYellow);
+ } else if(level & OtherActivity) {
+ c = QColor(Qt::darkGreen);
+ }
+ bufitems[b]->setForeground(0, c);
+ }
+}
+
+void NetworkView::clearActivity(Buffer *b) {
+ QColor c;
+ // it should be sane not to check if b is in bufitems since we just checked before calling this function
+ if(b->isActive()) {
+ c = QColor(Qt::black);
+ } else {
+ c = QColor(Qt::gray);
+ }
+ bufitems[b]->setForeground(0, c);
+}
+
bool NetworkView::shouldShow(Buffer *b) {
// bool f = false;
if((mode & NoActive) && b->isActive()) return false;
foreach(QTreeWidgetItem *i, sel) { if(i != item) i->setSelected(false); }
if(item) {
item->setSelected(true);
+ clearActivity(b);
currentBuffer = b;
} else {
currentBuffer = 0;