From 798d367d54a6c6379ad355bd8345fa40e31e7fe9 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sat, 6 Sep 2008 18:24:57 -0500 Subject: Second Life viewer sources 1.21.0-RC --- linden/indra/newview/llfloaterhud.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'linden/indra/newview/llfloaterhud.cpp') diff --git a/linden/indra/newview/llfloaterhud.cpp b/linden/indra/newview/llfloaterhud.cpp index 3ec08e3..cfdaba5 100644 --- a/linden/indra/newview/llfloaterhud.cpp +++ b/linden/indra/newview/llfloaterhud.cpp @@ -32,11 +32,15 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterhud.h" + +// Viewer libs #include "llviewercontrol.h" -#include "lluictrlfactory.h" #include "llwebbrowserctrl.h" #include "llalertdialog.h" +// Linden libs +#include "lluictrlfactory.h" + // statics LLFloaterHUD* LLFloaterHUD::sInstance = 0; @@ -47,7 +51,7 @@ LLFloaterHUD* LLFloaterHUD::sInstance = 0; // Default constructor LLFloaterHUD::LLFloaterHUD() -: LLFloater("floater_hud"), +: LLFloater(std::string("floater_hud")), mWebBrowser(0) { // Create floater from its XML definition @@ -80,7 +84,7 @@ LLFloaterHUD::LLFloaterHUD() // arrow keys during tutorial). mWebBrowser->setTakeFocusOnClick(false); - LLString language(gSavedSettings.getString("Language")); + std::string language(gSavedSettings.getString("Language")); if(language == "default") { language = gSavedSettings.getString("SystemLanguage"); @@ -120,7 +124,7 @@ LLFloaterHUD::~LLFloaterHUD() } // Show the HUD -void LLFloaterHUD::show() +void LLFloaterHUD::showHUD() { // do not build the floater if there the url is empty if (gSavedSettings.getString("TutorialURL") == "") @@ -135,7 +139,12 @@ void LLFloaterHUD::show() hud->setFrontmost(FALSE); } -void LLFloaterHUD::close() +// Save our visibility state on close in case the user accidentally +// quit the application while the tutorial was visible. +// virtual +void LLFloaterHUD::onClose(bool app_quitting) { - if (sInstance) sInstance->close(); + bool stay_visible = app_quitting; + gSavedSettings.setBOOL("ShowTutorial", stay_visible); + destroy(); } -- cgit v1.1