CHUI-280 : Make LLParticipantList derives from LLConversationItemSession

master
Merov Linden 2012-08-24 17:31:12 -07:00
parent b19e6c2959
commit fd62242dd6
8 changed files with 26 additions and 10 deletions

View File

@ -334,7 +334,7 @@ void LLCallFloater::refreshParticipantList()
if (!non_avatar_caller)
{
llassert(mParticipants == NULL); // check for possible memory leak
mParticipants = new LLParticipantList(mSpeakerManager, mAvatarList, true, mVoiceType != VC_GROUP_CHAT && mVoiceType != VC_AD_HOC_CHAT, false);
mParticipants = new LLParticipantList(mSpeakerManager, mAvatarList, mConversationViewModel, true, mVoiceType != VC_GROUP_CHAT && mVoiceType != VC_AD_HOC_CHAT, false);
mParticipants->setValidateSpeakerCallback(boost::bind(&LLCallFloater::validateSpeaker, this, _1));
const U32 speaker_sort_order = gSavedSettings.getU32("SpeakerParticipantDefaultOrder");
mParticipants->setSortOrder(LLParticipantList::EParticipantSortOrder(speaker_sort_order));

View File

@ -31,6 +31,7 @@
#include "lltransientdockablefloater.h"
#include "llvoicechannel.h"
#include "llvoiceclient.h"
#include "llconversationmodel.h"
class LLAvatarList;
class LLAvatarListItem;
@ -228,6 +229,7 @@ private:
LLSpeakerMgr* mSpeakerManager;
LLParticipantList* mParticipants;
LLAvatarList* mAvatarList;
LLConversationViewModel mConversationViewModel;
LLNonAvatarCaller* mNonAvatarCaller;
EVoiceControls mVoiceType;
LLPanel* mAgentPanel;

View File

@ -40,6 +40,13 @@ LLConversationItem::LLConversationItem(std::string display_name, const LLUUID& u
{
}
LLConversationItem::LLConversationItem(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) :
LLFolderViewModelItemCommon(root_view_model),
mName(""),
mUUID(uuid)
{
}
LLConversationItem::LLConversationItem(LLFolderViewModelInterface& root_view_model) :
LLFolderViewModelItemCommon(root_view_model),
mName(""),
@ -85,8 +92,8 @@ LLConversationItemSession::LLConversationItemSession(std::string display_name, c
{
}
LLConversationItemSession::LLConversationItemSession(LLFolderViewModelInterface& root_view_model) :
LLConversationItem(root_view_model)
LLConversationItemSession::LLConversationItemSession(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) :
LLConversationItem(uuid,root_view_model)
{
}
@ -99,8 +106,8 @@ LLConversationItemParticipant::LLConversationItemParticipant(std::string display
{
}
LLConversationItemParticipant::LLConversationItemParticipant(LLFolderViewModelInterface& root_view_model) :
LLConversationItem(root_view_model)
LLConversationItemParticipant::LLConversationItemParticipant(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) :
LLConversationItem(uuid,root_view_model)
{
}

View File

@ -43,6 +43,7 @@ class LLConversationItem : public LLFolderViewModelItemCommon
{
public:
LLConversationItem(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model);
LLConversationItem(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model);
LLConversationItem(LLFolderViewModelInterface& root_view_model);
virtual ~LLConversationItem() {}
@ -108,7 +109,7 @@ class LLConversationItemSession : public LLConversationItem
{
public:
LLConversationItemSession(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model);
LLConversationItemSession(LLFolderViewModelInterface& root_view_model);
LLConversationItemSession(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model);
virtual ~LLConversationItemSession() {}
};
@ -116,7 +117,7 @@ class LLConversationItemParticipant : public LLConversationItem
{
public:
LLConversationItemParticipant(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model);
LLConversationItemParticipant(LLFolderViewModelInterface& root_view_model);
LLConversationItemParticipant(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model);
virtual ~LLConversationItemParticipant() {}
};

View File

@ -165,7 +165,7 @@ void LLIMConversation::buildParticipantList()
if (mIsNearbyChat)
{
LLLocalSpeakerMgr* speaker_manager = LLLocalSpeakerMgr::getInstance();
mParticipantList = new LLParticipantList(speaker_manager, getChild<LLAvatarList>("speakers_list"), true, false);
mParticipantList = new LLParticipantList(speaker_manager, getChild<LLAvatarList>("speakers_list"), mConversationViewModel, true, false);
}
else
{
@ -174,7 +174,7 @@ void LLIMConversation::buildParticipantList()
if(!mIsP2PChat && mSessionID.notNull() && speaker_manager)
{
delete mParticipantList; // remove the old list and create a new one if the session id has changed
mParticipantList = new LLParticipantList(speaker_manager, getChild<LLAvatarList>("speakers_list"), true, false);
mParticipantList = new LLParticipantList(speaker_manager, getChild<LLAvatarList>("speakers_list"), mConversationViewModel, true, false);
}
}
updateHeaderAndToolbar();

View File

@ -33,6 +33,7 @@
#include "lltransientdockablefloater.h"
#include "llviewercontrol.h"
#include "lleventtimer.h"
#include "llconversationmodel.h"
class LLPanelChatControlPanel;
class LLChatEntry;
@ -104,6 +105,7 @@ protected:
LLLayoutPanel* mParticipantListPanel;
LLParticipantList* mParticipantList;
LLUUID mSessionID;
LLConversationViewModel mConversationViewModel;
LLChatHistory* mChatHistory;
LLChatEntry* mInputEditor;

View File

@ -200,9 +200,11 @@ private:
LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source,
LLAvatarList* avatar_list,
LLFolderViewModelInterface& root_view_model,
bool use_context_menu/* = true*/,
bool exclude_agent /*= true*/,
bool can_toggle_icons /*= true*/) :
LLConversationItemSession(data_source->getSessionID(), root_view_model),
mSpeakerMgr(data_source),
mAvatarList(avatar_list),
mParticipantListMenu(NULL),

View File

@ -31,13 +31,14 @@
#include "llevent.h"
#include "llavatarlist.h" // for LLAvatarItemRecentSpeakerComparator
#include "lllistcontextmenu.h"
#include "llconversationmodel.h"
class LLSpeakerMgr;
class LLAvatarList;
class LLUICtrl;
class LLAvalineUpdater;
class LLParticipantList
class LLParticipantList : public LLConversationItemSession
{
LOG_CLASS(LLParticipantList);
public:
@ -46,6 +47,7 @@ public:
LLParticipantList(LLSpeakerMgr* data_source,
LLAvatarList* avatar_list,
LLFolderViewModelInterface& root_view_model,
bool use_context_menu = true,
bool exclude_agent = true,
bool can_toggle_icons = true);