From ab5a0a1d4d0a029dd92c9fc108638736a57ce7c6 Mon Sep 17 00:00:00 2001
From: AlexanderP ProductEngine <apaschenko@productengine.com>
Date: Mon, 12 Nov 2012 15:06:42 +0200
Subject: [PATCH] CHUI-362 FIXED (Torn off conversation name is highlighted
 when selected in conversation list with different conversation showing in
 message panel): connect new method "returnFloaterToHost" to click on
 quasi-URL "Bring it back"

---
 indra/newview/llfloaterimcontainer.cpp               | 12 ++++++++++--
 indra/newview/llfloaterimcontainer.h                 |  2 +-
 indra/newview/llfloaterimsessiontab.h                |  2 +-
 .../skins/default/xui/en/floater_im_container.xml    |  4 ++--
 4 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 994a76189a2..2707e3dcbb6 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -133,7 +133,6 @@ void LLFloaterIMContainer::onCurrentChannelChanged(const LLUUID& session_id)
     }
 }
 
-
 BOOL LLFloaterIMContainer::postBuild()
 {
 	mNewMessageConnection = LLIMModel::instance().mNewMsgSignal.connect(boost::bind(&LLFloaterIMContainer::onNewMessageReceived, this, _1));
@@ -142,7 +141,8 @@ BOOL LLFloaterIMContainer::postBuild()
 	
 	setTabContainer(getChild<LLTabContainer>("im_box_tab_container"));
 	mStubPanel = getChild<LLPanel>("stub_panel");
-    mStubTextBox = getChild<LLTextBox>("stub_textbox");
+    mStubTextBox = getChild<LLTextBox>("stub_textbox_2");
+    mStubTextBox->setURLClickedCallback(boost::bind(&LLFloaterIMContainer::returnFloaterToHost, this));
 
 	mConversationsStack = getChild<LLLayoutStack>("conversations_stack");
 	mConversationsPane = getChild<LLLayoutPanel>("conversations_layout_panel");
@@ -506,6 +506,14 @@ void LLFloaterIMContainer::showStub(bool stub_is_visible)
 	mStubPanel->setVisible(stub_is_visible);
 }
 
+// listener for click on mStubTextBox2
+void LLFloaterIMContainer::returnFloaterToHost()
+{
+	LLUUID session_id = this->getSelectedSession();
+	LLFloaterIMSessionTab* floater = LLFloaterIMSessionTab::getConversation(session_id);
+	floater->onTearOffClicked();
+}
+
 void LLFloaterIMContainer::setVisible(BOOL visible)
 {	LLFloaterIMNearbyChat* nearby_chat;
 	if (visible)
diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h
index a09cde60f57..e60576a50d1 100644
--- a/indra/newview/llfloaterimcontainer.h
+++ b/indra/newview/llfloaterimcontainer.h
@@ -65,7 +65,7 @@ class LLFloaterIMContainer
 	/*virtual*/ void addFloater(LLFloater* floaterp, 
 								BOOL select_added_floater, 
 								LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
-    
+	void returnFloaterToHost();
     void showConversation(const LLUUID& session_id);
     void selectConversation(const LLUUID& session_id);
     BOOL selectConversationPair(const LLUUID& session_id, bool select_widget);
diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h
index 94854ee9eed..8f5a8c2c1b4 100644
--- a/indra/newview/llfloaterimsessiontab.h
+++ b/indra/newview/llfloaterimsessiontab.h
@@ -91,6 +91,7 @@ class LLFloaterIMSessionTab
 	void buildConversationViewParticipant();
 
 	void setSortOrder(const LLConversationSort& order);
+	virtual void onTearOffClicked();
 	
 	virtual void updateMessages() {}
 
@@ -106,7 +107,6 @@ class LLFloaterIMSessionTab
 	bool onIMShowModesMenuItemCheck(const LLSD& userdata);
 	bool onIMShowModesMenuItemEnable(const LLSD& userdata);
 	static void onSlide(LLFloaterIMSessionTab *self);
-	virtual void onTearOffClicked();
 
 	// refresh a visual state of the Call button
 	void updateCallBtnState(bool callIsActive);
diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml
index e3db3d52ed8..1388b9e4746 100644
--- a/indra/newview/skins/default/xui/en/floater_im_container.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_container.xml
@@ -159,9 +159,9 @@
                    top="40"
                    height="20"
                    valign="center"
-                   parse_urls="false"
+                   parse_urls="true"
                    wrap="true">
-                     Bring it back.
+                     [secondlife:/// Bring it back.]
                 </text>
              </panel>
             </panel_container>
-- 
GitLab