Skip to content
Merged
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/llui/lltabcontainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2202,3 +2202,16 @@ void LLTabContainer::setTabVisibility( LLPanel const *aPanel, bool aVisible )

updateMaxScrollPos();
}

bool LLTabContainer::getTabVisibility(const LLPanel* panel) const
{
for (tuple_list_t::const_iterator itr = mTabList.begin(); itr != mTabList.end(); ++itr)
{
LLTabTuple const* pTT = *itr;
if (pTT->mTabPanel == panel)
{
return pTT->mVisible;
}
}
return false;
}
1 change: 1 addition & 0 deletions indra/llui/lltabcontainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ class LLTabContainer : public LLPanel
S32 getMaxTabWidth() const { return mMaxTabWidth; }

void setTabVisibility( LLPanel const *aPanel, bool );
bool getTabVisibility(const LLPanel* panel) const;

void startDragAndDropDelayTimer() { mDragAndDropDelayTimer.start(); }

Expand Down
33 changes: 33 additions & 0 deletions indra/newview/app_settings/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16431,6 +16431,39 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>InventoryShowRecentTab</key>
<map>
<key>Comment</key>
<string>Show/hide Recent tab in the Inventory floater</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>InventoryShowWornTab</key>
<map>
<key>Comment</key>
<string>Show/hide Worn tab in the Inventory floater</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>InventoryShowFavoritesTab</key>
<map>
<key>Comment</key>
<string>Show/hide Favorites tab in the Inventory floater</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>StatsReportMaxDuration</key>
<map>
<key>Comment</key>
Expand Down
54 changes: 47 additions & 7 deletions indra/newview/llpanelmaininventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,14 @@ bool LLPanelMainInventory::postBuild()
mWornItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mWornItemsPanel, _1, _2));
}

LLInventoryPanel* favorites_panel = getChild<LLInventoryPanel>(FAVORITES);
if (favorites_panel)
mFavoritesPanel = getChild<LLInventoryPanel>(FAVORITES);
if (mFavoritesPanel)
{
favorites_panel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER));
LLInventoryFilter& favorites_filter = favorites_panel->getFilter();
mFavoritesPanel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER));
LLInventoryFilter& favorites_filter = mFavoritesPanel->getFilter();
favorites_filter.setEmptyLookupMessage("InventoryNoMatchingFavorites");
favorites_filter.markDefault();
favorites_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, favorites_panel, _1, _2));
mFavoritesPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mFavoritesPanel, _1, _2));
}

mSearchTypeCombo = getChild<LLComboBox>("search_type");
Expand Down Expand Up @@ -319,6 +319,10 @@ bool LLPanelMainInventory::postBuild()
menu->getChild<LLMenuItemGL>("Upload Animation")->setLabelArg("[COST]", animation_upload_cost_str);
}

mFilterTabs->setTabVisibility(mRecentPanel, gSavedSettings.getBOOL("InventoryShowRecentTab"));
mFilterTabs->setTabVisibility(mWornItemsPanel, gSavedSettings.getBOOL("InventoryShowWornTab"));
mFilterTabs->setTabVisibility(mFavoritesPanel, gSavedSettings.getBOOL("InventoryShowFavoritesTab"));

// Trigger callback for focus received so we can deselect items in inbox/outbox
LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMainInventory::onFocusReceived, this));

Expand Down Expand Up @@ -1613,8 +1617,10 @@ void LLPanelMainInventory::initSingleFolderRoot(const LLUUID& start_folder_id)
void LLPanelMainInventory::initInventoryViews()
{
mAllItemsPanel->initializeViewBuilding();
mRecentPanel->initializeViewBuilding();
mWornItemsPanel->initializeViewBuilding();
if (gSavedSettings.getBOOL("InventoryShowRecentTab"))
mRecentPanel->initializeViewBuilding();
if (gSavedSettings.getBOOL("InventoryShowWornTab"))
mWornItemsPanel->initializeViewBuilding();
}

void LLPanelMainInventory::toggleViewMode()
Expand Down Expand Up @@ -2056,6 +2062,27 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata)
{
setViewMode(MODE_COMBINATION);
}

