diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2009-12-12 15:50:01 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2009-12-12 15:50:01 -0500 |
commit | b8ac919d6fdf434c4c93ed60e85e14a0711ca4f8 (patch) | |
tree | cb5926d357576b76f6f19f9c54470ece61f45d8f /indra/newview/llinventorybridge.cpp | |
parent | ae8c1d1ea87b524797b2986f853745c0a124246c (diff) | |
parent | 7ca1bfc78d91fea8b5c77fec7ac8cb7fa72aee9b (diff) |
merge
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4abe93322a..e361082f7b 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -535,6 +535,8 @@ bool isWornLink(LLUUID link_id) if (LLGestureManager::instance().isGestureActive(item->getUUID())) return true; break; + default: + break; } return false; } @@ -1469,13 +1471,14 @@ BOOL LLFolderBridge::isItemRemovable() { return FALSE; } + // Allow protected types to be removed, but issue a warning. - /* - if(LLFolderType::lookupIsProtectedType(category->getPreferredType())) + // Restrict to god mode so users don't inadvertently mess up their inventory. + if(LLFolderType::lookupIsProtectedType(category->getPreferredType()) && + !gAgent.isGodlike()) { return FALSE; } - */ LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get()); LLFolderViewFolder* folderp = dynamic_cast<LLFolderViewFolder*>(panel ? panel->getRootFolder()->getItemByID(mUUID) : NULL); @@ -3196,6 +3199,22 @@ void LLTextureBridge::openItem() } } +bool LLTextureBridge::canSaveTexture(void) +{ + const LLInventoryModel* model = getInventoryModel(); + if(!model) + { + return false; + } + + const LLViewerInventoryItem *item = model->getItem(mUUID); + if (item) + { + return item->checkPermissionsSet(PERM_ITEM_UNRESTRICTED); + } + return false; +} + void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { lldebugs << "LLTextureBridge::buildContextMenu()" << llendl; @@ -3220,6 +3239,10 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Texture Separator")); items.push_back(std::string("Save As")); + if (!canSaveTexture()) + { + disabled_items.push_back(std::string("Save As")); + } } hide_context_entries(menu, items, disabled_items); } |