This commit is contained in:
Max-Wilhelm Bruker 2009-11-30 19:33:45 +01:00
parent 55482246dd
commit 59e9416f57
29 changed files with 332 additions and 187 deletions

View file

@ -103,19 +103,37 @@ void TabSupervisor::updatePingTime(int value, int max)
void TabSupervisor::gameJoined(Event_GameJoined *event)
{
TabGame *tab = new TabGame(client, event->getGameId(), event->getPlayerId(), event->getSpectator());
connect(tab, SIGNAL(gameClosing(TabGame *)), this, SLOT(gameLeft(TabGame *)));
addTab(tab, tr("Game %1").arg(event->getGameId()));
gameTabs.insert(event->getGameId(), tab);
setCurrentWidget(tab);
}
void TabSupervisor::gameLeft(TabGame *tab)
{
emit setMenu(0);
gameTabs.remove(tab->getGameId());
removeTab(indexOf(tab));
}
void TabSupervisor::addChatChannelTab(const QString &channelName)
{
TabChatChannel *tab = new TabChatChannel(client, channelName);
connect(tab, SIGNAL(channelClosing(TabChatChannel *)), this, SLOT(chatChannelLeft(TabChatChannel *)));
addTab(tab, channelName);
chatChannelTabs.insert(channelName, tab);
setCurrentWidget(tab);
}
void TabSupervisor::chatChannelLeft(TabChatChannel *tab)
{
emit setMenu(0);
chatChannelTabs.remove(tab->getChannelName());
removeTab(indexOf(tab));
}
void TabSupervisor::processChatEvent(ChatEvent *event)
{
TabChatChannel *tab = chatChannelTabs.value(event->getChannel(), 0);