diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-12-17 18:47:58 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-12-17 18:47:58 -0500 |
commit | 03c75c22f9ef1a9f99e6151e566e18bae35f6927 (patch) | |
tree | f0bf9cc5aa4b199ced1adc4029b3f8d40d5dbd57 | |
parent | 49cb11010e2d705560cc988317cf7f228310a7bd (diff) |
EXT-3329 : Able to delete system folder is confusing - disable from non-god mode
"Delete" no longer works for system folders.
Created a new "Delete System Folder" context menu entry that only works in RelWithDebug if only one item is selected.
--HG--
branch : avatar-pipeline
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 47 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_inventory.xml | 8 |
3 files changed, 49 insertions, 8 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index e2bab7eef2..d24a03a28a 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1439,10 +1439,7 @@ BOOL LLFolderBridge::isItemRemovable() return FALSE; } - // Allow protected types to be removed, but issue a warning. - // Restrict to god mode so users don't inadvertently mess up their inventory. - if(LLFolderType::lookupIsProtectedType(category->getPreferredType()) && - !gAgent.isGodlike()) + if(LLFolderType::lookupIsProtectedType(category->getPreferredType())) { return FALSE; } @@ -2141,6 +2138,12 @@ void LLFolderBridge::performAction(LLFolderView* folder, LLInventoryModel* model restoreItem(); return; } +#ifndef LL_RELEASE_FOR_DOWNLOAD + else if ("delete_system_folder" == action) + { + removeSystemFolder(); + } +#endif } void LLFolderBridge::openItem() @@ -2264,13 +2267,27 @@ BOOL LLFolderBridge::removeItem() LLNotification::Params params("ConfirmDeleteProtectedCategory"); params.payload(payload).substitutions(args).functor.function(boost::bind(&LLFolderBridge::removeItemResponse, this, _1, _2)); - if (LLFolderType::lookupIsProtectedType(cat->getPreferredType())) + LLNotifications::instance().forceResponse(params, 0); + return TRUE; +} + + +BOOL LLFolderBridge::removeSystemFolder() +{ + const LLViewerInventoryCategory *cat = getCategory(); + if (!LLFolderType::lookupIsProtectedType(cat->getPreferredType())) { - LLNotifications::instance().add(params); + return FALSE; } - else + + LLSD payload; + LLSD args; + args["FOLDERNAME"] = cat->getName(); + + LLNotification::Params params("ConfirmDeleteProtectedCategory"); + params.payload(payload).substitutions(args).functor.function(boost::bind(&LLFolderBridge::removeItemResponse, this, _1, _2)); { - LLNotifications::instance().forceResponse(params, 0); + LLNotifications::instance().add(params); } return TRUE; } @@ -2439,6 +2456,13 @@ void LLFolderBridge::folderOptionsMenu() } } +#ifndef LL_RELEASE_FOR_DOWNLOAD + if (LLFolderType::lookupIsProtectedType(type)) + { + mItems.push_back(std::string("Delete System Folder")); + } +#endif + // wearables related functionality for folders. //is_wearable LLFindWearables is_wearable; @@ -2642,6 +2666,13 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) mItems.push_back(std::string("--no options--")); mDisabledItems.push_back(std::string("--no options--")); } + + // Preemptively disable system folder removal if more than one item selected. + if ((flags & FIRST_SELECTED_ITEM) == 0) + { + mDisabledItems.push_back(std::string("Delete System Folder")); + } + hide_context_entries(menu, mItems, mDisabledItems); } diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 54eb27db39..4d83e9b684 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -292,7 +292,9 @@ public: static LLUIImagePtr getIcon(LLFolderType::EType preferred_type); virtual BOOL renameItem(const std::string& new_name); + virtual BOOL removeItem(); + BOOL removeSystemFolder(); bool removeItemResponse(const LLSD& notification, const LLSD& response); virtual void pasteFromClipboard(); diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 0f400777b8..d29dfa7034 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -471,6 +471,14 @@ function="Inventory.DoToSelected" parameter="delete" /> </menu_item_call> + <menu_item_call + label="Delete System Folder" + layout="topleft" + name="Delete System Folder"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="delete_system_folder" /> + </menu_item_call> <menu_item_separator layout="topleft" /> <menu_item_separator |