diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-12-04 20:07:09 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-12-04 20:07:09 -0500 |
commit | add459cfd2245dd116392426f12ba04365b579de (patch) | |
tree | 5bc77dcdca65821a3984330a69f314264c4cb516 /indra/newview/llpanelmaininventory.cpp | |
parent | c9c9943098d35914f7b8591bf66ea1ae3985a94e (diff) |
EXT-3179 : Add ability to recover broken links
EXT-3168 : Add "Find Original" to InventoryPanel gear menu
Broken link recovery is still work in progress.
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 2a56a6011e..92b4c8383e 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -966,6 +966,27 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) preview_texture->openToSave(); } } + if (command_name == "regenerate_link") + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) + { + return; + } + const LLUUID& item_id = current_item->getListener()->getUUID(); + LLViewerInventoryItem *item = gInventory.getItem(item_id); + item->regenerateLink(); + } + if (command_name == "find_original") + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) + { + return; + } + current_item->getListener()->performAction(getActivePanel()->getRootFolder(), getActivePanel()->getModel(), "goto"); + } + if (command_name == "find_links") { LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); @@ -1017,18 +1038,45 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) } return FALSE; } + if (command_name == "find_original") + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) return FALSE; + const LLUUID& item_id = current_item->getListener()->getUUID(); + const LLViewerInventoryItem *item = gInventory.getItem(item_id); + if (item && item->getIsLinkType() && !item->getIsBrokenLink()) + { + return TRUE; + } + return FALSE; + } + if (command_name == "find_links") { LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) return FALSE; const LLUUID& item_id = current_item->getListener()->getUUID(); - LLInventoryObject *obj = gInventory.getObject(item_id); + const LLInventoryObject *obj = gInventory.getObject(item_id); if (obj && !obj->getIsLinkType() && LLAssetType::lookupCanLink(obj->getType())) { return TRUE; } return FALSE; } + + if (command_name == "regenerate_link") + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) return FALSE; + const LLUUID& item_id = current_item->getListener()->getUUID(); + const LLViewerInventoryItem *item = gInventory.getItem(item_id); + if (item && item->getIsBrokenLink()) + { + return TRUE; + } + return FALSE; + } + return TRUE; } |