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>
|
|
|
|
|
|
2007-09-07 08:58:36 +00:00
|
|
|
#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
|
|
|
|
2007-08-21 12:34:33 +00:00
|
|
|
class Session;
|
|
|
|
|
class ConfigFile;
|
2009-08-17 23:20:58 +00:00
|
|
|
class ChatTools;
|
2008-09-09 22:21:41 +00:00
|
|
|
class startWindowImpl;
|
2009-06-14 22:56:49 +00:00
|
|
|
class MyGameListSortFilterProxyModel;
|
2007-08-21 12:34:33 +00:00
|
|
|
|
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 {
|
2010-03-30 12:25:30 +00:00
|
|
|
Q_OBJECT
|
2007-08-20 21:23:03 +00:00
|
|
|
public:
|
2010-03-30 12:25:30 +00:00
|
|
|
gameLobbyDialogImpl(startWindowImpl *parent = 0, ConfigFile* = 0);
|
2007-08-21 12:34:33 +00:00
|
|
|
|
2010-03-30 12:25:30 +00:00
|
|
|
~gameLobbyDialogImpl();
|
2007-08-20 21:23:03 +00:00
|
|
|
|
2010-03-30 12:25:30 +00:00
|
|
|
void exec();
|
2007-08-20 21:23:03 +00:00
|
|
|
|
2010-03-30 12:25:30 +00:00
|
|
|
ChatTools *getMyChat() { return myChat; }
|
2007-09-30 16:19:44 +00:00
|
|
|
|
2010-03-30 12:25:30 +00:00
|
|
|
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
|
|
|
|
2010-03-30 12:25:30 +00:00
|
|
|
void setMyW ( gameTableImpl* theValue ) { myW = theValue; }
|
2007-09-27 20:59:00 +00:00
|
|
|
|
2007-08-20 21:23:03 +00:00
|
|
|
public slots:
|
|
|
|
|
|
2010-03-30 12:25:30 +00:00
|
|
|
void createGame();
|
|
|
|
|
void joinGame();
|
|
|
|
|
void joinAnyGame();
|
2010-03-31 12:33:00 +00:00
|
|
|
void gameSelected(const QModelIndex &);
|
2010-03-30 12:25:30 +00:00
|
|
|
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);
|
2010-03-31 12:33:00 +00:00
|
|
|
void showGameDescription(bool show);
|
2010-03-30 12:25:30 +00:00
|
|
|
void showWaitStartGameMsgBox();
|
|
|
|
|
void joinAnyGameButtonRefresh();
|
|
|
|
|
void reject();
|
|
|
|
|
void closeEvent(QCloseEvent *event);
|
|
|
|
|
void writeDialogSettings(int);
|
|
|
|
|
void readDialogSettings();
|
|
|
|
|
void changeGameListFilter(int);
|
|
|
|
|
void changeGameListSorting();
|
|
|
|
|
void registeredUserMode();
|
|
|
|
|
void guestUserMode();
|
|
|
|
|
void showNickListContextMenu(QPoint);
|
|
|
|
|
void invitePlayerToCurrentGame();
|
|
|
|
|
void showInfoMsgBox();
|
|
|
|
|
void showInvitationDialog(unsigned gameId, unsigned playerIdFrom);
|
2010-03-30 17:30:33 +00:00
|
|
|
void chatInfoPlayerInvitation(unsigned gameId, unsigned playerIdWho, unsigned playerIdFrom);
|
|
|
|
|
void chatInfoPlayerRejectedInvitation(unsigned gameId, unsigned playerIdWho, DenyGameInvitationReason reason);
|
2010-03-30 19:38:14 +00:00
|
|
|
void putPlayerOnIgnoreList();
|
2010-03-30 17:30:33 +00:00
|
|
|
bool playerIsOnIgnoreList(unsigned playerid);
|
2010-01-05 12:53:37 +00:00
|
|
|
|
2007-08-21 12:34:33 +00:00
|
|
|
private:
|
2009-06-17 00:00:10 +00:00
|
|
|
|
2010-03-30 12:25:30 +00:00
|
|
|
gameTableImpl* myW;
|
|
|
|
|
startWindowImpl* myStartWindow;
|
|
|
|
|
ConfigFile *myConfig;
|
|
|
|
|
boost::shared_ptr<Session> mySession;
|
|
|
|
|
createInternetGameDialogImpl *myCreateInternetGameDialog;
|
|
|
|
|
QString currentGameName;
|
|
|
|
|
unsigned myPlayerId;
|
|
|
|
|
bool isGameAdministrator;
|
|
|
|
|
bool inGame;
|
|
|
|
|
bool guestMode;
|
|
|
|
|
|
|
|
|
|
QString myAppDataPath;
|
|
|
|
|
QMessageBox *waitStartGameMsgBox;
|
|
|
|
|
QTimer *waitStartGameMsgBoxTimer;
|
|
|
|
|
QTimer *blinkingButtonAnimationTimer;
|
|
|
|
|
QTimer *showInfoMsgBoxTimer;
|
|
|
|
|
bool blinkingButtonAnimationState;
|
|
|
|
|
QColor defaultStartButtonColor;
|
|
|
|
|
QColor defaultStartButtonTextColor;
|
|
|
|
|
QColor disabledStartButtonColor;
|
|
|
|
|
QColor disabledStartButtonTextColor;
|
|
|
|
|
ChatTools *myChat;
|
|
|
|
|
int keyUpCounter;
|
|
|
|
|
QStandardItemModel *myGameListModel;
|
|
|
|
|
QItemSelectionModel *myGameListSelectionModel;
|
|
|
|
|
MyGameListSortFilterProxyModel *myGameListSortFilterProxyModel;
|
|
|
|
|
QMenu *nickListContextMenu;
|
|
|
|
|
QAction *nickListInviteAction;
|
2010-03-30 17:30:33 +00:00
|
|
|
QAction *nickListIgnorePlayerAction;
|
2010-07-15 12:05:09 +00:00
|
|
|
QMenu *nickListPlayerInfoSubMenu;
|
2010-07-15 10:55:09 +00:00
|
|
|
QAction *nickListPlayerInGameInfo;
|
2010-03-30 12:25:30 +00:00
|
|
|
int infoMsgToShowId;
|
|
|
|
|
int currentInvitationGameId;
|
|
|
|
|
bool inviteDialogIsCurrentlyShown;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
bool eventFilter(QObject *obj, QEvent *event);
|
2007-10-10 10:06:09 +00:00
|
|
|
|
2007-08-20 21:23:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|