summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-12-07 19:00:35 -0800
committerMerov Linden <merov@lindenlab.com>2012-12-07 19:00:35 -0800
commit79b44fa561f58cdb47b7cfa6d0b55311d71688a8 (patch)
tree0ad10576473d9ae9fa17d9b4b1db136871958ae4 /indra/newview
parenta6f1690128b510977cfe86071f80f81967b9d0c7 (diff)
parentb1b4b78d5c97659d82ff67b38db4d4188967efbb (diff)
Pull merge from richard/viewer-chui
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llconversationview.cpp3
-rw-r--r--indra/newview/llfloaterimcontainer.cpp35
-rw-r--r--indra/newview/llfloaterimcontainer.h2
-rw-r--r--indra/newview/llfloaterimnearbychathandler.cpp5
-rw-r--r--indra/newview/llfloaterimsessiontab.cpp22
-rw-r--r--indra/newview/llfloaterimsessiontab.h1
-rw-r--r--indra/newview/llimview.cpp84
-rw-r--r--indra/newview/skins/default/xui/en/floater_im_container.xml17
8 files changed, 124 insertions, 45 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index b964cee09f..f088a8c084 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -472,6 +472,9 @@ S32 LLConversationViewParticipant::arrange(S32* width, S32* height)
mAvatarIcon->getRect().mBottom);
mAvatarIcon->setShape(avatarRect);
+ //Since dimensions changed, adjust the children (info button, speaker indicator)
+ updateChildren();
+
return arranged;
}
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 23c21d5309..c36128b0bd 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -206,6 +206,7 @@ BOOL LLFloaterIMContainer::postBuild()
mExpandCollapseBtn->setClickedCallback(boost::bind(&LLFloaterIMContainer::onExpandCollapseButtonClicked, this));
mStubCollapseBtn = getChild<LLButton>("stub_collapse_btn");
mStubCollapseBtn->setClickedCallback(boost::bind(&LLFloaterIMContainer::onStubCollapseButtonClicked, this));
+ getChild<LLButton>("speak_btn")->setClickedCallback(boost::bind(&LLFloaterIMContainer::onSpeakButtonClicked, this));
childSetAction("add_btn", boost::bind(&LLFloaterIMContainer::onAddButtonClicked, this));
@@ -341,6 +342,11 @@ void LLFloaterIMContainer::onStubCollapseButtonClicked()
collapseMessagesPane(true);
}
+void LLFloaterIMContainer::onSpeakButtonClicked()
+{
+ LLAgent::toggleMicrophone("speak");
+ updateSpeakBtnState();
+}
void LLFloaterIMContainer::onExpandCollapseButtonClicked()
{
if (mConversationsPane->isCollapsed() && mMessagesPane->isCollapsed()
@@ -870,8 +876,16 @@ const LLConversationItem * LLFloaterIMContainer::getCurSelectedViewModelItem()
mConversationsRoot->getCurSelectedItem() &&
mConversationsRoot->getCurSelectedItem()->getViewModelItem())
{
- conversationItem = static_cast<LLConversationItem *>(mConversationsRoot->getCurSelectedItem()->getViewModelItem());
- }
+ LLFloaterIMSessionTab *selectedSession = LLFloaterIMSessionTab::getConversation(mSelectedSession);
+ if (selectedSession && selectedSession->isTornOff())
+ {
+ conversationItem = selectedSession->getCurSelectedViewModelItem();
+ }
+ else
+ {
+ conversationItem = static_cast<LLConversationItem *>(mConversationsRoot->getCurSelectedItem()->getViewModelItem());
+ }
+ }
return conversationItem;
}
@@ -1560,21 +1574,19 @@ void LLFloaterIMContainer::moderateVoiceParticipant(const LLUUID& avatar_id, boo
LLSpeakerMgr * LLFloaterIMContainer::getSpeakerMgrForSelectedParticipant()
{
- LLFolderViewItem * selected_folder_itemp = mConversationsRoot->getCurSelectedItem();
- if (NULL == selected_folder_itemp)
+ LLFolderViewItem *selectedItem = mConversationsRoot->getCurSelectedItem();
+ if (NULL == selectedItem)
{
llwarns << "Current selected item is null" << llendl;
return NULL;
}
- LLFolderViewFolder * conversation_itemp = selected_folder_itemp->getParentFolder();
-
conversations_widgets_map::const_iterator iter = mConversationsWidgets.begin();
conversations_widgets_map::const_iterator end = mConversationsWidgets.end();
const LLUUID * conversation_uuidp = NULL;
while(iter != end)
{
- if (iter->second == conversation_itemp)
+ if (iter->second == selectedItem || iter->second == selectedItem->getParentFolder())
{
conversation_uuidp = &iter->first;
break;
@@ -1644,7 +1656,7 @@ void LLFloaterIMContainer::openNearbyChat()
LLConversationViewSession* nearby_chat = dynamic_cast<LLConversationViewSession*>(get_ptr_in_map(mConversationsWidgets,LLUUID()));
if (nearby_chat)
{
- selectConversation(LLUUID());
+ reSelectConversation();
nearby_chat->setOpen(TRUE);
}
}
@@ -1666,6 +1678,13 @@ void LLFloaterIMContainer::reSelectConversation()
}
}
+void LLFloaterIMContainer::updateSpeakBtnState()
+{
+ LLButton* mSpeakBtn = getChild<LLButton>("speak_btn");
+ mSpeakBtn->setToggleState(LLVoiceClient::getInstance()->getUserPTTState());
+ mSpeakBtn->setEnabled(LLAgent::isActionAllowed("speak"));
+}
+
void LLFloaterIMContainer::flashConversationItemWidget(const LLUUID& session_id, bool is_flashes)
{
//Finds the conversation line item to flash using the session_id
diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h
index c9987bffe8..92985c036a 100644
--- a/indra/newview/llfloaterimcontainer.h
+++ b/indra/newview/llfloaterimcontainer.h
@@ -117,6 +117,7 @@ private:
void onExpandCollapseButtonClicked();
void onStubCollapseButtonClicked();
void processParticipantsStyleUpdate();
+ void onSpeakButtonClicked();
void collapseConversationsPane(bool collapse);
@@ -172,6 +173,7 @@ public:
void setTimeNow(const LLUUID& session_id, const LLUUID& participant_id);
void setNearbyDistances();
void reSelectConversation();
+ void updateSpeakBtnState();
void flashConversationItemWidget(const LLUUID& session_id, bool is_flashes);
private:
diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp
index 903c903381..f64cfd0245 100644
--- a/indra/newview/llfloaterimnearbychathandler.cpp
+++ b/indra/newview/llfloaterimnearbychathandler.cpp
@@ -557,7 +557,10 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
// Send event on to LLEventStream
sChatWatcher->post(chat);
- if( nearby_chat->isInVisibleChain()
+ LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
+
+ if( nearby_chat->hasFocus()
+ || im_box->hasFocus()
|| ( chat_msg.mSourceType == CHAT_SOURCE_AGENT
&& gSavedSettings.getBOOL("UseChatBubbles") )
|| mChannel.isDead()
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index da25f95ffe..4c6d8fa5a0 100644
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -167,12 +167,7 @@ void LLFloaterIMSessionTab::addToHost(const LLUUID& session_id)
if (!conversp->isNearbyChat()
|| gSavedSettings.getBOOL("NearbyChatIsNotTornOff"))
{
- floater_container->addFloater(conversp, FALSE, LLTabContainer::END);
-
- if (!floater_container->getVisible())
- {
- LLFloaterReg::toggleInstanceOrBringToFront("im_container");
- }
+ floater_container->addFloater(conversp, !floater_container->getVisible(), LLTabContainer::RIGHT_OF_CURRENT);
}
else
{
@@ -698,7 +693,8 @@ void LLFloaterIMSessionTab::updateCallBtnState(bool callIsActive)
voiceButton->setToolTip(
callIsActive? getString("end_call_button_tooltip") : getString("start_call_button_tooltip"));
- enableDisableCallBtn();
+ LLFloaterIMContainer::getInstance()->updateSpeakBtnState();
+ enableDisableCallBtn();
}
@@ -831,4 +827,16 @@ void LLFloaterIMSessionTab::getSelectedUUIDs(uuid_vec_t& selected_uuids)
}
}
+LLConversationItem* LLFloaterIMSessionTab::getCurSelectedViewModelItem()
+{
+ LLConversationItem *conversationItem = NULL;
+ if(mConversationsRoot &&
+ mConversationsRoot->getCurSelectedItem() &&
+ mConversationsRoot->getCurSelectedItem()->getViewModelItem())
+ {
+ conversationItem = static_cast<LLConversationItem *>(mConversationsRoot->getCurSelectedItem()->getViewModelItem()) ;
+ }
+
+ return conversationItem;
+}
diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h
index 8efa0955fc..4851904074 100644
--- a/indra/newview/llfloaterimsessiontab.h
+++ b/indra/newview/llfloaterimsessiontab.h
@@ -94,6 +94,7 @@ public:
virtual void onTearOffClicked();
virtual void updateMessages() {}
+ LLConversationItem* getCurSelectedViewModelItem();
protected:
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 0b18a503ab..4e2ac09dd8 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -30,6 +30,7 @@
#include "llavatarnamecache.h" // IDEVO
#include "llavataractions.h"
+#include "llfloaterconversationlog.h"
#include "llfloaterreg.h"
#include "llfontgl.h"
#include "llgl.h"
@@ -155,57 +156,74 @@ void on_new_message(const LLSD& msg)
// execution of the action
+ LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
+ LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(session_id);
+
+ //session floater not focused (visible or not)
+ bool sessionFloaterNotFocused = session_floater && !session_floater->hasFocus();
+
+ //conversation floater not focused (visible or not)
+ bool conversationFloaterNotFocused = im_box && !im_box->hasFocus();
+
if ("toast" == action)
{
// Skip toasting if we have open window of IM with this session id
- LLFloaterIMSession* open_im_floater = LLFloaterIMSession::findInstance(session_id);
if (
- open_im_floater
- && open_im_floater->isInVisibleChain()
- && open_im_floater->hasFocus()
- && !open_im_floater->isMinimized()
- && !(open_im_floater->getHost()
- && open_im_floater->getHost()->isMinimized())
+ session_floater
+ && session_floater->isInVisibleChain()
+ && session_floater->hasFocus()
+ && !session_floater->isMinimized()
+ && !(session_floater->getHost()
+ && session_floater->getHost()->isMinimized())
)
{
return;
}
// Skip toasting for system messages and for nearby chat
- if (participant_id.isNull() || session_id.isNull())
+ if (participant_id.isNull())
{
return;
}
- //Show toast
- LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg));
+ //User is not focused on conversation containing the message
+ if(sessionFloaterNotFocused)
+ {
+ im_box->flashConversationItemWidget(session_id, true);
+
+ //The conversation floater isn't focused/open
+ if(conversationFloaterNotFocused)
+ {
+ gToolBarView->flashCommand(LLCommandId("chat"), true);
+
+ //Show IM toasts (upper right toasts)
+ if(session_id.notNull())
+ {
+ LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg));
+ }
+ }
+ }
}
else if ("flash" == action)
{
- LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
- if (im_box)
+ //User is not focused on conversation containing the message
+ if(sessionFloaterNotFocused && conversationFloaterNotFocused)
+ {
+ gToolBarView->flashCommand(LLCommandId("chat"), true);
+ }
+ //conversation floater is open but a different conversation is focused
+ else if(sessionFloaterNotFocused)
{
- im_box->flashConversationItemWidget(session_id, true); // flashing of the conversation's item
+ im_box->flashConversationItemWidget(session_id, true);
}
- gToolBarView->flashCommand(LLCommandId("chat"), true); // flashing of the FUI button "Chat"
}
else if("openconversations" == action)
{
- LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
- LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(session_id);
-
- //Don't flash and show conversation floater when conversation already active (has focus)
- if(session_floater
- && (!session_floater->isInVisibleChain()) //conversation floater not displayed
- ||
- (session_floater->isInVisibleChain() && session_floater->hasFocus() == false)) //conversation floater is displayed but doesn't have focus
-
+ //User is not focused on conversation containing the message
+ if(sessionFloaterNotFocused)
{
//Flash line item
- if (im_box)
- {
- im_box->flashConversationItemWidget(session_id, true); // flashing of the conversation's item
- }
+ im_box->flashConversationItemWidget(session_id, true);
//Surface conversations floater
LLFloaterReg::showInstance("im_container");
@@ -2459,6 +2477,18 @@ void LLIMMgr::addMessage(
new_session_id = computeSessionID(dialog, other_participant_id);
}
+ // Open conversation log if offline messages are present
+ if (is_offline_msg)
+ {
+ LLFloaterConversationLog* floater_log =
+ LLFloaterReg::getTypedInstance<LLFloaterConversationLog>("conversation");
+ if (floater_log && !(floater_log->isFrontmost()))
+ {
+ floater_log->openFloater();
+ floater_log->setFrontmost(TRUE);
+ }
+ }
+
//*NOTE session_name is empty in case of incoming P2P sessions
std::string fixed_session_name = from;
bool name_is_setted = false;
diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml
index 152c897120..9f6503d799 100644
--- a/indra/newview/skins/default/xui/en/floater_im_container.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_container.xml
@@ -32,7 +32,7 @@
top="0"
width="450">
<layout_panel
- auto_resize="true"
+ auto_resize="false"
user_resize="true"
height="430"
name="conversations_layout_panel"
@@ -73,13 +73,26 @@
image_hover_unselected="Toolbar_Middle_Over"
image_overlay="Conv_toolbar_plus"
image_selected="Toolbar_Middle_Selected"
- image_unselected="Toolbar_Middle_Off"
+ image_unselected="Toolbar_Middle_Off"
layout="topleft"
top="5"
left_pad="4"
name="add_btn"
tool_tip="Start a new conversation"
width="31"/>
+ <button
+ follows="top|left"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="Command_Speak_Icon"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ layout="topleft"
+ top="5"
+ left_pad="4"
+ name="speak_btn"
+ tool_tip="Speak with people using your microphone"
+ width="31"/>
</layout_panel>
<layout_panel
auto_resize="false"