From 235a3477364c6747d7724a090ca61adbcbeac272 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 15 Jan 2013 14:13:36 -0800 Subject: CHUI-458 : Fixed : Tidy up the title overwrite by the selected conversation --- indra/newview/llfloaterimcontainer.cpp | 6 +++--- indra/newview/llfloaterimsession.cpp | 2 ++ indra/newview/llfloaterimsession.h | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index cf81a2b046..8264a90325 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -505,10 +505,10 @@ void LLFloaterIMContainer::draw() collapseMessagesPane(true); } - //Update moderator options visibility const LLConversationItem *current_session = getCurSelectedViewModelItem(); if (current_session) { + // Update moderator options visibility LLFolderViewModelItemCommon::child_list_t::const_iterator current_participant_model = current_session->getChildrenBegin(); LLFolderViewModelItemCommon::child_list_t::const_iterator end_participant_model = current_session->getChildrenEnd(); while (current_participant_model != end_participant_model) @@ -518,9 +518,9 @@ void LLFloaterIMContainer::draw() current_participant_model++; } - // is P2P? Test if we can change the title + // Update floater's title as required by the currently selected session or use the default title LLFloaterIMSession * conversation_floaterp = LLFloaterIMSession::findInstance(current_session->getUUID()); - setTitle(conversation_floaterp && conversation_floaterp->hasSpecialTitle() ? conversation_floaterp->getSpecialTitle() : mGeneralTitle); + setTitle(conversation_floaterp && conversation_floaterp->needsTitleOverwrite() ? conversation_floaterp->getTitle() : mGeneralTitle); } LLFloater::draw(); diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index 931ee0dc66..a09dc1914f 100644 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -70,6 +70,7 @@ LLFloaterIMSession::LLFloaterIMSession(const LLUUID& session_id) mShouldSendTypingState(false), mMeTyping(false), mOtherTyping(false), + mSessionNameUpdatedForTyping(false), mTypingTimer(), mTypingTimeoutTimer(), mPositioned(false), @@ -556,6 +557,7 @@ void LLFloaterIMSession::updateSessionName(const std::string& name) LLFloaterIMSessionTab::updateSessionName(name); mTypingStart.setArg("[NAME]", name); setTitle (mOtherTyping ? mTypingStart.getString() : name); + mSessionNameUpdatedForTyping = mOtherTyping; } } diff --git a/indra/newview/llfloaterimsession.h b/indra/newview/llfloaterimsession.h index 7239481e56..2049cedfd7 100644 --- a/indra/newview/llfloaterimsession.h +++ b/indra/newview/llfloaterimsession.h @@ -132,8 +132,7 @@ public: static boost::signals2::connection setIMFloaterShowedCallback(const floater_showed_signal_t::slot_type& cb); static floater_showed_signal_t sIMFloaterShowedSignal; - bool hasSpecialTitle() { return mOtherTyping; } - std::string getSpecialTitle() { return getTitle(); } + bool needsTitleOverwrite() { return mSessionNameUpdatedForTyping && mOtherTyping; } private: /*virtual*/ void refresh(); @@ -184,6 +183,7 @@ private: bool mShouldSendTypingState; LLFrameTimer mTypingTimer; LLFrameTimer mTypingTimeoutTimer; + bool mSessionNameUpdatedForTyping; bool mSessionInitialized; LLSD mQueuedMsgsForInit; -- cgit v1.2.3