diff options
author | Richard Linden <none@none> | 2011-02-23 16:43:36 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2011-02-23 16:43:36 -0800 |
commit | 66de8ba97f058a4017f56d100a40a1d3b4e843c0 (patch) | |
tree | 0aeef92a1d1a70324206a6c118e7d21cc4a999d7 | |
parent | cc337162e3dec52e57e8dee6b564b7d186b9de4b (diff) |
SOCIAL-551 WIP Add buttons to open people and profile windows
added LLAvatarActions::profileVisible and hideProfile
-rwxr-xr-x | indra/newview/llavataractions.cpp | 33 | ||||
-rw-r--r-- | indra/newview/llavataractions.h | 2 |
2 files changed, 34 insertions, 1 deletions
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) { 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. |