diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index eb86f1e96..c1da6e8e5 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -293,6 +293,20 @@ void LLUICtrlFactory::buildFloaterInternal(LLFloater *floaterp, LLXMLNodePtr &ro mBuiltFloaters[handle] = filename; } +//----------------------------------------------------------------------------- +// getBuiltFloater() +//----------------------------------------------------------------------------- +LLFloater* LLUICtrlFactory::getBuiltFloater(const std::string name) const +{ + for (built_floater_t::const_iterator i = mBuiltFloaters.begin(); i != mBuiltFloaters.end(); ++i) + { + LLFloater* floater = i->first.get(); + if (floater && floater->getName() == name) + return floater; + } + return NULL; +} + //----------------------------------------------------------------------------- // saveToXML() //----------------------------------------------------------------------------- diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 4dd0cdd73..345d25cad 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -61,6 +61,8 @@ public: BOOL buildPanelFromBuffer(LLPanel *panelp, const std::string &buffer, const LLCallbackMap::map_t* factory_map = NULL); + LLFloater* getBuiltFloater(const std::string name) const; + void removePanel(LLPanel* panelp) { mBuiltPanels.erase(panelp->getHandle()); } void removeFloater(LLFloater* floaterp) { mBuiltFloaters.erase(floaterp->getHandle()); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ac0ece092..32526bd1c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6517,6 +6517,7 @@ class LLShowFloater : public view_listener_t bool handleEvent(LLPointer event, const LLSD& userdata) { std::string floater_name = userdata.asString(); + if (floater_name.empty()) return false; if (floater_name == "gestures") { LLFloaterGesture::toggleVisibility(); @@ -6688,6 +6689,14 @@ class LLShowFloater : public view_listener_t { LLFloaterOutbox::toggleInstance(LLSD()); } + else // Simple codeless floater + { + LLFloater* floater = LLUICtrlFactory::getInstance()->getBuiltFloater(floater_name); + if (floater) + gFloaterView->bringToFront(floater); + else + LLUICtrlFactory::getInstance()->buildFloater(new LLFloater(), floater_name); + } return true; } };