Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions indra/newview/app_settings/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23916,6 +23916,19 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>1</integer>
</map>
<!-- <FS:TP> [FIRE-34881] Show/hide the Library root folder -->
<key>FSShowLibraryFolder</key>
<map>
<key>Comment</key>
<string>Show/hide the Library root folder in the Inventory floater</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<!-- </FS:TP> [FIRE-34881] -->
<key>StatsReportMaxDuration</key>
<map>
<key>Comment</key>
Expand Down
48 changes: 47 additions & 1 deletion indra/newview/llinventorypanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1122,10 +1122,56 @@ void LLInventoryPanel::initRootContent()
// Default case: always add "My Inventory" root first, "Library" root second
// If we run out of time, this still should create root folders
buildNewViews(gInventory.getRootFolderID()); // My Inventory
buildNewViews(gInventory.getLibraryRootFolderID()); // Library
// <FS:TP> [FIRE-34881] Library root is now optional, toggled from the
// inventory gear menu, instead of being permanently disabled
// buildNewViews(gInventory.getLibraryRootFolderID()); // Library
if (gSavedSettings.getBOOL("FSShowLibraryFolder"))
{
buildNewViews(gInventory.getLibraryRootFolderID()); // Library
}
// </FS:TP>
}
}

// <FS:TP> [FIRE-34881] Build or tear down the Library root view live, without a restart.
// Only touches this panel's folder VIEW - the underlying gInventory data for
// Library stays loaded regardless, since other systems (default attachments,
// outfit lookups, etc.) depend on being able to resolve the Library folder ID.
void LLInventoryPanel::setLibraryFolderVisible(bool visible)
{
const LLUUID library_id = gInventory.getLibraryRootFolderID();
if (library_id.isNull())
{
return;
}

LLFolderViewItem* library_view = getItemByID(library_id);
if (visible)
{
if (!library_view)
{
buildNewViews(library_id);
// New folder views are added invisible with no rearrange request
// (LLFolderViewFolder::addFolder() has that call commented out,
// see addItem()/addFolder() in llfolderviewitem.cpp) - without
// this, the folder exists in the model but never actually draws.
mFolderRoot.get()->arrangeAll();
}
}
else
{
if (library_view)
{
// Same pattern used elsewhere in this file to tear down a folder's
// view: drop it from the item map, then destroy the UI element.
// destroyView() -> extractItem() already calls requestArrange()
// internally, so no extra rearrange call is needed on this side.
removeItemID(library_id);
library_view->destroyView();
}
}
}
// </FS:TP>

LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop)
{
Expand Down
4 changes: 4 additions & 0 deletions indra/newview/llinventorypanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ class LLInventoryPanel : public LLPanel
void initFolderRoot();
void initializeViewBuilding();

// <FS:TP> [FIRE-34881] Build or tear down the Library root view live, without a restart
void setLibraryFolderVisible(bool visible);
// </FS:TP>

protected:
void openStartFolderOrMyInventory(); // open the first level of inventory
void onItemsCompletion(); // called when selected items are complete
Expand Down
17 changes: 17 additions & 0 deletions indra/newview/llpanelmaininventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2711,6 +2711,17 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata)
gSavedSettings.setBOOL("InventoryShowFavoritesTab", visibility);
mFilterTabs->setTabVisibility(mFavoritesPanel, visibility);
}
// <FS:TP> [FIRE-34881] Show/hide the Library root folder live
if (command_name == "toggle_library")
{
bool visibility = !gSavedSettings.getBOOL("FSShowLibraryFolder");
gSavedSettings.setBOOL("FSShowLibraryFolder", visibility);
if (mAllItemsPanel)
{
mAllItemsPanel->setLibraryFolderVisible(visibility);
}
}
// </FS:TP>
}

void LLPanelMainInventory::onVisibilityChange( bool new_visibility )
Expand Down Expand Up @@ -2952,6 +2963,12 @@ bool LLPanelMainInventory::isActionChecked(const LLSD& userdata)
{
return mFilterTabs->getTabVisibility(mFavoritesPanel);
}
// <FS:TP> [FIRE-34881] Reflect current Library root visibility in the gear menu checkmark
if (command_name == "library")
{
return gSavedSettings.getBOOL("FSShowLibraryFolder");
}
// </FS:TP>

if (command_name == "add_objects_on_double_click")
{
Expand Down
16 changes: 16 additions & 0 deletions indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,22 @@
function="Inventory.GearDefault.Visible"
parameter="multi_folder_view" />
</menu_item_check>
<!-- <FS:TP> [FIRE-34881] Show/hide Library root -->
<menu_item_check
label="Show Library"
layout="topleft"
name="library">
<on_click
function="Inventory.GearDefault.Custom.Action"
parameter="toggle_library" />
<on_check
function="Inventory.GearDefault.Check"
parameter="library" />
<on_visible
function="Inventory.GearDefault.Visible"
parameter="multi_folder_view" />
</menu_item_check>
<!-- </FS:TP> -->
</context_menu>
<context_menu label="Sorting" name="sorting_menu" top="0">
<menu_item_check
Expand Down