From 7be91e6213aadb0405bdd2fa3a9210598b254041 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 21 Jan 2011 04:05:46 +0200 Subject: Show network error dialog as not modal. This fix stuck client in some situations. Also prevent server change if now disconnected. --- src/game.cpp | 2 +- src/gui/quitdialog.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 4f8bad0ce..f5565b71e 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -485,7 +485,7 @@ void Game::logic() if (!disconnectedDialog) { disconnectedDialog = new OkDialog(_("Network Error"), - errorMessage); + errorMessage, false); disconnectedDialog->addActionListener(&errorListener); disconnectedDialog->requestMoveToTop(); } diff --git a/src/gui/quitdialog.cpp b/src/gui/quitdialog.cpp index 2166902f6..7fc87c02a 100644 --- a/src/gui/quitdialog.cpp +++ b/src/gui/quitdialog.cpp @@ -33,6 +33,7 @@ #include "gui/widgets/radiobutton.h" #include "net/charhandler.h" +#include "net/gamehandler.h" #include "net/net.h" #include "utils/gettext.h" @@ -138,7 +139,8 @@ void QuitDialog::action(const gcn::ActionEvent &event) { Client::setState(STATE_EXIT); } - else if (mSwitchAccountServer->isSelected()) + else if (Net::getGameHandler()->isConnected() + && mSwitchAccountServer->isSelected()) { Client::setState(STATE_SWITCH_SERVER); } -- cgit v1.2.3-70-g09d2