Have Drop Targets with settings update when their settings update.
This commit is contained in:
@@ -37,6 +37,8 @@
|
||||
|
||||
#include "lldroptarget.h"
|
||||
|
||||
#include <boost/signals2/shared_connection_block.hpp>
|
||||
|
||||
#include "llinventorymodel.h"
|
||||
#include "llstartup.h"
|
||||
#include "lltextbox.h"
|
||||
@@ -135,6 +137,7 @@ void LLDropTarget::setControlName(const std::string& control_name, LLView* conte
|
||||
if (control_name.empty()) // The "empty set"
|
||||
{
|
||||
mControl = NULL;
|
||||
mConnection.disconnect();
|
||||
return; // This DropTarget never changes text, it isn't tied to a control
|
||||
}
|
||||
|
||||
@@ -159,6 +162,10 @@ void LLDropTarget::setControlName(const std::string& control_name, LLView* conte
|
||||
else
|
||||
text = LLTrans::getString("CurrentlySetToAnItemNotOnThisAccount");
|
||||
}
|
||||
if (mControl)
|
||||
mConnection = mControl->getSignal()->connect(boost::bind(&LLView::setValue, this, _2));
|
||||
else
|
||||
mConnection.disconnect();
|
||||
|
||||
mText->setText(text);
|
||||
}
|
||||
@@ -186,6 +193,7 @@ void LLDropTarget::setControlValue(const std::string& val)
|
||||
{
|
||||
if (mControl)
|
||||
{
|
||||
boost::signals2::shared_connection_block block(mConnection);
|
||||
mControl->setValue(val);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ protected:
|
||||
LLUUID mEntityID;
|
||||
class LLViewBorder* mBorder;
|
||||
LLControlVariable* mControl;
|
||||
boost::signals2::scoped_connection mConnection;
|
||||
class LLTextBox* mText;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user