From 3eb7f84b10832d77d8765ea9550108c67c462bcb Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Tue, 27 Oct 2009 18:01:41 +0200 Subject: IM: implemented task EXT-1905 (Add "Call" and "End Call" functionality to new IIM Floater) --HG-- branch : product-engine --- indra/newview/llpanelimcontrolpanel.cpp | 80 +++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 19 deletions(-) (limited to 'indra/newview/llpanelimcontrolpanel.cpp') diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 6eed956eb8..6678a3a460 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -34,6 +34,7 @@ #include "llpanelimcontrolpanel.h" +#include "llagent.h" #include "llavataractions.h" #include "llavatariconctrl.h" #include "llbutton.h" @@ -41,6 +42,53 @@ #include "llavatarlist.h" #include "llparticipantlist.h" #include "llimview.h" +#include "llvoicechannel.h" + +void LLPanelChatControlPanel::onCallButtonClicked() +{ + gIMMgr->startCall(mSessionId); +} + +void LLPanelChatControlPanel::onEndCallButtonClicked() +{ + gIMMgr->endCall(mSessionId); +} + +BOOL LLPanelChatControlPanel::postBuild() +{ + childSetAction("call_btn", boost::bind(&LLPanelChatControlPanel::onCallButtonClicked, this)); + childSetAction("end_call_btn", boost::bind(&LLPanelChatControlPanel::onEndCallButtonClicked, this)); + + return TRUE; +} + +void LLPanelChatControlPanel::draw() +{ + // hide/show start call and end call buttons + bool voice_enabled = LLVoiceClient::voiceEnabled(); + + LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(mSessionId); + if (!session) return; + + LLVoiceChannel* voice_channel = session->mVoiceChannel; + if (voice_channel && voice_enabled) + { + childSetVisible("end_call_btn", voice_channel->getState() >= LLVoiceChannel::STATE_CALL_STARTED); + childSetVisible("call_btn", voice_channel->getState() < LLVoiceChannel::STATE_CALL_STARTED); + } + + bool session_initialized = session->mSessionInitialized; + bool callback_enabled = session->mCallBackEnabled; + LLViewerRegion* region = gAgent.getRegion(); + + BOOL enable_connect = (region && region->getCapability("ChatSessionRequest") != "") + && session_initialized + && voice_enabled + && callback_enabled; + childSetEnabled("call_btn", enable_connect); + + LLPanel::draw(); +} LLPanelIMControlPanel::LLPanelIMControlPanel() { @@ -54,11 +102,11 @@ BOOL LLPanelIMControlPanel::postBuild() { childSetAction("view_profile_btn", boost::bind(&LLPanelIMControlPanel::onViewProfileButtonClicked, this)); childSetAction("add_friend_btn", boost::bind(&LLPanelIMControlPanel::onAddFriendButtonClicked, this)); - childSetAction("call_btn", boost::bind(&LLPanelIMControlPanel::onCallButtonClicked, this)); + childSetAction("share_btn", boost::bind(&LLPanelIMControlPanel::onShareButtonClicked, this)); childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(getChild("avatar_icon")->getAvatarId())); - - return TRUE; + + return LLPanelChatControlPanel::postBuild(); } void LLPanelIMControlPanel::onViewProfileButtonClicked() @@ -73,21 +121,20 @@ void LLPanelIMControlPanel::onAddFriendButtonClicked() LLAvatarActions::requestFriendshipDialog(avatar_icon->getAvatarId(), full_name); } -void LLPanelIMControlPanel::onCallButtonClicked() -{ - // *TODO: Implement -} - void LLPanelIMControlPanel::onShareButtonClicked() { // *TODO: Implement } -void LLPanelIMControlPanel::setID(const LLUUID& avatar_id) +void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) { + LLPanelChatControlPanel::setSessionId(session_id); + + LLUUID avatar_id = LLIMModel::getInstance()->getOtherParticipantID(session_id); + // Disable "Add friend" button for friends. childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(avatar_id)); - + getChild("avatar_icon")->setValue(avatar_id); } @@ -100,12 +147,11 @@ LLPanelGroupControlPanel::LLPanelGroupControlPanel(const LLUUID& session_id) BOOL LLPanelGroupControlPanel::postBuild() { childSetAction("group_info_btn", boost::bind(&LLPanelGroupControlPanel::onGroupInfoButtonClicked, this)); - childSetAction("call_btn", boost::bind(&LLPanelGroupControlPanel::onCallButtonClicked, this)); mAvatarList = getChild("speakers_list"); mParticipantList = new LLParticipantList(mSpeakerManager, mAvatarList); - return TRUE; + return LLPanelChatControlPanel::postBuild(); } LLPanelGroupControlPanel::~LLPanelGroupControlPanel() @@ -127,13 +173,9 @@ void LLPanelGroupControlPanel::onGroupInfoButtonClicked() } -void LLPanelGroupControlPanel::onCallButtonClicked() +void LLPanelGroupControlPanel::setSessionId(const LLUUID& session_id) { - // *TODO: Implement -} - + LLPanelChatControlPanel::setSessionId(session_id); -void LLPanelGroupControlPanel::setID(const LLUUID& id) -{ - mGroupID = id; + mGroupID = LLIMModel::getInstance()->getOtherParticipantID(session_id); } -- cgit v1.2.3 From a999e50a8ebb3ab641490294d67dbbd6eb0c8898 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Wed, 28 Oct 2009 16:14:52 +0200 Subject: Implemented major sub-task EXT-1912 ( Add handling restrictions of PSTN P2P calls in new IM Floaters ) --HG-- branch : product-engine --- indra/newview/llpanelimcontrolpanel.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelimcontrolpanel.cpp') diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 6678a3a460..c70d903fb0 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -130,12 +130,20 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) { LLPanelChatControlPanel::setSessionId(session_id); - LLUUID avatar_id = LLIMModel::getInstance()->getOtherParticipantID(session_id); + LLIMModel& im_model = LLIMModel::instance(); + + LLUUID avatar_id = im_model.getOtherParticipantID(session_id); // Disable "Add friend" button for friends. childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(avatar_id)); - + getChild("avatar_icon")->setValue(avatar_id); + + // Disable profile button if participant is not realy SL avatar + LLIMModel::LLIMSession* im_session = + im_model.findIMSession(session_id); + if( im_session && !im_session->mProfileButtonEnabled ) + childSetEnabled("view_profile_btn", FALSE); } -- cgit v1.2.3 From 4ca9e28f91446c2da413cc1089105278b60c8453 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Wed, 28 Oct 2009 18:44:31 +0200 Subject: No ticket, just renamed mProfileButtonEnabled to mOtherParticipantIsAvatar --HG-- branch : product-engine --- indra/newview/llpanelimcontrolpanel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanelimcontrolpanel.cpp') diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index c70d903fb0..5b589d6de6 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -142,7 +142,7 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) // Disable profile button if participant is not realy SL avatar LLIMModel::LLIMSession* im_session = im_model.findIMSession(session_id); - if( im_session && !im_session->mProfileButtonEnabled ) + if( im_session && !im_session->mOtherParticipantIsAvatar ) childSetEnabled("view_profile_btn", FALSE); } -- cgit v1.2.3 From 79738b2a65ef609f49db9bd2ff57fe5ae8e7e830 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Wed, 28 Oct 2009 20:59:33 +0200 Subject: Fixed normal bug EXT-1857-'Group Info' btn is unnecessary in Friends Conference floater --HG-- branch : product-engine --- indra/newview/llpanelimcontrolpanel.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llpanelimcontrolpanel.cpp') diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 5b589d6de6..f9eeaf1e9e 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -187,3 +187,17 @@ void LLPanelGroupControlPanel::setSessionId(const LLUUID& session_id) mGroupID = LLIMModel::getInstance()->getOtherParticipantID(session_id); } + + +LLPanelAdHocControlPanel::LLPanelAdHocControlPanel(const LLUUID& session_id):LLPanelGroupControlPanel(session_id) +{ +} + +BOOL LLPanelAdHocControlPanel::postBuild() +{ + mAvatarList = getChild("speakers_list"); + mParticipantList = new LLParticipantList(mSpeakerManager, mAvatarList); + + return LLPanelChatControlPanel::postBuild(); +} + -- cgit v1.2.3