diff options
author | Denis Serdjuk <dserduk@productengine.com> | 2009-12-04 14:15:08 +0200 |
---|---|---|
committer | Denis Serdjuk <dserduk@productengine.com> | 2009-12-04 14:15:08 +0200 |
commit | 83c8f43f8d155279192f0f6c75bca2458fe94f8f (patch) | |
tree | 450bc1ccb8aaa73e25a9ade427c55ae570460f43 /indra/llui | |
parent | 96a11910b19254e180247f76b9c0c201bbdf178c (diff) |
implemented Task EXT-2304 Offer Notifications should include a link that highlights the landmark or item in the appropriate side panel
Changes:
This task had been already implemented. llurlentyinventory and llurlregistry have been changed to correct parsing of offer url
--HG--
branch : product-engine
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llurlentry.cpp | 26 | ||||
-rw-r--r-- | indra/llui/llurlregistry.cpp | 4 |
2 files changed, 10 insertions, 20 deletions
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index b51709e208..9ad86a29f6 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -386,36 +386,24 @@ std::string LLUrlEntryGroup::getLabel(const std::string &url, const LLUrlLabelCa // // LLUrlEntryInventory Describes a Second Life inventory Url, e.g., -// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/select +// secondlife:///app/inventory/0e346d8b-4433-4d66-a6b0-fd37083abc4c/select // LLUrlEntryInventory::LLUrlEntryInventory() { - mPattern = boost::regex("secondlife:///app/inventory/[\\da-f-]+/\\w+", + //*TODO: add supporting of inventory item names with whitespaces + //this pattern cann't parse for example + //secondlife:///app/inventory/0e346d8b-4433-4d66-a6b0-fd37083abc4c/select?name=name with spaces¶m2=value + mPattern = boost::regex("secondlife:///app/inventory/[\\da-f-]+/\\w+\\S*", boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_inventory.xml"; } std::string LLUrlEntryInventory::getLabel(const std::string &url, const LLUrlLabelCallback &cb) { - return unescapeUrl(url); - // TODO: Figure out if we can somehow access the inventory from here to get the actual item name - /* - std::string inventory_id_string = getIDStringFromUrl(url); - if (inventory_id_string.empty()) - { - // something went wrong, give raw url - return unescapeUrl(url); - } - LLUUID inventory_id(inventory_id_string); - LLInventoryItem* item = gInventory.getItem(inventory_id); - if(!item) - { - return unescapeUrl(url); - } - return item->getName(); */ + std::string label = getStringAfterToken(url, "name="); + return label.empty() ? url : label; } - /// /// LLUrlEntryParcel Describes a Second Life parcel Url, e.g., /// secondlife:///app/parcel/0000060e-4b39-e00b-d0c3-d98b1934e3a8/about diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index b2f084e5ac..f47db2db1a 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -53,9 +53,11 @@ LLUrlRegistry::LLUrlRegistry() registerUrl(new LLUrlEntryTeleport()); registerUrl(new LLUrlEntryWorldMap()); registerUrl(new LLUrlEntryPlace()); + registerUrl(new LLUrlEntryInventory()); + //LLUrlEntrySL and LLUrlEntrySLLabel have more common pattern, + //so it should be registered in the end of list registerUrl(new LLUrlEntrySL()); registerUrl(new LLUrlEntrySLLabel()); - registerUrl(new LLUrlEntryInventory()); } LLUrlRegistry::~LLUrlRegistry() |