diff options
author | Richard Nelson <none@none> | 2010-09-10 18:54:30 -0700 |
---|---|---|
committer | Richard Nelson <none@none> | 2010-09-10 18:54:30 -0700 |
commit | e2257bc78e53162127c49adad3f9dc406ecc270e (patch) | |
tree | 63c7d3f87200b0d61cf26ec54316cd554c494c94 /indra/newview/llhints.cpp | |
parent | fbcde287363f38a4f73a14bbf3501e34b9698c68 (diff) |
EXP-24 FIX Menu disable all viewer hints
Diffstat (limited to 'indra/newview/llhints.cpp')
-rw-r--r-- | indra/newview/llhints.cpp | 51 |
1 files changed, 38 insertions, 13 deletions
diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index 21383109dc..bd7fec63e8 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -32,6 +32,7 @@ #include "llbutton.h" #include "lltextbox.h" #include "llviewerwindow.h" +#include "llviewercontrol.h" #include "llsdparam.h" class LLHintPopup : public LLPanel @@ -309,27 +310,31 @@ std::map<LLNotificationPtr, class LLHintPopup*> LLHints::sHints; //static void LLHints::show(LLNotificationPtr hint) { - LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams<LLHintPopup>()); - - LLParamSDParser parser; - parser.readSD(hint->getPayload(), p, true); - p.notification = hint; - - if (p.validateBlock()) + if (gSavedSettings.getBOOL("EnableUIHints")) { - LLHintPopup* popup = new LLHintPopup(p); + LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams<LLHintPopup>()); - sHints[hint] = popup; + LLParamSDParser parser; + parser.readSD(hint->getPayload(), p, true); + p.notification = hint; - LLView* hint_holder = gViewerWindow->getHintHolder(); - if (hint_holder) + if (p.validateBlock()) { - hint_holder->addChild(popup); - popup->centerWithin(hint_holder->getLocalRect()); + LLHintPopup* popup = new LLHintPopup(p); + + sHints[hint] = popup; + + LLView* hint_holder = gViewerWindow->getHintHolder(); + if (hint_holder) + { + hint_holder->addChild(popup); + popup->centerWithin(hint_holder->getLocalRect()); + } } } } +//static void LLHints::hide(LLNotificationPtr hint) { hint_map_t::iterator found_it = sHints.find(hint); @@ -341,6 +346,26 @@ void LLHints::hide(LLNotificationPtr hint) } //static +void LLHints::hideAll() +{ + std::vector<LLNotificationPtr> notifications; + for (hint_map_t::iterator it = sHints.begin(), end_it = sHints.end(); + it != end_it; + ++it) + { + notifications.push_back(it->first); + } + + for(std::vector<LLNotificationPtr>::iterator it = notifications.begin(), end_it = notifications.end(); + it != end_it; + ++it) + { + LLNotifications::instance().cancel(*it); + } + +} + +//static void LLHints::registerHintTarget(const std::string& name, LLHandle<LLView> target) { sTargetRegistry.defaultRegistrar().replace(name, target); |