From 60a7a1d891b5c019aa6fc0f7d54046976f31a9f3 Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Tue, 10 Nov 2009 15:25:39 +0200 Subject: Implemented Sub-task EXT-2214-Refactor IM Control Panels --HG-- branch : product-engine --- indra/newview/llpanelimcontrolpanel.cpp | 22 +++++++++++----------- indra/newview/llpanelimcontrolpanel.h | 3 ++- indra/newview/llparticipantlist.h | 3 ++- 3 files changed, 15 insertions(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index c9168670d5..6479f46283 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -86,10 +86,8 @@ void LLPanelChatControlPanel::draw() bool session_initialized = session->mSessionInitialized; bool callback_enabled = session->mCallBackEnabled; - LLViewerRegion* region = gAgent.getRegion(); - BOOL enable_connect = (region && region->getCapability("ChatSessionRequest") != "") - && session_initialized + BOOL enable_connect = session_initialized && voice_enabled && callback_enabled; childSetEnabled("call_btn", enable_connect); @@ -190,7 +188,8 @@ void LLPanelIMControlPanel::nameUpdatedCallback(const LLUUID& id, const std::str } } -LLPanelGroupControlPanel::LLPanelGroupControlPanel(const LLUUID& session_id) +LLPanelGroupControlPanel::LLPanelGroupControlPanel(const LLUUID& session_id): +mParticipantList(NULL) { mSpeakerManager = LLIMModel::getInstance()->getSpeakerManager(session_id); } @@ -199,9 +198,6 @@ BOOL LLPanelGroupControlPanel::postBuild() { childSetAction("group_info_btn", boost::bind(&LLPanelGroupControlPanel::onGroupInfoButtonClicked, this)); - mAvatarList = getChild("speakers_list"); - mParticipantList = new LLParticipantList(mSpeakerManager, mAvatarList); - return LLPanelChatControlPanel::postBuild(); } @@ -214,6 +210,8 @@ LLPanelGroupControlPanel::~LLPanelGroupControlPanel() // virtual void LLPanelGroupControlPanel::draw() { + //Remove event does not raised until speakerp->mActivityTimer.hasExpired() is false, see LLSpeakerManager::update() + //so we need update it to raise needed event mSpeakerManager->update(true); LLPanelChatControlPanel::draw(); } @@ -241,7 +239,7 @@ void LLPanelGroupControlPanel::onSortMenuItemClicked(const LLSD& userdata) void LLPanelGroupControlPanel::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state) { LLPanelChatControlPanel::onVoiceChannelStateChanged(old_state, new_state); - mAvatarList->setSpeakingIndicatorsVisible(new_state >= LLVoiceChannel::STATE_CALL_STARTED); + mParticipantList->setSpeakingIndicatorsVisible(new_state >= LLVoiceChannel::STATE_CALL_STARTED); } void LLPanelGroupControlPanel::setSessionId(const LLUUID& session_id) @@ -249,6 +247,10 @@ void LLPanelGroupControlPanel::setSessionId(const LLUUID& session_id) LLPanelChatControlPanel::setSessionId(session_id); mGroupID = LLIMModel::getInstance()->getOtherParticipantID(session_id); + + if(!mParticipantList) + mParticipantList = new LLParticipantList(LLIMModel::getInstance()->getSpeakerManager(session_id), + getChild("speakers_list")); } @@ -258,9 +260,7 @@ LLPanelAdHocControlPanel::LLPanelAdHocControlPanel(const LLUUID& session_id):LLP BOOL LLPanelAdHocControlPanel::postBuild() { - mAvatarList = getChild("speakers_list"); - mParticipantList = new LLParticipantList(mSpeakerManager, mAvatarList); - + //We don't need LLPanelGroupControlPanel::postBuild() to be executed as there is no group_info_btn at AdHoc chat return LLPanelChatControlPanel::postBuild(); } diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h index ac5d86345e..12de21a46a 100644 --- a/indra/newview/llpanelimcontrolpanel.h +++ b/indra/newview/llpanelimcontrolpanel.h @@ -100,10 +100,11 @@ public: protected: LLUUID mGroupID; LLSpeakerMgr* mSpeakerManager; - LLAvatarList* mAvatarList; + LLParticipantList* mParticipantList; private: + void onVisibilityChange(const LLSD& new_visibility); void onGroupInfoButtonClicked(); void onSortMenuItemClicked(const LLSD& userdata); /*virtual*/ void onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state); diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index 1ff1515d16..6fe178b023 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -34,9 +34,9 @@ #include "llevent.h" #include "llpanelpeoplemenus.h" #include "llimview.h" +#include "llavatarlist.h" class LLSpeakerMgr; -class LLAvatarList; class LLUICtrl; class LLParticipantList @@ -45,6 +45,7 @@ class LLParticipantList public: LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list); ~LLParticipantList(); + void setSpeakingIndicatorsVisible(BOOL visible){ mAvatarList->setSpeakingIndicatorsVisible(visible); }; typedef enum e_participant_sort_oder { E_SORT_BY_NAME = 0, -- cgit v1.2.3 From e292f310fbd1c98d62237eef27d284e024abe7ee Mon Sep 17 00:00:00 2001 From: Eugene Kondrashev Date: Tue, 10 Nov 2009 15:35:58 +0200 Subject: No ticket. Cleaned up the code after last commit --HG-- branch : product-engine --- indra/newview/llpanelimcontrolpanel.cpp | 3 +-- indra/newview/llpanelimcontrolpanel.h | 1 - indra/newview/llparticipantlist.cpp | 5 +++++ indra/newview/llparticipantlist.h | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 6479f46283..350b78ee3d 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -249,8 +249,7 @@ void LLPanelGroupControlPanel::setSessionId(const LLUUID& session_id) mGroupID = LLIMModel::getInstance()->getOtherParticipantID(session_id); if(!mParticipantList) - mParticipantList = new LLParticipantList(LLIMModel::getInstance()->getSpeakerManager(session_id), - getChild("speakers_list")); + mParticipantList = new LLParticipantList(mSpeakerManager, getChild("speakers_list")); } diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h index 12de21a46a..a0d3420d23 100644 --- a/indra/newview/llpanelimcontrolpanel.h +++ b/indra/newview/llpanelimcontrolpanel.h @@ -104,7 +104,6 @@ protected: LLParticipantList* mParticipantList; private: - void onVisibilityChange(const LLSD& new_visibility); void onGroupInfoButtonClicked(); void onSortMenuItemClicked(const LLSD& userdata); /*virtual*/ void onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state); diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 8155766b49..f5367c0477 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -92,6 +92,11 @@ LLParticipantList::~LLParticipantList() mParticipantListMenu = NULL; } +void LLParticipantList::setSpeakingIndicatorsVisible(BOOL visible) +{ + mAvatarList->setSpeakingIndicatorsVisible(visible); +}; + void LLParticipantList::onAvatarListDoubleClicked(LLAvatarList* list) { LLUUID clicked_id = list->getSelectedUUID(); diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index 6fe178b023..5e26c39fc8 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -34,9 +34,9 @@ #include "llevent.h" #include "llpanelpeoplemenus.h" #include "llimview.h" -#include "llavatarlist.h" class LLSpeakerMgr; +class LLAvatarList; class LLUICtrl; class LLParticipantList @@ -45,7 +45,7 @@ class LLParticipantList public: LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list); ~LLParticipantList(); - void setSpeakingIndicatorsVisible(BOOL visible){ mAvatarList->setSpeakingIndicatorsVisible(visible); }; + void setSpeakingIndicatorsVisible(BOOL visible); typedef enum e_participant_sort_oder { E_SORT_BY_NAME = 0, -- cgit v1.2.3