BeRo refactoring
This commit is contained in:
@@ -520,6 +520,8 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
|
||||
myCreateNetworkGameDialog = new createNetworkGameDialogImpl(this, myConfig);
|
||||
myAboutPokerthDialog = new aboutPokerthImpl(this);
|
||||
|
||||
myStartNetworkGameDialog->setMyW(this);
|
||||
|
||||
// //ShortCuts
|
||||
// QShortcut *quitPokerTHKeys = new QShortcut(QKeySequence(Qt::Key_Control + Qt::Key_Q), this);
|
||||
// connect( quitPokerTHKeys, SIGNAL(activated() ), actionQuit, SLOT( trigger() ) );
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <net/socket_msg.h>
|
||||
|
||||
startNetworkGameDialogImpl::startNetworkGameDialogImpl(QWidget *parent, ConfigFile *config)
|
||||
: QDialog(parent), myConfig(config), isAdmin(false)
|
||||
: QDialog(parent), myConfig(config), isAdmin(false), myW(0)
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
@@ -64,6 +64,8 @@ void startNetworkGameDialogImpl::addConnectedPlayer(QString playerName, int righ
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget,0);
|
||||
item->setData(0, 0, playerName);
|
||||
|
||||
// myW->getMySDLPlayer()->playSound("call", 0);
|
||||
|
||||
checkPlayerQuantity();
|
||||
}
|
||||
|
||||
@@ -104,11 +106,16 @@ void startNetworkGameDialogImpl::kickPlayer() {
|
||||
|
||||
void startNetworkGameDialogImpl::checkPlayerQuantity() {
|
||||
|
||||
if (treeWidget->topLevelItemCount() >= 2 && isAdmin)
|
||||
if (treeWidget->topLevelItemCount() >= 2 && isAdmin) {
|
||||
pushButton_startGame->setEnabled(TRUE);
|
||||
else
|
||||
}
|
||||
else {
|
||||
pushButton_startGame->setEnabled(FALSE);
|
||||
|
||||
}
|
||||
|
||||
if(treeWidget->topLevelItemCount() == maxPlayerNumber) {
|
||||
// myW->getMySDLPlayer()->playSound("raise", 0);
|
||||
}
|
||||
}
|
||||
|
||||
void startNetworkGameDialogImpl::setSession(Session *session)
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
#include <QtGui>
|
||||
#include <QtCore>
|
||||
#include "sdlplayer.h"
|
||||
#include "mainwindowimpl.h"
|
||||
|
||||
class Session;
|
||||
class ConfigFile;
|
||||
@@ -35,6 +37,9 @@ public:
|
||||
|
||||
public slots:
|
||||
|
||||
void setMyW ( mainWindowImpl* theValue ) { myW = theValue; }
|
||||
|
||||
|
||||
void startGame();
|
||||
void cancel();
|
||||
void refresh(int actionID);
|
||||
@@ -55,6 +60,7 @@ public slots:
|
||||
|
||||
private:
|
||||
|
||||
mainWindowImpl* myW;
|
||||
int maxPlayerNumber;
|
||||
bool isAdmin;
|
||||
ConfigFile *myConfig;
|
||||
|
||||
Reference in New Issue
Block a user