From b82d70cf2aa2b56a2c0bfdd941ee4f74e690e4df Mon Sep 17 00:00:00 2001 From: Kadah_Coba Date: Mon, 4 Mar 2019 00:18:45 -0800 Subject: Added viewer based profiles Split picks and classifieds in to separate panels Moved getProfileURL to LLAvatarActions Removed dead XUI panels Removed picks/classifieds floater --- indra/newview/llfloaterprofile.cpp | 107 +++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 indra/newview/llfloaterprofile.cpp (limited to 'indra/newview/llfloaterprofile.cpp') diff --git a/indra/newview/llfloaterprofile.cpp b/indra/newview/llfloaterprofile.cpp new file mode 100644 index 0000000000..6b8f881b08 --- /dev/null +++ b/indra/newview/llfloaterprofile.cpp @@ -0,0 +1,107 @@ +/** + * @file llfloaterprofile.cpp + * @brief Avatar profile floater. + * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterprofile.h" + +#include "llpanelavatar.h" +#include "llpanelprofile.h" +#include "llagent.h" //gAgent + +static const std::string PANEL_PROFILE_VIEW = "panel_profile_view"; + +LLFloaterProfile::LLFloaterProfile(const LLSD& key) + : LLFloater(key), + mAvatarId(key["id"].asUUID()), + mNameCallbackConnection() +{ +} + +LLFloaterProfile::~LLFloaterProfile() +{ + if (mNameCallbackConnection.connected()) + { + mNameCallbackConnection.disconnect(); + } +} + +void LLFloaterProfile::onOpen(const LLSD& key) +{ + mPanelProfile->onOpen(key); + + if (mAvatarId == gAgentID) + { + getChild("ok_btn")->setVisible(TRUE); + getChild("cancel_btn")->setVisible(TRUE); + } + + // Update the avatar name. + mNameCallbackConnection = LLAvatarNameCache::get(mAvatarId, boost::bind(&LLFloaterProfile::onAvatarNameCache, this, _1, _2)); +} + +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; +} + +void LLFloaterProfile::showPick(const LLUUID& pick_id) +{ + mPanelProfile->showPick(pick_id); +} + +void LLFloaterProfile::showClassified(const LLUUID& classified_id, bool edit) +{ + mPanelProfile->showClassified(classified_id, edit); +} + +void LLFloaterProfile::onOKBtn() +{ + if (mAvatarId == gAgentID) + { + mPanelProfile->apply(); + } + + closeFloater(); +} + +void LLFloaterProfile::onCancelBtn() +{ + closeFloater(); +} + +void LLFloaterProfile::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) +{ + mNameCallbackConnection.disconnect(); + setTitle(av_name.getCompleteName()); +} + +// eof -- cgit v1.3 From 4e2f5cda29c39ef041f773a4b897f3cfb0332f77 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Thu, 21 Mar 2019 16:10:43 +0200 Subject: SL-10727 FIXED Profile windows are not using last set size --- indra/llui/llfloater.cpp | 17 ++++++++++++++--- indra/llui/llfloater.h | 1 + indra/newview/llfloaterprofile.cpp | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloaterprofile.cpp') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index a245dd8f78..d1e0b3e0b7 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -252,6 +252,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) mMinHeight(p.min_height), mHeaderHeight(p.header_height), mLegacyHeaderHeight(p.legacy_header_height), + mDefaultRectForGroup(true), mMinimized(FALSE), mForeground(FALSE), mFirstLook(TRUE), @@ -892,7 +893,10 @@ bool LLFloater::applyRectControl() if (last_in_group && last_in_group != this) { // other floaters in our group, position ourselves relative to them and don't save the rect - mRectControl.clear(); + if (mDefaultRectForGroup) + { + mRectControl.clear(); + } mPositioning = LLFloaterEnums::POSITIONING_CASCADE_GROUP; } else @@ -3399,8 +3403,15 @@ void LLFloater::stackWith(LLFloater& other) } next_rect.translate(floater_offset, -floater_offset); - next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, getRect().getWidth(), getRect().getHeight()); - + const LLRect& rect = getControlGroup()->getRect(mRectControl); + if (rect.notEmpty() && !mDefaultRectForGroup && mResizable) + { + next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, llmax(mMinWidth, rect.getWidth()), llmax(mMinHeight, rect.getHeight())); + } + else + { + next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, getRect().getWidth(), getRect().getHeight()); + } setShape(next_rect); if (!other.getHost()) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 165f67499b..475a790b14 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -436,6 +436,7 @@ public: protected: bool mSaveRect; + bool mDefaultRectForGroup; std::string mRectControl; std::string mPosXControl; std::string mPosYControl; diff --git a/indra/newview/llfloaterprofile.cpp b/indra/newview/llfloaterprofile.cpp index 6b8f881b08..1bf5826c29 100644 --- a/indra/newview/llfloaterprofile.cpp +++ b/indra/newview/llfloaterprofile.cpp @@ -39,6 +39,7 @@ LLFloaterProfile::LLFloaterProfile(const LLSD& key) mAvatarId(key["id"].asUUID()), mNameCallbackConnection() { + mDefaultRectForGroup = false; } LLFloaterProfile::~LLFloaterProfile() -- cgit v1.3 From e0b24ee960c7a7eebb9e7d6e4b5974973eb3da00 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 25 Mar 2019 15:38:26 +0200 Subject: SL-10798 FIXED [Legacy Profiles] 'Picks' toolbar button does nothing --- indra/newview/app_settings/commands.xml | 6 ++---- indra/newview/llavataractions.cpp | 14 ++++++++++++++ indra/newview/llavataractions.h | 1 + indra/newview/llfloaterprofile.cpp | 5 +++++ indra/newview/llfloaterprofile.h | 1 + indra/newview/llpanelprofile.cpp | 6 ++++++ indra/newview/llpanelprofile.h | 1 + indra/newview/llviewermenu.cpp | 30 ++++++++++++++++++++++++++++++ 8 files changed, 60 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfloaterprofile.cpp') diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 412d3a53b3..6bc7b47c6f 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -175,10 +175,8 @@ icon="Command_Picks_Icon" label_ref="Command_Picks_Label" tooltip_ref="Command_Picks_Tooltip" - execute_function="Floater.ToggleOrBringToFront" - execute_parameters="picks" - is_running_function="Floater.IsOpen" - is_running_parameters="picks" + execute_function="Avatar.TogglePicks" + is_running_function="Avatar.IsPicksTabOpen" /> ("profile", LLSD().with("id", avatar_id)); + if (profilefloater) + { + return profilefloater->isPickTabSelected(); + } + } + return false; +} + // static void LLAvatarActions::showClassifieds(const LLUUID& avatar_id) { diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 3383b3f5f9..6845d7675b 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -103,6 +103,7 @@ public: static void showClassified(const LLUUID& avatar_id, const LLUUID& classified_id, bool edit = false); static void hideProfile(const LLUUID& avatar_id); static bool profileVisible(const LLUUID& avatar_id); + static bool isPickTabSelected(const LLUUID& avatar_id); static LLFloater* getProfileFloater(const LLUUID& avatar_id); static void showProfileWeb(const LLUUID& avatar_id); diff --git a/indra/newview/llfloaterprofile.cpp b/indra/newview/llfloaterprofile.cpp index 1bf5826c29..216bcb0580 100644 --- a/indra/newview/llfloaterprofile.cpp +++ b/indra/newview/llfloaterprofile.cpp @@ -79,6 +79,11 @@ void LLFloaterProfile::showPick(const LLUUID& pick_id) mPanelProfile->showPick(pick_id); } +bool LLFloaterProfile::isPickTabSelected() +{ + return mPanelProfile->isPickTabSelected(); +} + void LLFloaterProfile::showClassified(const LLUUID& classified_id, bool edit) { mPanelProfile->showClassified(classified_id, edit); diff --git a/indra/newview/llfloaterprofile.h b/indra/newview/llfloaterprofile.h index fa06347cee..22ed47e54f 100644 --- a/indra/newview/llfloaterprofile.h +++ b/indra/newview/llfloaterprofile.h @@ -43,6 +43,7 @@ public: /*virtual*/ BOOL postBuild(); void showPick(const LLUUID& pick_id = LLUUID::null); + bool isPickTabSelected(); void showClassified(const LLUUID& classified_id = LLUUID::null, bool edit = false); diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 8fbd7fe726..3a772a8104 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -1476,6 +1476,12 @@ void LLPanelProfile::showPick(const LLUUID& pick_id) mTabContainer->selectTabPanel(mPanelPicks); } +bool LLPanelProfile::isPickTabSelected() +{ + return (mTabContainer->getCurrentPanel() == mPanelPicks); +} + + void LLPanelProfile::showClassified(const LLUUID& classified_id, bool edit) { if (classified_id.notNull()) diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index 72f913b522..d9b70a7f35 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -393,6 +393,7 @@ public: void apply(); void showPick(const LLUUID& pick_id = LLUUID::null); + bool isPickTabSelected(); void showClassified(const LLUUID& classified_id = LLUUID::null, bool edit = false); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 40c9e65823..1ed02a9a61 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3476,6 +3476,11 @@ bool my_profile_visible() return floaterp && floaterp->isInVisibleChain(); } +bool picks_tab_visible() +{ + return my_profile_visible() && LLAvatarActions::isPickTabSelected(gAgentID); +} + bool enable_freeze_eject(const LLSD& avatar_id) { // Use avatar_id if available, otherwise default to right-click avatar @@ -6100,6 +6105,29 @@ class LLAvatarToggleMyProfile : public view_listener_t } }; +class LLAvatarTogglePicks : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLFloater* instance = LLAvatarActions::getProfileFloater(gAgent.getID()); + if (LLFloater::isMinimized(instance) || (instance && !instance->hasFocus() && !instance->getIsChrome())) + { + instance->setMinimized(FALSE); + instance->setFocus(TRUE); + LLAvatarActions::showPicks(gAgent.getID()); + } + else if (picks_tab_visible()) + { + instance->closeFloater(); + } + else + { + LLAvatarActions::showPicks(gAgent.getID()); + } + return true; + } +}; + class LLAvatarResetSkeleton: public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -9182,10 +9210,12 @@ void initialize_menus() enable.add("Avatar.EnableCall", boost::bind(&LLAvatarActions::canCall)); view_listener_t::addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse"); view_listener_t::addMenu(new LLAvatarToggleMyProfile(), "Avatar.ToggleMyProfile"); + view_listener_t::addMenu(new LLAvatarTogglePicks(), "Avatar.TogglePicks"); view_listener_t::addMenu(new LLAvatarResetSkeleton(), "Avatar.ResetSkeleton"); view_listener_t::addMenu(new LLAvatarEnableResetSkeleton(), "Avatar.EnableResetSkeleton"); view_listener_t::addMenu(new LLAvatarResetSkeletonAndAnimations(), "Avatar.ResetSkeletonAndAnimations"); enable.add("Avatar.IsMyProfileOpen", boost::bind(&my_profile_visible)); + enable.add("Avatar.IsPicksTabOpen", boost::bind(&picks_tab_visible)); commit.add("Avatar.OpenMarketplace", boost::bind(&LLWeb::loadURLExternal, gSavedSettings.getString("MarketplaceURL"))); -- cgit v1.3 From 023a69720876eaec0135b8536e1945db95336a36 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 3 Jun 2019 17:19:05 +0300 Subject: SL-11344 FIXED Private notes are not saved for another avatar --- indra/newview/llfloaterprofile.cpp | 12 +----------- indra/newview/llpanelprofile.cpp | 22 ++++++++++++++++------ indra/newview/llpanelprofile.h | 3 +++ 3 files changed, 20 insertions(+), 17 deletions(-) (limited to 'indra/newview/llfloaterprofile.cpp') diff --git a/indra/newview/llfloaterprofile.cpp b/indra/newview/llfloaterprofile.cpp index 216bcb0580..f2863e1e27 100644 --- a/indra/newview/llfloaterprofile.cpp +++ b/indra/newview/llfloaterprofile.cpp @@ -54,12 +54,6 @@ void LLFloaterProfile::onOpen(const LLSD& key) { mPanelProfile->onOpen(key); - if (mAvatarId == gAgentID) - { - getChild("ok_btn")->setVisible(TRUE); - getChild("cancel_btn")->setVisible(TRUE); - } - // Update the avatar name. mNameCallbackConnection = LLAvatarNameCache::get(mAvatarId, boost::bind(&LLFloaterProfile::onAvatarNameCache, this, _1, _2)); } @@ -91,11 +85,7 @@ void LLFloaterProfile::showClassified(const LLUUID& classified_id, bool edit) void LLFloaterProfile::onOKBtn() { - if (mAvatarId == gAgentID) - { - mPanelProfile->apply(); - } - + mPanelProfile->apply(); closeFloater(); } diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 6c0b1b9047..a60493a360 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -1514,6 +1514,13 @@ void LLPanelProfile::onTabChange() { active_panel->updateData(); } + updateBtnsVisibility(); +} + +void LLPanelProfile::updateBtnsVisibility() +{ + getChild("ok_btn")->setVisible(((getSelfProfile() && !getEmbedded()) || isNotesTabSelected())); + getChild("cancel_btn")->setVisible(((getSelfProfile() && !getEmbedded()) || isNotesTabSelected())); } void LLPanelProfile::onOpen(const LLSD& key) @@ -1557,12 +1564,7 @@ void LLPanelProfile::onOpen(const LLSD& key) resetLoading(); updateData(); - // Only show commit buttons on own profile on floater version - if (getSelfProfile() && !getEmbedded()) - { - getChild("ok_btn")->setVisible(TRUE); - getChild("cancel_btn")->setVisible(TRUE); - } + updateBtnsVisibility(); // KC - Not handling pick and classified opening thru onOpen // because this would make unique profile floaters per slurl @@ -1597,6 +1599,10 @@ void LLPanelProfile::apply() //KC - Classifieds handles this itself } + else + { + mPanelNotes->apply(); + } } void LLPanelProfile::showPick(const LLUUID& pick_id) @@ -1613,6 +1619,10 @@ bool LLPanelProfile::isPickTabSelected() return (mTabContainer->getCurrentPanel() == mPanelPicks); } +bool LLPanelProfile::isNotesTabSelected() +{ + return (mTabContainer->getCurrentPanel() == mPanelNotes); +} void LLPanelProfile::showClassified(const LLUUID& classified_id, bool edit) { diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index 7d22b64dbe..9eeb926549 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -409,6 +409,9 @@ public: void showPick(const LLUUID& pick_id = LLUUID::null); bool isPickTabSelected(); + bool isNotesTabSelected(); + + void updateBtnsVisibility(); void showClassified(const LLUUID& classified_id = LLUUID::null, bool edit = false); -- cgit v1.3 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/newview/llfloaterprofile.cpp') 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 @@ > -