diff options
| author | Loren Shih <seraph@lindenlab.com> | 2009-12-11 15:57:41 -0500 |
|---|---|---|
| committer | Loren Shih <seraph@lindenlab.com> | 2009-12-11 15:57:41 -0500 |
| commit | d2b72fe0184fb92f4a79eebd242825fbcc5f32e9 (patch) | |
| tree | 1d8bb75f6db751ae2e347737b2df3fb3f26f37e8 /indra/newview/llpanellandmarks.cpp | |
| parent | 3cb997a50475f4de54090f3e3a4490aac9e6d218 (diff) | |
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
Diffstat (limited to 'indra/newview/llpanellandmarks.cpp')
| -rw-r--r-- | indra/newview/llpanellandmarks.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
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); |
