diff options
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index e9c9c451a2..1a1792fb60 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -62,15 +62,11 @@ const std::string FILTERS_FILENAME("filters.xml"); -static LLPanelInjector<LLPanelMainInventory> t_inventory("panel_main_inventory"); +const std::string ALL_ITEMS("All Items"); +const std::string RECENT_ITEMS("Recent Items"); +const std::string WORN_ITEMS("Worn Items"); -void on_file_loaded_for_save(BOOL success, - LLViewerFetchedTexture *src_vi, - LLImageRaw* src, - LLImageRaw* aux_src, - S32 discard_level, - BOOL final, - void* userdata); +static LLPanelInjector<LLPanelMainInventory> t_inventory("panel_main_inventory"); ///---------------------------------------------------------------------------- /// LLFloaterInventoryFinder @@ -149,7 +145,7 @@ BOOL LLPanelMainInventory::postBuild() //panel->getFilter().markDefault(); // Set up the default inv. panel/filter settings. - mActivePanel = getChild<LLInventoryPanel>("All Items"); + mActivePanel = getChild<LLInventoryPanel>(ALL_ITEMS); if (mActivePanel) { // "All Items" is the previous only view, so it gets the InventorySortOrder @@ -159,7 +155,7 @@ BOOL LLPanelMainInventory::postBuild() mActivePanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mActivePanel, _1, _2)); mResortActivePanel = true; } - LLInventoryPanel* recent_items_panel = getChild<LLInventoryPanel>("Recent Items"); + LLInventoryPanel* recent_items_panel = getChild<LLInventoryPanel>(RECENT_ITEMS); if (recent_items_panel) { // assign default values until we will be sure that we have setting to restore @@ -174,7 +170,7 @@ BOOL LLPanelMainInventory::postBuild() recent_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, recent_items_panel, _1, _2)); } - mWornItemsPanel = getChild<LLInventoryPanel>("Worn Items"); + mWornItemsPanel = getChild<LLInventoryPanel>(WORN_ITEMS); if (mWornItemsPanel) { U32 filter_types = 0x0; @@ -271,7 +267,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void ) // for example, LLParamSDParser doesn't know about U64, // so some FilterOps params should be revised. LLSD filterRoot; - LLInventoryPanel* all_items_panel = getChild<LLInventoryPanel>("All Items"); + LLInventoryPanel* all_items_panel = getChild<LLInventoryPanel>(ALL_ITEMS); if (all_items_panel) { LLSD filterState; @@ -285,7 +281,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void ) } } - LLInventoryPanel* panel = findChild<LLInventoryPanel>("Recent Items"); + LLInventoryPanel* panel = findChild<LLInventoryPanel>(RECENT_ITEMS); if (panel) { LLSD filterState; @@ -316,7 +312,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void ) LLInventoryPanel* LLPanelMainInventory::getAllItemsPanel() { - return getChild<LLInventoryPanel>("All Items"); + return getChild<LLInventoryPanel>(ALL_ITEMS); } void LLPanelMainInventory::selectAllItemsPanel() @@ -324,6 +320,11 @@ void LLPanelMainInventory::selectAllItemsPanel() mFilterTabs->selectFirstTab(); } +bool LLPanelMainInventory::isRecentItemsPanelSelected() +{ + return (RECENT_ITEMS == getActivePanel()->getName()); +} + void LLPanelMainInventory::startSearch() { // this forces focus to line editor portion of search editor @@ -439,7 +440,7 @@ void LLPanelMainInventory::setSortBy(const LLSD& userdata) } getActivePanel()->setSortOrder(sort_order_mask); - if ("Recent Items" == getActivePanel()->getName()) + if (isRecentItemsPanelSelected()) { gSavedSettings.setU32("RecentItemsSortOrder", sort_order_mask); } @@ -801,8 +802,8 @@ void LLPanelMainInventory::toggleFindOptions() void LLPanelMainInventory::setSelectCallback(const LLFolderView::signal_t::slot_type& cb) { - getChild<LLInventoryPanel>("All Items")->setSelectCallback(cb); - getChild<LLInventoryPanel>("Recent Items")->setSelectCallback(cb); + getChild<LLInventoryPanel>(ALL_ITEMS)->setSelectCallback(cb); + getChild<LLInventoryPanel>(RECENT_ITEMS)->setSelectCallback(cb); } void LLPanelMainInventory::onSelectionChange(LLInventoryPanel *panel, const std::deque<LLFolderViewItem*>& items, BOOL user_action) @@ -1200,11 +1201,11 @@ void LLPanelMainInventory::onAddButtonClick() { // Gray out the "New Folder" option when the Recent tab is active as new folders will not be displayed // unless "Always show folders" is checked in the filter options. - bool recent_active = ("Recent Items" == mActivePanel->getName()); + LLMenuGL* menu = (LLMenuGL*)mMenuAddHandle.get(); if (menu) { - menu->getChild<LLMenuItemGL>("New Folder")->setEnabled(!recent_active); + menu->getChild<LLMenuItemGL>("New Folder")->setEnabled(!isRecentItemsPanelSelected()); setUploadCostIfNeeded(); |