initial commit for deck repository tab

This commit is contained in:
Max-Wilhelm Bruker 2009-11-19 17:12:44 +01:00
parent c0e64f3f42
commit f31405743e
12 changed files with 1047 additions and 10 deletions

View file

@ -3,10 +3,11 @@
#include "tab_server.h"
#include "tab_chatchannel.h"
#include "tab_game.h"
#include "tab_deck_storage.h"
#include "protocol_items.h"
TabSupervisor:: TabSupervisor(QWidget *parent)
: QTabWidget(parent), client(0), tabServer(0)
: QTabWidget(parent), client(0), tabServer(0), tabDeckStorage(0)
{
}
@ -15,6 +16,8 @@ void TabSupervisor::retranslateUi()
{
if (tabServer)
setTabText(0, tr("Server"));
if (tabDeckStorage)
setTabText(1, tr("Deck storage"));
}
void TabSupervisor::start(Client *_client)
@ -27,8 +30,10 @@ void TabSupervisor::start(Client *_client)
tabServer = new TabServer(client);
connect(tabServer, SIGNAL(gameJoined(int)), this, SLOT(addGameTab(int)));
connect(tabServer, SIGNAL(chatChannelJoined(const QString &)), this, SLOT(addChatChannelTab(const QString &)));
addTab(tabServer, QString());
tabDeckStorage = new TabDeckStorage(client);
addTab(tabDeckStorage, QString());
retranslateUi();
}
@ -45,6 +50,9 @@ void TabSupervisor::stop()
delete tabServer;
tabServer = 0;
delete tabDeckStorage;
tabDeckStorage = 0;
QMapIterator<QString, TabChatChannel *> chatChannelIterator(chatChannelTabs);
while (chatChannelIterator.hasNext())
delete chatChannelIterator.next().value();