diff options
| -rw-r--r-- | indra/newview/llchiclet.h | 1 | ||||
| -rw-r--r-- | indra/newview/llchicletbar.h | 1 | ||||
| -rw-r--r-- | indra/newview/llconversationlog.h | 1 | ||||
| -rwxr-xr-x | indra/newview/llconversationview.cpp | 30 | ||||
| -rwxr-xr-x | indra/newview/llconversationview.h | 1 | ||||
| -rw-r--r-- | indra/newview/llimconversation.cpp | 11 | ||||
| -rw-r--r-- | indra/newview/llimconversation.h | 3 | ||||
| -rw-r--r-- | indra/newview/llimfloater.cpp | 31 | ||||
| -rw-r--r-- | indra/newview/llimfloater.h | 1 | ||||
| -rw-r--r-- | indra/newview/llimfloatercontainer.cpp | 27 | ||||
| -rw-r--r-- | indra/newview/llimfloatercontainer.h | 3 | ||||
| -rw-r--r-- | indra/newview/llimview.cpp | 15 | ||||
| -rw-r--r-- | indra/newview/llimview.h | 3 | ||||
| -rw-r--r-- | indra/newview/llnearbychat.cpp | 23 | ||||
| -rw-r--r-- | indra/newview/llnearbychat.h | 2 | ||||
| -rw-r--r-- | indra/newview/llsyswellwindow.h | 1 | 
16 files changed, 116 insertions, 38 deletions
| diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index f51d7b622c..6395f5b694 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -874,6 +874,7 @@ class LLIMWellChiclet : public LLSysWellChiclet, LLIMSessionObserver  	friend class LLUICtrlFactory;  public:  	/*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {} +    /*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}  	/*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id) {};  	/*virtual*/ void sessionRemoved(const LLUUID& session_id) { messageCountChanged(LLSD()); }  	/*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) {} diff --git a/indra/newview/llchicletbar.h b/indra/newview/llchicletbar.h index 7d0d904810..a9a5b61ae7 100644 --- a/indra/newview/llchicletbar.h +++ b/indra/newview/llchicletbar.h @@ -51,6 +51,7 @@ public:  	// LLIMSessionObserver observe triggers  	/*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); +    /*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {};  	/*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id) {};  	/*virtual*/ void sessionRemoved(const LLUUID& session_id);  	/*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id); diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h index 373406aa6f..b92cf0f5e2 100644 --- a/indra/newview/llconversationlog.h +++ b/indra/newview/llconversationlog.h @@ -124,6 +124,7 @@ public:  	// LLIMSessionObserver triggers  	virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); +    virtual void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}; // Stub  	virtual void sessionRemoved(const LLUUID& session_id){}											// Stub  	virtual void sessionVoiceOrIMStarted(const LLUUID& session_id){};								// Stub  	virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id){};	// Stub diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 416e6da2da..637f30635e 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -32,6 +32,8 @@  #include <boost/bind.hpp>  #include "llagentdata.h"  #include "llconversationmodel.h" +#include "llimfloater.h" +#include "llnearbychat.h"  #include "llimconversation.h"  #include "llimfloatercontainer.h"  #include "llfloaterreg.h" @@ -405,21 +407,43 @@ void LLConversationViewParticipant::draw()      static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE);      const BOOL show_context = (getRoot() ? getRoot()->getShowSelectionContext() : FALSE); -    const BOOL filled = show_context || (getRoot() ? getRoot()->getParentPanel()->hasFocus() : FALSE); // If we have keyboard focus, draw selection filled      const LLFontGL* font = getLabelFontForStyle(mLabelStyle);      F32 right_x  = 0;      F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;      F32 text_left = (F32)getLabelXPos(); -    LLColor4 color = (mIsSelected && filled) ? sHighlightFgColor : sFgColor; +    LLColor4 color = mIsSelected ? sHighlightFgColor : sFgColor; -    drawHighlight(show_context, filled, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor); +    drawHighlight(show_context, mIsSelected, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor);      drawLabel(font, text_left, y, color, right_x);      LLView::draw();  } +void LLConversationViewParticipant::selectItem() +{ +    LLConversationItem* vmi = this->getParentFolder() ? static_cast<LLConversationItem*>(this->getParentFolder()->getViewModelItem()) : NULL; +    LLIMFloaterContainer* container = LLIMFloaterContainer::getInstance(); + +    //Only execute when switching floaters (conversations) +    if(vmi && vmi->getUUID() != container->getSelectedSession()) +    { +        //When null, show the nearby chat conversation floater +        if(vmi->getUUID().isNull()) +        { +            LLNearbyChat* nearbyChat = LLFloaterReg::findTypedInstance<LLNearbyChat>("nearby_chat"); +            nearbyChat->show(); +        } +        //Otherwise, show the IM conversation floater +        else +        { +            LLIMFloater::show(vmi->getUUID()); +        } +    } + +    LLFolderViewItem::selectItem(); +}  void LLConversationViewParticipant::refresh()  { diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h index c81c70b456..bd95387bbe 100755 --- a/indra/newview/llconversationview.h +++ b/indra/newview/llconversationview.h @@ -113,6 +113,7 @@ public:  	};      virtual ~LLConversationViewParticipant( void ) { } +    void selectItem();	      bool hasSameValue(const LLUUID& uuid) { return (uuid == mUUID); }      virtual void refresh();      void addToFolder(LLFolderViewFolder* folder); diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index 9f3c6d0f3d..bd2a2419a8 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -54,7 +54,6 @@ LLIMConversation::LLIMConversation(const LLSD& session_id)    , mInputEditor(NULL)    , mInputEditorTopPad(0)    , mRefreshTimer(new LLTimer()) -  , mHasFocus(false)  {  	mSession = LLIMModel::getInstance()->findIMSession(mSessionID); @@ -216,21 +215,11 @@ void LLIMConversation::onFocusReceived()  	}  	LLTransientDockableFloater::onFocusReceived(); - -    mHadFocus = mHasFocus; -    mHasFocus = true; - -	if (! mHadFocus) -	{ -	    LLIMFloaterContainer* container = LLIMFloaterContainer::getInstance(); -	    container->setConvItemSelect(mSessionID); -	}  }  void LLIMConversation::onFocusLost()  {  	setBackgroundOpaque(false); -	mHasFocus = false;  	LLTransientDockableFloater::onFocusLost();  } diff --git a/indra/newview/llimconversation.h b/indra/newview/llimconversation.h index 0960d6db88..603e0d0197 100644 --- a/indra/newview/llimconversation.h +++ b/indra/newview/llimconversation.h @@ -141,9 +141,6 @@ private:  	bool checkIfTornOff();  	LLTimer* mRefreshTimer; ///< Defines the rate at which refresh() is called. - -	bool mHadFocus; -	bool mHasFocus;  }; diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 467f48600a..e4032738a7 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -715,6 +715,19 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock)  	}  } +void LLIMFloater::setFocus(BOOL focusFlag) +{ +    LLTransientDockableFloater::setFocus(focusFlag); + +    //Redirect focus to input editor +    if (focusFlag) +    { +        updateMessages(); +        mInputEditor->setFocus(TRUE); +    } +     +} +  void LLIMFloater::setVisible(BOOL visible)  {  	LLNotificationsUI::LLScreenChannel* channel = static_cast<LLNotificationsUI::LLScreenChannel*> @@ -730,21 +743,6 @@ void LLIMFloater::setVisible(BOOL visible)  		channel->redrawToasts();  	} -	BOOL is_minimized = visible && isChatMultiTab() -		? LLIMFloaterContainer::getInstance()->isMinimized() -		: !visible; - -	if (!is_minimized && mChatHistory && mInputEditor) -	{ -		//only if floater was construced and initialized from xml -		updateMessages(); -		//prevent stealing focus when opening a background IM tab (EXT-5387, checking focus for EXT-6781) -		if (!isChatMultiTab() || hasFocus()) -		{ -			mInputEditor->setFocus(TRUE); -		} -	} -  	if(!visible)  	{  		LLIMChiclet* chiclet = LLChicletBar::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(mSessionID); @@ -757,7 +755,10 @@ void LLIMFloater::setVisible(BOOL visible)  	if (visible && isInVisibleChain())  	{  		sIMFloaterShowedSignal(mSessionID); +          	} + +    setFocus(visible);  }  BOOL LLIMFloater::getVisible() diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index 5ed1d1ab35..26daf00afd 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -65,6 +65,7 @@ public:  	// LLView overrides  	/*virtual*/ BOOL postBuild(); +    /*virtual*/ void setFocus(BOOL focusFlag);  	/*virtual*/ void setVisible(BOOL visible);  	/*virtual*/ BOOL getVisible();  	// Check typing timeout timer. diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 16751a6ea1..8a30b5cd68 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -101,6 +101,11 @@ void LLIMFloaterContainer::sessionAdded(const LLUUID& session_id, const std::str  	addConversationListItem(session_id);  } +void LLIMFloaterContainer::sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) +{ +    setItemSelect(session_id); +} +  void LLIMFloaterContainer::sessionVoiceOrIMStarted(const LLUUID& session_id)  {  	LLIMFloater::addToHost(session_id, true); @@ -1067,6 +1072,7 @@ bool LLIMFloaterContainer::checkContextMenuItem(const LLSD& userdata)      return false;  } +//Will select only the conversation item  void LLIMFloaterContainer::setConvItemSelect(const LLUUID& session_id)  {  	LLFolderViewItem* widget = mConversationsWidgets[session_id]; @@ -1077,6 +1083,26 @@ void LLIMFloaterContainer::setConvItemSelect(const LLUUID& session_id)  	}  } +//Will select the conversation/participant item +void LLIMFloaterContainer::setItemSelect(const LLUUID& session_id) +{ + +    if(mConversationsRoot->getCurSelectedItem() && mConversationsRoot->getCurSelectedItem()->getParentFolder()) +    { +        //Retreive the conversation id. When a participant is selected, then have to to get the converation id from the parent. +        LLConversationItem* vmi = dynamic_cast<LLConversationItem*>(mConversationsRoot->getCurSelectedItem()->getParentFolder()->getViewModelItem()); + +        //Will allow selection/highlighting of the conversation/participant +        if(session_id != vmi->getUUID()) +        { +            mSelectedSession = session_id; +            LLFolderViewItem* widget = mConversationsWidgets[session_id]; +            (widget->getRoot())->setSelection(widget, FALSE, FALSE); +        } +    } +} + +  void LLIMFloaterContainer::setTimeNow(const LLUUID& session_id, const LLUUID& participant_id)  {  	conversations_items_map::iterator item_it = mConversationsItems.find(session_id); @@ -1217,6 +1243,7 @@ bool LLIMFloaterContainer::removeConversationListItem(const LLUUID& uuid, bool c  		conversations_widgets_map::iterator widget_it = mConversationsWidgets.begin();  		if (widget_it != mConversationsWidgets.end())  		{ +            mSelectedSession = widget_it->first;  			LLFolderViewItem* widget = widget_it->second;  			widget->selectItem();  		} diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 5c11577154..6643471d97 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -64,6 +64,7 @@ public:  								BOOL select_added_floater,   								LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);      void setConvItemSelect(const LLUUID& session_id); +    void setItemSelect(const LLUUID& session_id);  	/*virtual*/ void tabClose();  	static LLFloater* getCurrentVoiceFloater(); @@ -81,11 +82,13 @@ public:  	// LLIMSessionObserver observe triggers  	/*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); +    /*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);  	/*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id);  	/*virtual*/ void sessionRemoved(const LLUUID& session_id);  	/*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id);  	LLConversationViewModel& getRootViewModel() { return mConversationViewModel; } +    LLUUID getSelectedSession() { return mSelectedSession; }  private:  	typedef std::map<LLUUID,LLFloater*> avatarID_panel_map_t; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index aa5b9ce006..115da54ec8 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2653,10 +2653,17 @@ LLUUID LLIMMgr::addSession(  		}  	} +    //Notify observers that a session was added  	if (new_session)  	{  		LLIMModel::getInstance()->newSession(session_id, name, dialog, other_participant_id, ids, voice);  	} +    //Notifies observers that the session was already added +    else +    { +        std::string session_name = LLIMModel::getInstance()->getName(session_id); +        LLIMMgr::getInstance()->notifyObserverSessionActivated(session_id, session_name, other_participant_id); +    }  	//we don't need to show notes about online/offline, mute/unmute users' statuses for existing sessions  	if (!new_session) return session_id; @@ -2959,6 +2966,14 @@ void LLIMMgr::notifyObserverSessionAdded(const LLUUID& session_id, const std::st  	}  } +void LLIMMgr::notifyObserverSessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) +{ +    for (session_observers_list_t::iterator it = mSessionObservers.begin(); it != mSessionObservers.end(); it++) +    { +        (*it)->sessionActivated(session_id, name, other_participant_id); +    } +} +  void LLIMMgr::notifyObserverSessionVoiceOrIMStarted(const LLUUID& session_id)  {  	for (session_observers_list_t::iterator it = mSessionObservers.begin(); it != mSessionObservers.end(); it++) diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 82cfa394a6..00b67f520c 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -303,6 +303,7 @@ class LLIMSessionObserver  public:  	virtual ~LLIMSessionObserver() {}  	virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) = 0; +    virtual void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) = 0;  	virtual void sessionVoiceOrIMStarted(const LLUUID& session_id) = 0;  	virtual void sessionRemoved(const LLUUID& session_id) = 0;  	virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) = 0; @@ -469,6 +470,8 @@ private:  	static void onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& name, bool is_group);  	void notifyObserverSessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); +    //Triggers when a session has already been added +    void notifyObserverSessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);  	void notifyObserverSessionVoiceOrIMStarted(const LLUUID& session_id);  	void notifyObserverSessionRemoved(const LLUUID& session_id);  	void notifyObserverSessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id); diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index b96b486868..a89ae4a2dc 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -271,14 +271,27 @@ void LLNearbyChat::removeScreenChat()  	}  } -void	LLNearbyChat::setVisible(BOOL visible) +void LLNearbyChat::setFocus(BOOL focusFlag)  { -	if(visible) -	{ -		removeScreenChat(); -	} +    LLTransientDockableFloater::setFocus(focusFlag); +     +    //Redirect focus to input editor +    if (focusFlag) +    { +        mInputEditor->setFocus(TRUE); +    } +     +} +void	LLNearbyChat::setVisible(BOOL visible) +{  	LLIMConversation::setVisible(visible); + +    if(visible) +    { +        removeScreenChat(); +    } +    setFocus(visible);  } diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h index 93168ba96a..7ada4daea8 100644 --- a/indra/newview/llnearbychat.h +++ b/indra/newview/llnearbychat.h @@ -52,7 +52,7 @@ public:  	/*virtual*/ BOOL postBuild();  	/*virtual*/ void onOpen(const LLSD& key); - +    /*virtual*/ void setFocus(BOOL focusFlag);  	/*virtual*/ void	setVisible(BOOL visible);  	void loadHistory(); diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index 6be12711ac..378d5e0aa2 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -171,6 +171,7 @@ public:  	// LLIMSessionObserver observe triggers  	/*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); +    /*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}  	/*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id) {};  	/*virtual*/ void sessionRemoved(const LLUUID& session_id);  	/*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id); | 
