diff options
author | James Cook <james@lindenlab.com> | 2009-07-07 00:53:05 +0000 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2009-07-07 00:53:05 +0000 |
commit | 52aeaa32841e7d0b37abab0a2a2540c2be2f16b7 (patch) | |
tree | d8f5c98644029dd289a97aa0d8b55c5a6200c214 /indra/llui/llfloater.cpp | |
parent | 2c722655bd6701a3dc8518c6518c51f538765dcd (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/llui/llfloater.cpp')
-rw-r--r-- | indra/llui/llfloater.cpp | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index d37459c040..c8bbdb0a56 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -191,7 +191,7 @@ bool LLFloater::KeyCompare::equate(const LLSD& a, const LLSD& b) //static const LLFloater::Params& LLFloater::getDefaultParams() { - return LLUICtrlFactory::getDefaultParams<LLFloater::Params>(); + return LLUICtrlFactory::getDefaultParams<LLFloater>(); } @@ -560,6 +560,7 @@ void LLFloater::openFloater(const LLSD& key) setVisibleAndFrontmost(mAutoFocus); } + mOpenSignal(this, getValue()); onOpen(key); } @@ -623,6 +624,7 @@ void LLFloater::closeFloater(bool app_quitting) } // Let floater do cleanup. + mCloseSignal(this, getValue()); onClose(app_quitting); } } @@ -1709,6 +1711,33 @@ void LLFloater::buildButtons() updateButtons(); } +void LLFloater::initOpenCallback(const OpenCallbackParam& cb, open_signal_t& sig) +{ + if (cb.function.isProvided()) + { + if (cb.parameter.isProvided()) + sig.connect(boost::bind(cb.function(), _1, cb.parameter)); + else + sig.connect(cb.function()); + } + else + { + std::string function_name = cb.function_name; + open_callback_t* func = (CallbackRegistry<open_callback_t>::getValue(function_name)); + if (func) + { + if (cb.parameter.isProvided()) + sig.connect(boost::bind((*func), _1, cb.parameter)); + else + sig.connect(*func); + } + else if (!function_name.empty()) + { + llwarns << "No callback found for: '" << function_name << "' in control: " << getName() << llendl; + } + } +} + ///////////////////////////////////////////////////// // LLFloaterView @@ -2462,18 +2491,25 @@ void LLFloater::initFromParams(const LLFloater::Params& p) { mVisibilityControl = "t"; // flag to build mVisibilityControl name once mInstanceName is set } + + // open callback + if (p.open_callback.isProvided()) + initOpenCallback(p.open_callback, mOpenSignal); + // close callback + if (p.close_callback.isProvided()) + initOpenCallback(p.close_callback, mCloseSignal); } void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, BOOL open_floater, LLXMLNodePtr output_node) { - Params params(LLUICtrlFactory::getDefaultParams<LLFloater::Params>()); + Params params(LLUICtrlFactory::getDefaultParams<LLFloater>()); LLXUIParser::instance().readXUI(node, params); if (output_node) { Params output_params(params); setupParamsForExport(output_params, parent); - Params default_params(LLUICtrlFactory::getDefaultParams<LLFloater::Params>()); + Params default_params(LLUICtrlFactory::getDefaultParams<LLFloater>()); output_node->setName(node->getName()->mString); LLXUIParser::instance().writeXUI( output_node, output_params, &default_params); @@ -2490,7 +2526,7 @@ void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, BOOL open_floa LLFloater::setFloaterHost((LLMultiFloater*) this); } - LLUICtrlFactory::createChildren(this, node, output_node); + LLUICtrlFactory::createChildren(this, node, child_registry_t::instance(), output_node); if (node->hasName("multi_floater")) { |