From 66de8ba97f058a4017f56d100a40a1d3b4e843c0 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 23 Feb 2011 16:43:36 -0800
Subject: SOCIAL-551 WIP Add buttons to open people and profile windows added
 LLAvatarActions::profileVisible and hideProfile

---
 indra/newview/llavataractions.cpp | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

(limited to 'indra/newview/llavataractions.cpp')

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index f3f0cde221..014a387276 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -47,6 +47,7 @@
 #include "llfloatergroups.h"
 #include "llfloaterreg.h"
 #include "llfloaterpay.h"
+#include "llfloaterwebcontent.h"
 #include "llfloaterworldmap.h"
 #include "llgiveinventory.h"
 #include "llinventorybridge.h"
@@ -315,7 +316,7 @@ void LLAvatarActions::showProfile(const LLUUID& id)
 			std::string agent_name = LLCacheName::buildUsername(full_name);
 			llinfos << "opening web profile for " << agent_name << llendl;		
 			std::string url = getProfileURL(agent_name);
-			LLWeb::loadWebURLInternal(url);
+			LLWeb::loadWebURLInternal(url, "", id.asString());
 		}
 		else
 		{
@@ -336,6 +337,36 @@ void LLAvatarActions::showProfile(const LLUUID& id)
 	}
 }
 
+//static 
+bool LLAvatarActions::profileVisible(const LLUUID& id)
+{
+	LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("web_content", id.asString()));
+	if (browser)
+	{
+		// PROFILES: open in webkit window
+		std::string full_name;
+		if (gCacheName->getFullName(id,full_name))
+		{
+			std::string agent_name = LLCacheName::buildUsername(full_name);
+			llinfos << "opening web profile for " << agent_name << llendl;		
+			std::string url = getProfileURL(agent_name);
+			return url == browser->getURL();
+		}
+	}
+	return false;
+}
+
+
+//static 
+void LLAvatarActions::hideProfile(const LLUUID& id)
+{
+	LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("web_content", id.asString()));
+	if (browser)
+	{
+		browser->closeFloater();
+	}
+}
+
 // static
 void LLAvatarActions::showOnMap(const LLUUID& id)
 {
-- 
cgit v1.2.3


From fd8dff8a448e7d2125a9b91351efb7d69e10e0a3 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 24 Feb 2011 18:38:29 -0800
Subject: SOCIAL-551 WIP add buttons to open people and profile windows
 detecting if a profile window is visible now relies on the key the window was
 opened with and not the current url of that window this way you can navigate
 away from your profile and still close the window with the profile button
 removed unused getURL() function

---
 indra/newview/llavataractions.cpp | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

(limited to 'indra/newview/llavataractions.cpp')

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 014a387276..afa8b62c74 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -341,19 +341,7 @@ void LLAvatarActions::showProfile(const LLUUID& id)
 bool LLAvatarActions::profileVisible(const LLUUID& id)
 {
 	LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("web_content", id.asString()));
-	if (browser)
-	{
-		// PROFILES: open in webkit window
-		std::string full_name;
-		if (gCacheName->getFullName(id,full_name))
-		{
-			std::string agent_name = LLCacheName::buildUsername(full_name);
-			llinfos << "opening web profile for " << agent_name << llendl;		
-			std::string url = getProfileURL(agent_name);
-			return url == browser->getURL();
-		}
-	}
-	return false;
+	return browser && browser->isShown();
 }
 
 
-- 
cgit v1.2.3