diff options
author | Josh Bell <josh@lindenlab.com> | 2007-11-21 02:10:12 +0000 |
---|---|---|
committer | Josh Bell <josh@lindenlab.com> | 2007-11-21 02:10:12 +0000 |
commit | 78aec043f35b8b07dc0f2ba39baba737dd57555e (patch) | |
tree | 1645378aaa34b02ffb6b4f864a4a83828f19c8ab /indra/newview/llpanelplace.cpp | |
parent | 11d85dac83e9d58f8f6e441dcea2d1f2b661c58d (diff) |
svn merge -r 73148:74186 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-18-5-Viewer --> release
Diffstat (limited to 'indra/newview/llpanelplace.cpp')
-rw-r--r-- | indra/newview/llpanelplace.cpp | 50 |
1 files changed, 44 insertions, 6 deletions
diff --git a/indra/newview/llpanelplace.cpp b/indra/newview/llpanelplace.cpp index 459e726f87..8825ce71fc 100644 --- a/indra/newview/llpanelplace.cpp +++ b/indra/newview/llpanelplace.cpp @@ -89,6 +89,9 @@ BOOL LLPanelPlace::postBuild() mSnapshotCtrl->setEnabled(FALSE); mNameEditor = LLViewerUICtrlFactory::getTextBoxByName(this, "name_editor"); + // Text boxes appear to have a " " in them by default. This breaks the + // emptiness test for filling in data from the network. Slam to empty. + mNameEditor->setText( LLString::null ); mDescEditor = LLUICtrlFactory::getTextEditorByName(this, "desc_editor"); @@ -127,6 +130,26 @@ void LLPanelPlace::displayItemInfo(const LLInventoryItem* pItem) mDescEditor->setText(pItem->getDescription()); } +// Use this for search directory clicks, because we are totally +// recycling the panel and don't need to use what's there. +// +// For SLURL clicks, don't call this, because we need to cache +// the location info from the user. +void LLPanelPlace::resetLocation() +{ + mParcelID.setNull(); + mRequestedID.setNull(); + mRegionID.setNull(); + mLandmarkAssetID.setNull(); + mPosGlobal.clearVec(); + mPosRegion.clearVec(); + mAuctionID = 0; + mNameEditor->setText( LLString::null ); + mDescEditor->setText( LLString::null ); + mInfoEditor->setText( LLString::null ); + mLocationEditor->setText( LLString::null ); +} + void LLPanelPlace::setParcelID(const LLUUID& parcel_id) { mParcelID = parcel_id; @@ -138,10 +161,6 @@ void LLPanelPlace::setSnapshot(const LLUUID& snapshot_id) mSnapshotCtrl->setImageAssetID(snapshot_id); } -void LLPanelPlace::setName(const std::string& name) -{ - mNameEditor->setText(name); -} void LLPanelPlace::setLocationString(const std::string& location) { @@ -240,11 +259,17 @@ void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **) std::string name_str(name); std::string desc_str(desc); - if(! name_str.empty() && ! self->mNameEditor->getText().empty()) + if( !name_str.empty() + && self->mNameEditor->getText().empty()) + { self->mNameEditor->setText(name_str); + } - if(! desc_str.empty() && ! self->mDescEditor->getText().empty()) + if( !desc_str.empty() + && self->mDescEditor->getText().empty()) + { self->mDescEditor->setText(desc_str); + } LLString info_text; LLUIString traffic = self->getUIString("traffic_text"); @@ -280,6 +305,19 @@ void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **) S32 region_y = llround(self->mPosRegion.mV[1]); S32 region_z = llround(self->mPosRegion.mV[2]); + // If the region position is zero, grab position from the global + if(self->mPosRegion.isExactlyZero()) + { + region_x = llround(global_x) % REGION_WIDTH_UNITS; + region_y = llround(global_y) % REGION_WIDTH_UNITS; + region_z = llround(global_z); + } + + if(self->mPosGlobal.isExactlyZero()) + { + self->mPosGlobal.setVec(global_x, global_y, global_z); + } + LLString location = llformat("%s %d, %d, %d (%s)", sim_name, region_x, region_y, region_z, rating); self->mLocationEditor->setText(location); |