diff -r 7ed19ada219e code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml --- a/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml Tue Oct 05 21:36:58 2010 +0200 +++ b/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml Sat Oct 09 18:53:05 2010 +0200 @@ -817,45 +817,26 @@ + + + + - - + + - - - - - - - - - - - - - - + + ---> - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 7ed19ada219e code/ryzom/client/src/events_listener.cpp --- a/code/ryzom/client/src/events_listener.cpp Tue Oct 05 21:36:58 2010 +0200 +++ b/code/ryzom/client/src/events_listener.cpp Sat Oct 09 18:53:05 2010 +0200 @@ -30,11 +30,12 @@ #include "input.h" #include "interface_v3/interface_manager.h" #include "interface_v3/custom_mouse.h" - +#include "far_tp.h" using namespace NLMISC; extern CActionsManager Actions; // Actions Manager. +extern CLoginStateMachine LoginSM; //--------------------------------------------------- // CEventsListener : @@ -123,24 +124,22 @@ // Window closed. if(event == EventDestroyWindowId) { - // Interface saving - CInterfaceManager::getInstance()->uninitInGame0(); - - /* YOYO: - quitting safely sometimes crash in CContinentMngr::select() - quitting unsafely crash always in ~CEntityManager() - Id did not succeed to reproduce the crash in CContinentMngr::select(). - Hence I let it to quit "safely", calling release methods - */ - releaseMainLoop(true); - release(); - - // quit properly crash info - extern void quitCrashReport (); - quitCrashReport (); - - // kill process - exit(EXIT_SUCCESS); + if (LoginSM.getCurrentState() == CLoginStateMachine::st_ingame) + { + if( CInterfaceManager::getInstance()->isInGame() ) + { + CInterfaceManager::getInstance()->runActionHandler("enter_modal", NULL, "group=ui:interface:quit_dialog"); + } + else + { + CInterfaceManager::getInstance()->runActionHandler("quit_ryzom", NULL, ""); + } + } + else + { + CInterfaceManager::getInstance()->runActionHandler("login_quit", NULL, ""); + } + return; } // Event from the Mouse (ANGLE) if(event == EventGDMouseMove) diff -r 7ed19ada219e code/ryzom/client/src/interface_v3/action_handler_game.cpp --- a/code/ryzom/client/src/interface_v3/action_handler_game.cpp Tue Oct 05 21:36:58 2010 +0200 +++ b/code/ryzom/client/src/interface_v3/action_handler_game.cpp Sat Oct 09 18:53:05 2010 +0200 @@ -1121,9 +1121,8 @@ public: void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */) { - /* todo game_exit game_exit = true; - nlinfo("User Request to Quit the game"); */ + ryzom_exit = true; } }; REGISTER_ACTION_HANDLER( CAHQuitGame, "quit_game"); @@ -1139,9 +1138,8 @@ // If we are not connected, quit now if((!ConnectionReadySent) && (!FarTP.isLeavingEGS())) { - game_exit = true; - ryzom_exit = true; nlinfo("User Request to Quit ryzom"); + CInterfaceManager::getInstance()->validMessageBox(CInterfaceManager::WarningIconMsg, CI18N::get("uiQuitConfirm"), "quit_game", "","leave_modal", "", "ui:outgame"); } else { diff -r 7ed19ada219e code/ryzom/client/src/login.cpp --- a/code/ryzom/client/src/login.cpp Tue Oct 05 21:36:58 2010 +0200 +++ b/code/ryzom/client/src/login.cpp Sat Oct 09 18:53:05 2010 +0200 @@ -1293,6 +1293,17 @@ virtual void execute (CCtrlBase * /* pCaller */, const string &/* Params */) { nlinfo("CAHLoginQuit called"); + CInterfaceManager::getInstance()->validMessageBox(CInterfaceManager::WarningIconMsg, CI18N::get("uiQuitConfirm"), "login_quit_real", "","leave_modal", "", "ui:login"); + } +}; +REGISTER_ACTION_HANDLER (CAHLoginQuit, "login_quit"); + +// *************************************************************************** +class CAHLoginQuitReal : public IActionHandler +{ + virtual void execute (CCtrlBase * /* pCaller */, const string &/* Params */) + { + nlinfo("CAHLoginQuitReal called"); loginFinished = true; loginOK = false; @@ -1300,7 +1311,7 @@ LoginSM.pushEvent(CLoginStateMachine::ev_quit); } }; -REGISTER_ACTION_HANDLER (CAHLoginQuit, "login_quit"); +REGISTER_ACTION_HANDLER (CAHLoginQuitReal, "login_quit_real"); // ***************************************************************************