MAINT-6655 Group inspector doesn't support default icon.

andreykproductengine 2016-08-17 20:35:00 +03:00
parent 57060fa0eb
commit 0f06168991
5 changed files with 21 additions and 14 deletions

View File

@ -74,9 +74,16 @@ LLGroupIconCtrl::~LLGroupIconCtrl()
LLGroupMgr::getInstance()->removeObserver(this);
}
void LLGroupIconCtrl::setIconId(const LLSD& value)
void LLGroupIconCtrl::setIconId(const LLUUID& icon_id)
{
LLIconCtrl::setValue(value);
if (icon_id.notNull())
{
LLIconCtrl::setValue(icon_id);
}
else
{
LLIconCtrl::setValue(mDefaultIconName, LLViewerFetchedTexture::BOOST_UI);
}
}
void LLGroupIconCtrl::setValue(const LLSD& value)
@ -122,14 +129,7 @@ bool LLGroupIconCtrl::updateFromCache()
LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(mGroupId);
if (!group_data) return false;
if (group_data->mInsigniaID.notNull())
{
LLIconCtrl::setValue(group_data->mInsigniaID);
}
else
{
LLIconCtrl::setValue(mDefaultIconName, LLViewerFetchedTexture::BOOST_UI);
}
setIconId(group_data->mInsigniaID);
if (mDrawTooltip && !group_data->mName.empty())
{

View File

@ -66,7 +66,13 @@ public:
*/
virtual void setValue(const LLSD& value);
void setIconId(const LLSD& value);
/**
* Sets icon_id as icon value directly. Avoids LLGroupMgr cache checks for group id
* Uses default icon in case id is null.
*
* @params icon_id - it is processed as icon id, default image will be used in case id is null.
*/
void setIconId(const LLUUID& icon_id);
// LLGroupMgrObserver observer trigger
virtual void changed(LLGroupChange gc);

View File

@ -233,7 +233,8 @@ void LLInspectGroup::processGroupData()
getChild<LLUICtrl>("group_details")->setValue( LLSD(data->mCharter) );
getChild<LLUICtrl>("group_icon")->setValue( LLSD(data->mInsigniaID) );
// LLGroupIconCtrl
getChild<LLUICtrl>("group_icon")->setValue(LLSD(mGroupID));
std::string cost;
bool is_member = LLGroupActions::isInGroup(mGroupID);

View File

@ -1393,7 +1393,7 @@ void LLTextureCtrl::setOnTextureSelectedCallback(texture_selected_callback cb)
void LLTextureCtrl::setImageAssetName(const std::string& name)
{
LLPointer<LLUIImage> imagep = LLUI::getUIImage(name, LLGLTexture::BOOST_PREVIEW);
LLPointer<LLUIImage> imagep = LLUI::getUIImage(name);
if(imagep)
{
LLViewerFetchedTexture* pTexture = dynamic_cast<LLViewerFetchedTexture*>(imagep->getImage().get());

View File

@ -66,7 +66,7 @@ Fear the moose! Fear it! And the mongoose too!
width="220">
L$123 to join
</text>
<icon
<group_icon
follows="all"
height="38"
right="-10"