From 8a39aaa3a485d9f1d4486c02e98286cfb08761d4 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 18 Apr 2022 21:35:41 +0300 Subject: SL-15312 Legacy profiles remake #10 Fixed Typo changed 'show in search' checkbox into combobox, implemented commit Fixed fl textbox setting sl text instead of fl text Fixed fl save/discard buttons not following resize --- indra/newview/llpanelavatar.cpp | 6 ++-- indra/newview/llpanelavatar.h | 6 ++-- indra/newview/llpanelprofile.cpp | 35 +++++++++++++++----- indra/newview/llpanelprofile.h | 4 ++- indra/newview/llpanelprofileclassifieds.cpp | 4 +-- indra/newview/llpanelprofileclassifieds.h | 4 +-- indra/newview/llpanelprofilepicks.cpp | 4 +-- indra/newview/llpanelprofilepicks.h | 4 +-- .../default/xui/en/panel_profile_firstlife.xml | 6 ++-- .../default/xui/en/panel_profile_secondlife.xml | 37 +++++++++++++++------- 10 files changed, 73 insertions(+), 37 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 90f3e87ae9..5d5d4b676c 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -121,12 +121,12 @@ void LLPanelProfileTab::setApplyProgress(bool started) } } -LLPanelProfilePropertiesPeocessorTab::LLPanelProfilePropertiesPeocessorTab() +LLPanelProfilePropertiesProcessorTab::LLPanelProfilePropertiesProcessorTab() : LLPanelProfileTab() { } -LLPanelProfilePropertiesPeocessorTab::~LLPanelProfilePropertiesPeocessorTab() +LLPanelProfilePropertiesProcessorTab::~LLPanelProfilePropertiesProcessorTab() { if (getAvatarId().notNull()) { @@ -134,7 +134,7 @@ LLPanelProfilePropertiesPeocessorTab::~LLPanelProfilePropertiesPeocessorTab() } } -void LLPanelProfilePropertiesPeocessorTab::setAvatarId(const LLUUID & avatar_id) +void LLPanelProfilePropertiesProcessorTab::setAvatarId(const LLUUID & avatar_id) { if (avatar_id.notNull()) { diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index 1b47411fdb..249b895abb 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -146,13 +146,13 @@ private: bool mSelfProfile; }; -class LLPanelProfilePropertiesPeocessorTab +class LLPanelProfilePropertiesProcessorTab : public LLPanelProfileTab , public LLAvatarPropertiesObserver { public: - LLPanelProfilePropertiesPeocessorTab(); - ~LLPanelProfilePropertiesPeocessorTab(); + LLPanelProfilePropertiesProcessorTab(); + ~LLPanelProfilePropertiesProcessorTab(); /*virtual*/ void setAvatarId(const LLUUID& avatar_id); diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 7d3a98ba96..46b2d032e1 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -37,6 +37,7 @@ #include "llavatariconctrl.h" #include "llclipboard.h" #include "llcheckboxctrl.h" +#include "llcombobox.h" #include "lllineeditor.h" #include "llloadingindicator.h" #include "llmenubutton.h" @@ -116,6 +117,8 @@ void request_avatar_properties_coro(std::string cap_url, LLUUID agent_id) LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + LL_DEBUGS("AvatarProperties") << "Agent id: " << agent_id << " Result: " << httpResults << LL_ENDL; + if (!status || !result.has("id") || agent_id != result["id"].asUUID()) @@ -151,7 +154,6 @@ void request_avatar_properties_coro(std::string cap_url, LLUUID agent_id) avatar_data->fl_image_id = result["fl_image_id"].asUUID(); avatar_data->partner_id = result["partner_id"].asUUID(); avatar_data->about_text = result["sl_about_text"].asString(); - // Todo: new descriptio size is 65536, check if it actually fits or has scroll avatar_data->fl_about_text = result["fl_about_text"].asString(); avatar_data->born_on = result["member_since"].asDate(); avatar_data->profile_url = getProfileURL(agent_id.asString()); @@ -248,7 +250,6 @@ void request_avatar_properties_coro(std::string cap_url, LLUUID agent_id) avatar_notes.agent_id = agent_id; avatar_notes.target_id = agent_id; - // Todo: new notes size is 65536, check that field has a scroll avatar_notes.notes = result["notes"].asString(); panel = floater_profile->findChild(PANEL_NOTES, TRUE); @@ -284,9 +285,11 @@ void put_avatar_properties_coro(std::string cap_url, LLUUID agent_id, LLSD data) if (!status) { - LL_WARNS("AvatarProperties") << "Failed to put agent information for id " << agent_id << LL_ENDL; + LL_WARNS("AvatarProperties") << "Failed to put agent information " << data << " for id " << agent_id << LL_ENDL; return; } + + LL_DEBUGS("AvatarProperties") << "Agent id: " << agent_id << " Data: " << data << " Result: " << httpResults << LL_ENDL; } LLUUID post_profile_image(std::string cap_url, const LLSD &first_data, std::string path_to_image, LLHandle *handle) @@ -810,7 +813,7 @@ LLPanelProfileSecondLife::~LLPanelProfileSecondLife() BOOL LLPanelProfileSecondLife::postBuild() { mGroupList = getChild("group_list"); - mShowInSearchCheckbox = getChild("show_in_search_checkbox"); + mShowInSearchCombo = getChild("show_in_search"); mSecondLifePic = getChild("2nd_life_pic"); mSecondLifePicLayout = getChild("image_stack"); mDescriptionEdit = getChild("sl_description_edit"); @@ -821,6 +824,7 @@ BOOL LLPanelProfileSecondLife::postBuild() mSeeOnMapToggle = getChild("allow_to_see_on_map"); mEditObjectsToggle = getChild("allow_edit_my_objects"); + mShowInSearchCombo->setCommitCallback([this](LLUICtrl*, void*) { onShowInSearchCallback(); }, nullptr); mGroupList->setDoubleClickCallback([this](LLUICtrl*, S32 x, S32 y, MASK mask) { LLPanelProfileSecondLife::openGroupProfile(); }); mGroupList->setReturnCallback([this](LLUICtrl*, const LLSD&) { LLPanelProfileSecondLife::openGroupProfile(); }); mSaveDescriptionChanges->setCommitCallback([this](LLUICtrl*, void*) { onSaveDescriptionChanges(); }, nullptr); @@ -1052,7 +1056,7 @@ void LLPanelProfileSecondLife::fillCommonData(const LLAvatarData* avatar_data) if (getSelfProfile()) { - mShowInSearchCheckbox->setValue((BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH)); + mShowInSearchCombo->setValue((BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH)); } } @@ -1225,8 +1229,7 @@ void LLPanelProfileSecondLife::setLoaded() if (getSelfProfile()) { - mShowInSearchCheckbox->setVisible(TRUE); - mShowInSearchCheckbox->setEnabled(TRUE); + mShowInSearchCombo->setEnabled(TRUE); mDescriptionEdit->setEnabled(TRUE); } } @@ -1525,6 +1528,22 @@ void LLPanelProfileSecondLife::onSetDescriptionDirty() mDiscardDescriptionChanges->setEnabled(TRUE); } +void LLPanelProfileSecondLife::onShowInSearchCallback() +{ + std::string cap_url = gAgent.getRegionCapability(PROFILE_PROPERTIES_CAP); + if (!cap_url.empty()) + { + LLSD data; + data["allow_publish"] = mShowInSearchCombo->getValue().asBoolean(); + LLCoros::instance().launch("putAgentUserInfoCoro", + boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), data)); + } + else + { + LL_WARNS("AvatarProperties") << "Failed to update profile data, no cap found" << LL_ENDL; + } +} + void LLPanelProfileSecondLife::onSaveDescriptionChanges() { mDescriptionText = mDescriptionEdit->getValue().asString(); @@ -1814,7 +1833,7 @@ void LLPanelProfileFirstLife::onSaveDescriptionChanges() if (!cap_url.empty()) { LLCoros::instance().launch("putAgentUserInfoCoro", - boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with("sl_about_text", mCurrentDescription))); + boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with("fl_about_text", mCurrentDescription))); } else { diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index 05be48f1c2..b959ac1ec3 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -47,6 +47,7 @@ class LLAvatarName; class LLButton; class LLCheckBoxCtrl; +class LLComboBox; class LLIconCtrl; class LLTabContainer; class LLTextBox; @@ -166,6 +167,7 @@ private: void setDescriptionText(const std::string &text); void onSetDescriptionDirty(); + void onShowInSearchCallback(); void onSaveDescriptionChanges(); void onDiscardDescriptionChanges(); void onShowAgentPermissionsDialog(); @@ -176,7 +178,7 @@ private: void openGroupProfile(); LLGroupList* mGroupList; - LLCheckBoxCtrl* mShowInSearchCheckbox; + LLComboBox* mShowInSearchCombo; LLIconCtrl* mSecondLifePic; LLPanel* mSecondLifePicLayout; LLTextEditor* mDescriptionEdit; diff --git a/indra/newview/llpanelprofileclassifieds.cpp b/indra/newview/llpanelprofileclassifieds.cpp index 2769329dca..9cd7ca8160 100644 --- a/indra/newview/llpanelprofileclassifieds.cpp +++ b/indra/newview/llpanelprofileclassifieds.cpp @@ -191,7 +191,7 @@ LLClassifiedHandler gClassifiedHandler; //----------------------------------------------------------------------------- LLPanelProfileClassifieds::LLPanelProfileClassifieds() - : LLPanelProfilePropertiesPeocessorTab() + : LLPanelProfilePropertiesProcessorTab() , mClassifiedToSelectOnLoad(LLUUID::null) , mClassifiedEditOnLoad(false) { @@ -473,7 +473,7 @@ static const S32 CB_ITEM_MATURE = 0; static const S32 CB_ITEM_PG = 1; LLPanelProfileClassified::LLPanelProfileClassified() - : LLPanelProfilePropertiesPeocessorTab() + : LLPanelProfilePropertiesProcessorTab() , mInfoLoaded(false) , mTeleportClicksOld(0) , mMapClicksOld(0) diff --git a/indra/newview/llpanelprofileclassifieds.h b/indra/newview/llpanelprofileclassifieds.h index 89ce8dae1a..3c4dfc9bd0 100644 --- a/indra/newview/llpanelprofileclassifieds.h +++ b/indra/newview/llpanelprofileclassifieds.h @@ -68,7 +68,7 @@ public: * Panel for displaying Avatar's picks. */ class LLPanelProfileClassifieds - : public LLPanelProfilePropertiesPeocessorTab + : public LLPanelProfilePropertiesProcessorTab { public: LLPanelProfileClassifieds(); @@ -109,7 +109,7 @@ private: class LLPanelProfileClassified - : public LLPanelProfilePropertiesPeocessorTab + : public LLPanelProfilePropertiesProcessorTab { public: diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp index 264d3b78f1..b3109e7da2 100644 --- a/indra/newview/llpanelprofilepicks.cpp +++ b/indra/newview/llpanelprofilepicks.cpp @@ -120,7 +120,7 @@ LLPickHandler gPickHandler; //----------------------------------------------------------------------------- LLPanelProfilePicks::LLPanelProfilePicks() - : LLPanelProfilePropertiesPeocessorTab() + : LLPanelProfilePropertiesProcessorTab() , mPickToSelectOnLoad(LLUUID::null) { } @@ -370,7 +370,7 @@ bool LLPanelProfilePicks::canDeletePick() //----------------------------------------------------------------------------- LLPanelProfilePick::LLPanelProfilePick() - : LLPanelProfilePropertiesPeocessorTab() + : LLPanelProfilePropertiesProcessorTab() , LLRemoteParcelInfoObserver() , mSnapshotCtrl(NULL) , mPickId(LLUUID::null) diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h index 8be3e0285b..046f13292e 100644 --- a/indra/newview/llpanelprofilepicks.h +++ b/indra/newview/llpanelprofilepicks.h @@ -44,7 +44,7 @@ class LLTextEditor; * Panel for displaying Avatar's picks. */ class LLPanelProfilePicks - : public LLPanelProfilePropertiesPeocessorTab + : public LLPanelProfilePropertiesProcessorTab { public: LLPanelProfilePicks(); @@ -93,7 +93,7 @@ private: class LLPanelProfilePick - : public LLPanelProfilePropertiesPeocessorTab + : public LLPanelProfilePropertiesProcessorTab , public LLRemoteParcelInfoObserver { public: diff --git a/indra/newview/skins/default/xui/en/panel_profile_firstlife.xml b/indra/newview/skins/default/xui/en/panel_profile_firstlife.xml index a957a2b454..90e0f1bc05 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_firstlife.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_firstlife.xml @@ -74,12 +74,12 @@