SOCIAL-551 WIP Add buttons to open people and profile windows

added LLAvatarActions::profileVisible and hideProfile
meow-7.2.2
Richard Linden 2011-02-23 16:43:36 -08:00
parent cc337162e3
commit 66de8ba97f
2 changed files with 34 additions and 1 deletions

View File

@ -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)
{

View File

@ -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.