Skip to content
Snippets Groups Projects
Commit 647327d0 authored by Eugene Mutavchi's avatar Eugene Mutavchi
Browse files

Fixed normal bug EXT-6907 ('Show residents profile' menu opens inspector...

Fixed normal bug EXT-6907 ('Show residents profile' menu opens inspector instead of profile) - added 'Url.ShowProfile' action.
Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/282/

--HG--
branch : product-engine
parent b36539f2
No related branches found
No related tags found
No related merge requests found
......@@ -1507,6 +1507,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url)
registrar.add("Url.OpenExternal", boost::bind(&LLUrlAction::openURLExternal, url));
registrar.add("Url.Execute", boost::bind(&LLUrlAction::executeSLURL, url));
registrar.add("Url.Teleport", boost::bind(&LLUrlAction::teleportToLocation, url));
registrar.add("Url.ShowProfile", boost::bind(&LLUrlAction::showProfile, url));
registrar.add("Url.ShowOnMap", boost::bind(&LLUrlAction::showLocationOnMap, url));
registrar.add("Url.CopyLabel", boost::bind(&LLUrlAction::copyLabelToClipboard, url));
registrar.add("Url.CopyUrl", boost::bind(&LLUrlAction::copyURLToClipboard, url));
......
......@@ -146,3 +146,20 @@ void LLUrlAction::copyLabelToClipboard(std::string url)
LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(match.getLabel()));
}
}
void LLUrlAction::showProfile(std::string url)
{
// Get id from 'secondlife:///app/{cmd}/{id}/{action}'
// and show its profile
LLURI uri(url);
LLSD path_array = uri.pathArray();
if (path_array.size() == 4)
{
std::string id_str = path_array.get(2).asString();
if (LLUUID::validate(id_str))
{
std::string cmd_str = path_array.get(1).asString();
executeSLURL("secondlife:///app/" + cmd_str + "/" + id_str + "/about");
}
}
}
......@@ -79,6 +79,9 @@ class LLUrlAction
/// copy a Url to the clipboard
static void copyURLToClipboard(std::string url);
/// if the Url specifies an SL command in the form like 'app/{cmd}/{id}/*', show its profile
static void showProfile(std::string url);
/// specify the callbacks to enable this class's functionality
static void setOpenURLCallback(void (*cb) (const std::string& url));
static void setOpenURLInternalCallback(void (*cb) (const std::string& url));
......
......@@ -7,7 +7,7 @@
layout="topleft"
name="show_agent">
<menu_item_call.on_click
function="Url.Execute" />
function="Url.ShowProfile" />
</menu_item_call>
<menu_item_separator
layout="topleft" />
......
......@@ -7,7 +7,7 @@
layout="topleft"
name="show_group">
<menu_item_call.on_click
function="Url.Execute" />
function="Url.ShowProfile" />
</menu_item_call>
<menu_item_separator
layout="topleft" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment