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