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;
|
2007-09-07 20:26:13 +00:00
|
|
|
class LobbyChat;
|
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 {
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2008-09-09 22:21:41 +00:00
|
|
|
gameLobbyDialogImpl(startWindowImpl *parent = 0, ConfigFile* = 0);
|
2007-08-21 12:34:33 +00:00
|
|
|
|
|
|
|
|
~gameLobbyDialogImpl();
|
2007-08-20 21:23:03 +00:00
|
|
|
|
|
|
|
|
void exec();
|
|
|
|
|
|
2007-09-30 16:19:44 +00:00
|
|
|
LobbyChat *getLobbyChat() { return myChat; }
|
|
|
|
|
|
2008-10-07 21:16:27 +00:00
|
|
|
void setSession(boost::shared_ptr<Session> session) { mySession = session; }
|
|
|
|
|
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-09-27 20:59:00 +00:00
|
|
|
|
2007-08-20 21:23:03 +00:00
|
|
|
public slots:
|
|
|
|
|
|
2007-08-21 12:34:33 +00:00
|
|
|
void createGame();
|
|
|
|
|
void joinGame();
|
2007-11-23 00:57:40 +00:00
|
|
|
void joinAnyGame();
|
2007-08-20 21:23:03 +00:00
|
|
|
|
2009-06-13 12:09:45 +00:00
|
|
|
void gameSelected(const QModelIndex &, const QModelIndex &);
|
|
|
|
|
void updateGameItem(QList <QStandardItem*>, unsigned gameId);
|
2007-08-21 17:27:13 +00:00
|
|
|
|
2007-09-04 12:44:11 +00:00
|
|
|
void addGame(unsigned gameId);
|
2007-09-29 20:20:01 +00:00
|
|
|
void updateGameMode(unsigned gameId, int newMode);
|
2007-10-12 14:32:25 +00:00
|
|
|
void updateGameAdmin(unsigned gameId, unsigned adminPlayerId);
|
2007-09-04 12:44:11 +00:00
|
|
|
void removeGame(unsigned gameId);
|
2007-09-02 16:36:52 +00:00
|
|
|
void gameAddPlayer(unsigned gameId, unsigned playerId);
|
|
|
|
|
void gameRemovePlayer(unsigned gameId, unsigned playerId);
|
2007-10-20 22:22:11 +00:00
|
|
|
|
|
|
|
|
void updateStats(ServerStats stats);
|
|
|
|
|
|
2007-10-17 22:27:11 +00:00
|
|
|
void refreshGameStats();
|
|
|
|
|
void refreshPlayerStats();
|
2007-08-21 12:34:33 +00:00
|
|
|
|
2007-08-22 20:03:19 +00:00
|
|
|
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();
|
2009-06-17 00:00:10 +00:00
|
|
|
void blinkingStartButtonAnimation();
|
|
|
|
|
|
2007-09-02 16:36:52 +00:00
|
|
|
void joinedNetworkGame(unsigned, QString, int);
|
|
|
|
|
void addConnectedPlayer(unsigned, QString, int);
|
|
|
|
|
void updatePlayer(unsigned, QString);
|
|
|
|
|
void removePlayer(unsigned, QString);
|
2007-10-03 13:36:47 +00:00
|
|
|
void newGameAdmin(unsigned, QString);
|
2007-09-02 16:36:52 +00:00
|
|
|
|
2007-11-01 12:21:34 +00:00
|
|
|
void refreshConnectedPlayerAvatars();
|
|
|
|
|
|
2007-09-05 19:14:34 +00:00
|
|
|
void playerSelected(QTreeWidgetItem*, QTreeWidgetItem*);
|
|
|
|
|
void refresh(int actionID);
|
2007-09-06 19:09:05 +00:00
|
|
|
void removedFromGame(int reason);
|
2007-09-05 19:14:34 +00:00
|
|
|
void startGame();
|
2007-09-06 19:09:05 +00:00
|
|
|
void leaveGame();
|
2007-09-05 19:14:34 +00:00
|
|
|
void kickPlayer();
|
|
|
|
|
|
2007-09-29 14:05:41 +00:00
|
|
|
void joinedGameDialogUpdate();
|
|
|
|
|
void leftGameDialogUpdate();
|
2007-10-03 09:37:02 +00:00
|
|
|
void updateDialogBlinds(const GameData &gameData);
|
2007-09-02 16:36:52 +00:00
|
|
|
void clearDialog();
|
2007-08-27 09:57:51 +00:00
|
|
|
|
2007-10-09 07:50:56 +00:00
|
|
|
void keyPressEvent(QKeyEvent * keyEvent);
|
|
|
|
|
bool event(QEvent * event);
|
2007-09-30 00:42:14 +00:00
|
|
|
void hideShowGameDescription(bool show);
|
2007-09-07 08:58:36 +00:00
|
|
|
|
2007-10-16 23:07:59 +00:00
|
|
|
void showWaitStartGameMsgBox();
|
|
|
|
|
|
2007-11-23 00:57:40 +00:00
|
|
|
void joinAnyGameButtonRefresh();
|
2009-01-11 22:36:43 +00:00
|
|
|
void reject();
|
|
|
|
|
void closeEvent(QCloseEvent *event);
|
2009-06-16 09:13:45 +00:00
|
|
|
void writeDialogSettings(int);
|
2009-01-11 22:36:43 +00:00
|
|
|
void readDialogSettings();
|
2009-06-14 22:56:49 +00:00
|
|
|
void changeGameListFilter(int);
|
2009-06-16 09:13:45 +00:00
|
|
|
void changeGameListSorting();
|
2009-06-14 22:56:49 +00:00
|
|
|
|
2007-08-21 12:34:33 +00:00
|
|
|
private:
|
2007-08-29 22:30:18 +00:00
|
|
|
|
2008-05-05 07:46:19 +00:00
|
|
|
gameTableImpl* myW;
|
2008-09-09 22:21:41 +00:00
|
|
|
startWindowImpl* myStartWindow;
|
2007-08-21 12:34:33 +00:00
|
|
|
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;
|
2007-08-22 20:03:19 +00:00
|
|
|
QString currentGameName;
|
2007-10-03 13:36:47 +00:00
|
|
|
unsigned myPlayerId;
|
2009-06-17 00:00:10 +00:00
|
|
|
unsigned myCurrentGameId;
|
2007-08-29 22:30:18 +00:00
|
|
|
bool isAdmin;
|
2007-09-29 14:05:41 +00:00
|
|
|
bool inGame;
|
2009-06-17 00:00:10 +00:00
|
|
|
|
2007-09-29 22:50:20 +00:00
|
|
|
QString myAppDataPath;
|
2007-10-09 07:50:56 +00:00
|
|
|
int keyUpCounter;
|
2007-10-18 20:10:01 +00:00
|
|
|
QMessageBox *waitStartGameMsgBox;
|
2007-10-16 23:07:59 +00:00
|
|
|
QTimer *waitStartGameMsgBoxTimer;
|
2009-06-17 00:00:10 +00:00
|
|
|
QTimer *blinkingButtonAnimationTimer;
|
|
|
|
|
bool blinkingButtonAnimationState;
|
|
|
|
|
QColor defaultStartButtonColor;
|
|
|
|
|
QColor defaultStartButtonTextColor;
|
|
|
|
|
LobbyChat *myChat;
|
2009-06-13 12:09:45 +00:00
|
|
|
QStandardItemModel *myGameListModel;
|
|
|
|
|
QItemSelectionModel *myGameListSelectionModel;
|
2009-06-14 22:56:49 +00:00
|
|
|
MyGameListSortFilterProxyModel *myGameListSortFilterProxyModel;
|
2009-06-17 00:00:10 +00:00
|
|
|
|
2007-10-10 10:06:09 +00:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
bool eventFilter(QObject *obj, QEvent *event);
|
2007-10-09 07:50:56 +00:00
|
|
|
|
2007-08-20 21:23:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|