aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterhud.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloaterhud.cpp')
-rw-r--r--linden/indra/newview/llfloaterhud.cpp21
1 files changed, 15 insertions, 6 deletions
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 @@
32#include "llviewerprecompiledheaders.h" 32#include "llviewerprecompiledheaders.h"
33 33
34#include "llfloaterhud.h" 34#include "llfloaterhud.h"
35
36// Viewer libs
35#include "llviewercontrol.h" 37#include "llviewercontrol.h"
36#include "lluictrlfactory.h"
37#include "llwebbrowserctrl.h" 38#include "llwebbrowserctrl.h"
38#include "llalertdialog.h" 39#include "llalertdialog.h"
39 40
41// Linden libs
42#include "lluictrlfactory.h"
43
40// statics 44// statics
41LLFloaterHUD* LLFloaterHUD::sInstance = 0; 45LLFloaterHUD* LLFloaterHUD::sInstance = 0;
42 46
@@ -47,7 +51,7 @@ LLFloaterHUD* LLFloaterHUD::sInstance = 0;
47 51
48// Default constructor 52// Default constructor
49LLFloaterHUD::LLFloaterHUD() 53LLFloaterHUD::LLFloaterHUD()
50: LLFloater("floater_hud"), 54: LLFloater(std::string("floater_hud")),
51 mWebBrowser(0) 55 mWebBrowser(0)
52{ 56{
53 // Create floater from its XML definition 57 // Create floater from its XML definition
@@ -80,7 +84,7 @@ LLFloaterHUD::LLFloaterHUD()
80 // arrow keys during tutorial). 84 // arrow keys during tutorial).
81 mWebBrowser->setTakeFocusOnClick(false); 85 mWebBrowser->setTakeFocusOnClick(false);
82 86
83 LLString language(gSavedSettings.getString("Language")); 87 std::string language(gSavedSettings.getString("Language"));
84 if(language == "default") 88 if(language == "default")
85 { 89 {
86 language = gSavedSettings.getString("SystemLanguage"); 90 language = gSavedSettings.getString("SystemLanguage");
@@ -120,7 +124,7 @@ LLFloaterHUD::~LLFloaterHUD()
120} 124}
121 125
122// Show the HUD 126// Show the HUD
123void LLFloaterHUD::show() 127void LLFloaterHUD::showHUD()
124{ 128{
125 // do not build the floater if there the url is empty 129 // do not build the floater if there the url is empty
126 if (gSavedSettings.getString("TutorialURL") == "") 130 if (gSavedSettings.getString("TutorialURL") == "")
@@ -135,7 +139,12 @@ void LLFloaterHUD::show()
135 hud->setFrontmost(FALSE); 139 hud->setFrontmost(FALSE);
136} 140}
137 141
138void LLFloaterHUD::close() 142// Save our visibility state on close in case the user accidentally
143// quit the application while the tutorial was visible.
144// virtual
145void LLFloaterHUD::onClose(bool app_quitting)
139{ 146{
140 if (sInstance) sInstance->close(); 147 bool stay_visible = app_quitting;
148 gSavedSettings.setBOOL("ShowTutorial", stay_visible);
149 destroy();
141} 150}