summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-12-17 18:47:58 -0500
committerLoren Shih <seraph@lindenlab.com>2009-12-17 18:47:58 -0500
commit03c75c22f9ef1a9f99e6151e566e18bae35f6927 (patch)
treef0bf9cc5aa4b199ced1adc4029b3f8d40d5dbd57 /indra/newview/llinventorybridge.cpp
parent49cb11010e2d705560cc988317cf7f228310a7bd (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
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp47
1 files changed, 39 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);
}