session refactoring
This commit is contained in:
@@ -2935,7 +2935,7 @@ void gameTableImpl::showMaximized () {
|
|||||||
|
|
||||||
void gameTableImpl::closeGameTable() {
|
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"),
|
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);
|
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 ) {
|
if (msgBox.exec() == QMessageBox::Yes ) {
|
||||||
myStartWindow->getSession()->terminateNetworkClient();
|
myStartWindow->getSession()->terminateNetworkClient();
|
||||||
stopTimer();
|
stopTimer();
|
||||||
if (myServerGuiInterface.get()) myServerGuiInterface->getSession()->terminateNetworkServer();
|
if (myStartWindow->getMyServerGuiInterface().get()) myStartWindow->getMyServerGuiInterface()->getSession()->terminateNetworkServer();
|
||||||
myStartWindow->show();
|
myStartWindow->show();
|
||||||
this->hide();
|
this->hide();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ GuiWrapper::~GuiWrapper()
|
|||||||
void GuiWrapper::initGui(int speed) { myW->signalInitGui(speed); }
|
void GuiWrapper::initGui(int speed) { myW->signalInitGui(speed); }
|
||||||
|
|
||||||
boost::shared_ptr<Session> GuiWrapper::getSession() { return myStartWindow->getSession(); }
|
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::refreshSet() const { myW->signalRefreshSet(); }
|
||||||
void GuiWrapper::refreshCash() const { myW->signalRefreshCash(); }
|
void GuiWrapper::refreshCash() const { myW->signalRefreshCash(); }
|
||||||
|
|||||||
@@ -51,7 +51,8 @@ public:
|
|||||||
|
|
||||||
void setSession(boost::shared_ptr<Session> session) { mySession = session; }
|
void setSession(boost::shared_ptr<Session> session) { mySession = session; }
|
||||||
boost::shared_ptr<Session> getSession() { assert(mySession.get()); return mySession; }
|
boost::shared_ptr<Session> getSession() { assert(mySession.get()); return mySession; }
|
||||||
|
boost::shared_ptr< GuiInterface > getMyServerGuiInterface() const { return myServerGuiInterface; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void signalShowClientDialog();
|
void signalShowClientDialog();
|
||||||
|
|
||||||
@@ -111,7 +112,7 @@ public slots:
|
|||||||
|
|
||||||
void networkStart(boost::shared_ptr<Game> game);
|
void networkStart(boost::shared_ptr<Game> game);
|
||||||
QStringList getPlayerNicksList();
|
QStringList getPlayerNicksList();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ConfigFile *myConfig;
|
ConfigFile *myConfig;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user