diff options
Diffstat (limited to 'indra/newview/llpanelplaces.cpp')
-rw-r--r-- | indra/newview/llpanelplaces.cpp | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 257a21ca15..e21eb01da3 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -43,7 +43,7 @@ #include "llcombobox.h" #include "llfiltereditor.h" #include "llfloaterreg.h" -#include "llnotifications.h" +#include "llnotificationsutil.h" #include "lltabcontainer.h" #include "lltexteditor.h" #include "lltrans.h" @@ -118,7 +118,6 @@ static LLRegisterPanelClassWrapper<LLPanelPlaces> t_places("panel_places"); LLPanelPlaces::LLPanelPlaces() : LLPanel(), - mFilterSubString(LLStringUtil::null), mActivePanel(NULL), mFilterEditor(NULL), mPlaceProfile(NULL), @@ -262,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) { @@ -275,12 +278,20 @@ void LLPanelPlaces::onOpen(const LLSD& key) } else if (mPlaceInfoType == REMOTE_PLACE_INFO_TYPE) { - mPosGlobal = LLVector3d(key["x"].asReal(), - key["y"].asReal(), - key["z"].asReal()); + if (key.has("id")) + { + LLUUID parcel_id = key["id"].asUUID(); + mPlaceProfile->setParcelID(parcel_id); + } + else + { + mPosGlobal = LLVector3d(key["x"].asReal(), + key["y"].asReal(), + key["z"].asReal()); + mPlaceProfile->displayParcelInfo(LLUUID(), mPosGlobal); + } mPlaceProfile->setInfoType(LLPanelPlaceInfo::PLACE); - mPlaceProfile->displayParcelInfo(LLUUID(), mPosGlobal); } else if (mPlaceInfoType == TELEPORT_HISTORY_INFO_TYPE) { @@ -381,20 +392,24 @@ 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 || mFilterSubString != search_string) + if (!mActivePanel) + return; + + if (force_filter || mActivePanel->getFilterSubString() != 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 +419,7 @@ void LLPanelPlaces::onTabSelected() if (!mActivePanel) return; - onFilterEdit(mFilterSubString, true); + onFilterEdit(mActivePanel->getFilterSubString(), true); mActivePanel->updateVerbs(); } @@ -417,7 +432,7 @@ void LLPanelPlaces::onTeleportButtonClicked() { LLSD payload; payload["asset_id"] = mItem->getAssetUUID(); - LLNotifications::instance().add("TeleportFromLandmark", LLSD(), payload); + LLNotificationsUtil::add("TeleportFromLandmark", LLSD(), payload); } else if (mPlaceInfoType == AGENT_INFO_TYPE || mPlaceInfoType == REMOTE_PLACE_INFO_TYPE || @@ -815,7 +830,7 @@ void LLPanelPlaces::changedInventory(U32 mask) // Filter applied to show all items. if (mActivePanel) - mActivePanel->onSearchEdit(mFilterSubString); + mActivePanel->onSearchEdit(mActivePanel->getFilterSubString()); // we don't need to monitor inventory changes anymore, // so remove the observer @@ -847,6 +862,7 @@ void LLPanelPlaces::updateVerbs() mCancelBtn->setVisible(isLandmarkEditModeOn); mCloseBtn->setVisible(is_create_landmark_visible && !isLandmarkEditModeOn); + mShowOnMapBtn->setEnabled(!is_create_landmark_visible && !isLandmarkEditModeOn); mOverflowBtn->setEnabled(is_place_info_visible && !is_create_landmark_visible); if (is_place_info_visible) @@ -906,5 +922,5 @@ static void onSLURLBuilt(std::string& slurl) LLSD args; args["SLURL"] = slurl; - LLNotifications::instance().add("CopySLURL", args); + LLNotificationsUtil::add("CopySLURL", args); } |