void FSFloaterVoiceControls::initParticipantsVoiceState() { // Set initial status for each participant in the list. std::vector<LLPanel*> items; mAvatarList->getItems(items); std::vector<LLPanel*>::const_iterator it = items.begin(), it_end = items.end(); uuid_vec_t speakers_uuids; get_voice_participants_uuids(speakers_uuids); for(; it != it_end; ++it) { LLAvatarListItem *item = dynamic_cast<LLAvatarListItem*>(*it); if (!item) continue; LLUUID speaker_id = item->getAvatarId(); uuid_vec_t::const_iterator speaker_iter = std::find(speakers_uuids.begin(), speakers_uuids.end(), speaker_id); // If an avatarID assigned to a panel is found in a speakers list // obtained from VoiceClient we assign the JOINED status to the owner // of this avatarID. if (speaker_iter != speakers_uuids.end()) { setState(item, STATE_JOINED); } else { LLPointer<LLSpeaker> speakerp = mSpeakerManager->findSpeaker(speaker_id); // If someone has already left the call before, we create his // avatar row panel with HAS_LEFT status and remove it after // the timeout, otherwise we create a panel with INVITED status if (speakerp.notNull() && speakerp.get()->mHasLeftCurrentCall) { setState(item, STATE_LEFT); } else { setState(item, STATE_INVITED); } } } }
void LLAvatarList::handleDisplayNamesOptionChanged() { // <FS:Ansariel> FIRE-1089: Set the proper name options for the AvatarListItem before we update the list. mShowUsername = (bool)gSavedSettings.getBOOL("NameTagShowUsernames"); mShowDisplayName = (bool)gSavedSettings.getBOOL("UseDisplayNames"); std::vector<LLPanel*> items; getItems(items); for( std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); it++) { LLAvatarListItem* item = static_cast<LLAvatarListItem*>(*it); item->showUsername(mShowUsername, false); item->showDisplayName(mShowDisplayName, false); } // </FS:Ansariel> mNeedUpdateNames = true; }
void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) { LLAvatarListItem* item = new LLAvatarListItem(); item->setName(name); item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus); item->setOnline(mIgnoreOnlineStatus ? true : is_online); item->showLastInteractionTime(mShowLastInteractionTime); item->setAvatarIconVisible(mShowIcons); item->setShowInfoBtn(mShowInfoBtn); item->setShowProfileBtn(mShowProfileBtn); item->showSpeakingIndicator(mShowSpeakingIndicator); item->setDoubleClickCallback(boost::bind(&LLAvatarList::onItemDoucleClicked, this, _1, _2, _3, _4)); addItem(item, id, pos); }
void LLAvatarList::updateExtraData() // S21 { if(mShowLastInteractionTime) { updateLastInteractionTimes(); } else if(!mExtraDataSignal.empty()) { std::vector<LLPanel*> items; getItems(items); for( std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); it++) { LLAvatarListItem* item = static_cast<LLAvatarListItem*>(*it); item->setExtraInformation(*mExtraDataSignal(item->getAvatarId())); } } }
void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) { LLAvatarListItem* item = new LLAvatarListItem(); // This sets the name as a side effect item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus); item->setOnline(mIgnoreOnlineStatus ? true : is_online); item->showExtraInformation(mShowExtraInformation); // S21 item->setAvatarIconVisible(mShowIcons); item->setShowInfoBtn(mShowInfoBtn); item->setShowProfileBtn(mShowProfileBtn); item->showSpeakingIndicator(mShowSpeakingIndicator); item->setShowPermissions(mShowPermissions); item->setDoubleClickCallback(boost::bind(&LLAvatarList::onItemDoubleClicked, this, _1, _2, _3, _4)); addItem(item, id, pos); }
void FSParticipantList::FSParticipantListMenu::toggleMute(const LLSD& userdata, U32 flags) { const LLUUID speaker_id = mUUIDs.front(); BOOL is_muted = LLMuteList::getInstance()->isMuted(speaker_id, flags); std::string name; //fill in name using voice client's copy of name cache LLPointer<LLSpeaker> speakerp = mParent.mSpeakerMgr->findSpeaker(speaker_id); if (speakerp.isNull()) { LL_WARNS("Speakers") << "Speaker " << speaker_id << " not found" << LL_ENDL; return; } LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*>(mParent.mAvatarList->getItemByValue(speaker_id)); if (NULL == item) return; name = item->getAvatarName(); LLMute::EType mute_type; switch (speakerp->mType) { case LLSpeaker::SPEAKER_AGENT: mute_type = LLMute::AGENT; break; case LLSpeaker::SPEAKER_OBJECT: mute_type = LLMute::OBJECT; break; case LLSpeaker::SPEAKER_EXTERNAL: default: mute_type = LLMute::EXTERNAL; break; } LLMute mute(speaker_id, name, mute_type); if (!is_muted) { LLMuteList::getInstance()->add(mute, flags); } else { LLMuteList::getInstance()->remove(mute, flags); } }
void LLAvatarList::setItemHeight(S32 height) // AO: Adjust some parameters that need to be changed when we adjust item spacing form the .xml default // If you change these, also change addNewItem() { mItemHeight = height; std::vector<LLPanel*> items; getItems(items); for(std::vector<LLPanel*>::const_iterator it = items.begin(), end_it = items.end(); it != end_it; ++it) { LLAvatarListItem* avItem = static_cast<LLAvatarListItem*>(*it); if (mItemHeight != 0) { S32 width = avItem->getRect().getWidth(); avItem->reshape(width,mItemHeight); LLIconCtrl* highlight = avItem->getChild<LLIconCtrl>("hovered_icon"); LLIconCtrl* select = avItem->getChild<LLIconCtrl>("selected_icon"); highlight->setOrigin(0,24-height); // temporary hack to be in the right ballpark. highlight->reshape(width,mItemHeight); select->setOrigin(0,24-height); select->reshape(width,mItemHeight); } } mNeedUpdateNames = true; }
void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param) { LLAvatarList* list = dynamic_cast<LLAvatarList*>(ctrl); if (list) { const std::string moderator_indicator(LLTrans::getString("IM_moderator_label")); const std::size_t moderator_indicator_len = moderator_indicator.length(); // Firstly remove moderators indicator std::set<LLUUID>::const_iterator moderator_list_it = mModeratorToRemoveList.begin(), moderator_list_end = mModeratorToRemoveList.end(); for (;moderator_list_it != moderator_list_end; ++moderator_list_it) { LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*> (list->getItemByValue(*moderator_list_it)); if ( item ) { std::string name = item->getAvatarName(); std::string tooltip = item->getAvatarToolTip(); size_t found = name.find(moderator_indicator); if (found != std::string::npos) { name.erase(found, moderator_indicator_len); item->setAvatarName(name); } found = tooltip.find(moderator_indicator); if (found != tooltip.npos) { tooltip.erase(found, moderator_indicator_len); item->setAvatarToolTip(tooltip); } } } mModeratorToRemoveList.clear(); // Add moderators indicator moderator_list_it = mModeratorList.begin(); moderator_list_end = mModeratorList.end(); for (;moderator_list_it != moderator_list_end; ++moderator_list_it) { LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*> (list->getItemByValue(*moderator_list_it)); if ( item ) { std::string name = item->getAvatarName(); std::string tooltip = item->getAvatarToolTip(); size_t found = name.find(moderator_indicator); if (found == std::string::npos) { name += " "; name += moderator_indicator; item->setAvatarName(name); } found = tooltip.find(moderator_indicator); if (found == std::string::npos) { tooltip += " "; tooltip += moderator_indicator; item->setAvatarToolTip(tooltip); } } } // update voice mute state of all items. See EXT-7235 LLSpeakerMgr::speaker_list_t speaker_list; // Use also participants which are not in voice session now (the second arg is TRUE). // They can already have mModeratorMutedVoice set from the previous voice session // and LLSpeakerVoiceModerationEvent will not be sent when speaker manager is updated next time. mSpeakerMgr->getSpeakerList(&speaker_list, TRUE); for(LLSpeakerMgr::speaker_list_t::iterator it = speaker_list.begin(); it != speaker_list.end(); it++) { const LLPointer<LLSpeaker>& speakerp = *it; update_speaker_indicator(list, speakerp->mID, speakerp->mModeratorMutedVoice); } } }
void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) { LLAvatarListItem* item = new LLAvatarListItem(); // [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d item->setRlvCheckShowNames(mRlvCheckShowNames); // [/RLVa:KB] // AO: Adjust some parameters that need to be changed when we adjust item spacing form the .xml default // If you change these, also change setLineHeight() if (mItemHeight != 0) { S32 width = item->getRect().getWidth(); item->reshape(width,mItemHeight); LLIconCtrl* highlight = item->getChild<LLIconCtrl>("hovered_icon"); LLIconCtrl* select = item->getChild<LLIconCtrl>("selected_icon"); highlight->setOrigin(0,24-mItemHeight); // temporary hack to be in the right ballpark. highlight->reshape(width,mItemHeight); select->setOrigin(0,24-mItemHeight); select->reshape(width,mItemHeight); } // This sets the name as a side effect item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus); item->setOnline(mIgnoreOnlineStatus ? true : is_online); item->showLastInteractionTime(mShowLastInteractionTime); item->setAvatarIconVisible(mShowIcons); item->setShowInfoBtn(mShowInfoBtn); item->setShowVoiceVolume(mShowVoiceVolume); item->setShowProfileBtn(mShowProfileBtn); item->showSpeakingIndicator(mShowSpeakingIndicator); item->setShowPermissions(mShowPermissions); item->showUsername(mShowUsername); item->showDisplayName(mShowDisplayName); item->showRange(mShowRange); item->showFirstSeen(mShowFirstSeen); item->showStatusFlags(mShowStatusFlags); item->showPaymentStatus(mShowPaymentStatus); item->showAvatarAge(mShowAge); // [Ansariel: Colorful radar] item->setUseRangeColors(mUseRangeColors); LLUIColorTable* colorTable = &LLUIColorTable::instance(); item->setShoutRangeColor(colorTable->getColor("AvatarListItemShoutRange", LLColor4::yellow)); item->setBeyondShoutRangeColor(colorTable->getColor("AvatarListItemBeyondShoutRange", LLColor4::red)); // [/Ansariel: Colorful radar] item->setDoubleClickCallback(boost::bind(&LLAvatarList::onItemDoubleClicked, this, _1, _2, _3, _4)); addItem(item, id, pos); }