if (command_name == "toggle_recent_tab")
{
bool visibility = !gSavedSettings.getBOOL("InventoryShowRecentTab");
gSavedSettings.setBOOL("InventoryShowRecentTab", visibility);
mFilterTabs->setTabVisibility(mRecentPanel, visibility);
mRecentPanel->initializeViewBuilding();
}
if (command_name == "toggle_worn_tab")
{
bool visibility = !gSavedSettings.getBOOL("InventoryShowWornTab");
gSavedSettings.setBOOL("InventoryShowWornTab", visibility);
mFilterTabs->setTabVisibility(mWornItemsPanel, visibility);
mWornItemsPanel->initializeViewBuilding();
}
if (command_name == "toggle_favorites_tab")
{
bool visibility = !gSavedSettings.getBOOL("InventoryShowFavoritesTab");
gSavedSettings.setBOOL("InventoryShowFavoritesTab", visibility);
mFilterTabs->setTabVisibility(mFavoritesPanel, visibility);
}
}

void LLPanelMainInventory::onVisibilityChange( bool new_visibility )
Expand Down Expand Up @@ -2283,6 +2310,19 @@ bool LLPanelMainInventory::isActionChecked(const LLSD& userdata)
return isCombinationViewMode();
}

if (command_name == "recent_tab")
{
return mFilterTabs->getTabVisibility(mRecentPanel);
}
if (command_name == "worn_tab")
{
return mFilterTabs->getTabVisibility(mWornItemsPanel);
}
if (command_name == "favorites_tab")
{
return mFilterTabs->getTabVisibility(mFavoritesPanel);
}

return false;
}

Expand Down
1 change: 1 addition & 0 deletions indra/newview/llpanelmaininventory.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ class LLPanelMainInventory : public LLPanel, LLInventoryObserver
LLInventoryPanel* mAllItemsPanel = nullptr;
LLInventoryPanel* mRecentPanel = nullptr;
LLInventoryPanel* mWornItemsPanel = nullptr;
LLInventoryPanel* mFavoritesPanel = nullptr;
bool mResortActivePanel;
LLSaveFolderState* mSavedFolderState;
std::string mFilterText;
Expand Down
48 changes: 43 additions & 5 deletions indra/newview/skins/default/xui/en/menu_inventory_view_default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@
function="Inventory.GearDefault.Visible"
parameter="multi_folder_view" />
</menu_item_check>
<menu_item_separator>
<menu_item_separator.on_visible
function="Inventory.GearDefault.Visible"
parameter="single_folder_view" />
</menu_item_separator>
<menu_item_separator/>
<menu_item_check
label="List view"
layout="topleft"
Expand Down Expand Up @@ -100,4 +96,46 @@
function="Inventory.GearDefault.Visible"
parameter="single_folder_view" />
</menu_item_check>
<menu_item_check
label="Recent tab"
layout="topleft"
name="recent_tab">
<on_click
function="Inventory.GearDefault.Custom.Action"
parameter="toggle_recent_tab" />
<on_check
function="Inventory.GearDefault.Check"
parameter="recent_tab" />
<on_visible
function="Inventory.GearDefault.Visible"
parameter="multi_folder_view" />
</menu_item_check>
<menu_item_check
label="Worn tab"
layout="topleft"
name="worn_tab">
<on_click
function="Inventory.GearDefault.Custom.Action"
parameter="toggle_worn_tab" />
<on_check
function="Inventory.GearDefault.Check"
parameter="worn_tab" />
<on_visible
function="Inventory.GearDefault.Visible"
parameter="multi_folder_view" />
</menu_item_check>
<menu_item_check
label="Favorites tab"
layout="topleft"
name="favorites_tab">
<on_click
function="Inventory.GearDefault.Custom.Action"
parameter="toggle_favorites_tab" />
<on_check
function="Inventory.GearDefault.Check"
parameter="favorites_tab" />
<on_visible
function="Inventory.GearDefault.Visible"
parameter="multi_folder_view" />
</menu_item_check>
</toggleable_menu>