summaryrefslogtreecommitdiff
path: root/indra/llui/llpanel.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2009-11-25 15:46:30 +0200
committerVadim Savchuk <vsavchuk@productengine.com>2009-11-25 15:46:30 +0200
commitf0e3eec40be91558efdae3051f42fa32f306207c (patch)
tree36ba3eb7516b60c0fb6a4aba6aa3b9c3b7ed8e24 /indra/llui/llpanel.cpp
parentc2c83f3535c5a0bc099528580375afc99ad3b020 (diff)
parent41eb231e6a41da13549e5cbd4cfe6f5efeab74b1 (diff)
Merge from default branch
--HG-- branch : product-engine
Diffstat (limited to 'indra/llui/llpanel.cpp')
-rw-r--r--indra/llui/llpanel.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index 89c4656297..063822dd56 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -106,7 +106,8 @@ LLPanel::LLPanel(const LLPanel::Params& p)
mHelpTopic(p.help_topic),
mCommitCallbackRegistrar(false),
mEnableCallbackRegistrar(false),
- mXMLFilename(p.filename)
+ mXMLFilename(p.filename),
+ mVisibleSignal(NULL)
// *NOTE: Be sure to also change LLPanel::initFromParams(). We have too
// many classes derived from LLPanel to retrofit them all to pass in params.
{
@@ -118,6 +119,11 @@ LLPanel::LLPanel(const LLPanel::Params& p)
mPanelHandle.bind(this);
}
+LLPanel::~LLPanel()
+{
+ delete mVisibleSignal;
+}
+
// virtual
BOOL LLPanel::isPanel() const
{
@@ -332,7 +338,8 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask )
void LLPanel::handleVisibilityChange ( BOOL new_visibility )
{
LLUICtrl::handleVisibilityChange ( new_visibility );
- mVisibleSignal(this, LLSD(new_visibility) ); // Pass BOOL as LLSD
+ if (mVisibleSignal)
+ (*mVisibleSignal)(this, LLSD(new_visibility) ); // Pass BOOL as LLSD
}
void LLPanel::setFocus(BOOL b)
@@ -424,7 +431,9 @@ void LLPanel::initFromParams(const LLPanel::Params& p)
// visible callback
if (p.visible_callback.isProvided())
- initCommitCallback(p.visible_callback, mVisibleSignal);
+ {
+ setVisibleCallback(initCommitCallback(p.visible_callback));
+ }
for (LLInitParam::ParamIterator<LocalizedString>::const_iterator it = p.strings().begin();
it != p.strings().end();
@@ -907,3 +916,13 @@ void LLPanel::childSetControlName(const std::string& id, const std::string& cont
view->setControlName(control_name, NULL);
}
}
+
+boost::signals2::connection LLPanel::setVisibleCallback( const commit_signal_t::slot_type& cb )
+{
+ if (!mVisibleSignal)
+ {
+ mVisibleSignal = new commit_signal_t();
+ }
+
+ return mVisibleSignal->connect(cb);
+}