Send notification to clients when a game in the lobby was started. Mark games as running in lobby dialog.

This commit is contained in:
lotodore
2007-09-29 20:20:01 +00:00
parent 43103d6fea
commit aaf4106c20
15 changed files with 72 additions and 18 deletions
@@ -209,8 +209,11 @@ void gameLobbyDialogImpl::updateGameItem(QTreeWidgetItem *item, unsigned gameId)
playerStr.sprintf("%u/%u", info.players.size(), info.data.maxNumberOfPlayers);
item->setData(1, Qt::DisplayRole, playerStr);
if (info.isPasswordProtected)
if (info.mode == GAME_MODE_STARTED)
item->setData(2, Qt::DisplayRole, "X");
if (info.isPasswordProtected)
item->setData(3, Qt::DisplayRole, "X");
}
void gameLobbyDialogImpl::addGame(unsigned gameId)
@@ -220,6 +223,19 @@ void gameLobbyDialogImpl::addGame(unsigned gameId)
updateGameItem(item, gameId);
}
void gameLobbyDialogImpl::updateGameMode(unsigned gameId, int /*newMode*/)
{
QTreeWidgetItemIterator it(treeWidget_GameList);
while (*it) {
if ((*it)->data(0, Qt::UserRole) == gameId)
{
updateGameItem(*it, gameId);
break;
}
++it;
}
}
void gameLobbyDialogImpl::removeGame(unsigned gameId)
{
QTreeWidgetItemIterator it(treeWidget_GameList);