From 1e84d0e6494df1f5ccb3f69e53849bf26b01e385 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 11 May 2022 20:38:13 +0300 Subject: SL-15312 Profiles tweaks Fix loading indicators to be at the center of picls and classified Hide classifieds and picks related buttons for other agents 10px distance from image Fix chat history menu button not working Changed 'partner' field behavior Prevent selection of disabled FL text field --- indra/newview/llagentpicksinfo.h | 4 +- indra/newview/llpanelavatar.cpp | 6 + indra/newview/llpanelprofile.cpp | 54 +++--- indra/newview/llpanelprofile.h | 2 +- indra/newview/llpanelprofileclassifieds.cpp | 6 +- indra/newview/llpanelprofilepicks.cpp | 5 +- .../default/xui/en/panel_profile_classifieds.xml | 182 +++++++++++++------- .../skins/default/xui/en/panel_profile_picks.xml | 190 ++++++++++++++------- .../default/xui/en/panel_profile_secondlife.xml | 79 ++++++--- indra/newview/skins/default/xui/en/strings.xml | 4 +- 10 files changed, 356 insertions(+), 176 deletions(-) diff --git a/indra/newview/llagentpicksinfo.h b/indra/newview/llagentpicksinfo.h index f981e08ff7..21df036cb7 100644 --- a/indra/newview/llagentpicksinfo.h +++ b/indra/newview/llagentpicksinfo.h @@ -74,10 +74,10 @@ public: void decrementNumberOfPicks() { --mNumberOfPicks; } -private: - void onServerRespond(LLAvatarPicks* picks); +private: + /** * Sets number of Picks. */ diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 5d5d4b676c..9a030f1d7d 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -119,6 +119,12 @@ void LLPanelProfileTab::setApplyProgress(bool started) indicator->stop(); } } + + LLPanel* panel = findChild("indicator_stack"); + if (panel) + { + panel->setVisible(started); + } } LLPanelProfilePropertiesProcessorTab::LLPanelProfilePropertiesProcessorTab() diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 031c1db7e2..542ecf8b42 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -217,6 +217,8 @@ void request_avatar_properties_coro(std::string cap_url, LLUUID agent_id) LLPanelProfilePicks *panel_picks = dynamic_cast(panel); if (panel_picks) { + // Refresh pick limit before processing + LLAgentPicksInfo::getInstance()->onServerRespond(&avatar_picks); panel_picks->processProperties(&avatar_picks); } @@ -820,7 +822,7 @@ BOOL LLPanelProfileSecondLife::postBuild() mGroupList = getChild("group_list"); mShowInSearchCombo = getChild("show_in_search"); mSecondLifePic = getChild("2nd_life_pic"); - mSecondLifePicLayout = getChild("image_stack"); + mSecondLifePicLayout = getChild("image_panel"); mDescriptionEdit = getChild("sl_description_edit"); mNotesSnippet = getChild("notes_snippet"); mAgentActionMenuButton = getChild("agent_actions_menu"); @@ -989,6 +991,11 @@ void LLPanelProfileSecondLife::onAvatarNameCache(const LLUUID& agent_id, const L getChild("user_name")->setValue(av_name.getAccountName()); } +void LLPanelProfileSecondLife::setNotesSnippet(std::string ¬es) +{ + mNotesSnippet->setValue(notes); +} + void LLPanelProfileSecondLife::setProfileImageUploading(bool loading) { LLLoadingIndicator* indicator = getChild("image_upload_indicator"); @@ -1077,6 +1084,7 @@ void LLPanelProfileSecondLife::fillPartnerData(const LLAvatarData* avatar_data) LLTextBox* partner_text_ctrl = getChild("partner_link"); if (avatar_data->partner_id.notNull()) { + childSetVisible("partner_layout", TRUE); LLStringUtil::format_map_t args; args["[LINK]"] = LLSLURL("agent", avatar_data->partner_id, "inspect").getSLURLString(); std::string partner_text = getString("partner_text", args); @@ -1084,7 +1092,7 @@ void LLPanelProfileSecondLife::fillPartnerData(const LLAvatarData* avatar_data) } else { - partner_text_ctrl->setText(getString("no_partner_text")); + childSetVisible("partner_layout", FALSE); } } @@ -1333,7 +1341,7 @@ void LLPanelProfileSecondLife::onCommitMenu(const LLSD& userdata) { LLAvatarActions::startCall(agent_id); } - else if (item_name == "callog") + else if (item_name == "chat_history") { LLAvatarActions::viewChatHistory(agent_id); } @@ -1443,7 +1451,7 @@ bool LLPanelProfileSecondLife::onEnableMenu(const LLSD& userdata) { return mVoiceStatus; } - else if (item_name == "callog") + else if (item_name == "chat_history") { return LLLogChat::isTranscriptExist(agent_id); } @@ -1780,6 +1788,12 @@ void LLPanelProfileFirstLife::onOpen(const LLSD& key) { LLPanelProfileTab::onOpen(key); + if (!getSelfProfile()) + { + // Otherwise as the only focusable element it will be selected + mDescriptionEdit->setTabStop(FALSE); + } + resetData(); } @@ -1953,24 +1967,6 @@ void LLPanelProfileNotes::onOpen(const LLSD& key) resetData(); } -void LLPanelProfileNotes::onCommitNotes() -{ - std::string cap_url = gAgent.getRegionCapability(PROFILE_PROPERTIES_CAP); - if (getIsLoaded()) - { - if (!cap_url.empty()) - { - std::string notes = mNotesEditor->getValue().asString(); - LLCoros::instance().launch("putAgentUserInfoCoro", - boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with("notes", notes))); - } - else - { - LL_WARNS() << "Failed to update notes, no cap found" << LL_ENDL; - } - } -} - void LLPanelProfileNotes::setNotesText(const std::string &text) { mSaveChanges->setEnabled(FALSE); @@ -1993,6 +1989,20 @@ void LLPanelProfileNotes::onSaveNotesChanges() { LLCoros::instance().launch("putAgentUserInfoCoro", boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with("notes", mCurrentNotes))); + + + LLFloater* floater_profile = LLFloaterReg::findInstance("profile", LLSD().with("id", getAvatarId())); + if (!floater_profile) + { + return; + } + + LLPanel* panel = floater_profile->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 fa98e6fd1b..8b2893905d 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -99,6 +99,7 @@ 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); @@ -314,7 +315,6 @@ public: /*virtual*/ void updateData(); protected: - void onCommitNotes(); void setNotesText(const std::string &text); void onSetNotesDirty(); void onSaveNotesChanges(); diff --git a/indra/newview/llpanelprofileclassifieds.cpp b/indra/newview/llpanelprofileclassifieds.cpp index 56f9a387a1..7f7bba3b91 100644 --- a/indra/newview/llpanelprofileclassifieds.cpp +++ b/indra/newview/llpanelprofileclassifieds.cpp @@ -207,7 +207,8 @@ void LLPanelProfileClassifieds::onOpen(const LLSD& key) resetData(); - if (getSelfProfile()) + bool own_profile = getSelfProfile(); + if (own_profile) { mNewButton->setVisible(TRUE); mNewButton->setEnabled(FALSE); @@ -215,6 +216,9 @@ void LLPanelProfileClassifieds::onOpen(const LLSD& key) mDeleteButton->setVisible(TRUE); mDeleteButton->setEnabled(FALSE); } + + childSetVisible("buttons_header", own_profile); + } void LLPanelProfileClassifieds::selectClassified(const LLUUID& classified_id, bool edit) diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp index c452fb5abd..08c4690eaa 100644 --- a/indra/newview/llpanelprofilepicks.cpp +++ b/indra/newview/llpanelprofilepicks.cpp @@ -135,7 +135,8 @@ void LLPanelProfilePicks::onOpen(const LLSD& key) resetData(); - if (getSelfProfile()) + bool own_profile = getSelfProfile(); + if (own_profile) { mNewButton->setVisible(TRUE); mNewButton->setEnabled(FALSE); @@ -143,6 +144,8 @@ void LLPanelProfilePicks::onOpen(const LLSD& key) mDeleteButton->setVisible(TRUE); mDeleteButton->setEnabled(FALSE); } + + childSetVisible("buttons_header", own_profile); } void LLPanelProfilePicks::selectPick(const LLUUID& pick_id) diff --git a/indra/newview/skins/default/xui/en/panel_profile_classifieds.xml b/indra/newview/skins/default/xui/en/panel_profile_classifieds.xml index ff27113d53..3dfa0a58df 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_classifieds.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_classifieds.xml @@ -13,66 +13,130 @@ name="no_classifieds" value="No Classifieds" /> - -