From 4f92a3222efac36b2355550ed55ca0a2fcb9591d Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 3 Jun 2022 21:24:09 +0300 Subject: SL-15312 Updated picks's layout - better emphasis onto saving - better resize logic - ability to discard changes --- indra/newview/llpanelprofile.cpp | 6 +- indra/newview/llpanelprofilepicks.cpp | 18 +- indra/newview/llpanelprofilepicks.h | 9 +- indra/newview/skins/default/xui/en/panel_picks.xml | 227 -------------- .../default/xui/en/panel_profile_classified.xml | 6 +- .../default/xui/en/panel_profile_classifieds.xml | 2 +- .../skins/default/xui/en/panel_profile_pick.xml | 340 +++++++++++++++------ 7 files changed, 278 insertions(+), 330 deletions(-) delete mode 100644 indra/newview/skins/default/xui/en/panel_picks.xml diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index cb10dd75fb..17c557e4f9 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -1246,11 +1246,11 @@ void LLPanelProfileSecondLife::fillNameAgeData(const LLAvatarName &av_name, cons args_name["[NAME]"] = av_name.getAccountName(); LLStringUtil::format(name_and_date, args_name); getChild("user_name_date")->setValue(name_and_date); - + std::string register_date = getString("age_format"); - LLSD args_age; + LLSD args_age; args_age["[AGE]"] = LLDateUtil::ageFromDate(born_on, LLDate::now()); - LLStringUtil::format(register_date, args_age); + LLStringUtil::format(register_date, args_age); getChild("user_age")->setValue(register_date); } 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("pick_name"); mPickDescription = getChild("pick_desc"); mSaveButton = getChild("save_changes_btn"); + mCreateButton = getChild("create_changes_btn"); + mCancelButton = getChild("cancel_changes_btn"); mSetCurrentLocationButton = getChild("set_to_curr_location_btn"); mSnapshotCtrl = getChild("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"); diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h index d5df7b7f12..fc975604d9 100644 --- a/indra/newview/llpanelprofilepicks.h +++ b/indra/newview/llpanelprofilepicks.h @@ -207,10 +207,15 @@ protected: void onClickSetLocation(); /** - * Callback for "Save" button click + * Callback for "Save" and "Create" button click */ void onClickSave(); + /** + * Callback for "Save" button click + */ + void onClickCancel(); + std::string getLocationNotice(); /** @@ -225,6 +230,8 @@ protected: LLTextEditor* mPickDescription; LLButton* mSetCurrentLocationButton; LLButton* mSaveButton; + LLButton* mCreateButton; + LLButton* mCancelButton; LLVector3d mPosGlobal; LLUUID mParcelId; diff --git a/indra/newview/skins/default/xui/en/panel_picks.xml b/indra/newview/skins/default/xui/en/panel_picks.xml deleted file mode 100644 index 8def96cada..0000000000 --- a/indra/newview/skins/default/xui/en/panel_picks.xml +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - - - - - - - - - - - - -