Fixed bug EXT-2915 ([BSI] Pay Button is hard to find on small resolutions).
Added a "Block/Unblock" item to the profile view panel overflow menu to make the menu more visible. --HG-- branch : product-enginemeow-7.2.2
parent
b52d2a2f1b
commit
e5bd3b8a48
|
|
@ -612,3 +612,13 @@ bool LLAvatarActions::isBlocked(const LLUUID& id)
|
|||
gCacheName->getFullName(id, name);
|
||||
return LLMuteList::getInstance()->isMuted(id, name);
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLAvatarActions::canBlock(const LLUUID& id)
|
||||
{
|
||||
std::string firstname, lastname;
|
||||
gCacheName->getName(id, firstname, lastname);
|
||||
bool is_linden = !LLStringUtil::compareStrings(lastname, "Linden");
|
||||
bool is_self = id == gAgentID;
|
||||
return !is_self && !is_linden;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,6 +123,11 @@ public:
|
|||
*/
|
||||
static bool isBlocked(const LLUUID& id);
|
||||
|
||||
/**
|
||||
* @return true if you can block the avatar
|
||||
*/
|
||||
static bool canBlock(const LLUUID& id);
|
||||
|
||||
/**
|
||||
* Return true if the avatar is in a P2P voice call with a given user
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -483,6 +483,7 @@ BOOL LLPanelAvatarProfile::postBuild()
|
|||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
|
||||
registrar.add("Profile.Pay", boost::bind(&LLPanelAvatarProfile::pay, this));
|
||||
registrar.add("Profile.Share", boost::bind(&LLPanelAvatarProfile::share, this));
|
||||
registrar.add("Profile.BlockUnblock", boost::bind(&LLPanelAvatarProfile::toggleBlock, this));
|
||||
registrar.add("Profile.Kick", boost::bind(&LLPanelAvatarProfile::kick, this));
|
||||
registrar.add("Profile.Freeze", boost::bind(&LLPanelAvatarProfile::freeze, this));
|
||||
registrar.add("Profile.Unfreeze", boost::bind(&LLPanelAvatarProfile::unfreeze, this));
|
||||
|
|
@ -490,6 +491,8 @@ BOOL LLPanelAvatarProfile::postBuild()
|
|||
|
||||
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable;
|
||||
enable.add("Profile.EnableGod", boost::bind(&enable_god));
|
||||
enable.add("Profile.CheckItem", boost::bind(&LLPanelAvatarProfile::checkOverflowMenuItem, this, _2));
|
||||
enable.add("Profile.EnableItem", boost::bind(&LLPanelAvatarProfile::enableOverflowMenuItem, this, _2));
|
||||
|
||||
mProfileMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_profile_overflow.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
|
||||
|
|
@ -666,6 +669,26 @@ void LLPanelAvatarProfile::fillAccountStatus(const LLAvatarData* avatar_data)
|
|||
childSetValue("acc_status_text", caption_text);
|
||||
}
|
||||
|
||||
bool LLPanelAvatarProfile::checkOverflowMenuItem(const LLSD& param)
|
||||
{
|
||||
std::string item = param.asString();
|
||||
|
||||
if (item == "is_blocked")
|
||||
return LLAvatarActions::isBlocked(getAvatarId());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LLPanelAvatarProfile::enableOverflowMenuItem(const LLSD& param)
|
||||
{
|
||||
std::string item = param.asString();
|
||||
|
||||
if (item == "can_block")
|
||||
return LLAvatarActions::canBlock(getAvatarId());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void LLPanelAvatarProfile::pay()
|
||||
{
|
||||
LLAvatarActions::pay(getAvatarId());
|
||||
|
|
@ -676,6 +699,11 @@ void LLPanelAvatarProfile::share()
|
|||
LLAvatarActions::share(getAvatarId());
|
||||
}
|
||||
|
||||
void LLPanelAvatarProfile::toggleBlock()
|
||||
{
|
||||
LLAvatarActions::toggleBlock(getAvatarId());
|
||||
}
|
||||
|
||||
void LLPanelAvatarProfile::kick()
|
||||
{
|
||||
LLAvatarActions::kick(getAvatarId());
|
||||
|
|
|
|||
|
|
@ -192,12 +192,18 @@ protected:
|
|||
*/
|
||||
void share();
|
||||
|
||||
/**
|
||||
* Add/remove resident to/from your block list.
|
||||
*/
|
||||
void toggleBlock();
|
||||
|
||||
void kick();
|
||||
void freeze();
|
||||
void unfreeze();
|
||||
void csr();
|
||||
|
||||
|
||||
bool checkOverflowMenuItem(const LLSD& param);
|
||||
bool enableOverflowMenuItem(const LLSD& param);
|
||||
bool enableGod();
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -164,11 +164,7 @@ bool NearbyMenu::enableContextMenuItem(const LLSD& userdata)
|
|||
if (item == std::string("can_block"))
|
||||
{
|
||||
const LLUUID& id = mUUIDs.front();
|
||||
std::string firstname, lastname;
|
||||
gCacheName->getName(id, firstname, lastname);
|
||||
bool is_linden = !LLStringUtil::compareStrings(lastname, "Linden");
|
||||
bool is_self = id == gAgentID;
|
||||
return !is_self && !is_linden;
|
||||
return LLAvatarActions::canBlock(id);
|
||||
}
|
||||
else if (item == std::string("can_add"))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,6 +19,19 @@
|
|||
<menu_item_call.on_click
|
||||
function="Profile.Share" />
|
||||
</menu_item_call>
|
||||
<menu_item_check
|
||||
label="Block/Unblock"
|
||||
layout="topleft"
|
||||
name="block_unblock">
|
||||
<menu_item_check.on_click
|
||||
function="Profile.BlockUnblock" />
|
||||
<menu_item_check.on_check
|
||||
function="Profile.CheckItem"
|
||||
parameter="is_blocked" />
|
||||
<menu_item_check.on_enable
|
||||
function="Profile.EnableItem"
|
||||
parameter="can_block" />
|
||||
</menu_item_check>
|
||||
<menu_item_call
|
||||
label="Kick"
|
||||
layout="topleft"
|
||||
|
|
|
|||
Loading…
Reference in New Issue