diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llcallfloater.cpp | 56 | ||||
-rw-r--r-- | indra/newview/llcallfloater.h | 10 | ||||
-rw-r--r-- | indra/newview/llimfloater.cpp | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_voice_controls.xml | 31 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_im_control_panel.xml | 1 |
5 files changed, 87 insertions, 15 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 46432a4953..1b929eca0e 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -35,6 +35,7 @@ #include "llcallfloater.h" +#include "llagentdata.h" // for gAgentID #include "llavatarlist.h" #include "llbottomtray.h" #include "llparticipantlist.h" @@ -46,6 +47,7 @@ LLCallFloater::LLCallFloater(const LLSD& key) , mSpeakerManager(NULL) , mPaticipants(NULL) , mAvatarList(NULL) +, mVoiceType(VC_LOCAL_CHAT) { } @@ -69,6 +71,8 @@ BOOL LLCallFloater::postBuild() anchor_panel, this, getDockTongue(), LLDockControl::TOP)); + initAgentData(); + // update list for current session updateSession(); @@ -110,6 +114,19 @@ void LLCallFloater::updateSession() if (im_session) { mSpeakerManager = LLIMModel::getInstance()->getSpeakerManager(session_id); + switch (im_session->mType) + { + case IM_NOTHING_SPECIAL: + case IM_SESSION_P2P_INVITE: + mVoiceType = VC_PEER_TO_PEER; + break; + case IM_SESSION_CONFERENCE_START: + mVoiceType = VC_AD_HOC_CHAT; + break; + default: + mVoiceType = VC_GROUP_CHAT; + break; + } } if (NULL == mSpeakerManager) @@ -117,6 +134,7 @@ void LLCallFloater::updateSession() // by default let show nearby chat participants mSpeakerManager = LLLocalSpeakerMgr::getInstance(); lldebugs << "Set DEFAULT speaker manager" << llendl; + mVoiceType = VC_LOCAL_CHAT; } updateTitle(); @@ -130,6 +148,11 @@ void LLCallFloater::refreshPartisipantList() bool do_not_use_context_menu_in_local_chat = LLLocalSpeakerMgr::getInstance() != mSpeakerManager; mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList, do_not_use_context_menu_in_local_chat); + + if (!do_not_use_context_menu_in_local_chat) + { + mAvatarList->setNoItemsCommentText(getString("no_one_near")); + } } void LLCallFloater::onCurrentChannelChanged(const LLUUID& /*session_id*/) @@ -140,16 +163,37 @@ void LLCallFloater::onCurrentChannelChanged(const LLUUID& /*session_id*/) void LLCallFloater::updateTitle() { LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel(); - if (NULL == voice_channel) return; - - std::string title = voice_channel->getSessionName(); - - if (LLLocalSpeakerMgr::getInstance() == mSpeakerManager) + std::string title; + switch (mVoiceType) { + case VC_LOCAL_CHAT: title = getString("title_nearby"); + break; + case VC_PEER_TO_PEER: + title = voice_channel->getSessionName(); + break; + case VC_AD_HOC_CHAT: + title = getString("title_adhoc"); + break; + case VC_GROUP_CHAT: + LLStringUtil::format_map_t args; + args["[GROUP]"] = voice_channel->getSessionName(); + title = getString("title_group", args); + break; } - // *TODO: mantipov: update code to use title from xml for other chat types setTitle(title); } + +void LLCallFloater::initAgentData() +{ + childSetValue("user_icon", gAgentID); + + std::string name; + gCacheName->getFullName(gAgentID, name); + childSetValue("user_text", name); + + LLOutputMonitorCtrl* speaking_indicator = getChild<LLOutputMonitorCtrl>("speaking_indicator"); + speaking_indicator->setSpeakerId(gAgentID); +} //EOF diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index 0cd5fe05c1..8a440873ff 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -61,6 +61,14 @@ public: /*virtual*/ void onOpen(const LLSD& key); private: + typedef enum e_voice_controls_type + { + VC_LOCAL_CHAT, + VC_GROUP_CHAT, + VC_AD_HOC_CHAT, + VC_PEER_TO_PEER + }EVoiceControls; + /** * Updates mSpeakerManager and list according to current Voice Channel * @@ -75,11 +83,13 @@ private: void refreshPartisipantList(); void onCurrentChannelChanged(const LLUUID& session_id); void updateTitle(); + void initAgentData(); private: LLSpeakerMgr* mSpeakerManager; LLParticipantList* mPaticipants; LLAvatarList* mAvatarList; + EVoiceControls mVoiceType; }; diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 5fa278e727..5e9ffdf410 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -34,6 +34,8 @@ #include "llimfloater.h" +#include "llnotificationsutil.h" + #include "llagent.h" #include "llappviewer.h" #include "llbutton.h" @@ -636,7 +638,7 @@ void LLIMFloater::processAgentListUpdates(const LLSD& body) mInputEditor->setLabel(label); if (moderator_muted_text) - LLNotifications::instance().add("TextChatIsMutedByModerator"); + LLNotificationsUtil::add("TextChatIsMutedByModerator"); } } } diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml index 4a5642e5c6..04696ca2e7 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -20,32 +20,37 @@ name="title_adhoc"> Conference Call </string> + <string + name="no_one_near"> + No one near + </string> <panel bevel_style="in" follows="left|right|top" - height="73" + height="62" layout="topleft" left="0" name="control_panel" - width="285"> + width="282"> <panel - height="20" + height="18" + follows="top|left|right" layout="topleft" left="10" name="my_panel" - width="262"> + width="263"> <avatar_icon enabled="false" follows="left|top" height="18" - image_name="Generic_Person" + default_icon_name="Generic_Person" layout="topleft" left="0" name="user_icon" top="0" width="18" /> <text - follows="top|left" + follows="top|left|right" font="SansSerifSmallBold" height="16" layout="topleft" @@ -53,8 +58,20 @@ name="user_text" text_color="white" top="4" + use_ellipses="true" value="Mya Avatar:" - width="80" /> + width="210" /> + <output_monitor + auto_update="true" + draw_border="false" + follows="right" + height="16" + layout="topleft" + name="speaking_indicator" + right="-1" + top="2" + visible="true" + width="20" /> </panel> <layout_stack bottom="10" diff --git a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml index 0a5812882d..0a3fd1699f 100644 --- a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml +++ b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml @@ -76,7 +76,6 @@ visible="false" width="100" /> <button - enabled="false" bottom="10" height="20" label="Voice Controls" |