From 8163eeb43bdfa806c306ba5caf2457c59efed2d4 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 6 Apr 2022 22:16:39 +0300 Subject: SL-15312 Legacy profiles remake #1 Initial layout --- indra/newview/llfloaterprofile.cpp | 3 - indra/newview/llpanelavatar.cpp | 2 +- indra/newview/llpanelprofile.cpp | 150 +--- indra/newview/llpanelprofile.h | 31 - .../skins/default/xui/en/floater_profile.xml | 27 +- .../skins/default/xui/en/panel_edit_profile.xml | 472 ------------ .../default/xui/en/panel_profile_secondlife.xml | 827 ++++++++------------- 7 files changed, 338 insertions(+), 1174 deletions(-) delete mode 100644 indra/newview/skins/default/xui/en/panel_edit_profile.xml (limited to 'indra') diff --git a/indra/newview/llfloaterprofile.cpp b/indra/newview/llfloaterprofile.cpp index f2863e1e27..0a775f217a 100644 --- a/indra/newview/llfloaterprofile.cpp +++ b/indra/newview/llfloaterprofile.cpp @@ -62,9 +62,6 @@ BOOL LLFloaterProfile::postBuild() { mPanelProfile = findChild(PANEL_PROFILE_VIEW); - childSetAction("ok_btn", boost::bind(&LLFloaterProfile::onOKBtn, this)); - childSetAction("cancel_btn", boost::bind(&LLFloaterProfile::onCancelBtn, this)); - return TRUE; } diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index dbda6070fa..e25eba11d2 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -120,7 +120,7 @@ void LLPanelProfileTab::setApplyProgress(bool started) if (indicator) { - indicator->setVisible(started); + indicator->setVisible(true); if (started) { diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index c19688191b..5453c87013 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -562,7 +562,6 @@ LLAgentHandler gAgentHandler; LLPanelProfileSecondLife::LLPanelProfileSecondLife() : LLPanelProfileTab() - , mStatusText(NULL) , mAvatarNameCacheConnection() { } @@ -589,42 +588,13 @@ LLPanelProfileSecondLife::~LLPanelProfileSecondLife() BOOL LLPanelProfileSecondLife::postBuild() { - mStatusText = getChild("status"); mGroupList = getChild("group_list"); mShowInSearchCheckbox = getChild("show_in_search_checkbox"); mSecondLifePic = getChild("2nd_life_pic"); mSecondLifePicLayout = getChild("image_stack"); mDescriptionEdit = getChild("sl_description_edit"); - mTeleportButton = getChild("teleport"); - mShowOnMapButton = getChild("show_on_map_btn"); - mBlockButton = getChild("block"); - mUnblockButton = getChild("unblock"); - mNameLabel = getChild("name_label"); - mDisplayNameButton = getChild("set_name"); - mAddFriendButton = getChild("add_friend"); - mGroupInviteButton = getChild("group_invite"); - mPayButton = getChild("pay"); - mIMButton = getChild("im"); - mCopyMenuButton = getChild("copy_btn"); mGiveInvPanel = getChild("give_stack"); - mStatusText->setVisible(FALSE); - mCopyMenuButton->setVisible(FALSE); - - mAddFriendButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onAddFriendButtonClick, this)); - mIMButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onIMButtonClick, this)); - mTeleportButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onTeleportButtonClick, this)); - mShowOnMapButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onMapButtonClick, this)); - mPayButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::pay, this)); - mBlockButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onClickToggleBlock, this)); - mUnblockButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onClickToggleBlock, this)); - mGroupInviteButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onGroupInvite,this)); - mDisplayNameButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onClickSetName, this)); - mSecondLifePic->setMouseUpCallback(boost::bind(&LLPanelProfileSecondLife::onPickTexture, this)); - - LLUICtrl::CommitCallbackRegistry::ScopedRegistrar commit; - commit.add("Profile.CopyName", [this](LLUICtrl*, const LLSD& userdata) { onCommitMenu(userdata); }); - LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable; enable.add("Profile.EnableCall", [this](LLUICtrl*, const LLSD&) { return mVoiceStatus; }); enable.add("Profile.EnableGod", [](LLUICtrl*, const LLSD&) { return gAgent.isGodlike(); }); @@ -632,8 +602,7 @@ BOOL LLPanelProfileSecondLife::postBuild() mGroupList->setDoubleClickCallback(boost::bind(&LLPanelProfileSecondLife::openGroupProfile, this)); mGroupList->setReturnCallback(boost::bind(&LLPanelProfileSecondLife::openGroupProfile, this)); - LLVoiceClient::getInstance()->addObserver((LLVoiceClientStatusObserver*)this); - mCopyMenuButton->setMenu("menu_name_field.xml", LLMenuButton::MP_BOTTOM_RIGHT); + //mAgentActionMenuButton->setMenu("menu_name_field.xml", LLMenuButton::MP_BOTTOM_RIGHT); return TRUE; } @@ -649,16 +618,11 @@ void LLPanelProfileSecondLife::onOpen(const LLSD& key) BOOL own_profile = getSelfProfile(); - mGroupInviteButton->setVisible(!own_profile); - mShowOnMapButton->setVisible(!own_profile); - mPayButton->setVisible(!own_profile); - mTeleportButton->setVisible(!own_profile); - mIMButton->setVisible(!own_profile); - mAddFriendButton->setVisible(!own_profile); - mBlockButton->setVisible(!own_profile); - mUnblockButton->setVisible(!own_profile); mGroupList->setShowNone(!own_profile); - mGiveInvPanel->setVisible(!own_profile); + //mGiveInvPanel->setVisible(!own_profile); + + childSetVisible("notes_panel", !own_profile); + childSetVisible("settings_panel", own_profile); if (own_profile && !getEmbedded()) { @@ -667,11 +631,8 @@ void LLPanelProfileSecondLife::onOpen(const LLSD& key) mGroupList->enableForAgent(false); } - if (own_profile && !getEmbedded() ) + if (own_profile) { - mNameLabel->setVisible(FALSE); - mDisplayNameButton->setVisible(TRUE); - mDisplayNameButton->setEnabled(TRUE); } mDescriptionEdit->setParseHTML(!own_profile && !getEmbedded()); @@ -794,11 +755,10 @@ void LLPanelProfileSecondLife::resetData() mSecondLifePicLayout->reshape(imageRect.getHeight(), imageRect.getHeight()); mDescriptionEdit->setValue(LLStringUtil::null); - mStatusText->setVisible(FALSE); - mCopyMenuButton->setVisible(FALSE); mGroups.clear(); mGroupList->setGroups(mGroups); clearUploadProfileImagePath(); + //mAgentActionMenuButton set menu } void LLPanelProfileSecondLife::processProfileProperties(const LLAvatarData* avatar_data) @@ -858,8 +818,7 @@ void LLPanelProfileSecondLife::onAvatarNameCache(const LLUUID& agent_id, const L { mAvatarNameCacheConnection.disconnect(); - getChild("complete_name")->setValue( av_name.getCompleteName() ); - mCopyMenuButton->setVisible(TRUE); + //getChild("complete_name")->setValue( av_name.getCompleteName() ); } void LLPanelProfileSecondLife::setUploadProfileImagePath(const std::string &path, const std::string &orig_path) @@ -900,14 +859,8 @@ void LLPanelProfileSecondLife::fillCommonData(const LLAvatarData* avatar_data) LLAvatarIconIDCache::getInstance()->add(avatar_data->avatar_id, avatar_data->image_id); LLStringUtil::format_map_t args; - { - std::string birth_date = LLTrans::getString("AvatarBirthDateFormat"); - LLStringUtil::format(birth_date, LLSD().with("datetime", (S32) avatar_data->born_on.secondsSinceEpoch())); - args["[REG_DATE]"] = birth_date; - } - args["[AGE]"] = LLDateUtil::ageFromDate( avatar_data->born_on, LLDate::now()); - std::string register_date = getString("RegisterDateFormat", args); + std::string register_date = getString("AgeFormat", args); getChild("register_date")->setValue(register_date ); mDescriptionEdit->setValue(avatar_data->about_text); mImageAssetId = avatar_data->image_id; @@ -956,53 +909,7 @@ void LLPanelProfileSecondLife::fillAccountStatus(const LLAvatarData* avatar_data args["[PAYMENTINFO]"] = LLAvatarPropertiesProcessor::paymentInfo(avatar_data); std::string caption_text = getString("CaptionTextAcctInfo", args); - getChild("acc_status_text")->setValue(caption_text); -} - -void LLPanelProfileSecondLife::onMapButtonClick() -{ - LLAvatarActions::showOnMap(getAvatarId()); -} - -void LLPanelProfileSecondLife::pay() -{ - LLAvatarActions::pay(getAvatarId()); -} - -void LLPanelProfileSecondLife::onClickToggleBlock() -{ - bool blocked = LLAvatarActions::toggleBlock(getAvatarId()); - - updateButtons(); - // we are hiding one button and showing another, set focus - if (blocked) - { - mUnblockButton->setFocus(true); - } - else - { - mBlockButton->setFocus(true); - } -} - -void LLPanelProfileSecondLife::onAddFriendButtonClick() -{ - LLAvatarActions::requestFriendshipDialog(getAvatarId()); -} - -void LLPanelProfileSecondLife::onIMButtonClick() -{ - LLAvatarActions::startIM(getAvatarId()); -} - -void LLPanelProfileSecondLife::onTeleportButtonClick() -{ - LLAvatarActions::offerTeleport(getAvatarId()); -} - -void LLPanelProfileSecondLife::onGroupInvite() -{ - LLAvatarActions::inviteToGroup(getAvatarId()); + getChild("account_info")->setValue(caption_text); } void LLPanelProfileSecondLife::onImageLoaded(BOOL success, LLViewerFetchedTexture *imagep) @@ -1112,14 +1019,6 @@ void LLPanelProfileSecondLife::updateOnlineStatus() void LLPanelProfileSecondLife::processOnlineStatus(bool online) { - mStatusText->setVisible(isGrantedToSeeOnlineStatus()); - - std::string status = getString(online ? "status_online" : "status_offline"); - - mStatusText->setValue(status); - mStatusText->setColor(online ? - LLUIColorTable::instance().getColor("StatusUserOnline") : - LLUIColorTable::instance().getColor("StatusUserOffline")); } void LLPanelProfileSecondLife::updateButtons() @@ -1132,33 +1031,6 @@ void LLPanelProfileSecondLife::updateButtons() mShowInSearchCheckbox->setEnabled(TRUE); mDescriptionEdit->setEnabled(TRUE); } - - if (!getSelfProfile()) - { - LLUUID av_id = getAvatarId(); - bool is_buddy_online = LLAvatarTracker::instance().isBuddyOnline(getAvatarId()); - - if (LLAvatarActions::isFriend(av_id)) - { - mTeleportButton->setEnabled(is_buddy_online); - //Disable "Add Friend" button for friends. - mAddFriendButton->setEnabled(false); - } - else - { - mTeleportButton->setEnabled(true); - mAddFriendButton->setEnabled(true); - } - - bool enable_map_btn = (is_buddy_online && is_agent_mappable(av_id)) || gAgent.isGodlike(); - mShowOnMapButton->setEnabled(enable_map_btn); - - bool enable_block_btn = LLAvatarActions::canBlock(av_id) && !LLAvatarActions::isBlocked(av_id); - mBlockButton->setVisible(enable_block_btn); - - bool enable_unblock_btn = LLAvatarActions::isBlocked(av_id); - mUnblockButton->setVisible(enable_unblock_btn); - } } void LLPanelProfileSecondLife::onClickSetName() @@ -1857,8 +1729,6 @@ void LLPanelProfile::onTabChange() void LLPanelProfile::updateBtnsVisibility() { - getChild("ok_btn")->setVisible(((getSelfProfile() && !getEmbedded()) || isNotesTabSelected())); - getChild("cancel_btn")->setVisible(((getSelfProfile() && !getEmbedded()) || isNotesTabSelected())); } void LLPanelProfile::onOpen(const LLSD& key) diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index 9aab8a087c..c73973b812 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -134,25 +134,6 @@ protected: */ virtual void fillAccountStatus(const LLAvatarData* avatar_data); - void onMapButtonClick(); - - /** - * Opens "Pay Resident" dialog. - */ - void pay(); - - /** - * Add/remove resident to/from your block list. - * Updates button focus - */ - void onClickToggleBlock(); - - void onAddFriendButtonClick(); - void onIMButtonClick(); - void onTeleportButtonClick(); - - void onGroupInvite(); - void onImageLoaded(BOOL success, LLViewerFetchedTexture *imagep); static void onImageLoaded(BOOL success, LLViewerFetchedTexture *src_vi, @@ -191,23 +172,11 @@ private: group_map_t mGroups; void openGroupProfile(); - LLTextBox* mStatusText; LLGroupList* mGroupList; LLCheckBoxCtrl* mShowInSearchCheckbox; LLIconCtrl* mSecondLifePic; LLPanel* mSecondLifePicLayout; LLTextBase* mDescriptionEdit; - LLButton* mTeleportButton; - LLButton* mShowOnMapButton; - LLButton* mBlockButton; - LLButton* mUnblockButton; - LLUICtrl* mNameLabel; - LLButton* mDisplayNameButton; - LLButton* mAddFriendButton; - LLButton* mGroupInviteButton; - LLButton* mPayButton; - LLButton* mIMButton; - LLMenuButton* mCopyMenuButton; LLPanel* mGiveInvPanel; bool mVoiceStatus; diff --git a/indra/newview/skins/default/xui/en/floater_profile.xml b/indra/newview/skins/default/xui/en/floater_profile.xml index dede8bc0a6..92207cdc36 100644 --- a/indra/newview/skins/default/xui/en/floater_profile.xml +++ b/indra/newview/skins/default/xui/en/floater_profile.xml @@ -36,7 +36,7 @@ > -