diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfavoritesbar.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llimview.cpp | 55 |
2 files changed, 52 insertions, 12 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index da0a9727a9..64af1225bf 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -657,7 +657,7 @@ void LLFavoritesBarCtrl::updateButtons() int first_changed_item_index = 0; int rightest_point = getRect().mRight - mChevronButton->getRect().getWidth(); //lets find first changed button - while (child_it != childs->end()) + while (child_it != childs->end() && first_changed_item_index < mItems.count()) { LLFavoriteLandmarkButton* button = dynamic_cast<LLFavoriteLandmarkButton*> (*child_it); if (button) @@ -675,9 +675,8 @@ void LLFavoritesBarCtrl::updateButtons() } // now first_changed_item_index should contains a number of button that need to change - if (first_changed_item_index < mItems.count()) + if (first_changed_item_index <= mItems.count()) { - mUpdateDropDownItems = true; // Rebuild the buttons only // child_list_t is a linked list, so safe to erase from the middle if we pre-incrament the iterator @@ -722,6 +721,10 @@ void LLFavoritesBarCtrl::updateButtons() // Chevron button if (mFirstDropDownItem < mItems.count()) { + // if updateButton had been called it means: + //or there are some new favorites, or width had been changed + // so if we need to display chevron button, we must update dropdown items too. + mUpdateDropDownItems = true; S32 buttonHGap = 2; // default value buttonXMLNode->getAttributeS32("left", buttonHGap); LLRect rect; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index c152ad6c02..f5362acbfe 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -238,15 +238,17 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state, const LLVoiceChannel::EDirection& direction) { - bool is_p2p_session = dynamic_cast<LLVoiceChannelP2P*>(mVoiceChannel); - std::string other_avatar_name; + std::string you = LLTrans::getString("You"); + std::string started_call = LLTrans::getString("started_call"); + std::string joined_call = LLTrans::getString("joined_call"); + std::string other_avatar_name = ""; - if(is_p2p_session) + switch(mSessionType) { + case AVALINE_SESSION: + // *TODO: test avaline calls (EXT-2211) + case P2P_SESSION: gCacheName->getFullName(mOtherParticipantID, other_avatar_name); - std::string you = LLTrans::getString("You"); - std::string started_call = LLTrans::getString("started_call"); - std::string joined_call = LLTrans::getString("joined_call"); if(direction == LLVoiceChannel::INCOMING_CALL) { @@ -280,10 +282,45 @@ void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::ES { mSpeakers->update(true); } - } - else // group || ad-hoc calls - { + break; + + case GROUP_SESSION: + case ADHOC_SESSION: + // *TODO: determine call starter's name "other_avatar_name" (EXT-2211) + // decide how to show notifications for a group/adhoc chat already opened + // for now there is no notification from voice channel for this case + if(direction == LLVoiceChannel::INCOMING_CALL) + { + switch(new_state) + { + case LLVoiceChannel::STATE_CALL_STARTED : + LLIMModel::getInstance()->addMessageSilently(mSessionID, other_avatar_name, mOtherParticipantID, started_call); + break; + case LLVoiceChannel::STATE_CONNECTED : + LLIMModel::getInstance()->addMessageSilently(mSessionID, you, gAgent.getID(), joined_call); + default: + break; + } + } + else // outgoing call + { + switch(new_state) + { + case LLVoiceChannel::STATE_CALL_STARTED : + LLIMModel::getInstance()->addMessageSilently(mSessionID, you, gAgent.getID(), started_call); + break; + default: + break; + } + } + + // Update speakers list when connected + if (LLVoiceChannel::STATE_CONNECTED == new_state) + { + mSpeakers->update(true); + } + break; } } |