From c88e30736bc6e8e005bbe9d9edde34f31f5012ab Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 4 Jun 2022 23:33:18 +0300 Subject: SL-15312 Updated sl bio layout --- indra/newview/llpanelprofile.cpp | 84 +- indra/newview/llpanelprofile.h | 10 +- .../skins/default/xui/en/floater_profile.xml | 8 +- .../default/xui/en/panel_profile_secondlife.xml | 844 ++++++++++----------- 4 files changed, 414 insertions(+), 532 deletions(-) diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 17c557e4f9..8db9658837 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -260,10 +260,6 @@ void request_avatar_properties_coro(std::string cap_url, LLUUID agent_id) { panel_notes->processProperties(&avatar_notes); } - if (panel_sl) - { - panel_sl->processNotesProperties(&avatar_notes); - } } //TODO: changes take two minutes to propagate! @@ -863,7 +859,6 @@ BOOL LLPanelProfileSecondLife::postBuild() mSecondLifePic = getChild("2nd_life_pic"); mSecondLifePicLayout = getChild("image_panel"); mDescriptionEdit = getChild("sl_description_edit"); - mNotesSnippet = getChild("notes_snippet"); mAgentActionMenuButton = getChild("agent_actions_menu"); mSaveDescriptionChanges = getChild("save_description_changes"); mDiscardDescriptionChanges = getChild("discard_description_changes"); @@ -979,14 +974,16 @@ void LLPanelProfileSecondLife::resetData() mGroups.clear(); mGroupList->setGroups(mGroups); + bool own_profile = getSelfProfile(); mCanSeeOnlineIcon->setVisible(false); - mCantSeeOnlineIcon->setVisible(true); + mCantSeeOnlineIcon->setVisible(!own_profile); mCanSeeOnMapIcon->setVisible(false); - mCantSeeOnMapIcon->setVisible(true); + mCantSeeOnMapIcon->setVisible(!own_profile); mCanEditObjectsIcon->setVisible(false); - mCantEditObjectsIcon->setVisible(true); + mCantEditObjectsIcon->setVisible(!own_profile); - childSetVisible("permissions_panel", false); + childSetVisible("partner_layout", FALSE); + childSetVisible("partner_spacer_layout", TRUE); } void LLPanelProfileSecondLife::processProfileProperties(const LLAvatarData* avatar_data) @@ -1027,11 +1024,6 @@ void LLPanelProfileSecondLife::processGroupProperties(const LLAvatarGroups* avat mGroupList->setGroups(mGroups); } -void LLPanelProfileSecondLife::processNotesProperties(LLAvatarNotes* avatar_notes) -{ - mNotesSnippet->setValue(avatar_notes->notes); -} - void LLPanelProfileSecondLife::openGroupProfile() { LLUUID group_id = mGroupList->getSelectedUUID(); @@ -1041,15 +1033,8 @@ void LLPanelProfileSecondLife::openGroupProfile() void LLPanelProfileSecondLife::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { mAvatarNameCacheConnection.disconnect(); - if (getIsLoaded()) - { - fillNameAgeData(av_name, mBornOn); - } -} - -void LLPanelProfileSecondLife::setNotesSnippet(std::string ¬es) -{ - mNotesSnippet->setValue(notes); + getChild("display_name")->setValue(av_name.getDisplayName()); + getChild("user_name")->setValue(av_name.getAccountName()); } void LLPanelProfileSecondLife::setProfileImageUploading(bool loading) @@ -1128,20 +1113,7 @@ void LLPanelProfileSecondLife::fillCommonData(const LLAvatarData* avatar_data) // and to make sure icons in text will be up to date LLAvatarIconIDCache::getInstance()->add(avatar_data->avatar_id, avatar_data->image_id); - mBornOn = avatar_data->born_on; - - // Should be possible to get user and display names from AgentProfile capability - // but at the moment contraining this to limits of LLAvatarData - LLAvatarName av_name; - if (LLAvatarNameCache::get(avatar_data->avatar_id, &av_name)) - { - fillNameAgeData(av_name, mBornOn); - } - else if (!mAvatarNameCacheConnection.connected()) - { - // shouldn't happen, but just in case - mAvatarNameCacheConnection = LLAvatarNameCache::get(getAvatarId(), boost::bind(&LLPanelProfileSecondLife::onAvatarNameCache, this, _1, _2)); - } + fillAgeData(avatar_data->born_on); setDescriptionText(avatar_data->about_text); @@ -1184,6 +1156,7 @@ void LLPanelProfileSecondLife::fillPartnerData(const LLAvatarData* avatar_data) if (avatar_data->partner_id.notNull()) { childSetVisible("partner_layout", TRUE); + childSetVisible("partner_spacer_layout", FALSE); LLStringUtil::format_map_t args; args["[LINK]"] = LLSLURL("agent", avatar_data->partner_id, "inspect").getSLURLString(); std::string partner_text = getString("partner_text", args); @@ -1192,6 +1165,7 @@ void LLPanelProfileSecondLife::fillPartnerData(const LLAvatarData* avatar_data) else { childSetVisible("partner_layout", FALSE); + childSetVisible("partner_spacer_layout", TRUE); } } @@ -1207,6 +1181,11 @@ void LLPanelProfileSecondLife::fillAccountStatus(const LLAvatarData* avatar_data void LLPanelProfileSecondLife::fillRightsData() { + if (getSelfProfile()) + { + return; + } + const LLRelationship* relation = LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); // If true - we are viewing friend's profile, enable check boxes and set values. if (relation) @@ -1232,20 +1211,15 @@ void LLPanelProfileSecondLife::fillRightsData() mCanEditObjectsIcon->setVisible(false); mCantEditObjectsIcon->setVisible(true); } - - childSetVisible("permissions_panel", NULL != relation); } -void LLPanelProfileSecondLife::fillNameAgeData(const LLAvatarName &av_name, const LLDate &born_on) +void LLPanelProfileSecondLife::fillAgeData(const LLDate &born_on) { - getChild("display_name")->setValue(av_name.getDisplayName()); - - std::string name_and_date = getString("name_date_format"); + std::string name_and_date = getString("date_format"); LLSD args_name; args_name["datetime"] = (S32)born_on.secondsSinceEpoch(); - args_name["[NAME]"] = av_name.getAccountName(); LLStringUtil::format(name_and_date, args_name); - getChild("user_name_date")->setValue(name_and_date); + getChild("sl_birth_date")->setValue(name_and_date); std::string register_date = getString("age_format"); LLSD args_age; @@ -1259,12 +1233,12 @@ void LLPanelProfileSecondLife::onImageLoaded(BOOL success, LLViewerFetchedTextur LLRect imageRect = mSecondLifePicLayout->getRect(); if (!success || imagep->getFullWidth() == imagep->getFullHeight()) { - mSecondLifePicLayout->reshape(imageRect.getHeight(), imageRect.getHeight()); + mSecondLifePicLayout->reshape(imageRect.getWidth(), imageRect.getWidth()); } else { // assume 3:4, for sake of firestorm - mSecondLifePicLayout->reshape(imageRect.getHeight() * 4 / 3, imageRect.getHeight()); + mSecondLifePicLayout->reshape(imageRect.getWidth(), imageRect.getWidth() * 3 / 4); } } @@ -1348,7 +1322,6 @@ void LLPanelProfileSecondLife::updateOnlineStatus() } else { - childSetVisible("spacer_layout", true); childSetVisible("frind_layout", false); childSetVisible("online_layout", false); childSetVisible("offline_layout", false); @@ -1357,7 +1330,6 @@ void LLPanelProfileSecondLife::updateOnlineStatus() void LLPanelProfileSecondLife::processOnlineStatus(bool is_friend, bool show_online, bool online) { - childSetVisible("spacer_layout", false); childSetVisible("frind_layout", is_friend); childSetVisible("online_layout", online && show_online); childSetVisible("offline_layout", !online && show_online); @@ -2157,20 +2129,6 @@ void LLPanelProfileNotes::onSaveNotesChanges() { LLCoros::instance().launch("putAgentUserInfoCoro", boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with("notes", mCurrentNotes))); - - - LLFloater* parent_floater = gFloaterView->getParentFloater(this); - if (!parent_floater) - { - return; - } - - LLPanel* panel = parent_floater->findChild(PANEL_SECONDLIFE, TRUE); - LLPanelProfileSecondLife *panel_sl = dynamic_cast(panel); - if (panel_sl) - { - panel_sl->setNotesSnippet(mCurrentNotes); - } } else { diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index 5b30a6c536..19ce92a2d4 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -99,7 +99,6 @@ public: void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); - void setNotesSnippet(std::string ¬es); void setProfileImageUploading(bool loading); void setProfileImageUploaded(const LLUUID &image_asset_id); @@ -119,11 +118,6 @@ protected: */ void processGroupProperties(const LLAvatarGroups* avatar_groups); - /** - * Processes notes related data received from server. - */ - void processNotesProperties(LLAvatarNotes* avatar_notes); - /** * Fills common for Avatar profile and My Profile fields. */ @@ -147,7 +141,7 @@ protected: /** * Fills user name, display name, age. */ - void fillNameAgeData(const LLAvatarName &av_name, const LLDate &born_on); + void fillAgeData(const LLDate &born_on); void onImageLoaded(BOOL success, LLViewerFetchedTexture *imagep); static void onImageLoaded(BOOL success, @@ -198,7 +192,6 @@ private: LLIconCtrl* mSecondLifePic; LLPanel* mSecondLifePicLayout; LLTextEditor* mDescriptionEdit; - LLTextEditor* mNotesSnippet; LLMenuButton* mAgentActionMenuButton; LLButton* mSaveDescriptionChanges; LLButton* mDiscardDescriptionChanges; @@ -216,7 +209,6 @@ private: bool mWaitingForImageUpload; bool mAllowPublish; std::string mDescriptionText; - LLDate mBornOn; boost::signals2::connection mAvatarNameCacheConnection; }; diff --git a/indra/newview/skins/default/xui/en/floater_profile.xml b/indra/newview/skins/default/xui/en/floater_profile.xml index 1009fda4ea..61347c7348 100644 --- a/indra/newview/skins/default/xui/en/floater_profile.xml +++ b/indra/newview/skins/default/xui/en/floater_profile.xml @@ -2,13 +2,13 @@ @@ -27,7 +27,7 @@ top_pad="5" left="0" height="500" - width="445" + width="505" follows="all" layout="topleft" halign="center" diff --git a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml index 63136fd6a4..aa40f29e5d 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml @@ -10,8 +10,8 @@ layout="topleft" > + name="date_format" + value="SL birthdate: [mth,datetime,slt] [day,datetime,slt], [year,datetime,slt]" /> @@ -25,358 +25,401 @@ Account: [ACCTTYPE] - - + right="-1"/> - - - + + - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + - - - + - + - + - + - + - - + @@ -393,7 +436,7 @@ Account: [ACCTTYPE] always_show_icons="true" commit_on_focus_lost="false" enabled="false" - top="1" + top="0" left="1" right="-1" bottom="-1" @@ -444,146 +487,35 @@ Account: [ACCTTYPE] top_pad="9" width="492"/> + - - + - - - - - - - - - - -