From e9fcaa09e0817a34056fc049c6d8317bec7ec74d Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 8 Dec 2009 15:06:39 -0500 Subject: For EXT-3166 : MyInventory/Library Places accordions are causing massive inventory background fetch on startup Took out line to start background fetch at start of filter; the background fetch will start when the filter is started. This prevents the viewer from requesting a complete inventory fetch at login. --HG-- branch : avatar-pipeline --- indra/newview/llpanellandmarks.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llpanellandmarks.cpp') diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index e87b70f6a5..ebde902e81 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -1003,8 +1003,6 @@ static void filter_list(LLInventorySubTreePanel* inventory_list, const std::stri inventory_list->restoreFolderState(); } - gInventory.startBackgroundFetch(); - if (inventory_list->getFilterSubString().empty() && string.empty()) { // current filter and new filter empty, do nothing -- cgit v1.2.3 From 947260880713f0bd65b03f796f782b167127e294 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 8 Dec 2009 18:19:39 -0500 Subject: EXT-3256 : Show help message in Favorites bar if empty --HG-- branch : avatar-pipeline --- indra/newview/llpanellandmarks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanellandmarks.cpp') diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index ebde902e81..975219458f 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -327,7 +327,7 @@ void LLLandmarksPanel::initFavoritesInventoryPanel() mFavoritesInventoryPanel = getChild("favorites_list"); initLandmarksPanel(mFavoritesInventoryPanel); - + mFavoritesInventoryPanel->getFilter()->setEmptyLookupMessage("FavoritesNoMatchingItems"); initAccordion("tab_favorites", mFavoritesInventoryPanel); } -- cgit v1.2.3 From b1b9ef14f5bf323b2d4caaa4b88d9727f6197567 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 9 Dec 2009 09:56:34 +0200 Subject: Fixed critical bug EXT-3094 (Content of accordions disappears after collapsing all folders in My "Landmarks" tab and switching to "Teleport history" tab and back) Reason: Folder state of loaded folders was not saved before switching to Teleport history and back Due to inventory loading was changed to fetch items in background it is impossible to save folder state while initializing of an Inventory panel. Inventory observer was implemented to save folder states for Inventory Panels in all accordions. Reviwed by Seth ProductEngine --HG-- branch : product-engine --- indra/newview/llpanellandmarks.cpp | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'indra/newview/llpanellandmarks.cpp') diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index e87b70f6a5..faa0aa95b9 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -66,6 +66,30 @@ static const std::string TRASH_BUTTON_NAME = "trash_btn"; // helper functions static void filter_list(LLInventorySubTreePanel* inventory_list, const std::string& string); +static void save_folder_state_if_no_filter(LLInventorySubTreePanel* inventory_list); + +/** + * Bridge to support knowing when the inventory has changed to update folder (open/close) state + * for landmarks panels. + * + * Due to Inventory data are loaded in background we need to save folder state each time + * next level is loaded. See EXT-3094. + */ +class LLLandmarksPanelObserver : public LLInventoryObserver +{ +public: + LLLandmarksPanelObserver(LLLandmarksPanel* lp) : mLP(lp) {} + virtual ~LLLandmarksPanelObserver() {} + /*virtual*/ void changed(U32 mask); + +private: + LLLandmarksPanel* mLP; +}; + +void LLLandmarksPanelObserver::changed(U32 mask) +{ + mLP->saveFolderStateIfNoFilter(); +} LLLandmarksPanel::LLLandmarksPanel() : LLPanelPlacesTab() @@ -78,11 +102,18 @@ LLLandmarksPanel::LLLandmarksPanel() , mGearFolderMenu(NULL) , mGearLandmarkMenu(NULL) { + mInventoryObserver = new LLLandmarksPanelObserver(this); + gInventory.addObserver(mInventoryObserver); + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_landmarks.xml"); } LLLandmarksPanel::~LLLandmarksPanel() { + if (gInventory.containsObserver(mInventoryObserver)) + { + gInventory.removeObserver(mInventoryObserver); + } } BOOL LLLandmarksPanel::postBuild() @@ -226,6 +257,14 @@ void LLLandmarksPanel::onSelectorButtonClicked() } } +void LLLandmarksPanel::saveFolderStateIfNoFilter() +{ + save_folder_state_if_no_filter(mFavoritesInventoryPanel); + save_folder_state_if_no_filter(mLandmarksInventoryPanel); + save_folder_state_if_no_filter(mMyInventoryPanel); + save_folder_state_if_no_filter(mLibraryInventoryPanel); +} + ////////////////////////////////////////////////////////////////////////// // PROTECTED METHODS ////////////////////////////////////////////////////////////////////////// @@ -1020,4 +1059,13 @@ static void filter_list(LLInventorySubTreePanel* inventory_list, const std::stri // set new filter string inventory_list->setFilterSubString(string); } + +static void save_folder_state_if_no_filter(LLInventorySubTreePanel* inventory_list) +{ + // save current folder open state if no filter currently applied + if (inventory_list->getRootFolder() && inventory_list->getRootFolder()->getFilterSubString().empty()) + { + inventory_list->saveFolderState(); + } +} // EOF -- cgit v1.2.3 From 96d5f52624d68768592893ee0b27a0589b0f6222 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 9 Dec 2009 14:47:52 -0500 Subject: EXT-3274 : Landmarks or Favorites accordion panel shows up as empty EXT-1609 : Strange behavior for accordions in Places panel, Landmarks tab Forcing top-level folders open when accordion is active. Removed logic that was saving and restoring initial folder state. --HG-- branch : avatar-pipeline --- indra/newview/llpanellandmarks.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'indra/newview/llpanellandmarks.cpp') diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 975219458f..c85fab2092 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -389,10 +389,6 @@ void LLLandmarksPanel::initLandmarksPanel(LLInventorySubTreePanel* inventory_lis } root_folder->setParentLandmarksPanel(this); - - // save initial folder state to avoid incorrect work while switching between Landmarks & Teleport History tabs - // See EXT-1609. - inventory_list->saveFolderState(); } void LLLandmarksPanel::initAccordion(const std::string& accordion_tab_name, LLInventorySubTreePanel* inventory_list) @@ -995,12 +991,13 @@ void LLLandmarksPanel::doCreatePick(LLLandmark* landmark) ////////////////////////////////////////////////////////////////////////// static void filter_list(LLInventorySubTreePanel* inventory_list, const std::string& string) { + // Open the immediate children of the root folder, since those + // are invisible in the UI and thus must always be open. + inventory_list->getRootFolder()->openTopLevelFolders(); + if (string == "") { inventory_list->setFilterSubString(LLStringUtil::null); - - // re-open folders that were initially open - inventory_list->restoreFolderState(); } if (inventory_list->getFilterSubString().empty() && string.empty()) @@ -1009,13 +1006,8 @@ static void filter_list(LLInventorySubTreePanel* inventory_list, const std::stri return; } - // save current folder open state if no filter currently applied - if (inventory_list->getRootFolder()->getFilterSubString().empty()) - { - inventory_list->saveFolderState(); - } - - // set new filter string + // Set new filter string inventory_list->setFilterSubString(string); + } // EOF -- cgit v1.2.3 From 96b8f71fa985d0e760d023fdd745dcd91a7dce6a Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Wed, 9 Dec 2009 21:58:13 +0200 Subject: Re-fixed normal bug EXT-2346 \"My Landmarks accordion panels shouldn't be displayed if there are no landmarks in respective folders\" --HG-- branch : product-engine --- indra/newview/llpanellandmarks.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview/llpanellandmarks.cpp') diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index faa0aa95b9..65056b00d6 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -786,7 +786,7 @@ void LLLandmarksPanel::updateFilteredAccordions() { LLInventoryPanel* inventory_list = NULL; LLAccordionCtrlTab* accordion_tab = NULL; -// bool needs_arrange = false; + bool needs_arrange = false; for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) { @@ -798,7 +798,7 @@ void LLLandmarksPanel::updateFilteredAccordions() if (NULL == inventory_list) continue; // This doesn't seem to work correctly. Disabling for now. -Seraph - /* + // Enabled to show/hide accordions with/without landmarks. See EXT-2346. (Seth PE) LLFolderView* fv = inventory_list->getRootFolder(); // arrange folder view contents to draw its descendants if it has any @@ -809,17 +809,17 @@ void LLLandmarksPanel::updateFilteredAccordions() needs_arrange = true; accordion_tab->setVisible(has_descendants); - */ - accordion_tab->setVisible(TRUE); + + //accordion_tab->setVisible(TRUE); } // we have to arrange accordion tabs for cases when filter string is less restrictive but // all items are still filtered. -// if (needs_arrange) -// { + if (needs_arrange) + { static LLAccordionCtrl* accordion = getChild("landmarks_accordion"); accordion->arrange(); -// } + } } /* -- cgit v1.2.3 From d2b72fe0184fb92f4a79eebd242825fbcc5f32e9 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 11 Dec 2009 15:57:41 -0500 Subject: EXT-3373 : Favorites folder disappears after canceling filter Doing a more robust check to see if folders need to be refreshed. --HG-- branch : avatar-pipeline --- indra/newview/llpanellandmarks.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpanellandmarks.cpp') diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index c85fab2092..4b5ff1732d 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -328,6 +328,7 @@ void LLLandmarksPanel::initFavoritesInventoryPanel() initLandmarksPanel(mFavoritesInventoryPanel); mFavoritesInventoryPanel->getFilter()->setEmptyLookupMessage("FavoritesNoMatchingItems"); + initAccordion("tab_favorites", mFavoritesInventoryPanel); } @@ -389,6 +390,7 @@ void LLLandmarksPanel::initLandmarksPanel(LLInventorySubTreePanel* inventory_lis } root_folder->setParentLandmarksPanel(this); + inventory_list->saveFolderState(); } void LLLandmarksPanel::initAccordion(const std::string& accordion_tab_name, LLInventorySubTreePanel* inventory_list) @@ -991,21 +993,30 @@ void LLLandmarksPanel::doCreatePick(LLLandmark* landmark) ////////////////////////////////////////////////////////////////////////// static void filter_list(LLInventorySubTreePanel* inventory_list, const std::string& string) { - // Open the immediate children of the root folder, since those - // are invisible in the UI and thus must always be open. - inventory_list->getRootFolder()->openTopLevelFolders(); - + // When search is cleared, restore the old folder state. if (string == "") { inventory_list->setFilterSubString(LLStringUtil::null); + // Re-open folders that were open before + inventory_list->restoreFolderState(); } + // Open the immediate children of the root folder, since those + // are invisible in the UI and thus must always be open. + inventory_list->getRootFolder()->openTopLevelFolders(); + if (inventory_list->getFilterSubString().empty() && string.empty()) { // current filter and new filter empty, do nothing return; } + // save current folder open state if no filter currently applied + if (inventory_list->getRootFolder()->getFilterSubString().empty()) + { + inventory_list->saveFolderState(); + } + // Set new filter string inventory_list->setFilterSubString(string); -- cgit v1.2.3