mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-24 08:50:10 -05:00
Show gray icons for not subscribed lobbies.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6693 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
65e7ad0e5b
commit
04e543a154
@ -351,17 +351,26 @@ void ChatLobbyWidget::updateDisplay()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item == NULL) {
|
|
||||||
item = new RSTreeWidgetItem(compareRole, TYPE_LOBBY);
|
|
||||||
item->setIcon(COLUMN_NAME, (lobby_item == publicLobbyItem) ? QIcon(IMAGE_PUBLIC) : QIcon(IMAGE_PRIVATE));
|
|
||||||
lobby_item->addChild(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool subscribed = false;
|
bool subscribed = false;
|
||||||
if (rsMsgs->getVirtualPeerId(lobby.lobby_id, vpid)) {
|
if (rsMsgs->getVirtualPeerId(lobby.lobby_id, vpid)) {
|
||||||
subscribed = true;
|
subscribed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QIcon icon;
|
||||||
|
if (item == NULL) {
|
||||||
|
item = new RSTreeWidgetItem(compareRole, TYPE_LOBBY);
|
||||||
|
icon = (lobby_item == publicLobbyItem) ? QIcon(IMAGE_PUBLIC) : QIcon(IMAGE_PRIVATE);
|
||||||
|
lobby_item->addChild(item);
|
||||||
|
} else {
|
||||||
|
if (item->data(COLUMN_DATA, ROLE_SUBSCRIBED).toBool() != subscribed) {
|
||||||
|
// Replace icon
|
||||||
|
icon = (lobby_item == publicLobbyItem) ? QIcon(IMAGE_PUBLIC) : QIcon(IMAGE_PRIVATE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!icon.isNull()) {
|
||||||
|
item->setIcon(COLUMN_NAME, subscribed ? icon : icon.pixmap(lobbyTreeWidget->iconSize(), QIcon::Disabled));
|
||||||
|
}
|
||||||
|
|
||||||
bool autoSubscribe = rsMsgs->getLobbyAutoSubscribe(lobby.lobby_id);
|
bool autoSubscribe = rsMsgs->getLobbyAutoSubscribe(lobby.lobby_id);
|
||||||
|
|
||||||
if (autoSubscribe && subscribed)
|
if (autoSubscribe && subscribed)
|
||||||
@ -412,10 +421,19 @@ void ChatLobbyWidget::updateDisplay()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QIcon icon;
|
||||||
if (item == NULL) {
|
if (item == NULL) {
|
||||||
item = new RSTreeWidgetItem(compareRole, TYPE_LOBBY);
|
item = new RSTreeWidgetItem(compareRole, TYPE_LOBBY);
|
||||||
item->setIcon(COLUMN_NAME, (itemParent == publicLobbyItem) ? QIcon(IMAGE_PUBLIC) : QIcon(IMAGE_PRIVATE));
|
icon = (itemParent == publicLobbyItem) ? QIcon(IMAGE_PUBLIC) : QIcon(IMAGE_PRIVATE);
|
||||||
itemParent->addChild(item);
|
itemParent->addChild(item);
|
||||||
|
} else {
|
||||||
|
if (!item->data(COLUMN_DATA, ROLE_SUBSCRIBED).toBool()) {
|
||||||
|
// Replace icon
|
||||||
|
icon = (itemParent == publicLobbyItem) ? QIcon(IMAGE_PUBLIC) : QIcon(IMAGE_PRIVATE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!icon.isNull()) {
|
||||||
|
item->setIcon(COLUMN_NAME, icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool autoSubscribe = rsMsgs->getLobbyAutoSubscribe(lobby.lobby_id);
|
bool autoSubscribe = rsMsgs->getLobbyAutoSubscribe(lobby.lobby_id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user