From 66de8ba97f058a4017f56d100a40a1d3b4e843c0 Mon Sep 17 00:00:00 2001 From: Richard Linden 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 ++++++++++++++++++++++++++++++++- indra/newview/llavataractions.h | 2 ++ 2 files changed, 34 insertions(+), 1 deletion(-) (limited to 'indra') 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 (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 (LLFloaterReg::findInstance("web_content", id.asString())); + if (browser) + { + browser->closeFloater(); + } +} + // static void LLAvatarActions::showOnMap(const LLUUID& id) { diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 2db2918eed..956fed7461 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -93,6 +93,8 @@ public: * Show avatar profile. */ static void showProfile(const LLUUID& id); + static void hideProfile(const LLUUID& id); + static bool profileVisible(const LLUUID& id); /** * Show avatar on world map. -- cgit v1.2.3