summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-11-08 13:34:57 -0800
committerMerov Linden <merov@lindenlab.com>2012-11-08 13:34:57 -0800
commit865cb1b9674cf61d1abda6865e568fe5d791edcd (patch)
tree78f0ce12b6496e02fee29f0927cf472b4ca757d7 /indra
parent4ee2b01b304b5c95fd4b1d73109033d37e84cb25 (diff)
parent93f9c6991819f53ea03b36dff1af77bbd74ff43b (diff)
Pull merge from viewer-chui
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llui/llfolderviewitem.cpp2
-rwxr-xr-xindra/newview/llconversationview.cpp77
-rwxr-xr-xindra/newview/llconversationview.h6
-rw-r--r--indra/newview/llimconversation.cpp23
-rw-r--r--indra/newview/llimconversation.h3
-rw-r--r--indra/newview/llimfloater.cpp13
-rw-r--r--indra/newview/llimfloater.h3
-rw-r--r--indra/newview/llimfloatercontainer.cpp41
-rw-r--r--indra/newview/llimfloatercontainer.h2
-rw-r--r--indra/newview/llimview.cpp9
-rw-r--r--indra/newview/llnearbychat.cpp18
-rw-r--r--indra/newview/llnearbychat.h1
12 files changed, 116 insertions, 82 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index c5231c4f08..822534ffcf 100755
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -409,8 +409,8 @@ void LLFolderViewItem::selectItem(void)
{
if (mIsSelected == FALSE)
{
- getViewModelItem()->selectItem();
mIsSelected = TRUE;
+ getViewModelItem()->selectItem();
}
}
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index c6b970158f..ac5b2ad6ac 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -203,6 +203,17 @@ void LLConversationViewSession::draw()
LLView::draw();
}
+BOOL LLConversationViewSession::handleMouseDown( S32 x, S32 y, MASK mask )
+{
+ LLConversationItem* item = dynamic_cast<LLConversationItem *>(getViewModelItem());
+ LLUUID session_id = item? item->getUUID() : LLUUID();
+
+ (LLFloaterReg::getTypedInstance<LLIMFloaterContainer>("im_container"))->
+ selectConversationPair(session_id, false);
+
+ return LLFolderViewFolder::handleMouseDown(x, y, mask);
+}
+
// virtual
S32 LLConversationViewSession::arrange(S32* width, S32* height)
{
@@ -233,30 +244,6 @@ void LLConversationViewSession::toggleOpen()
}
}
-void LLConversationViewSession::selectItem()
-{
- LLFolderViewModelItem* item = mViewModelItem;
- LLUUID session_uuid = dynamic_cast<LLConversationItem*>(item)->getUUID();
- LLFloater* session_floater = LLIMConversation::getConversation(session_uuid);
- LLMultiFloater* host_floater = session_floater->getHost();
-
- if (host_floater == mContainer)
- {
- // Always expand the message pane if the panel is hosted by the container
- mContainer->collapseMessagesPane(false);
- // Switch to the conversation floater that is being selected
- mContainer->selectFloater(session_floater);
- }
-
- // Set the focus on the selected floater
- session_floater->setFocus(TRUE);
- // Store the active session
- LLIMFloaterContainer::getInstance()->setSelectedSession(session_uuid);
-
-
- LLFolderViewItem::selectItem();
-}
-
void LLConversationViewSession::toggleMinimizedMode(bool is_minimized)
{
mMinimizedMode = is_minimized;
@@ -458,31 +445,6 @@ S32 LLConversationViewParticipant::arrange(S32* width, S32* height)
return arranged;
}
-void LLConversationViewParticipant::selectItem()
-{
- LLConversationItem* vmi = this->getParentFolder() ? static_cast<LLConversationItem*>(this->getParentFolder()->getViewModelItem()) : NULL;
- LLIMFloaterContainer* container = LLIMFloaterContainer::getInstance();
- LLFloater* session_floater;
-
- if(vmi)
- {
- session_floater = LLIMConversation::getConversation(vmi->getUUID());
-
- //Only execute when switching floaters (conversations)
- if(vmi->getUUID() != container->getSelectedSession())
- {
- container->selectFloater(session_floater);
- // Store the active session
- container->setSelectedSession(vmi->getUUID());
- }
-
- //Redirect focus to the conversation floater
- session_floater->setFocus(TRUE);
- }
-
- LLFolderViewItem::selectItem();
-}
-
void LLConversationViewParticipant::refresh()
{
// Refresh the participant view from its model data
@@ -532,6 +494,23 @@ void LLConversationViewParticipant::onMouseLeave(S32 x, S32 y, MASK mask)
LLFolderViewItem::onMouseLeave(x, y, mask);
}
+BOOL LLConversationViewParticipant::handleMouseDown( S32 x, S32 y, MASK mask )
+{
+ LLConversationItem* item = NULL;
+ LLConversationViewSession* session_widget =
+ dynamic_cast<LLConversationViewSession *>(this->getParentFolder());
+ if (session_widget)
+ {
+ item = dynamic_cast<LLConversationItem*>(session_widget->getViewModelItem());
+ }
+ LLUUID session_id = item? item->getUUID() : LLUUID();
+
+ (LLFloaterReg::getTypedInstance<LLIMFloaterContainer>("im_container"))->
+ selectConversationPair(session_id, false);
+
+ return LLFolderViewItem::handleMouseDown(x, y, mask);
+}
+
S32 LLConversationViewParticipant::getLabelXPos()
{
return getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad;
diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h
index f2ab093739..43547d155b 100755
--- a/indra/newview/llconversationview.h
+++ b/indra/newview/llconversationview.h
@@ -60,10 +60,10 @@ protected:
public:
virtual ~LLConversationViewSession();
- virtual void selectItem();
/*virtual*/ BOOL postBuild();
/*virtual*/ void draw();
+ /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask );
/*virtual*/ S32 arrange(S32* width, S32* height);
@@ -117,11 +117,13 @@ public:
};
virtual ~LLConversationViewParticipant( void ) { }
- void selectItem();
+
bool hasSameValue(const LLUUID& uuid) { return (uuid == mUUID); }
virtual void refresh();
void addToFolder(LLFolderViewFolder* folder);
+ /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask );
+
void onMouseEnter(S32 x, S32 y, MASK mask);
void onMouseLeave(S32 x, S32 y, MASK mask);
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp
index d1ffba0663..e031b0e829 100644
--- a/indra/newview/llimconversation.cpp
+++ b/indra/newview/llimconversation.cpp
@@ -133,6 +133,22 @@ void LLIMConversation::setVisible(BOOL visible)
setFocus(visible);
}
+/*virtual*/
+void LLIMConversation::setFocus(BOOL focus)
+{
+ LLTransientDockableFloater::setFocus(focus);
+
+ //Redirect focus to input editor
+ if (focus)
+ {
+ updateMessages();
+
+ if (mInputEditor)
+ {
+ mInputEditor->setFocus(TRUE);
+ }
+ }
+}
void LLIMConversation::addToHost(const LLUUID& session_id)
@@ -286,7 +302,6 @@ void LLIMConversation::enableDisableCallBtn()
&& mSession->mCallBackEnabled);
}
-
void LLIMConversation::onFocusReceived()
{
setBackgroundOpaque(true);
@@ -297,6 +312,12 @@ void LLIMConversation::onFocusReceived()
}
LLTransientDockableFloater::onFocusReceived();
+
+ LLIMFloaterContainer* container = LLFloaterReg::getTypedInstance<LLIMFloaterContainer>("im_container");
+ if (container)
+ {
+ container->selectConversationPair(mSessionID, true);
+ }
}
void LLIMConversation::onFocusLost()
diff --git a/indra/newview/llimconversation.h b/indra/newview/llimconversation.h
index edcae5e45d..49cfcb68c4 100644
--- a/indra/newview/llimconversation.h
+++ b/indra/newview/llimconversation.h
@@ -81,6 +81,7 @@ public:
/*virtual*/ BOOL postBuild();
/*virtual*/ void draw();
/*virtual*/ void setVisible(BOOL visible);
+ /*virtual*/ void setFocus(BOOL focus);
// Handle the left hand participant list widgets
void addConversationViewParticipant(LLConversationItem* item);
@@ -91,6 +92,8 @@ public:
void setSortOrder(const LLConversationSort& order);
+ virtual void updateMessages() {}
+
protected:
// callback for click on any items of the visual states menu
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index d9c201d856..73c7be37eb 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -597,19 +597,6 @@ 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*>
diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h
index 8a0a163678..6ba31657dc 100644
--- a/indra/newview/llimfloater.h
+++ b/indra/newview/llimfloater.h
@@ -65,7 +65,6 @@ public:
// LLView overrides
/*virtual*/ BOOL postBuild();
- /*virtual*/ void setFocus(BOOL focusFlag);
/*virtual*/ void setVisible(BOOL visible);
/*virtual*/ BOOL getVisible();
// Check typing timeout timer.
@@ -86,7 +85,7 @@ public:
void sessionInitReplyReceived(const LLUUID& im_session_id);
// get new messages from LLIMModel
- void updateMessages();
+ /*virtual*/ void updateMessages();
void reloadMessages();
static void onSendMsg(LLUICtrl*, void*);
void sendMsgFromInputEditor();
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index c6e82f11a3..6fc03cec66 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -1118,6 +1118,47 @@ void LLIMFloaterContainer::selectConversation(const LLUUID& session_id)
}
}
+// Synchronous select the conversation item and the conversation floater
+BOOL LLIMFloaterContainer::selectConversationPair(const LLUUID& session_id, bool select_widget)
+{
+ BOOL handled = TRUE;
+
+ /* widget processing */
+ if (select_widget)
+ {
+ LLFolderViewItem* widget = mConversationsWidgets[session_id];
+ if (widget && widget->getParentFolder())
+ {
+ widget->getParentFolder()->setSelection(widget, FALSE, FALSE);
+ }
+ }
+
+ /* floater processing */
+
+ if (session_id != getSelectedSession())
+ {
+ // Store the active session
+ setSelectedSession(session_id);
+
+ LLIMConversation* session_floater = LLIMConversation::getConversation(session_id);
+
+ if (session_floater->getHost())
+ {
+ // Always expand the message pane if the panel is hosted by the container
+ collapseMessagesPane(false);
+ // Switch to the conversation floater that is being selected
+ selectFloater(session_floater);
+ }
+
+ // Set the focus on the selected floater
+ if (!session_floater->hasFocus())
+ {
+ session_floater->setFocus(TRUE);
+ }
+ }
+
+ return handled;
+}
void LLIMFloaterContainer::setTimeNow(const LLUUID& session_id, const LLUUID& participant_id)
{
diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h
index 5ae3f9f1d4..f1e0181f4e 100644
--- a/indra/newview/llimfloatercontainer.h
+++ b/indra/newview/llimfloatercontainer.h
@@ -68,6 +68,8 @@ public:
void showConversation(const LLUUID& session_id);
void selectConversation(const LLUUID& session_id);
+ BOOL selectConversationPair(const LLUUID& session_id, bool select_widget);
+
/*virtual*/ void tabClose();
static LLFloater* getCurrentVoiceFloater();
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index d5f1e81933..11337c358f 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -121,7 +121,14 @@ void toast_callback(const LLSD& msg){
// Skip toasting if we have open window of IM with this session id
LLIMFloater* open_im_floater = LLIMFloater::findInstance(msg["session_id"]);
- if (open_im_floater && open_im_floater->isInVisibleChain() && open_im_floater->hasFocus())
+ if (
+ open_im_floater
+ && open_im_floater->isInVisibleChain()
+ && open_im_floater->hasFocus()
+ && !open_im_floater->isMinimized()
+ && !(open_im_floater->getHost()
+ && open_im_floater->getHost()->isMinimized())
+ )
{
return;
}
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index d1c7c6bfd7..a30d8b685e 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -195,8 +195,13 @@ BOOL LLNearbyChat::handleMouseDown(S32 x, S32 y, MASK mask)
//background opaque. This all happenn since NearByChat is "chrome" and didn't process focus change.
if(mChatHistory)
+ {
mChatHistory->setFocus(TRUE);
- return LLPanel::handleMouseDown(x, y, mask);
+ }
+
+ BOOL handled = LLPanel::handleMouseDown(x, y, mask);
+ setFocus(handled);
+ return handled;
}
void LLNearbyChat::reloadMessages()
@@ -270,17 +275,6 @@ void LLNearbyChat::removeScreenChat()
}
}
-void LLNearbyChat::setFocus(BOOL focusFlag)
-{
- LLTransientDockableFloater::setFocus(focusFlag);
-
- //Redirect focus to input editor
- if (focusFlag)
- {
- mInputEditor->setFocus(TRUE);
- }
-
-}
void LLNearbyChat::setVisible(BOOL visible)
{
diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h
index b155fd3c26..11346a313c 100644
--- a/indra/newview/llnearbychat.h
+++ b/indra/newview/llnearbychat.h
@@ -52,7 +52,6 @@ public:
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
- /*virtual*/ void setFocus(BOOL focusFlag);
/*virtual*/ void setVisible(BOOL visible);
void loadHistory();