summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelprofilepicks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelprofilepicks.cpp')
-rw-r--r--indra/newview/llpanelprofilepicks.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp
index 69f6ac0407..4b2d32ac60 100644
--- a/indra/newview/llpanelprofilepicks.cpp
+++ b/indra/newview/llpanelprofilepicks.cpp
@@ -549,6 +549,8 @@ BOOL LLPanelProfilePick::postBuild()
mPickName = getChild<LLLineEditor>("pick_name");
mPickDescription = getChild<LLTextEditor>("pick_desc");
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");
@@ -558,6 +560,8 @@ BOOL LLPanelProfilePick::postBuild()
childSetAction("show_on_map_btn", boost::bind(&LLPanelProfilePick::onClickMap, this));
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);
@@ -676,8 +680,11 @@ void LLPanelProfilePick::onClickTeleport()
void LLPanelProfilePick::enableSaveButton(BOOL enable)
{
- mSaveButton->setEnabled(enable);
- mSaveButton->setVisible(enable);
+ childSetVisible("save_changes_lp", enable);
+
+ childSetVisible("save_btn_lp", enable && !mNewPick);
+ childSetVisible("create_btn_lp", enable && mNewPick);
+ childSetVisible("cancel_btn_lp", enable && !mNewPick);
}
void LLPanelProfilePick::onSnapshotChanged()
@@ -752,6 +759,13 @@ void LLPanelProfilePick::onClickSave()
mLocationChanged = false;
}
+void LLPanelProfilePick::onClickCancel()
+{
+ LLAvatarPropertiesProcessor::getInstance()->sendPickInfoRequest(getAvatarId(), getPickId());
+ mLocationChanged = false;
+ enableSaveButton(FALSE);
+}
+
std::string LLPanelProfilePick::getLocationNotice()
{
static const std::string notice = getString("location_notice");