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

139 lines
3.4 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;
2007-09-07 20:26:13 +00:00
class LobbyChat;
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();
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-08-20 21:23:03 +00:00
public slots:
void createGame();
void joinGame();
void joinAnyGame();
2007-08-20 21:23:03 +00:00
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);
void updateStats(ServerStats stats);
2007-10-17 22:27:11 +00:00
void refreshGameStats();
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 joinedNetworkGame(unsigned, QString, int);
void addConnectedPlayer(unsigned, QString, int);
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();
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);
2009-06-16 09:13:45 +00:00
void changeGameListSorting();
2009-06-14 22:56:49 +00:00
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;
2007-08-29 22:30:18 +00:00
bool isAdmin;
bool inGame;
2007-09-28 05:23:13 +00:00
LobbyChat *myChat;
2007-09-29 22:50:20 +00:00
QString myAppDataPath;
int keyUpCounter;
2007-10-18 20:10:01 +00:00
QMessageBox *waitStartGameMsgBox;
2007-10-16 23:07:59 +00:00
QTimer *waitStartGameMsgBoxTimer;
QStandardItemModel *myGameListModel;
QItemSelectionModel *myGameListSelectionModel;
2009-06-14 22:56:49 +00:00
MyGameListSortFilterProxyModel *myGameListSortFilterProxyModel;
2007-10-10 10:06:09 +00:00
protected:
bool eventFilter(QObject *obj, QEvent *event);
2007-08-20 21:23:03 +00:00
};
#endif