diff options
Diffstat (limited to 'indra/newview/llpanelprofilepicks.cpp')
-rw-r--r-- | indra/newview/llpanelprofilepicks.cpp | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp index ff3f654d0e..8bbd4a748d 100644 --- a/indra/newview/llpanelprofilepicks.cpp +++ b/indra/newview/llpanelprofilepicks.cpp @@ -488,6 +488,8 @@ LLPanelProfilePick::LLPanelProfilePick() , mLocationChanged(false) , mNewPick(false) , mIsEditing(false) + , mRegionCallbackConnection() + , mParcelCallbackConnection() { } @@ -505,6 +507,15 @@ LLPanelProfilePick::~LLPanelProfilePick() { LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelId, this); } + + if (mRegionCallbackConnection.connected()) + { + mRegionCallbackConnection.disconnect(); + } + if (mParcelCallbackConnection.connected()) + { + mParcelCallbackConnection.disconnect(); + } } void LLPanelProfilePick::setAvatarId(const LLUUID& avatar_id) @@ -562,7 +573,6 @@ void LLPanelProfilePick::setAvatarId(const LLUUID& avatar_id) { mPickName->setEnabled(TRUE); mPickDescription->setEnabled(TRUE); - mSetCurrentLocationButton->setVisible(TRUE); } else { @@ -577,10 +587,11 @@ BOOL LLPanelProfilePick::postBuild() mSaveButton = getChild<LLButton>("save_changes_btn"); mCreateButton = getChild<LLButton>("create_changes_btn"); mCancelButton = getChild<LLButton>("cancel_changes_btn"); - mSetCurrentLocationButton = getChild<LLButton>("set_to_curr_location_btn"); mSnapshotCtrl = getChild<LLTextureCtrl>("pick_snapshot"); mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelProfilePick::onSnapshotChanged, this)); + mSnapshotCtrl->setAllowLocalTexture(FALSE); + mSnapshotCtrl->setBakeTextureEnabled(FALSE); childSetAction("teleport_btn", boost::bind(&LLPanelProfilePick::onClickTeleport, this)); childSetAction("show_on_map_btn", boost::bind(&LLPanelProfilePick::onClickMap, this)); @@ -588,7 +599,6 @@ BOOL LLPanelProfilePick::postBuild() mSaveButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickSave, this)); mCreateButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickSave, this)); mCancelButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickCancel, this)); - mSetCurrentLocationButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickSetLocation, this)); mPickName->setKeystrokeCallback(boost::bind(&LLPanelProfilePick::onPickChanged, this, _1), NULL); mPickName->setEnabled(FALSE); @@ -670,6 +680,7 @@ void LLPanelProfilePick::setSnapshotId(const LLUUID& id) void LLPanelProfilePick::setPickName(const std::string& name) { mPickName->setValue(name); + mPickNameStr = name; } const std::string LLPanelProfilePick::getPickName() @@ -750,34 +761,16 @@ BOOL LLPanelProfilePick::isDirty() const return FALSE; } -void LLPanelProfilePick::onClickSetLocation() +void LLPanelProfilePick::onClickSave() { - // Save location for later use. - setPosGlobal(gAgent.getPositionGlobal()); - - std::string parcel_name, region_name; - - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if (parcel) + if (mRegionCallbackConnection.connected()) { - mParcelId = parcel->getID(); - parcel_name = parcel->getName(); + mRegionCallbackConnection.disconnect(); } - - LLViewerRegion* region = gAgent.getRegion(); - if (region) + if (mParcelCallbackConnection.connected()) { - region_name = region->getName(); + mParcelCallbackConnection.disconnect(); } - - setPickLocation(createLocationText(getLocationNotice(), parcel_name, region_name, getPosGlobal())); - - mLocationChanged = true; - enableSaveButton(TRUE); -} - -void LLPanelProfilePick::onClickSave() -{ sendUpdate(); mLocationChanged = false; @@ -785,6 +778,7 @@ void LLPanelProfilePick::onClickSave() void LLPanelProfilePick::onClickCancel() { + updateTabLabel(mPickNameStr); LLAvatarPropertiesProcessor::getInstance()->sendPickInfoRequest(getAvatarId(), getPickId()); mLocationChanged = false; enableSaveButton(FALSE); |