mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-25 08:03:54 -07:00
kick users out of games
This commit is contained in:
parent
d6083a85c7
commit
731dfcad5c
13 changed files with 263 additions and 86 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue