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.2.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/newview/llfloaterprofile.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterprofile.cpp') 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.2.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/llfloaterprofile.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llfloaterprofile.cpp') 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); -- cgit v1.2.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 +----------- 1 file changed, 1 insertion(+), 11 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(); } -- cgit v1.2.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 --- 1 file changed, 3 deletions(-) (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; } -- cgit v1.2.3 From 1483c05c9f61e7ce44e8883d8e10d976867882fa Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 12 Apr 2022 21:46:53 +0300 Subject: SL-15312 Legacy profiles remake #5 Mostly changes for notes tab and first life tab --- indra/newview/llfloaterprofile.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'indra/newview/llfloaterprofile.cpp') diff --git a/indra/newview/llfloaterprofile.cpp b/indra/newview/llfloaterprofile.cpp index 0a775f217a..b259bd28f5 100644 --- a/indra/newview/llfloaterprofile.cpp +++ b/indra/newview/llfloaterprofile.cpp @@ -80,17 +80,6 @@ void LLFloaterProfile::showClassified(const LLUUID& classified_id, bool edit) mPanelProfile->showClassified(classified_id, edit); } -void LLFloaterProfile::onOKBtn() -{ - mPanelProfile->apply(); - closeFloater(); -} - -void LLFloaterProfile::onCancelBtn() -{ - closeFloater(); -} - void LLFloaterProfile::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { mNameCallbackConnection.disconnect(); -- cgit v1.2.3 From 4ffc6c3fde17de5e18370139274bbd44b1b61a23 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 30 May 2022 22:06:59 +0300 Subject: SL-15312 Tweaks and fixes - Allowed resizing text fields for classifieds in profiles - Fixed mislabeled floater from picks to classifieds - Fixed classified floater's title - Added support to see multiple classifieds - Removed obsolete panels - Fixed pick requests for various menus - Fixed pick creation from landmarks - Improved online status handling - Updated headers in files --- indra/newview/llfloaterprofile.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterprofile.cpp') diff --git a/indra/newview/llfloaterprofile.cpp b/indra/newview/llfloaterprofile.cpp index b259bd28f5..78920863e2 100644 --- a/indra/newview/llfloaterprofile.cpp +++ b/indra/newview/llfloaterprofile.cpp @@ -2,9 +2,9 @@ * @file llfloaterprofile.cpp * @brief Avatar profile floater. * - * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * $LicenseInfo:firstyear=2022&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2022, 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 @@ -65,6 +65,11 @@ BOOL LLFloaterProfile::postBuild() return TRUE; } +void LLFloaterProfile::createPick(const LLPickData &data) +{ + mPanelProfile->createPick(data); +} + void LLFloaterProfile::showPick(const LLUUID& pick_id) { mPanelProfile->showPick(pick_id); -- cgit v1.2.3 From 3efe64619b772ce8cab596d7e74de48dcc7f6c20 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 2 Jun 2022 00:17:54 +0300 Subject: SL-15312 Confirm usaved changes dialog when closing floater --- indra/newview/llfloaterprofile.cpp | 59 +++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterprofile.cpp') diff --git a/indra/newview/llfloaterprofile.cpp b/indra/newview/llfloaterprofile.cpp index 78920863e2..a4a9fe8410 100644 --- a/indra/newview/llfloaterprofile.cpp +++ b/indra/newview/llfloaterprofile.cpp @@ -28,9 +28,10 @@ #include "llfloaterprofile.h" +#include "llagent.h" //gAgent +#include "llnotificationsutil.h" #include "llpanelavatar.h" #include "llpanelprofile.h" -#include "llagent.h" //gAgent static const std::string PANEL_PROFILE_VIEW = "panel_profile_view"; @@ -65,6 +66,62 @@ BOOL LLFloaterProfile::postBuild() return TRUE; } +void LLFloaterProfile::onClickCloseBtn(bool app_quitting) +{ + if (!app_quitting) + { + if (mPanelProfile->hasUnpublishedClassifieds()) + { + LLNotificationsUtil::add("ProfileUnpublishedClassified", LLSD(), LLSD(), + boost::bind(&LLFloaterProfile::onUnsavedChangesCallback, this, _1, _2, false)); + } + else if (mPanelProfile->hasUnsavedChanges()) + { + LLNotificationsUtil::add("ProfileUnsavedChanges", LLSD(), LLSD(), + boost::bind(&LLFloaterProfile::onUnsavedChangesCallback, this, _1, _2, true)); + } + else + { + closeFloater(); + } + } + else + { + closeFloater(); + } +} + +void LLFloaterProfile::onUnsavedChangesCallback(const LLSD& notification, const LLSD& response, bool can_save) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (can_save) + { + // savable content + + if (option == 0) // Save + { + mPanelProfile->commitUnsavedChanges(); + closeFloater(); + } + if (option == 1) // Discard + { + closeFloater(); + } + // else cancel + } + else + { + // classifieds + + if (option == 0) // Ok + { + closeFloater(); + } + // else cancel + } + +} + void LLFloaterProfile::createPick(const LLPickData &data) { mPanelProfile->createPick(data); -- cgit v1.2.3 From 946bdc1ee352618f0d333292272aceb48b6d8dd8 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 8 Aug 2022 22:38:56 +0300 Subject: SL-14556 Profile floater does not update after a name change --- indra/newview/llfloaterprofile.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llfloaterprofile.cpp') diff --git a/indra/newview/llfloaterprofile.cpp b/indra/newview/llfloaterprofile.cpp index a4a9fe8410..624075e9fd 100644 --- a/indra/newview/llfloaterprofile.cpp +++ b/indra/newview/llfloaterprofile.cpp @@ -137,6 +137,20 @@ bool LLFloaterProfile::isPickTabSelected() return mPanelProfile->isPickTabSelected(); } +void LLFloaterProfile::refreshName() +{ + if (!mNameCallbackConnection.connected()) + { + mNameCallbackConnection = LLAvatarNameCache::get(mAvatarId, boost::bind(&LLFloaterProfile::onAvatarNameCache, this, _1, _2)); + } + + LLPanelProfileSecondLife *panel = findChild("panel_profile_secondlife"); + if (panel) + { + panel->refreshName(); + } +} + void LLFloaterProfile::showClassified(const LLUUID& classified_id, bool edit) { mPanelProfile->showClassified(classified_id, edit); -- cgit v1.2.3 From c4335939d90346a778eb18acb7611135742231df Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 10 Aug 2022 19:03:12 +0300 Subject: SL-17925 Fix SLURL based creation of picks and classifieds --- indra/newview/llfloaterprofile.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llfloaterprofile.cpp') diff --git a/indra/newview/llfloaterprofile.cpp b/indra/newview/llfloaterprofile.cpp index 624075e9fd..6ccdace6c5 100644 --- a/indra/newview/llfloaterprofile.cpp +++ b/indra/newview/llfloaterprofile.cpp @@ -156,6 +156,11 @@ void LLFloaterProfile::showClassified(const LLUUID& classified_id, bool edit) mPanelProfile->showClassified(classified_id, edit); } +void LLFloaterProfile::createClassified() +{ + mPanelProfile->createClassified(); +} + void LLFloaterProfile::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { mNameCallbackConnection.disconnect(); -- cgit v1.2.3