CHUI-258: Adding a method to better whether nearby chat is visible or not.

master
Todd Stinson 2012-07-30 19:09:48 -07:00
parent 209fd15176
commit b57d8e9c06
4 changed files with 47 additions and 3 deletions

View File

@ -419,6 +419,35 @@ void LLNearbyChat::show()
setVisible(TRUE);
}
bool LLNearbyChat::isChatVisible() const
{
bool isVisible = false;
if (isChatMultiTab())
{
LLIMFloaterContainer* im_box = LLIMFloaterContainer::getInstance();
// Is the IM floater container ever null?
llassert(im_box != NULL);
if (im_box != NULL)
{
if (gSavedSettings.getBOOL("NearbyChatIsNotTornOff"))
{
isVisible = (im_box->getVisible() && !im_box->isMinimized());
}
else
{
isVisible = (getVisible() && !isMinimized());
}
}
}
else
{
isVisible = (getVisible() && !isMinimized());
}
return isVisible;
}
void LLNearbyChat::showHistory()
{
openFloater();

View File

@ -66,6 +66,7 @@ public:
void addToHost();
void show();
bool isChatVisible() const;
/** @param archive true - to save a message to the chat history log */
void addMessage (const LLChat& message,bool archive = true, const LLSD &args = LLSD());
@ -99,8 +100,6 @@ protected:
/* virtual */ bool applyRectControl();
void onToggleNearbyChatPanel();
/*virtual*/ void onTearOffClicked();
static LLWString stripChannelNumber(const LLWString &mesg, S32* channel);

View File

@ -86,7 +86,7 @@ bool LLTipHandler::processNotification(const LLNotificationPtr& notification)
// don't show toast if Nearby Chat is opened
LLNearbyChat* nearby_chat = LLNearbyChat::getInstance();
if (!nearby_chat->isMinimized() && nearby_chat->getVisible())
if (nearby_chat->isChatVisible())
{
return false;
}

View File

@ -4204,6 +4204,8 @@ Are you sure you want to change the Estate Covenant?
<notification
icon="notifytip.tga"
name="RegionEntryAccessBlocked_Notify"
log_to_im="false"
log_to_chat="true"
type="notifytip">
<tag>fail</tag>
The region you're trying to visit contains [REGIONMATURITY] content, but your current preferences are set to exclude [REGIONMATURITY] content.
@ -4212,6 +4214,8 @@ The region you're trying to visit contains [REGIONMATURITY] content, but your cu
<notification
icon="notifytip.tga"
name="RegionEntryAccessBlocked_NotifyAdultsOnly"
log_to_im="false"
log_to_chat="true"
type="notifytip">
<tag>fail</tag>
The region you're trying to visit contains [REGIONMATURITY] content, which is accessible to adults only.
@ -4283,6 +4287,8 @@ The region you're trying to visit contains [REGIONMATURITY] content, but your cu
<notification
icon="notifytip.tga"
name="TeleportEntryAccessBlocked_Notify"
log_to_im="false"
log_to_chat="true"
type="notifytip">
<unique>
<context>REGIONMATURITY</context>
@ -4294,6 +4300,8 @@ The region you're trying to visit contains [REGIONMATURITY] content, but your cu
<notification
icon="notifytip.tga"
name="TeleportEntryAccessBlocked_NotifyAdultsOnly"
log_to_im="false"
log_to_chat="true"
type="notifytip">
<unique>
<context>REGIONMATURITY</context>
@ -4414,6 +4422,8 @@ You won't receive any more notifications that you're about to visit a region wit
<notification
icon="notifytip.tga"
name="LandClaimAccessBlocked_Notify"
log_to_im="false"
log_to_chat="true"
type="notifytip">
The land you're trying to claim contains [REGIONMATURITY] content, but your current preferences are set to exclude [REGIONMATURITY] content.
<tag>fail</tag>
@ -4422,6 +4432,8 @@ You won't receive any more notifications that you're about to visit a region wit
<notification
icon="notifytip.tga"
name="LandClaimAccessBlocked_NotifyAdultsOnly"
log_to_im="false"
log_to_chat="true"
type="notifytip">
<tag>fail</tag>
The land you're trying to claim contains [REGIONMATURITY] content, which is accessible to adults only.
@ -4479,6 +4491,8 @@ You won't receive any more notifications that you're about to visit a region wit
<notification
icon="notifytip.tga"
name="LandBuyAccessBlocked_Notify"
log_to_im="false"
log_to_chat="true"
type="notifytip">
The land you're trying to buy contains [REGIONMATURITY] content, but your current preferences are set to exclude [REGIONMATURITY] content.
<tag>fail</tag>
@ -4487,6 +4501,8 @@ You won't receive any more notifications that you're about to visit a region wit
<notification
icon="notifytip.tga"
name="LandBuyAccessBlocked_NotifyAdultsOnly"
log_to_im="false"
log_to_chat="true"
type="notifytip">
<tag>fail</tag>
The land you're trying to buy contains [REGIONMATURITY] content, which is accessible to adults only.