From b57d8e9c06e01cc6aa2eca17fa80da0a36a52b91 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 30 Jul 2012 19:09:48 -0700 Subject: CHUI-258: Adding a method to better whether nearby chat is visible or not. --- indra/newview/llnearbychat.cpp | 29 ++++++++++++++++++++++ indra/newview/llnearbychat.h | 3 +-- indra/newview/llnotificationtiphandler.cpp | 2 +- .../newview/skins/default/xui/en/notifications.xml | 16 ++++++++++++ 4 files changed, 47 insertions(+), 3 deletions(-) diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 4e53082c05..3bd5f96add 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -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(); diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h index 90feb71488..a0928e67ef 100644 --- a/indra/newview/llnearbychat.h +++ b/indra/newview/llnearbychat.h @@ -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); diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index 507c6686fd..a420c0d2ed 100644 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -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; } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 3d057fa8f5..f3d2762d3f 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4204,6 +4204,8 @@ Are you sure you want to change the Estate Covenant? fail 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 fail 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 REGIONMATURITY @@ -4294,6 +4300,8 @@ The region you're trying to visit contains [REGIONMATURITY] content, but your cu REGIONMATURITY @@ -4414,6 +4422,8 @@ You won't receive any more notifications that you're about to visit a region wit The land you're trying to claim contains [REGIONMATURITY] content, but your current preferences are set to exclude [REGIONMATURITY] content. fail @@ -4422,6 +4432,8 @@ You won't receive any more notifications that you're about to visit a region wit fail 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 The land you're trying to buy contains [REGIONMATURITY] content, but your current preferences are set to exclude [REGIONMATURITY] content. fail @@ -4487,6 +4501,8 @@ You won't receive any more notifications that you're about to visit a region wit fail The land you're trying to buy contains [REGIONMATURITY] content, which is accessible to adults only. -- cgit v1.2.3