summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-11-05 18:33:39 -0800
committerMerov Linden <merov@lindenlab.com>2012-11-05 18:33:39 -0800
commit2d9d44e31643214c80bde5ffee03f9b6af6af9d0 (patch)
tree6b0cb7a8a71acfa0838d97a43ac753e63a81bbfc /indra
parente3524a5fe159566edefb0bbc395e94ee3126adec (diff)
CHUI-468 : WIP : Taking LLAvatarList and related out of LLParticipantList
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llconversationview.cpp7
-rw-r--r--indra/newview/llimconversation.cpp5
-rw-r--r--indra/newview/llimconversation.h1
-rw-r--r--indra/newview/llimfloatercontainer.cpp4
-rw-r--r--indra/newview/llparticipantlist.cpp142
-rw-r--r--indra/newview/llparticipantlist.h37
-rw-r--r--indra/newview/skins/default/xui/en/panel_conversation_list_item.xml2
7 files changed, 43 insertions, 155 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 81212a9141..87532268e7 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -108,7 +108,7 @@ BOOL LLConversationViewSession::postBuild()
mSessionTitle = mItemPanel->getChild<LLTextBox>("conversation_title");
mActiveVoiceChannelConnection = LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLConversationViewSession::onCurrentVoiceSessionChanged, this, _1));
- mSpeakingIndicator = getChild<LLOutputMonitorCtrl>("speaking_indicatorn");
+ mSpeakingIndicator = getChild<LLOutputMonitorCtrl>("speaking_indicator");
LLConversationItem* vmi = dynamic_cast<LLConversationItem*>(getViewModelItem());
if (vmi)
@@ -476,10 +476,11 @@ void LLConversationViewParticipant::selectItem()
void LLConversationViewParticipant::refresh()
{
// Refresh the participant view from its model data
- LLConversationItem* vmi = dynamic_cast<LLConversationItem*>(getViewModelItem());
+ LLConversationItemParticipant* vmi = dynamic_cast<LLConversationItemParticipant*>(getViewModelItem());
vmi->resetRefresh();
- // Note: for the moment, all that needs to be done is done by LLFolderViewItem::refresh()
+ // *TODO: We should also do something with vmi->isModerator() to echo that state in the UI somewhat
+ mSpeakingIndicator->setIsMuted(vmi->isMuted());
// Do the regular upstream refresh
LLFolderViewItem::refresh();
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp
index de769d95ac..62712a5c7c 100644
--- a/indra/newview/llimconversation.cpp
+++ b/indra/newview/llimconversation.cpp
@@ -485,7 +485,8 @@ LLConversationViewParticipant* LLIMConversation::createConversationViewParticipa
void LLIMConversation::onSortMenuItemClicked(const LLSD& userdata)
{
- // TODO: Check this code when sort order menu will be added. (EM)
+ // *TODO: Check this code when sort order menu will be added. (EM)
+ /*
if (!getParticipantList())
{
return;
@@ -497,7 +498,7 @@ void LLIMConversation::onSortMenuItemClicked(const LLSD& userdata)
{
getParticipantList()->setSortOrder(LLParticipantList::E_SORT_BY_NAME);
}
-
+ */
}
void LLIMConversation::onIMSessionMenuItemClicked(const LLSD& userdata)
diff --git a/indra/newview/llimconversation.h b/indra/newview/llimconversation.h
index cb306c4d8d..ff248d97ff 100644
--- a/indra/newview/llimconversation.h
+++ b/indra/newview/llimconversation.h
@@ -36,6 +36,7 @@
#include "llimview.h"
#include "llconversationmodel.h"
#include "llconversationview.h"
+#include "lltexteditor.h"
class LLPanelChatControlPanel;
class LLChatEntry;
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 72e0f90f8c..e6657260e6 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -115,7 +115,7 @@ void LLIMFloaterContainer::sessionVoiceOrIMStarted(const LLUUID& session_id)
void LLIMFloaterContainer::sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id)
{
- // CHUI-441 : We should do this *without* delete and recreate
+ // *TODO: We should do this *without* delete and recreate
addConversationListItem(new_session_id, removeConversationListItem(old_session_id));
}
@@ -1164,7 +1164,7 @@ LLConversationItem* LLIMFloaterContainer::addConversationListItem(const LLUUID&
LLSpeakerMgr* speaker_manager = (is_nearby_chat ? (LLSpeakerMgr*)(LLLocalSpeakerMgr::getInstance()) : LLIMModel::getInstance()->getSpeakerManager(uuid));
if (speaker_manager)
{
- item = new LLParticipantList(speaker_manager, NULL, getRootViewModel(), true, false);
+ item = new LLParticipantList(speaker_manager, getRootViewModel(), true, false);
}
if (!item)
{
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index e199cb5776..6afcf21348 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -1,6 +1,6 @@
/**
* @file llparticipantlist.cpp
- * @brief LLParticipantList intended to update view(LLAvatarList) according to incoming messages
+ * @brief LLParticipantList widgets of a conversation list
*
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
@@ -48,23 +48,6 @@
#pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally
#endif
-static const LLAvatarItemAgentOnTopComparator AGENT_ON_TOP_NAME_COMPARATOR;
-
-// helper function to update AvatarList Item's indicator in the voice participant list
-static void update_speaker_indicator(const LLAvatarList* const avatar_list, const LLUUID& avatar_uuid, bool is_muted)
-{
- if (avatar_list)
- {
- LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*>(avatar_list->getItemByValue(avatar_uuid));
- if (item)
- {
- LLOutputMonitorCtrl* indicator = item->getChild<LLOutputMonitorCtrl>("speaking_indicator");
- indicator->setIsMuted(is_muted);
- }
- }
-}
-
-
// See EXT-4301.
/**
* class LLAvalineUpdater - observe the list of voice participants in session and check
@@ -205,14 +188,12 @@ 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),
mExcludeAgent(exclude_agent),
mValidateSpeakerCallback(NULL)
{
@@ -234,7 +215,7 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source,
mSpeakerMgr->addListener(mSpeakerUpdateListener, "update_speaker");
setSessionID(mSpeakerMgr->getSessionID());
-
+ /*
if (mAvatarList)
{
mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData"));
@@ -260,7 +241,7 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source,
mAvatarListToggleIconsConnection = gSavedSettings.getControl("ParticipantListShowIcons")->getSignal()->connect(boost::bind(&LLAvatarList::toggleIcons, mAvatarList));
}
}
-
+ */
//Lets fill avatarList with existing speakers
LLSpeakerMgr::speaker_list_t speaker_list;
mSpeakerMgr->getSpeakerList(&speaker_list, true);
@@ -278,8 +259,6 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source,
mModeratorToRemoveList.insert(speakerp->mID);
}
}
- // we need to exclude agent id for non group chat
- sort();
// Identify and store what kind of session we are
LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(data_source->getSessionID());
@@ -305,6 +284,7 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source,
LLParticipantList::~LLParticipantList()
{
+ /*
if (mAvatarList)
{
mAvatarListDoubleClickConnection.disconnect();
@@ -318,10 +298,11 @@ LLParticipantList::~LLParticipantList()
mAvatarList->setContextMenu(NULL);
mAvatarList->setComparator(NULL);
}
-
+ */
delete mAvalineUpdater;
}
+/*
void LLParticipantList::setSpeakingIndicatorsVisible(BOOL visible)
{
if (mAvatarList)
@@ -329,7 +310,8 @@ void LLParticipantList::setSpeakingIndicatorsVisible(BOOL visible)
mAvatarList->setSpeakingIndicatorsVisible(visible);
}
}
-
+*/
+/*
void LLParticipantList::onAvatarListDoubleClicked(LLUICtrl* ctrl)
{
LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*>(ctrl);
@@ -345,7 +327,8 @@ void LLParticipantList::onAvatarListDoubleClicked(LLUICtrl* ctrl)
LLAvatarActions::startIM(clicked_id);
}
-
+*/
+/*
void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param)
{
LLAvatarList* list = dynamic_cast<LLAvatarList*>(ctrl);
@@ -423,11 +406,10 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param)
if (speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY)
{
setParticipantIsMuted(speakerp->mID, speakerp->mModeratorMutedVoice);
- update_speaker_indicator(list, speakerp->mID, speakerp->mModeratorMutedVoice);
}
}
}
-
+*/
/*
Seems this method is not necessary after onAvalineCallerRemoved was implemented;
@@ -441,40 +423,11 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param)
*/
void LLParticipantList::onAvalineCallerFound(const LLUUID& participant_id)
{
- if (mAvatarList)
- {
- LLPanel* item = mAvatarList->getItemByValue(participant_id);
-
- if (NULL == item)
- {
- LL_WARNS("Avaline") << "Something wrong. Unable to find item for: " << participant_id << LL_ENDL;
- return;
- }
-
- if (typeid(*item) == typeid(LLAvalineListItem))
- {
- LL_DEBUGS("Avaline") << "Avaline caller has already correct class type for: " << participant_id << LL_ENDL;
- // item representing an Avaline caller has a correct type already.
- return;
- }
-
- LL_DEBUGS("Avaline") << "remove item from the list and re-add it: " << participant_id << LL_ENDL;
-
- // remove UUID from LLAvatarList::mIDs to be able add it again.
- uuid_vec_t& ids = mAvatarList->getIDs();
- uuid_vec_t::iterator pos = std::find(ids.begin(), ids.end(), participant_id);
- ids.erase(pos);
-
- // remove item directly
- mAvatarList->removeItem(item);
- }
-
LLConversationItemParticipant* participant = findParticipant(participant_id);
if (participant)
{
removeParticipant(participant);
}
-
// re-add avaline caller with a correct class instance.
addAvatarIDExceptAgent(participant_id);
}
@@ -485,7 +438,7 @@ void LLParticipantList::onAvalineCallerRemoved(const LLUUID& participant_id)
mSpeakerMgr->removeAvalineSpeaker(participant_id);
}
-
+/*
void LLParticipantList::setSortOrder(EParticipantSortOrder order)
{
const U32 speaker_sort_order = gSavedSettings.getU32("SpeakerParticipantDefaultOrder");
@@ -502,7 +455,7 @@ const LLParticipantList::EParticipantSortOrder LLParticipantList::getSortOrder()
const U32 speaker_sort_order = gSavedSettings.getU32("SpeakerParticipantDefaultOrder");
return EParticipantSortOrder(speaker_sort_order);
}
-
+*/
void LLParticipantList::setValidateSpeakerCallback(validate_speaker_callback_t cb)
{
mValidateSpeakerCallback = cb;
@@ -512,19 +465,14 @@ void LLParticipantList::update()
{
mSpeakerMgr->update(true);
+ /*
// Need to resort the participant list if it's in sort by recent speaker order.
- if (E_SORT_BY_RECENT_SPEAKERS == getSortOrder() && !isHovered())
+ if (E_SORT_BY_RECENT_SPEAKERS == getSortOrder())
{
// Resort avatar list
sort();
}
-}
-
-bool LLParticipantList::isHovered()
-{
- S32 x, y;
- LLUI::getMousePositionScreen(&x, &y);
- return (mAvatarList ? mAvatarList->calcScreenRect().pointInRect(x, y) : false);
+ */
}
bool LLParticipantList::onAddItemEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
@@ -537,35 +485,18 @@ bool LLParticipantList::onAddItemEvent(LLPointer<LLOldEvents::LLEvent> event, co
}
addAvatarIDExceptAgent(uu_id);
- sort();
return true;
}
bool LLParticipantList::onRemoveItemEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
{
LLUUID avatar_id = event->getValue().asUUID();
- if (mAvatarList)
- {
- uuid_vec_t& group_members = mAvatarList->getIDs();
- uuid_vec_t::iterator pos = std::find(group_members.begin(), group_members.end(), avatar_id);
- if(pos != group_members.end())
- {
- group_members.erase(pos);
- mAvatarList->setDirty();
- }
- }
removeParticipant(avatar_id);
return true;
}
bool LLParticipantList::onClearListEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
{
- if (mAvatarList)
- {
- uuid_vec_t& group_members = mAvatarList->getIDs();
- group_members.clear();
- mAvatarList->setDirty();
- }
clearParticipants();
return true;
}
@@ -605,9 +536,9 @@ bool LLParticipantList::onModeratorUpdateEvent(LLPointer<LLOldEvents::LLEvent> e
mModeratorList.erase(id);
}
}
-
+ // *TODO : do we have to fire an event so that LLIMConversation::refreshConversation() gets called
// apply changes immediately
- onAvatarListRefreshed(mAvatarList, LLSD());
+ //onAvatarListRefreshed(mAvatarList, LLSD());
}
}
return true;
@@ -622,11 +553,11 @@ bool LLParticipantList::onSpeakerMuteEvent(LLPointer<LLOldEvents::LLEvent> event
if (event->getValue().asString() == "voice")
{
setParticipantIsMuted(speakerp->mID, speakerp->mModeratorMutedVoice);
- update_speaker_indicator(mAvatarList, speakerp->mID, speakerp->mModeratorMutedVoice);
}
return true;
}
+/*
void LLParticipantList::sort()
{
// *TODO : Merov : Need to plan for sort() for LLConversationModel
@@ -658,12 +589,12 @@ void LLParticipantList::sort()
return;
}
}
+*/
void LLParticipantList::addAvatarIDExceptAgent(const LLUUID& avatar_id)
{
// Do not add if already in there or excluded for some reason
if (mExcludeAgent && gAgent.getID() == avatar_id) return;
- if (mAvatarList && mAvatarList->contains(avatar_id)) return;
if (findParticipant(avatar_id)) return;
bool is_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(avatar_id);
@@ -677,21 +608,25 @@ void LLParticipantList::addAvatarIDExceptAgent(const LLUUID& avatar_id)
bool has_name = LLAvatarNameCache::get(avatar_id, &avatar_name);
participant = new LLConversationItemParticipant(!has_name ? LLTrans::getString("AvatarNameWaiting") : avatar_name.mDisplayName , avatar_id, mRootViewModel);
participant->fetchAvatarName();
+ /*
if (mAvatarList)
{
mAvatarList->getIDs().push_back(avatar_id);
mAvatarList->setDirty();
}
+ */
}
else
{
std::string display_name = LLVoiceClient::getInstance()->getDisplayName(avatar_id);
// Create a participant view model instance
participant = new LLConversationItemParticipant(display_name.empty() ? LLTrans::getString("AvatarNameWaiting") : display_name, avatar_id, mRootViewModel);
+ /*
if (mAvatarList)
{
mAvatarList->addAvalineItem(avatar_id, mSpeakerMgr->getSessionID(), display_name.empty() ? LLTrans::getString("AvatarNameWaiting") : display_name);
}
+ */
mAvalineUpdater->watchAvalineCaller(avatar_id);
}
@@ -768,33 +703,4 @@ bool LLParticipantList::SpeakerMuteListener::handleEvent(LLPointer<LLOldEvents::
return mParent.onSpeakerMuteEvent(event, userdata);
}
-bool LLParticipantList::LLAvatarItemRecentSpeakerComparator::doCompare(const LLAvatarListItem* avatar_item1, const LLAvatarListItem* avatar_item2) const
-{
- if (mParent.mSpeakerMgr)
- {
- LLPointer<LLSpeaker> lhs = mParent.mSpeakerMgr->findSpeaker(avatar_item1->getAvatarId());
- LLPointer<LLSpeaker> rhs = mParent.mSpeakerMgr->findSpeaker(avatar_item2->getAvatarId());
- if ( lhs.notNull() && rhs.notNull() )
- {
- // Compare by last speaking time
- if( lhs->mLastSpokeTime != rhs->mLastSpokeTime )
- return ( lhs->mLastSpokeTime > rhs->mLastSpokeTime );
- else if ( lhs->mSortIndex != rhs->mSortIndex )
- return ( lhs->mSortIndex < rhs->mSortIndex );
- }
- else if ( lhs.notNull() )
- {
- // True if only avatar_item1 speaker info available
- return true;
- }
- else if ( rhs.notNull() )
- {
- // False if only avatar_item2 speaker info available
- return false;
- }
- }
- // By default compare by name.
- return LLAvatarItemNameComparator::doCompare(avatar_item1, avatar_item2);
-}
-
//EOF
diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h
index aaf1e070a5..97e06dcfea 100644
--- a/indra/newview/llparticipantlist.h
+++ b/indra/newview/llparticipantlist.h
@@ -1,6 +1,6 @@
/**
* @file llparticipantlist.h
- * @brief LLParticipantList intended to update view(LLAvatarList) according to incoming messages
+ * @brief LLParticipantList widgets of a conversation list
*
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* Second Life Viewer Source Code
@@ -29,12 +29,10 @@
#include "llviewerprecompiledheaders.h"
#include "llevent.h"
-#include "llavatarlist.h" // for LLAvatarItemRecentSpeakerComparator
#include "lllistcontextmenu.h"
#include "llconversationmodel.h"
class LLSpeakerMgr;
-class LLAvatarList;
class LLUICtrl;
class LLAvalineUpdater;
@@ -46,13 +44,12 @@ public:
typedef boost::function<bool (const LLUUID& speaker_id)> validate_speaker_callback_t;
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);
~LLParticipantList();
- void setSpeakingIndicatorsVisible(BOOL visible);
+// void setSpeakingIndicatorsVisible(BOOL visible);
enum EParticipantSortOrder
{
@@ -70,8 +67,8 @@ public:
/**
* Set and sort Avatarlist by given order
*/
- void setSortOrder(EParticipantSortOrder order = E_SORT_BY_NAME);
- const EParticipantSortOrder getSortOrder() const;
+ //void setSortOrder(EParticipantSortOrder order = E_SORT_BY_NAME);
+ //const EParticipantSortOrder getSortOrder() const;
/**
* Refreshes the participant list.
@@ -101,7 +98,7 @@ protected:
/**
* Sorts the Avatarlist by stored order
*/
- void sort();
+ //void sort();
/**
* List of listeners implementing LLOldEvents::LLSimpleListener.
@@ -159,24 +156,9 @@ protected:
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
};
- /**
- * Comparator for comparing avatar items by last spoken time
- */
- class LLAvatarItemRecentSpeakerComparator : public LLAvatarItemNameComparator, public LLRefCount
- {
- LOG_CLASS(LLAvatarItemRecentSpeakerComparator);
- public:
- LLAvatarItemRecentSpeakerComparator(LLParticipantList& parent):mParent(parent){};
- virtual ~LLAvatarItemRecentSpeakerComparator() {};
- protected:
- virtual bool doCompare(const LLAvatarListItem* avatar_item1, const LLAvatarListItem* avatar_item2) const;
- private:
- LLParticipantList& mParent;
- };
-
private:
- void onAvatarListDoubleClicked(LLUICtrl* ctrl);
- void onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param);
+// void onAvatarListDoubleClicked(LLUICtrl* ctrl);
+// void onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param);
void onAvalineCallerFound(const LLUUID& participant_id);
void onAvalineCallerRemoved(const LLUUID& participant_id);
@@ -188,10 +170,7 @@ private:
*/
void adjustParticipant(const LLUUID& speaker_id);
- bool isHovered();
-
LLSpeakerMgr* mSpeakerMgr;
- LLAvatarList* mAvatarList;
std::set<LLUUID> mModeratorList;
std::set<LLUUID> mModeratorToRemoveList;
@@ -216,7 +195,7 @@ private:
boost::signals2::connection mAvatarListReturnConnection;
boost::signals2::connection mAvatarListToggleIconsConnection;
- LLPointer<LLAvatarItemRecentSpeakerComparator> mSortByRecentSpeakers;
+// LLPointer<LLAvatarItemRecentSpeakerComparator> mSortByRecentSpeakers;
validate_speaker_callback_t mValidateSpeakerCallback;
LLAvalineUpdater* mAvalineUpdater;
};
diff --git a/indra/newview/skins/default/xui/en/panel_conversation_list_item.xml b/indra/newview/skins/default/xui/en/panel_conversation_list_item.xml
index 56056ed560..771d9fa680 100644
--- a/indra/newview/skins/default/xui/en/panel_conversation_list_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_conversation_list_item.xml
@@ -90,7 +90,7 @@
layout="topleft"
left_pad="5"
mouse_opaque="true"
- name="speaking_indicatorn"
+ name="speaking_indicator"
visible="false"
width="20" />
</layout_panel>