From 56504054d8e0cba815c25035ed7dd71015cf3222 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Tue, 1 Dec 2009 20:25:01 +0200 Subject: Fixed normal bug EXT-2346 "My Landmarks accordion panels shouldn't be displayed if there are no landmarks in respective folders". - Added updating accordions contents in idle routine. - Removed inventory observer. --HG-- branch : product-engine --- indra/newview/llpanelplaces.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'indra/newview/llpanelplaces.cpp') diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 839b2ec45e..cd4bcb6c0a 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -118,7 +118,6 @@ static LLRegisterPanelClassWrapper t_places("panel_places"); LLPanelPlaces::LLPanelPlaces() : LLPanel(), - mFilterSubString(LLStringUtil::null), mActivePanel(NULL), mFilterEditor(NULL), mPlaceProfile(NULL), @@ -385,16 +384,16 @@ void LLPanelPlaces::onLandmarkLoaded(LLLandmark* landmark) void LLPanelPlaces::onFilterEdit(const std::string& search_string, bool force_filter) { - if (force_filter || mFilterSubString != search_string) + if (force_filter || LLPanelPlacesTab::sFilterSubString != search_string) { - mFilterSubString = search_string; + std::string string = search_string; // Searches are case-insensitive - LLStringUtil::toUpper(mFilterSubString); - LLStringUtil::trimHead(mFilterSubString); + LLStringUtil::toUpper(string); + LLStringUtil::trimHead(string); if (mActivePanel) - mActivePanel->onSearchEdit(mFilterSubString); + mActivePanel->onSearchEdit(string); } } @@ -404,7 +403,7 @@ void LLPanelPlaces::onTabSelected() if (!mActivePanel) return; - onFilterEdit(mFilterSubString, true); + onFilterEdit(LLPanelPlacesTab::sFilterSubString, true); mActivePanel->updateVerbs(); } @@ -815,7 +814,7 @@ void LLPanelPlaces::changedInventory(U32 mask) // Filter applied to show all items. if (mActivePanel) - mActivePanel->onSearchEdit(mFilterSubString); + mActivePanel->onSearchEdit(LLPanelPlacesTab::sFilterSubString); // we don't need to monitor inventory changes anymore, // so remove the observer -- cgit v1.2.3 From fe284981abacbd4fa18db7b87fc76289057d3851 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Thu, 3 Dec 2009 16:16:21 +0200 Subject: Fixed normal bug EXT-3004 "Created landmark isn't saved in "Favorite" folder and isn't shown in "Fav" bar". - Added enabling "Save" landmark button only after landmark is loaded. Minor cleanup of fix for EXT-2346 "My Landmarks accordion panels shouldn't be displayed if there are no landmarks in respective folders". --HG-- branch : product-engine --- indra/newview/llpanelplaces.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'indra/newview/llpanelplaces.cpp') diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index cd4bcb6c0a..f7f3c5830d 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -261,6 +261,10 @@ void LLPanelPlaces::onOpen(const LLSD& key) } mLandmarkInfo->displayParcelInfo(LLUUID(), mPosGlobal); + + // Disable Save button because there is no item to save yet. + // The button will be enabled in onLandmarkLoaded callback. + mSaveBtn->setEnabled(FALSE); } else if (mPlaceInfoType == LANDMARK_INFO_TYPE) { @@ -380,11 +384,16 @@ void LLPanelPlaces::onLandmarkLoaded(LLLandmark* landmark) landmark->getRegionID(region_id); landmark->getGlobalPos(mPosGlobal); mLandmarkInfo->displayParcelInfo(region_id, mPosGlobal); + + mSaveBtn->setEnabled(TRUE); } void LLPanelPlaces::onFilterEdit(const std::string& search_string, bool force_filter) { - if (force_filter || LLPanelPlacesTab::sFilterSubString != search_string) + if (!mActivePanel) + return; + + if (force_filter || mActivePanel->getFilterSubString() != search_string) { std::string string = search_string; @@ -392,8 +401,7 @@ void LLPanelPlaces::onFilterEdit(const std::string& search_string, bool force_fi LLStringUtil::toUpper(string); LLStringUtil::trimHead(string); - if (mActivePanel) - mActivePanel->onSearchEdit(string); + mActivePanel->onSearchEdit(string); } } @@ -403,7 +411,7 @@ void LLPanelPlaces::onTabSelected() if (!mActivePanel) return; - onFilterEdit(LLPanelPlacesTab::sFilterSubString, true); + onFilterEdit(mActivePanel->getFilterSubString(), true); mActivePanel->updateVerbs(); } @@ -814,7 +822,7 @@ void LLPanelPlaces::changedInventory(U32 mask) // Filter applied to show all items. if (mActivePanel) - mActivePanel->onSearchEdit(LLPanelPlacesTab::sFilterSubString); + mActivePanel->onSearchEdit(mActivePanel->getFilterSubString()); // we don't need to monitor inventory changes anymore, // so remove the observer -- cgit v1.2.3