summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterimcontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterimcontainer.cpp')
-rwxr-xr-xindra/newview/llfloaterimcontainer.cpp70
1 files changed, 54 insertions, 16 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 4591b80ac4..b5aa309066 100755
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -101,6 +101,7 @@ LLFloaterIMContainer::~LLFloaterIMContainer()
gSavedPerAccountSettings.setBOOL("ConversationsListPaneCollapsed", mConversationsPane->isCollapsed());
gSavedPerAccountSettings.setBOOL("ConversationsMessagePaneCollapsed", mMessagesPane->isCollapsed());
+ gSavedPerAccountSettings.setBOOL("ConversationsParticipantListCollapsed", !isParticipantListExpanded());
if (!LLSingleton<LLIMMgr>::destroyed())
{
@@ -250,6 +251,11 @@ BOOL LLFloaterIMContainer::postBuild()
// Init the sort order now that the root had been created
setSortOrder(LLConversationSort(gSavedSettings.getU32("ConversationSortOrder")));
+ //We should expand nearby chat participants list for the new user
+ if(gAgent.isFirstLogin() || !gSavedPerAccountSettings.getBOOL("ConversationsParticipantListCollapsed"))
+ {
+ expandConversation();
+ }
// Keep the xml set title around for when we have to overwrite it
mGeneralTitle = getTitle();
@@ -662,10 +668,10 @@ void LLFloaterIMContainer::setVisible(BOOL visible)
LLFloater* session_floater = widget->getSessionFloater();
if (session_floater != nearby_chat)
{
- widget->setVisibleIfDetached(visible);
- }
+ widget->setVisibleIfDetached(visible);
}
}
+ }
// Now, do the normal multifloater show/hide
LLMultiFloater::setVisible(visible);
@@ -674,13 +680,18 @@ void LLFloaterIMContainer::setVisible(BOOL visible)
void LLFloaterIMContainer::getDetachedConversationFloaters(floater_list_t& floaters)
{
typedef conversations_widgets_map::value_type conv_pair;
+ LLFloaterIMNearbyChat *nearby_chat = LLFloaterReg::findTypedInstance<LLFloaterIMNearbyChat>("nearby_chat");
+
BOOST_FOREACH(conv_pair item, mConversationsWidgets)
{
LLConversationViewSession* widget = dynamic_cast<LLConversationViewSession*>(item.second);
if (widget)
{
LLFloater* session_floater = widget->getSessionFloater();
- if (session_floater && session_floater->isDetachedAndNotMinimized())
+
+ // Exclude nearby chat from output, as it should be handled separately
+ if (session_floater && session_floater->isDetachedAndNotMinimized()
+ && session_floater != nearby_chat)
{
floaters.push_back(session_floater);
}
@@ -695,13 +706,13 @@ void LLFloaterIMContainer::setVisibleAndFrontmost(BOOL take_focus, const LLSD& k
// Only select other sessions
if (!getSelectedSession().isNull())
{
- selectConversationPair(getSelectedSession(), false, take_focus);
+ selectConversationPair(getSelectedSession(), false, take_focus);
}
if (mInitialized && mIsFirstLaunch)
{
collapseMessagesPane(gSavedPerAccountSettings.getBOOL("ConversationsMessagePaneCollapsed"));
mIsFirstLaunch = false;
- }
+}
}
void LLFloaterIMContainer::updateResizeLimits()
@@ -710,6 +721,16 @@ void LLFloaterIMContainer::updateResizeLimits()
assignResizeLimits();
}
+bool LLFloaterIMContainer::isMessagesPaneCollapsed()
+{
+ return mMessagesPane->isCollapsed();
+}
+
+bool LLFloaterIMContainer::isConversationsPaneCollapsed()
+{
+ return mConversationsPane->isCollapsed();
+}
+
void LLFloaterIMContainer::collapseMessagesPane(bool collapse)
{
if (mMessagesPane->isCollapsed() == collapse)
@@ -779,8 +800,8 @@ void LLFloaterIMContainer::collapseConversationsPane(bool collapse, bool save_is
mConversationsPane->setTargetDim(gSavedPerAccountSettings.getS32("ConversationsListPaneWidth"));
}
- S32 delta_width =
- gSavedPerAccountSettings.getS32("ConversationsListPaneWidth") - mConversationsPane->getMinDim();
+ S32 delta_width = gSavedPerAccountSettings.getS32("ConversationsListPaneWidth")
+ - mConversationsPane->getMinDim() - mConversationsStack->getPanelSpacing() + 1;
reshapeFloaterAndSetResizeLimits(collapse, delta_width);
@@ -829,7 +850,7 @@ void LLFloaterIMContainer::assignResizeLimits()
S32 conv_pane_target_width = is_conv_pane_expanded
? ( is_msg_pane_expanded?mConversationsPane->getRect().getWidth():mConversationsPane->getExpandedMinDim() )
- : mConversationsPane->getMinDim();
+ : mConversationsPane->getMinDim();
S32 msg_pane_min_width = is_msg_pane_expanded ? mMessagesPane->getExpandedMinDim() : 0;
S32 new_min_width = conv_pane_target_width + msg_pane_min_width + summary_width_of_visible_borders;
@@ -990,7 +1011,7 @@ void LLFloaterIMContainer::setSortOrder(const LLConversationSort& order)
conversation_floater->setSortOrder(order);
}
}
-
+
gSavedSettings.setU32("ConversationSortOrder", (U32)order);
}
@@ -1075,6 +1096,10 @@ void LLFloaterIMContainer::doToParticipants(const std::string& command, uuid_vec
{
LLAvatarActions::offerTeleport(selectedIDS);
}
+ else if ("request_teleport" == command)
+ {
+ LLAvatarActions::teleportRequest(selectedIDS.front());
+ }
else if ("voice_call" == command)
{
LLAvatarActions::startCall(userID);
@@ -1177,7 +1202,7 @@ void LLFloaterIMContainer::doToSelectedConversation(const std::string& command,
}
else if("chat_history" == command)
{
- if (selectedIDS.size() > 0)
+ if (selectedIDS.size() > 0)
{
LLAvatarActions::viewChatHistory(selectedIDS.front());
}
@@ -1199,7 +1224,7 @@ void LLFloaterIMContainer::doToSelectedConversation(const std::string& command,
{
LLFloaterReg::showInstance("preview_conversation", LLSD(LLUUID::null), true);
}
- }
+}
}
}
@@ -1230,7 +1255,7 @@ void LLFloaterIMContainer::doToSelectedGroup(const LLSD& userdata)
if (action == "group_profile")
{
- LLGroupActions::show(mSelectedSession);
+ LLGroupActions::show(mSelectedSession);
}
else if (action == "activate_group")
{
@@ -1604,7 +1629,7 @@ LLConversationItem* LLFloaterIMContainer::addConversationListItem(const LLUUID&
// Create the participants widgets now
// Note: usually, we do not get an updated avatar list at that point
- if (uuid.isNull() || im_sessionp && !im_sessionp->isP2PSessionType())
+ if (uuid.isNull() || (im_sessionp && !im_sessionp->isP2PSessionType()))
{
LLFolderViewModelItemCommon::child_list_t::const_iterator current_participant_model = item->getChildrenBegin();
LLFolderViewModelItemCommon::child_list_t::const_iterator end_participant_model = item->getChildrenEnd();
@@ -2077,6 +2102,19 @@ void LLFloaterIMContainer::expandConversation()
}
}
}
+bool LLFloaterIMContainer::isParticipantListExpanded()
+{
+ bool is_expanded = false;
+ if(!mConversationsPane->isCollapsed())
+ {
+ LLConversationViewSession* widget = dynamic_cast<LLConversationViewSession*>(get_ptr_in_map(mConversationsWidgets,getSelectedSession()));
+ if (widget)
+ {
+ is_expanded = widget->isOpen();
+ }
+ }
+ return is_expanded;
+}
// By default, if torn off session is currently frontmost, LLFloater::isFrontmost() will return FALSE, which can lead to some bugs
// So LLFloater::isFrontmost() is overriden here to check both selected session and the IM floater itself
@@ -2093,7 +2131,7 @@ BOOL LLFloaterIMContainer::isFrontmost()
// For conversations, closeFloater() (linked to Ctrl-W) does not actually close the floater but the active conversation.
// This is intentional so it doesn't confuse the user. onClickCloseBtn() closes the whole floater.
-void LLFloaterIMContainer::onClickCloseBtn()
+void LLFloaterIMContainer::onClickCloseBtn(bool app_quitting/* = false*/)
{
// Always unminimize before trying to close.
// Most of the time the user will never see this state.
@@ -2102,7 +2140,7 @@ void LLFloaterIMContainer::onClickCloseBtn()
LLMultiFloater::setMinimized(FALSE);
}
- LLFloater::closeFloater();
+ LLFloater::closeFloater(app_quitting);
}
void LLFloaterIMContainer::closeHostedFloater()
@@ -2149,7 +2187,7 @@ void LLFloaterIMContainer::closeFloater(bool app_quitting/* = false*/)
if(app_quitting)
{
closeAllConversations();
- onClickCloseBtn();
+ onClickCloseBtn(app_quitting);
}
else
{