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

154 lines
4.6 KiB
C++
Raw Normal View History

2007-08-20 21:23:03 +00:00
//
// C++ Interface: gamelobbydialogimpl
//
// Description:
//
//
// 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;
2007-08-20 21:23:03 +00:00
/**
@author FThauer FHammer <webmaster@pokerth.net>
*/
2009-06-14 22:56:49 +00:00
2007-08-20 21:23:03 +00:00
class gameLobbyDialogImpl: public QDialog, public Ui::gameLobbyDialog {
Q_OBJECT
public:
gameLobbyDialogImpl(startWindowImpl *parent = 0, ConfigFile* = 0);
~gameLobbyDialogImpl();
2007-08-20 21:23:03 +00:00
void exec();
2009-08-17 23:20:58 +00:00
ChatTools *getMyChat() { return myChat; }
2009-08-18 00:46:18 +00:00
void setSession(boost::shared_ptr<Session> session);
2008-10-07 21:16:27 +00:00
boost::shared_ptr<Session> getSession() { assert(mySession.get()); return mySession; }
2007-09-07 20:26:13 +00:00
2008-05-05 07:46:19 +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 &, 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);
2009-08-17 23:20:58 +00:00
void playerJoinedLobby(unsigned playerId, QString playerName);
void playerLeftLobby(unsigned playerId);
void updateStats(ServerStats stats);
2010-03-27 21:55:34 +00:00
void refreshGameStats();
2007-10-17 22:27:11 +00:00
void refreshPlayerStats();
void setCurrentGameName ( const QString& theValue ) { currentGameName = theValue; }
QString getCurrentGameName() const { return currentGameName; }
2008-05-05 07:46:19 +00:00
gameTableImpl* getMyW() const { return myW; }
2007-08-29 22:30:18 +00:00
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();
2007-10-03 09:37:02 +00:00
void updateDialogBlinds(const GameData &gameData);
void clearDialog();
void keyPressEvent(QKeyEvent * keyEvent);
bool event(QEvent * event);
2007-09-30 00:42:14 +00:00
void hideShowGameDescription(bool show);
2007-10-16 23:07:59 +00:00
void showWaitStartGameMsgBox();
2010-03-27 21:55:34 +00:00
void joinAnyGameButtonRefresh();
void reject();
void closeEvent(QCloseEvent *event);
2009-06-16 09:13:45 +00:00
void writeDialogSettings(int);
void readDialogSettings();
2009-06-14 22:56:49 +00:00
void changeGameListFilter(int);
2010-03-27 21:55:34 +00:00
void changeGameListSorting();
void registeredUserMode();
void guestUserMode();
2010-03-27 21:55:34 +00:00
void showNickListContextMenu(QPoint);
void invitePlayerToCurrentGame();
void showInfoMsgBox();
2010-03-29 13:08:59 +00:00
void showInvitationDialog(unsigned gameId, unsigned playerIdFrom);
void chatInfoPlayerInviation(unsigned gameId, unsigned playerIdWho, unsigned playerIdFrom);
void chatInfoPlayerRejectedInviation(unsigned gameId, unsigned playerIdWho, DenyGameInvitationReason reason);
private:
2007-08-29 22:30:18 +00:00
2008-05-05 07:46:19 +00:00
gameTableImpl* myW;
startWindowImpl* myStartWindow;
ConfigFile *myConfig;
2008-10-07 21:16:27 +00:00
boost::shared_ptr<Session> mySession;
2007-08-21 23:31:09 +00:00
createInternetGameDialogImpl *myCreateInternetGameDialog;
QString currentGameName;
unsigned myPlayerId;
unsigned myCurrentGameId;
bool isGameAdministrator;
bool inGame;
bool guestMode;
2007-09-29 22:50:20 +00:00
QString myAppDataPath;
2007-10-18 20:10:01 +00:00
QMessageBox *waitStartGameMsgBox;
2007-10-16 23:07:59 +00:00
QTimer *waitStartGameMsgBoxTimer;
QTimer *blinkingButtonAnimationTimer;
QTimer *showInfoMsgBoxTimer;
bool blinkingButtonAnimationState;
QColor defaultStartButtonColor;
QColor defaultStartButtonTextColor;
2009-06-19 21:58:35 +00:00
QColor disabledStartButtonColor;
QColor disabledStartButtonTextColor;
2009-08-17 23:20:58 +00:00
ChatTools *myChat;
int keyUpCounter;
QStandardItemModel *myGameListModel;
QItemSelectionModel *myGameListSelectionModel;
2009-06-14 22:56:49 +00:00
MyGameListSortFilterProxyModel *myGameListSortFilterProxyModel;
2010-03-27 21:55:34 +00:00
QMenu *nickListContextMenu;
QAction *nickListInviteAction;
2010-03-29 13:08:59 +00:00
QAction *ignorePlayerAction;
int infoMsgToShowId;
2010-03-29 13:08:59 +00:00
int currentInvitationGameId;
bool inviteDialogIsCurrentlyShown;
2007-10-10 10:06:09 +00:00
protected:
bool eventFilter(QObject *obj, QEvent *event);
2007-08-20 21:23:03 +00:00
};
#endif