Files
pokerth/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h
T

183 lines
4.9 KiB
C++
Raw Normal View History

2007-08-20 21:23:03 +00:00
//
// C++ Interface: gamelobbydialogimpl
//
// Description:
2007-08-20 21:23:03 +00:00
//
//
// Author: FThauer FHammer <webmaster@pokerth.net>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef GAMELOBBYDIALOGIMPL_H
#define GAMELOBBYDIALOGIMPL_H
#include <ui_gamelobbydialog.h>
#include <QtGui>
#include <QtCore>
#include <iostream>
2007-10-03 09:37:02 +00:00
#include <gamedata.h>
2007-08-21 23:31:09 +00:00
#include "createinternetgamedialogimpl.h"
2007-08-29 22:30:18 +00:00
#include "sdlplayer.h"
2008-05-05 07:46:19 +00:00
#include "gametableimpl.h"
2007-08-29 22:30:18 +00:00
class Session;
class ConfigFile;
2009-08-17 23:20:58 +00:00
class ChatTools;
class startWindowImpl;
2009-06-14 22:56:49 +00:00
class MyGameListSortFilterProxyModel;
class MyNickListSortFilterProxyModel;
2007-08-20 21:23:03 +00:00
/**
@author FThauer FHammer <webmaster@pokerth.net>
*/
2009-06-14 22:56:49 +00:00
class gameLobbyDialogImpl: public QDialog, public Ui::gameLobbyDialog
{
Q_OBJECT
2007-08-20 21:23:03 +00:00
public:
gameLobbyDialogImpl(startWindowImpl *parent = 0, ConfigFile* = 0);
~gameLobbyDialogImpl();
2007-08-20 21:23:03 +00:00
void exec();
2007-08-20 21:23:03 +00:00
ChatTools *getMyChat() {
return myChat;
}
void setSession(boost::shared_ptr<Session> session);
boost::shared_ptr<Session> getSession() {
assert(mySession.get());
return mySession;
}
2007-09-07 20:26:13 +00:00
void setMyW ( gameTableImpl* theValue ) {
myW = theValue;
}
2007-08-20 21:23:03 +00:00
public slots:
void createGame();
void joinGame();
void joinAnyGame();
void gameSelected(const QModelIndex &);
void updateGameItem(QList <QStandardItem*>, unsigned gameId);
void addGame(unsigned gameId);
void updateGameMode(unsigned gameId, int newMode);
void updateGameAdmin(unsigned gameId, unsigned adminPlayerId);
void removeGame(unsigned gameId);
void gameAddPlayer(unsigned gameId, unsigned playerId);
void gameRemovePlayer(unsigned gameId, unsigned playerId);
void playerJoinedLobby(unsigned playerId, QString playerName);
void playerLeftLobby(unsigned playerId);
void updateStats(ServerStats stats);
void refreshGameStats();
void refreshPlayerStats();
void setCurrentGameName ( const QString& theValue ) {
currentGameName = theValue;
}
QString getCurrentGameName() const {
return currentGameName;
}
gameTableImpl* getMyW() const {
return myW;
}
void checkPlayerQuantity();
void blinkingStartButtonAnimation();
void joinedNetworkGame(unsigned, QString, bool);
void addConnectedPlayer(unsigned, QString, bool);
void updatePlayer(unsigned, QString);
void removePlayer(unsigned, QString);
void newGameAdmin(unsigned, QString);
void refreshConnectedPlayerAvatars();
void playerSelected(QTreeWidgetItem*, QTreeWidgetItem*);
void refresh(int actionID);
void removedFromGame(int reason);
void startGame();
void leaveGame();
void kickPlayer();
void joinedGameDialogUpdate();
void leftGameDialogUpdate();
void updateDialogBlinds(const GameData &gameData);
void clearDialog();
void keyPressEvent(QKeyEvent * keyEvent);
bool event(QEvent * event);
void showGameDescription(bool show);
void showWaitStartGameMsgBox();
void joinAnyGameButtonRefresh();
void reject();
void closeEvent(QCloseEvent *event);
void writeDialogSettings(int);
void readDialogSettings();
void changeGameListFilter(int);
void changeNickListFilter(int);
void changeGameListSorting();
void registeredUserMode();
void guestUserMode();
void showNickListContextMenu(QPoint);
void invitePlayerToCurrentGame();
void showInfoMsgBox();
void showInvitationDialog(unsigned gameId, unsigned playerIdFrom);
void chatInfoPlayerInvitation(unsigned gameId, unsigned playerIdWho, unsigned playerIdFrom);
void chatInfoPlayerRejectedInvitation(unsigned gameId, unsigned playerIdWho, DenyGameInvitationReason reason);
void putPlayerOnIgnoreList();
bool playerIsOnIgnoreList(unsigned playerid);
void searchForPlayerRegExpChanged();
void showAutoStartTimer();
void updateAutoStartTimer();
private:
gameTableImpl* myW;
startWindowImpl* myStartWindow;
ConfigFile *myConfig;
boost::shared_ptr<Session> mySession;
createInternetGameDialogImpl *myCreateInternetGameDialog;
QString currentGameName;
unsigned myPlayerId;
bool isGameAdministrator;
bool inGame;
bool guestMode;
2010-03-30 12:25:30 +00:00
QString myAppDataPath;
QMessageBox *waitStartGameMsgBox;
QTimer *waitStartGameMsgBoxTimer;
QTimer *blinkingButtonAnimationTimer;
QTimer *showInfoMsgBoxTimer;
QTimer *autoStartTimer;
bool blinkingButtonAnimationState;
QColor defaultStartButtonColor;
QColor defaultStartButtonTextColor;
QColor disabledStartButtonColor;
QColor disabledStartButtonTextColor;
ChatTools *myChat;
int keyUpCounter;
QStandardItemModel *myGameListModel;
QItemSelectionModel *myGameListSelectionModel;
MyGameListSortFilterProxyModel *myGameListSortFilterProxyModel;
QMenu *nickListContextMenu;
QAction *nickListInviteAction;
QAction *nickListIgnorePlayerAction;
QMenu *nickListPlayerInfoSubMenu;
QAction *nickListPlayerInGameInfo;
int infoMsgToShowId;
int currentInvitationGameId;
bool inviteDialogIsCurrentlyShown;
2010-03-30 12:25:30 +00:00
QStandardItemModel *myNickListModel;
QItemSelectionModel *myNickListSelectionModel;
MyNickListSortFilterProxyModel *myNickListSortFilterProxyModel;
2010-03-30 12:25:30 +00:00
QLabel *autoStartTimerOverlay;
int autoStartTimerCounter;
2010-03-30 12:25:30 +00:00
protected:
bool eventFilter(QObject *obj, QEvent *event);
2007-10-10 10:06:09 +00:00
2007-08-20 21:23:03 +00:00
};
#endif