summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-09-28 17:38:34 -0700
committerMerov Linden <merov@lindenlab.com>2012-09-28 17:38:34 -0700
commitd1ada50b9e6f9a357d04498cf138208ee7653d7c (patch)
treece023fc35c03a105d023028798f2bc423cbe4426 /indra/newview
parent7fc33cc47fdc080bbc7674cf118011b689ba1485 (diff)
parent8b2ed2e2050fcb8836be120902f44417613adb13 (diff)
Mer ge pull from richard/viewer-chui
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/CMakeLists.txt2
-rwxr-xr-xindra/newview/llavataractions.cpp6
-rw-r--r--indra/newview/llavataractions.h5
-rwxr-xr-xindra/newview/llconversationview.cpp58
-rwxr-xr-xindra/newview/llconversationview.h6
-rw-r--r--indra/newview/llfloaterchatvoicevolume.cpp26
-rw-r--r--indra/newview/llfloaterchatvoicevolume.h26
-rw-r--r--[-rwxr-xr-x]indra/newview/llimfloatercontainer.cpp1
-rw-r--r--indra/newview/llinventorypanel.cpp3
-rw-r--r--indra/newview/llnearbychat.cpp2
-rw-r--r--indra/newview/lloutputmonitorctrl.cpp13
-rw-r--r--indra/newview/lloutputmonitorctrl.h6
-rw-r--r--indra/newview/llpanelpeoplemenus.cpp1
-rw-r--r--indra/newview/llviewerfloaterreg.cpp2
-rw-r--r--indra/newview/skins/default/xui/en/floater_voice_chat_volume.xml48
-rw-r--r--indra/newview/skins/default/xui/en/menu_people_friends_view.xml8
-rw-r--r--indra/newview/skins/default/xui/en/menu_people_nearby.xml10
17 files changed, 202 insertions, 21 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index b94c33587b..ec1562a4c1 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -197,6 +197,7 @@ set(viewer_SOURCE_FILES
llfloaterbuycurrencyhtml.cpp
llfloaterbuyland.cpp
llfloatercamera.cpp
+ llfloaterchatvoicevolume.cpp
llfloatercolorpicker.cpp
llfloaterconversationlog.cpp
llfloaterconversationpreview.cpp
@@ -781,6 +782,7 @@ set(viewer_HEADER_FILES
llfloaterbuycurrencyhtml.h
llfloaterbuyland.h
llfloatercamera.h
+ llfloaterchatvoicevolume.h
llfloatercolorpicker.h
llfloaterconversationlog.h
llfloaterconversationpreview.h
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 42a0376774..a76dbcac53 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -897,6 +897,12 @@ void LLAvatarActions::inviteToGroup(const LLUUID& id)
}
}
+// static
+void LLAvatarActions::viewChatHistory(const LLUUID& id)
+{
+ LLFloaterReg::showInstance("preview_conversation", id, true);
+}
+
//== private methods ========================================================================================
// static
diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h
index 473b9cecc3..6e60f624ad 100644
--- a/indra/newview/llavataractions.h
+++ b/indra/newview/llavataractions.h
@@ -218,6 +218,11 @@ public:
*/
static void buildResidentsString(const std::vector<LLAvatarName> avatar_names, std::string& residents_string);
+ /**
+ * Opens the chat history for avatar
+ */
+ static void viewChatHistory(const LLUUID& id);
+
static std::set<LLUUID> getInventorySelectedUUIDs();
private:
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index ab15e20d89..c2898d9a47 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -45,6 +45,30 @@ static LLDefaultChildRegistry::Register<LLConversationViewSession> r_conversatio
const LLColor4U DEFAULT_WHITE(255, 255, 255);
+class LLNearbyVoiceClientStatusObserver : public LLVoiceClientStatusObserver
+{
+public:
+
+ LLNearbyVoiceClientStatusObserver(LLConversationViewSession* conv)
+ : conversation(conv)
+ {}
+
+ virtual void onChange(EStatusType status, const std::string &channelURI, bool proximal)
+ {
+ if (conversation
+ && status != STATUS_JOINING
+ && status != STATUS_LEFT_CHANNEL
+ && LLVoiceClient::getInstance()->voiceEnabled()
+ && LLVoiceClient::getInstance()->isVoiceWorking())
+ {
+ conversation->showVoiceIndicator();
+ }
+ }
+
+private:
+ LLConversationViewSession* conversation;
+};
+
LLConversationViewSession::Params::Params() :
container()
{}
@@ -55,13 +79,19 @@ LLConversationViewSession::LLConversationViewSession(const LLConversationViewSes
mItemPanel(NULL),
mCallIconLayoutPanel(NULL),
mSessionTitle(NULL),
- mSpeakingIndicator(NULL)
+ mSpeakingIndicator(NULL),
+ mVoiceClientObserver(NULL)
{
}
LLConversationViewSession::~LLConversationViewSession()
{
mActiveVoiceChannelConnection.disconnect();
+
+ if(LLVoiceClient::instanceExists() && mVoiceClientObserver)
+ {
+ LLVoiceClient::getInstance()->removeObserver(mVoiceClientObserver);
+ }
}
BOOL LLConversationViewSession::postBuild()
@@ -91,8 +121,7 @@ BOOL LLConversationViewSession::postBuild()
LLAvatarIconCtrl* icon = mItemPanel->getChild<LLAvatarIconCtrl>("avatar_icon");
icon->setVisible(true);
icon->setValue(session->mOtherParticipantID);
- mSpeakingIndicator->setSpeakerId(gAgentID, session->mSessionID);
- mSpeakingIndicator->setShowParticipantsTalking(true);
+ mSpeakingIndicator->setSpeakerId(gAgentID, session->mSessionID, true);
}
break;
}
@@ -100,27 +129,28 @@ BOOL LLConversationViewSession::postBuild()
{
LLGroupIconCtrl* icon = mItemPanel->getChild<LLGroupIconCtrl>("group_icon");
icon->setVisible(true);
- mSpeakingIndicator->setSpeakerId(gAgentID, vmi->getUUID());
- mSpeakingIndicator->setShowParticipantsTalking(true);
+ mSpeakingIndicator->setSpeakerId(gAgentID, vmi->getUUID(), true);
}
case LLConversationItem::CONV_SESSION_GROUP:
{
LLGroupIconCtrl* icon = mItemPanel->getChild<LLGroupIconCtrl>("group_icon");
icon->setVisible(true);
icon->setValue(vmi->getUUID());
- mSpeakingIndicator->setSpeakerId(gAgentID, vmi->getUUID());
- mSpeakingIndicator->setShowParticipantsTalking(true);
+ mSpeakingIndicator->setSpeakerId(gAgentID, vmi->getUUID(), true);
break;
}
case LLConversationItem::CONV_SESSION_NEARBY:
{
LLIconCtrl* icon = mItemPanel->getChild<LLIconCtrl>("nearby_chat_icon");
icon->setVisible(true);
- mSpeakingIndicator->setSpeakerId(gAgentID);
- mSpeakingIndicator->setShowParticipantsTalking(true);
+ mSpeakingIndicator->setSpeakerId(gAgentID, LLUUID::null, true);
+ if(LLVoiceClient::instanceExists())
+ {
+ LLNearbyVoiceClientStatusObserver* mVoiceClientObserver = new LLNearbyVoiceClientStatusObserver(this);
+ LLVoiceClient::getInstance()->addObserver(mVoiceClientObserver);
+ }
break;
}
-
default:
break;
}
@@ -232,6 +262,14 @@ LLConversationViewParticipant* LLConversationViewSession::findParticipant(const
return (iter == getItemsEnd() ? NULL : participant);
}
+void LLConversationViewSession::showVoiceIndicator()
+{
+ if (LLVoiceChannel::getCurrentVoiceChannel()->getSessionID().isNull())
+ {
+ mCallIconLayoutPanel->setVisible(true);
+ }
+}
+
void LLConversationViewSession::refresh()
{
// Refresh the session view from its model data
diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h
index dbc7f3b1bb..064239eeb1 100755
--- a/indra/newview/llconversationview.h
+++ b/indra/newview/llconversationview.h
@@ -38,6 +38,8 @@ class LLIMFloaterContainer;
class LLConversationViewSession;
class LLConversationViewParticipant;
+class LLVoiceClientStatusObserver;
+
// Implementation of conversations list session widgets
class LLConversationViewSession : public LLFolderViewFolder
@@ -68,6 +70,8 @@ public:
void setVisibleIfDetached(BOOL visible);
LLConversationViewParticipant* findParticipant(const LLUUID& participant_id);
+ void showVoiceIndicator();
+
virtual void refresh();
private:
@@ -79,6 +83,8 @@ private:
LLTextBox* mSessionTitle;
LLOutputMonitorCtrl* mSpeakingIndicator;
+ LLVoiceClientStatusObserver* mVoiceClientObserver;
+
boost::signals2::connection mActiveVoiceChannelConnection;
};
diff --git a/indra/newview/llfloaterchatvoicevolume.cpp b/indra/newview/llfloaterchatvoicevolume.cpp
new file mode 100644
index 0000000000..d10c3c6504
--- /dev/null
+++ b/indra/newview/llfloaterchatvoicevolume.cpp
@@ -0,0 +1,26 @@
+/*
+ * llfloaterchatvoicevolume.cpp
+ *
+ * Created on: Sep 27, 2012
+ * Author: pguslisty
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llfloaterchatvoicevolume.h"
+
+LLFloaterChatVoiceVolume::LLFloaterChatVoiceVolume(const LLSD& key)
+: LLInspect(key)
+{
+}
+
+void LLFloaterChatVoiceVolume::onOpen(const LLSD& key)
+{
+ LLInspect::onOpen(key);
+ LLUI::positionViewNearMouse(this);
+}
+
+LLFloaterChatVoiceVolume::~LLFloaterChatVoiceVolume()
+{
+ LLTransientFloaterMgr::getInstance()->removeControlView(this);
+};
diff --git a/indra/newview/llfloaterchatvoicevolume.h b/indra/newview/llfloaterchatvoicevolume.h
new file mode 100644
index 0000000000..0aeab7874c
--- /dev/null
+++ b/indra/newview/llfloaterchatvoicevolume.h
@@ -0,0 +1,26 @@
+/*
+ * llfloaterchatvoicevolume.h
+ *
+ * Created on: Sep 27, 2012
+ * Author: pguslisty
+ */
+
+#ifndef LLFLOATERCHATVOICEVOLUME_H_
+#define LLFLOATERCHATVOICEVOLUME_H_
+
+#include "llinspect.h"
+#include "lltransientfloatermgr.h"
+
+class LLFloaterChatVoiceVolume : public LLInspect, LLTransientFloater
+{
+public:
+
+ LLFloaterChatVoiceVolume(const LLSD& key);
+ virtual ~LLFloaterChatVoiceVolume();
+
+ virtual void onOpen(const LLSD& key);
+
+ /*virtual*/ LLTransientFloaterMgr::ETransientGroup getGroup() { return LLTransientFloaterMgr::GLOBAL; }
+};
+
+#endif /* LLFLOATERCHATVOICEVOLUME_H_ */
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 45d63ce4f9..ffbdae305b 100755..100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -464,6 +464,7 @@ void LLIMFloaterContainer::setVisible(BOOL visible)
// *TODO: find a way to move this to XML as a default panel or something like that
LLSD name("nearby_chat");
LLFloaterReg::toggleInstanceOrBringToFront(name);
+ LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat")->addToHost();
}
}
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 2a84616ddf..a77b57638f 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -441,8 +441,9 @@ void LLInventoryPanel::modelChanged(U32 mask)
handled = true;
if (model_item && view_item && viewmodel_item)
{
+ const LLUUID& idp = viewmodel_item->getUUID();
view_item->destroyView();
- removeItemID(viewmodel_item->getUUID());
+ removeItemID(idp);
}
view_item = buildNewViews(item_id);
viewmodel_item =
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index 75c691d99b..4b35092f2d 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -122,8 +122,6 @@ BOOL LLNearbyChat::postBuild()
// it is used for show the item's name in the conversations list
setTitle(LLTrans::getString("NearbyChatTitle"));
- addToHost();
-
//for menu
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp
index 1c412b15f7..4a9a50d96a 100644
--- a/indra/newview/lloutputmonitorctrl.cpp
+++ b/indra/newview/lloutputmonitorctrl.cpp
@@ -75,7 +75,7 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p)
mIsAgentControl(false),
mIsSwitchDirty(false),
mShouldSwitchOn(false),
- mShowParticipantsTalking(false)
+ mShowParticipantsSpeaking(false)
{
//static LLUIColor output_monitor_muted_color = LLUIColorTable::instance().getColor("OutputMonitorMutedColor", LLColor4::orange);
//static LLUIColor output_monitor_overdriven_color = LLUIColorTable::instance().getColor("OutputMonitorOverdrivenColor", LLColor4::red);
@@ -158,7 +158,7 @@ void LLOutputMonitorCtrl::draw()
}
}
- if ((mPower == 0.f && !mIsTalking) && mShowParticipantsTalking)
+ if ((mPower == 0.f && !mIsTalking) && mShowParticipantsSpeaking)
{
std::set<LLUUID> participant_uuids;
LLVoiceClient::instance().getParticipantList(participant_uuids);
@@ -264,15 +264,19 @@ void LLOutputMonitorCtrl::draw()
// virtual
BOOL LLOutputMonitorCtrl::handleMouseUp(S32 x, S32 y, MASK mask)
{
- if (mSpeakerId != gAgentID)
+ if (mSpeakerId != gAgentID && !mShowParticipantsSpeaking)
{
LLFloaterReg::showInstance("floater_voice_volume", LLSD().with("avatar_id", mSpeakerId));
}
+ else if(mShowParticipantsSpeaking)
+ {
+ LLFloaterReg::showInstance("chat_voice", LLSD());
+ }
return TRUE;
}
-void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id, const LLUUID& session_id/* = LLUUID::null*/)
+void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id, const LLUUID& session_id/* = LLUUID::null*/, bool show_other_participants_speaking /* = false */)
{
if (speaker_id.isNull() && mSpeakerId.notNull())
{
@@ -287,6 +291,7 @@ void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id, const LLUUID& s
LLSpeakingIndicatorManager::unregisterSpeakingIndicator(mSpeakerId, this);
}
+ mShowParticipantsSpeaking = show_other_participants_speaking;
mSpeakerId = speaker_id;
LLSpeakingIndicatorManager::registerSpeakingIndicator(mSpeakerId, this, session_id);
diff --git a/indra/newview/lloutputmonitorctrl.h b/indra/newview/lloutputmonitorctrl.h
index 44d4d6f64b..1fa6ef41f8 100644
--- a/indra/newview/lloutputmonitorctrl.h
+++ b/indra/newview/lloutputmonitorctrl.h
@@ -82,7 +82,7 @@ public:
void setIsTalking(bool val) { mIsTalking = val; }
- void setShowParticipantsTalking(bool show) { mShowParticipantsTalking = show; }
+ void setShowParticipantsSpeaking(bool show) { mShowParticipantsSpeaking = show; }
/**
* Sets avatar UUID to interact with voice channel.
@@ -92,7 +92,7 @@ public:
* If this parameter is set registered indicator will be shown only in voice channel
* which has the same session id (EXT-5562).
*/
- void setSpeakerId(const LLUUID& speaker_id, const LLUUID& session_id = LLUUID::null);
+ void setSpeakerId(const LLUUID& speaker_id, const LLUUID& session_id = LLUUID::null, bool show_other_participants_speaking = false);
//called by mute list
virtual void onChange();
@@ -134,7 +134,7 @@ private:
bool mIsAgentControl;
bool mIsMuted;
bool mIsTalking;
- bool mShowParticipantsTalking;
+ bool mShowParticipantsSpeaking;
LLPointer<LLUIImage> mImageMute;
LLPointer<LLUIImage> mImageOff;
LLPointer<LLUIImage> mImageOn;
diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp
index c9eebe24d3..899771f3b9 100644
--- a/indra/newview/llpanelpeoplemenus.cpp
+++ b/indra/newview/llpanelpeoplemenus.cpp
@@ -69,6 +69,7 @@ LLContextMenu* NearbyMenu::createMenu()
registrar.add("Avatar.Pay", boost::bind(&LLAvatarActions::pay, id));
registrar.add("Avatar.BlockUnblock", boost::bind(&LLAvatarActions::toggleBlock, id));
registrar.add("Avatar.InviteToGroup", boost::bind(&LLAvatarActions::inviteToGroup, id));
+ registrar.add("Avatar.Calllog", boost::bind(&LLAvatarActions::viewChatHistory, id));
enable_registrar.add("Avatar.EnableItem", boost::bind(&NearbyMenu::enableContextMenuItem, this, _2));
enable_registrar.add("Avatar.CheckItem", boost::bind(&NearbyMenu::checkContextMenuItem, this, _2));
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 927ee8f380..4cd5ecc754 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -50,6 +50,7 @@
#include "llfloaterbump.h"
#include "llfloaterbvhpreview.h"
#include "llfloatercamera.h"
+#include "llfloaterchatvoicevolume.h"
#include "llfloaterconversationlog.h"
#include "llfloaterconversationpreview.h"
#include "llfloaterdeleteenvpreset.h"
@@ -192,6 +193,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("bumps", "floater_bumps.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBump>);
LLFloaterReg::add("camera", "floater_camera.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCamera>);
+ LLFloaterReg::add("chat_voice", "floater_voice_chat_volume.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterChatVoiceVolume>);
LLFloaterReg::add("nearby_chat", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLNearbyChat>);
LLFloaterReg::add("compile_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCompileQueue>);
LLFloaterReg::add("conversation", "floater_conversation_log.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterConversationLog>);
diff --git a/indra/newview/skins/default/xui/en/floater_voice_chat_volume.xml b/indra/newview/skins/default/xui/en/floater_voice_chat_volume.xml
new file mode 100644
index 0000000000..5c71fd3bc6
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_voice_chat_volume.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+
+<floater
+ legacy_header_height="25"
+ bevel_style="in"
+ bg_opaque_image="Inspector_Background"
+ can_close="false"
+ can_minimize="false"
+ height="90"
+ layout="topleft"
+ name="floater_voice_volume"
+ single_instance="true"
+ sound_flags="0"
+ title="VOICE CHAT VOLUME"
+ visible="true"
+ width="245">
+ <slider
+ control_name="AudioLevelVoice"
+ disabled_control="MuteAudio"
+ follows="left|top"
+ height="16"
+ increment="0.025"
+ initial_value="0.5"
+ label="Voice Chat"
+ label_width="50"
+ layout="topleft"
+ left="15"
+ top="50"
+ name="chat_voice_volume"
+ show_text="false"
+ slider_label.halign="right"
+ volume="true"
+ width="200">
+ </slider>
+ <button
+ control_name="MuteVoice"
+ disabled_control="MuteAudio"
+ follows="top|left"
+ height="16"
+ image_selected="AudioMute_Off"
+ image_unselected="Audio_Off"
+ is_toggle="true"
+ layout="topleft"
+ left_pad="5"
+ name="mute_audio"
+ tab_stop="false"
+ width="16" />
+</floater> \ No newline at end of file
diff --git a/indra/newview/skins/default/xui/en/menu_people_friends_view.xml b/indra/newview/skins/default/xui/en/menu_people_friends_view.xml
index eab7b8c085..dde9432867 100644
--- a/indra/newview/skins/default/xui/en/menu_people_friends_view.xml
+++ b/indra/newview/skins/default/xui/en/menu_people_friends_view.xml
@@ -40,4 +40,12 @@
function="CheckControl"
parameter="FriendsListShowPermissions" />
</menu_item_check>
+ <menu_item_check name="view_conversation" label="View Conversation Log...">
+ <menu_item_check.on_check
+ function="Floater.Visible"
+ parameter="conversation" />
+ <menu_item_check.on_click
+ function="Floater.Toggle"
+ parameter="conversation" />
+ </menu_item_check>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
index b7c9ab1fe3..8014e81469 100644
--- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml
+++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
@@ -37,6 +37,14 @@
</menu_item_call>
<menu_item_separator />
<menu_item_call
+ label="View chat history..."
+ layout="topleft"
+ name="Chat history">
+ <menu_item_call.on_click
+ function="Avatar.Calllog" />
+ </menu_item_call>
+ <menu_item_separator />
+ <menu_item_call
label="Add Friend"
layout="topleft"
name="Add Friend">
@@ -101,5 +109,5 @@
function="Avatar.EnableItem"
parameter="can_block" />
</menu_item_check>
-
+ <menu_item_separator />
</context_menu>