From 5924266b02d4b73d501daa1f5c851bc369ccf3da Mon Sep 17 00:00:00 2001 From: doitux Date: Wed, 8 Oct 2008 08:11:37 +0000 Subject: [PATCH] session refactoring --- src/gui/qt/gametable/gametableimpl.cpp | 4 ++-- src/gui/qt/guiwrapper.cpp | 2 +- src/gui/qt/startwindow/startwindowimpl.h | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp index 36e2e6cb..53333cad 100755 --- a/src/gui/qt/gametable/gametableimpl.cpp +++ b/src/gui/qt/gametable/gametableimpl.cpp @@ -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(); } diff --git a/src/gui/qt/guiwrapper.cpp b/src/gui/qt/guiwrapper.cpp index 31e016e2..bbc3b2ef 100644 --- a/src/gui/qt/guiwrapper.cpp +++ b/src/gui/qt/guiwrapper.cpp @@ -47,7 +47,7 @@ GuiWrapper::~GuiWrapper() void GuiWrapper::initGui(int speed) { myW->signalInitGui(speed); } boost::shared_ptr GuiWrapper::getSession() { return myStartWindow->getSession(); } -void GuiWrapper::setSession(boost::shared_ptr session) { /*myStartWindow->setSession(session);*/ } +void GuiWrapper::setSession(boost::shared_ptr /*session*/) { /*myStartWindow->setSession(session);*/ } void GuiWrapper::refreshSet() const { myW->signalRefreshSet(); } void GuiWrapper::refreshCash() const { myW->signalRefreshCash(); } diff --git a/src/gui/qt/startwindow/startwindowimpl.h b/src/gui/qt/startwindow/startwindowimpl.h index 1cb9a2f7..8b89a56f 100644 --- a/src/gui/qt/startwindow/startwindowimpl.h +++ b/src/gui/qt/startwindow/startwindowimpl.h @@ -51,7 +51,8 @@ public: void setSession(boost::shared_ptr session) { mySession = session; } boost::shared_ptr 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); QStringList getPlayerNicksList(); - + private: ConfigFile *myConfig;