diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-11-27 08:19:22 +0200 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-11-27 08:19:22 +0200 |
commit | d0c7b4fade611bb3bd05a4e6230145b1babc9f7f (patch) | |
tree | 96edb360c7cacaef64a4b865e7d97c9ef8404669 /indra/newview/llhints.cpp | |
parent | 49216183902045a2b9ba4a0627eb4298a65c004c (diff) | |
parent | 78bdf57ad6610b34389226bf941ba736ca0c2225 (diff) |
Merged in lindenlab/viewer-release
Diffstat (limited to 'indra/newview/llhints.cpp')
-rw-r--r-- | indra/newview/llhints.cpp | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index 197408b40e..7271376a3c 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -240,7 +240,7 @@ void LLHintPopup::draw() } else { - LLView* targetp = LLHints::getHintTarget(mTarget).get(); + LLView* targetp = LLHints::getInstance()->getHintTarget(mTarget).get(); if (!targetp) { // target widget is no longer valid, go away @@ -349,10 +349,20 @@ void LLHintPopup::draw() } -LLRegistry<std::string, LLHandle<LLView> > LLHints::sTargetRegistry; -std::map<LLNotificationPtr, class LLHintPopup*> LLHints::sHints; +/// LLHints + +LLHints::LLHints() +{ + LLControlVariablePtr control = gSavedSettings.getControl("EnableUIHints"); + mControlConnection = control->getSignal()->connect(boost::bind(&LLHints::showHints, this, _2)); + gViewerWindow->getHintHolder()->setVisible(control->getValue().asBoolean()); +} + +LLHints::~LLHints() +{ + mControlConnection.disconnect(); +} -//static void LLHints::show(LLNotificationPtr hint) { LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams<LLHintPopup>()); @@ -365,7 +375,7 @@ void LLHints::show(LLNotificationPtr hint) { LLHintPopup* popup = new LLHintPopup(p); - sHints[hint] = popup; + mHints[hint] = popup; LLView* hint_holder = gViewerWindow->getHintHolder(); if (hint_holder) @@ -376,27 +386,24 @@ void LLHints::show(LLNotificationPtr hint) } } -//static void LLHints::hide(LLNotificationPtr hint) { - hint_map_t::iterator found_it = sHints.find(hint); - if (found_it != sHints.end()) + hint_map_t::iterator found_it = mHints.find(hint); + if (found_it != mHints.end()) { found_it->second->hide(); - sHints.erase(found_it); + mHints.erase(found_it); } } -//static void LLHints::registerHintTarget(const std::string& name, LLHandle<LLView> target) { - sTargetRegistry.defaultRegistrar().replace(name, target); + mTargetRegistry.defaultRegistrar().replace(name, target); } -//static LLHandle<LLView> LLHints::getHintTarget(const std::string& name) { - LLHandle<LLView>* handlep = sTargetRegistry.getValue(name); + LLHandle<LLView>* handlep = mTargetRegistry.getValue(name); if (handlep) { return *handlep; @@ -407,18 +414,6 @@ LLHandle<LLView> LLHints::getHintTarget(const std::string& name) } } -//static -void LLHints::initClass() -{ - sRegister.reference(); - - LLControlVariablePtr control = gSavedSettings.getControl("EnableUIHints"); - control->getSignal()->connect(boost::bind(&showHints, _2)); - gViewerWindow->getHintHolder()->setVisible(control->getValue().asBoolean()); - -} - -//staic void LLHints::showHints(const LLSD& show) { bool visible = show.asBoolean(); |