File tree Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -399,6 +399,30 @@ bool LLFloaterMyEnvironment::canApply(const std::string &context)
399
399
return false ;
400
400
}
401
401
402
+ bool can_delete (const LLUUID& id)
403
+ {
404
+ const LLUUID trash_id = gInventory .findCategoryUUIDForType (LLFolderType::FT_TRASH);
405
+ if (id == trash_id || gInventory .isObjectDescendentOf (id, trash_id))
406
+ {
407
+ return false ;
408
+ }
409
+
410
+ LLViewerInventoryCategory* cat = gInventory .getCategory (id);
411
+ if (cat)
412
+ {
413
+ if (!get_is_category_removable (&gInventory , id))
414
+ {
415
+ return false ;
416
+ }
417
+ }
418
+ else if (!get_is_item_removable (&gInventory , id))
419
+ {
420
+ return false ;
421
+ }
422
+
423
+ return true ;
424
+ }
425
+
402
426
// -------------------------------------------------------------------------
403
427
void LLFloaterMyEnvironment::refreshButtonStates ()
404
428
{
@@ -409,7 +433,14 @@ void LLFloaterMyEnvironment::refreshButtonStates()
409
433
410
434
getChild<LLUICtrl>(BUTTON_GEAR)->setEnabled (settings_ok);
411
435
getChild<LLUICtrl>(BUTTON_NEWSETTINGS)->setEnabled (true );
412
- getChild<LLUICtrl>(BUTTON_DELETE)->setEnabled (settings_ok && !selected.empty ());
436
+
437
+ bool enable_delete = false ;
438
+ if (settings_ok && !selected.empty ())
439
+ {
440
+ enable_delete = can_delete (selected.front ());
441
+ }
442
+
443
+ getChild<LLUICtrl>(BUTTON_DELETE)->setEnabled (enable_delete);
413
444
}
414
445
415
446
// -------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments