summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterhud.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2009-07-07 00:53:05 +0000
committerJames Cook <james@lindenlab.com>2009-07-07 00:53:05 +0000
commit52aeaa32841e7d0b37abab0a2a2540c2be2f16b7 (patch)
treed8f5c98644029dd289a97aa0d8b55c5a6200c214 /indra/newview/llfloaterhud.cpp
parent2c722655bd6701a3dc8518c6518c51f538765dcd (diff)
Merge skinning-14 to viewer-2, including refactoring many floaters to register them with LLFloaterReg, support for introspection of ParamBlock based UI widgets to dump XML schema, splitting llfolderview.cpp into three separate files to unravel dependencies and skeleton for for LLListView widget. Resolved conflicts in these files:
lldraghandle.h, lluictrl.h, llchiclet.cpp, llfolderview.h/cpp, lliinventorybridge.cpp, llpanelpicks.cpp, llviewermenu.cpp, floater_mute.xml, floater_preferences.xml, notifications.xml, panel_preferences_audio.xml, panel_preferences_graphics1.xml, panel_region_general.xml svn merge -r124961:126284 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/skinning-14
Diffstat (limited to 'indra/newview/llfloaterhud.cpp')
-rw-r--r--indra/newview/llfloaterhud.cpp59
1 files changed, 18 insertions, 41 deletions
diff --git a/indra/newview/llfloaterhud.cpp b/indra/newview/llfloaterhud.cpp
index 4379d25a66..dd70560bb7 100644
--- a/indra/newview/llfloaterhud.cpp
+++ b/indra/newview/llfloaterhud.cpp
@@ -42,8 +42,6 @@
// Linden libs
#include "lluictrlfactory.h"
-// statics
-LLFloaterHUD* LLFloaterHUD::sInstance = 0;
///----------------------------------------------------------------------------
/// Class LLFloaterHUD
@@ -51,12 +49,18 @@ LLFloaterHUD* LLFloaterHUD::sInstance = 0;
#define super LLFloater /* superclass */
// Default constructor
-LLFloaterHUD::LLFloaterHUD()
-: LLFloater(),
+LLFloaterHUD::LLFloaterHUD(const LLSD& key)
+: LLFloater(key),
mWebBrowser(0)
{
- // Create floater from its XML definition
- LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hud.xml");
+ // do not build the floater if there the url is empty
+ if (gSavedSettings.getString("TutorialURL") == "")
+ {
+ LLNotifications::instance().add("TutorialNotFound");
+ return;
+ }
+
+ //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hud.xml");
// Don't grab the focus as it will impede performing in-world actions
// while using the HUD
@@ -68,62 +72,35 @@ LLFloaterHUD::LLFloaterHUD()
// Opaque background since we never get the focus
setBackgroundOpaque(TRUE);
+}
+BOOL LLFloaterHUD::postBuild()
+{
mWebBrowser = getChild<LLWebBrowserCtrl>("floater_hud_browser" );
if (mWebBrowser)
{
// Open links in internal browser
mWebBrowser->setOpenInExternalBrowser(false);
-
+
// This is a "chrome" floater, so we don't want anything to
// take focus (as the user needs to be able to walk with
// arrow keys during tutorial).
mWebBrowser->setTakeFocusOnClick(false);
-
+
std::string language = LLUI::getLanguage();
std::string base_url = gSavedSettings.getString("TutorialURL");
-
+
std::string url = base_url + language + "/";
mWebBrowser->navigateTo(url);
}
-}
-
-// Get the instance
-LLFloaterHUD* LLFloaterHUD::getInstance()
-{
- if (!sInstance)
- {
- sInstance = new LLFloaterHUD();
- }
- return sInstance;
+
+ return TRUE;
}
// Destructor
LLFloaterHUD::~LLFloaterHUD()
{
- // Clear out the one instance if it's ours
- if (sInstance == this)
- {
- sInstance = NULL;
- }
}
-
-// Show the HUD
-void LLFloaterHUD::showHUD()
-{
- // do not build the floater if there the url is empty
- if (gSavedSettings.getString("TutorialURL") == "")
- {
- LLNotifications::instance().add("TutorialNotFound");
- return;
- }
-
- // Create the instance if necessary
- LLFloaterHUD* hud = getInstance();
- hud->openFloater();
- hud->setFrontmost(FALSE);
-}
-
// Save our visibility state on close in case the user accidentally
// quit the application while the tutorial was visible.
// virtual