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