kick users out of games

This commit is contained in:
Max-Wilhelm Bruker 2011-03-03 17:05:44 +01:00
parent d6083a85c7
commit 731dfcad5c
13 changed files with 263 additions and 86 deletions

View file

@ -4,17 +4,34 @@
#include <QTreeWidget>
#include <QMap>
#include <QIcon>
#include <QStyledItemDelegate>
class ServerInfo_PlayerProperties;
class TabSupervisor;
class AbstractClient;
class TabGame;
class PlayerListItemDelegate : public QStyledItemDelegate {
public:
PlayerListItemDelegate(QObject *const parent);
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index);
};
class PlayerListWidget : public QTreeWidget {
Q_OBJECT
private:
PlayerListItemDelegate *itemDelegate;
QMap<int, QTreeWidgetItem *> players;
TabSupervisor *tabSupervisor;
AbstractClient *client;
TabGame *game;
bool gameCreator;
QIcon readyIcon, notReadyIcon, concededIcon, playerIcon, spectatorIcon;
bool gameStarted;
signals:
void openMessageDialog(const QString &userName, bool focus);
public:
PlayerListWidget(QWidget *parent = 0);
PlayerListWidget(TabSupervisor *_tabSupervisor, AbstractClient *_client, TabGame *_game, bool _gameCreator, QWidget *parent = 0);
void retranslateUi();
void addPlayer(ServerInfo_PlayerProperties *player);
void removePlayer(int playerId);
@ -22,6 +39,7 @@ public:
void updatePing(int playerId, int pingTime);
void updatePlayerProperties(ServerInfo_PlayerProperties *prop);
void setGameStarted(bool _gameStarted);
void showContextMenu(const QPoint &pos, const QModelIndex &index);
};
#endif