Cockatrice/cockatrice/src/gameselector.h
ebbit1q c874f201c3 add a bunch of parents to dialogs (#3658)
* add a bunch of parents to dialogs

works on #3651

* use game as parent instead

* add more parents

* fix create token dialog modality

* add parent to game information window

* replace a bunch of nullptrs with the magic of sed

* add parent to tip of the day and counters

* reorder game ptr

* set parent for life counter

* clangify
2019-03-26 14:54:47 -04:00

55 lines
1.4 KiB
C++

#ifndef GAMESELECTOR_H
#define GAMESELECTOR_H
#include "gametypemap.h"
#include <QGroupBox>
class QTreeView;
class GamesModel;
class GamesProxyModel;
class QPushButton;
class QCheckBox;
class AbstractClient;
class TabSupervisor;
class TabRoom;
class ServerInfo_Game;
class Response;
class GameSelector : public QGroupBox
{
Q_OBJECT
private slots:
void actSetFilter();
void actClearFilter();
void actCreate();
void actJoin();
void actSelectedGameChanged(const QModelIndex &current, const QModelIndex &previous);
void checkResponse(const Response &response);
signals:
void gameJoined(int gameId);
private:
AbstractClient *client;
const TabSupervisor *tabSupervisor;
TabRoom *room;
QTreeView *gameListView;
GamesModel *gameListModel;
GamesProxyModel *gameListProxyModel;
QPushButton *filterButton, *clearFilterButton, *createButton, *joinButton, *spectateButton;
GameTypeMap gameTypeMap;
public:
GameSelector(AbstractClient *_client,
const TabSupervisor *_tabSupervisor,
TabRoom *_room,
const QMap<int, QString> &_rooms,
const QMap<int, GameTypeMap> &_gameTypes,
const bool restoresettings,
const bool showfilters,
QWidget *parent = nullptr);
void retranslateUi();
void processGameInfo(const ServerInfo_Game &info);
};
#endif