session refactoring
This commit is contained in:
@@ -2935,7 +2935,7 @@ void gameTableImpl::showMaximized () {
|
||||
|
||||
void gameTableImpl::closeGameTable() {
|
||||
|
||||
if (myServerGuiInterface.get() && myServerGuiInterface->getSession()->isNetworkServerRunning()) {
|
||||
if (myStartWindow->getMyServerGuiInterface().get() && myStartWindow->getMyServerGuiInterface()->getSession()->isNetworkServerRunning()) {
|
||||
|
||||
QMessageBox msgBox(QMessageBox::Warning, tr("Closing PokerTH during network game"),
|
||||
tr("You are the hosting server. Do you want to close PokerTH anyway?"), QMessageBox::Yes | QMessageBox::No, this);
|
||||
@@ -2943,7 +2943,7 @@ void gameTableImpl::closeGameTable() {
|
||||
if (msgBox.exec() == QMessageBox::Yes ) {
|
||||
myStartWindow->getSession()->terminateNetworkClient();
|
||||
stopTimer();
|
||||
if (myServerGuiInterface.get()) myServerGuiInterface->getSession()->terminateNetworkServer();
|
||||
if (myStartWindow->getMyServerGuiInterface().get()) myStartWindow->getMyServerGuiInterface()->getSession()->terminateNetworkServer();
|
||||
myStartWindow->show();
|
||||
this->hide();
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ GuiWrapper::~GuiWrapper()
|
||||
void GuiWrapper::initGui(int speed) { myW->signalInitGui(speed); }
|
||||
|
||||
boost::shared_ptr<Session> GuiWrapper::getSession() { return myStartWindow->getSession(); }
|
||||
void GuiWrapper::setSession(boost::shared_ptr<Session> session) { /*myStartWindow->setSession(session);*/ }
|
||||
void GuiWrapper::setSession(boost::shared_ptr<Session> /*session*/) { /*myStartWindow->setSession(session);*/ }
|
||||
|
||||
void GuiWrapper::refreshSet() const { myW->signalRefreshSet(); }
|
||||
void GuiWrapper::refreshCash() const { myW->signalRefreshCash(); }
|
||||
|
||||
@@ -51,7 +51,8 @@ public:
|
||||
|
||||
void setSession(boost::shared_ptr<Session> session) { mySession = session; }
|
||||
boost::shared_ptr<Session> getSession() { assert(mySession.get()); return mySession; }
|
||||
|
||||
boost::shared_ptr< GuiInterface > getMyServerGuiInterface() const { return myServerGuiInterface; }
|
||||
|
||||
signals:
|
||||
void signalShowClientDialog();
|
||||
|
||||
@@ -111,7 +112,7 @@ public slots:
|
||||
|
||||
void networkStart(boost::shared_ptr<Game> game);
|
||||
QStringList getPlayerNicksList();
|
||||
|
||||
|
||||
private:
|
||||
ConfigFile *myConfig;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user