summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelprofilepicks.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-06-03 21:24:09 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-06-04 22:27:04 +0300
commit4f92a3222efac36b2355550ed55ca0a2fcb9591d (patch)
tree965a4cc6218236c22a3407c69282702487087d07 /indra/newview/llpanelprofilepicks.cpp
parent3f5164446653f89ef559a883612401fea886b138 (diff)
SL-15312 Updated picks's layout
- better emphasis onto saving - better resize logic - ability to discard changes
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");