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/llpanelavatar.h | 167 +++++++++++++++++++++++++++--------------- 1 file changed, 106 insertions(+), 61 deletions(-) (limited to 'indra/newview/llpanelavatar.h') diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index e33a850cfa..f73ea0643d 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -1,25 +1,25 @@ -/** +/** * @file llpanelavatar.h - * @brief LLPanelAvatar and related class definitions + * @brief Legacy profile panel base class * - * $LicenseInfo:firstyear=2004&license=viewerlgpl$ + * $LicenseInfo:firstyear=2019&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * + * Copyright (C) 2019, 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$ */ @@ -29,80 +29,125 @@ #include "llpanel.h" #include "llavatarpropertiesprocessor.h" -#include "llcallingcard.h" -#include "llvoiceclient.h" #include "llavatarnamecache.h" class LLComboBox; class LLLineEditor; +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLProfileDropTarget +// +// This handy class is a simple way to drop something on another +// view. It handles drop events, always setting itself to the size of +// its parent. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLProfileDropTarget : public LLView +{ +public: + struct Params : public LLInitParam::Block + { + Optional agent_id; + Params() + : agent_id("agent_id") + { + changeDefault(mouse_opaque, false); + changeDefault(follows.flags, FOLLOWS_ALL); + } + }; + + LLProfileDropTarget(const Params&); + ~LLProfileDropTarget() {} + + void doDrop(EDragAndDropType cargo_type, void* cargo_data); + + // + // LLView functionality + virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg); + + void setAgentID(const LLUUID &agent_id) { mAgentID = agent_id; } + +protected: + LLUUID mAgentID; +}; + + /** * Base class for any Profile View. */ class LLPanelProfileTab - : public LLPanel - , public LLAvatarPropertiesObserver + : public LLPanel + , public LLAvatarPropertiesObserver { public: - /** - * Sets avatar ID, sets panel as observer of avatar related info replies from server. - */ - virtual void setAvatarId(const LLUUID& id); - - /** - * Returns avatar ID. - */ - virtual const LLUUID& getAvatarId() { return mAvatarId; } - - /** - * Sends update data request to server. - */ - virtual void updateData() = 0; - - /** - * Clears panel data if viewing avatar info for first time and sends update data request. - */ - virtual void onOpen(const LLSD& key); - - /** - * Profile tabs should close any opened panels here. - * - * Called from LLPanelProfile::onOpen() before opening new profile. - * See LLPanelPicks::onClosePanel for example. LLPanelPicks closes picture info panel - * before new profile is displayed, otherwise new profile will - * be hidden behind picture info panel. - */ - virtual void onClosePanel() {} - - /** - * Resets controls visibility, state, etc. - */ - virtual void resetControls(){}; - - /** - * Clears all data received from server. - */ - virtual void resetData(){}; - - /*virtual*/ ~LLPanelProfileTab(); + /** + * Sets avatar ID, sets panel as observer of avatar related info replies from server. + */ + virtual void setAvatarId(const LLUUID& avatar_id); + + /** + * Returns avatar ID. + */ + virtual const LLUUID& getAvatarId() { return mAvatarId; } + + /** + * Sends update data request to server. + */ + virtual void updateData() {}; + + /** + * Clears panel data if viewing avatar info for first time and sends update data request. + */ + virtual void onOpen(const LLSD& key); + + /** + * Processes data received from server. + */ + virtual void processProperties(void* data, EAvatarProcessorType type) = 0; + + /** + * Clears all data received from server. + */ + virtual void resetData(){}; + + /*virtual*/ ~LLPanelProfileTab(); + + void setEmbedded(bool embedded) { mEmbedded = embedded; } protected: - LLPanelProfileTab(); + LLPanelProfileTab(); + + + // mLoading: false: Initial state, can request + // true: Data requested, skip duplicate requests (happens due to LLUI's habit of repeated callbacks) + // mLoaded: false: Initial state, show loading indicator + // true: Data recieved, which comes in a single message, hide indicator + bool getIsLoading() { return mLoading; } + void setIsLoading() { mLoading = true; } + bool getIsLoaded() { return mLoaded; } + void resetLoading() { mLoading = false; mLoaded = false; } + + const bool getEmbedded() const { return mEmbedded; } - /** - * Scrolls panel to top when viewing avatar info for first time. - */ - void scrollToTop(); + const bool getSelfProfile() const { return mSelfProfile; } - virtual void onMapButtonClick(); + void setApplyProgress(bool started); - virtual void updateButtons(); + virtual void updateButtons(); private: - LLUUID mAvatarId; + LLUUID mAvatarId; + bool mLoading; + bool mLoaded; + bool mEmbedded; + bool mSelfProfile; }; #endif // LL_LLPANELAVATAR_H -- cgit v1.2.3 From c9b83e8117026aa7fc70da3972049152a669b0fc Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 16 Apr 2022 01:01:01 +0300 Subject: SL-15312 Legacy profiles remake #8 Progress indicators, loading states and 'embedded' cleanup --- indra/newview/llpanelavatar.h | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'indra/newview/llpanelavatar.h') diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index f73ea0643d..fb9ff26ca6 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -117,36 +117,38 @@ public: /*virtual*/ ~LLPanelProfileTab(); - void setEmbedded(bool embedded) { mEmbedded = embedded; } - protected: LLPanelProfileTab(); + enum ELoadingState + { + PROFILE_INIT, + PROFILE_LOADING, + PROFILE_LOADED, + }; + // mLoading: false: Initial state, can request // true: Data requested, skip duplicate requests (happens due to LLUI's habit of repeated callbacks) // mLoaded: false: Initial state, show loading indicator // true: Data recieved, which comes in a single message, hide indicator - bool getIsLoading() { return mLoading; } - void setIsLoading() { mLoading = true; } - bool getIsLoaded() { return mLoaded; } - void resetLoading() { mLoading = false; mLoaded = false; } + ELoadingState getLoadingState() { return mLoadingState; } + void setIsLoading() { mLoadingState = PROFILE_LOADING; } + virtual void setLoaded(); + void resetLoading() { mLoadingState = PROFILE_INIT; } - const bool getEmbedded() const { return mEmbedded; } + bool getStarted() { return mLoadingState != PROFILE_INIT; } + bool getIsLoaded() { return mLoadingState == PROFILE_LOADED; } const bool getSelfProfile() const { return mSelfProfile; } void setApplyProgress(bool started); - virtual void updateButtons(); - private: LLUUID mAvatarId; - bool mLoading; - bool mLoaded; - bool mEmbedded; + ELoadingState mLoadingState; bool mSelfProfile; }; -- cgit v1.2.3 From 3fb9993a4a74c19b872bb96ed4878cd7b7143208 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 16 Apr 2022 02:09:03 +0300 Subject: SL-15312 Legacy profiles remake #9 Cleanup obsolete properties processesing --- indra/newview/llpanelavatar.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'indra/newview/llpanelavatar.h') diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index fb9ff26ca6..1b47411fdb 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -81,7 +81,6 @@ protected: */ class LLPanelProfileTab : public LLPanel - , public LLAvatarPropertiesObserver { public: @@ -105,11 +104,6 @@ public: */ virtual void onOpen(const LLSD& key); - /** - * Processes data received from server. - */ - virtual void processProperties(void* data, EAvatarProcessorType type) = 0; - /** * Clears all data received from server. */ @@ -152,4 +146,20 @@ private: bool mSelfProfile; }; +class LLPanelProfilePropertiesPeocessorTab + : public LLPanelProfileTab + , public LLAvatarPropertiesObserver +{ +public: + LLPanelProfilePropertiesPeocessorTab(); + ~LLPanelProfilePropertiesPeocessorTab(); + + /*virtual*/ void setAvatarId(const LLUUID& avatar_id); + + /** + * Processes data received from server via LLAvatarPropertiesObserver. + */ + virtual void processProperties(void* data, EAvatarProcessorType type) = 0; +}; + #endif // LL_LLPANELAVATAR_H -- cgit v1.2.3 From 8a39aaa3a485d9f1d4486c02e98286cfb08761d4 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 18 Apr 2022 21:35:41 +0300 Subject: SL-15312 Legacy profiles remake #10 Fixed Typo changed 'show in search' checkbox into combobox, implemented commit Fixed fl textbox setting sl text instead of fl text Fixed fl save/discard buttons not following resize --- indra/newview/llpanelavatar.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpanelavatar.h') diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index 1b47411fdb..249b895abb 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -146,13 +146,13 @@ private: bool mSelfProfile; }; -class LLPanelProfilePropertiesPeocessorTab +class LLPanelProfilePropertiesProcessorTab : public LLPanelProfileTab , public LLAvatarPropertiesObserver { public: - LLPanelProfilePropertiesPeocessorTab(); - ~LLPanelProfilePropertiesPeocessorTab(); + LLPanelProfilePropertiesProcessorTab(); + ~LLPanelProfilePropertiesProcessorTab(); /*virtual*/ void setAvatarId(const LLUUID& avatar_id); -- 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/llpanelavatar.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'indra/newview/llpanelavatar.h') diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index 249b895abb..98fd97f00a 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -128,17 +128,18 @@ protected: // mLoaded: false: Initial state, show loading indicator // true: Data recieved, which comes in a single message, hide indicator ELoadingState getLoadingState() { return mLoadingState; } - void setIsLoading() { mLoadingState = PROFILE_LOADING; } virtual void setLoaded(); + void setApplyProgress(bool started); + + const bool getSelfProfile() const { return mSelfProfile; } + +public: + void setIsLoading() { mLoadingState = PROFILE_LOADING; } void resetLoading() { mLoadingState = PROFILE_INIT; } bool getStarted() { return mLoadingState != PROFILE_INIT; } bool getIsLoaded() { return mLoadingState == PROFILE_LOADED; } - const bool getSelfProfile() const { return mSelfProfile; } - - void setApplyProgress(bool started); - private: LLUUID mAvatarId; -- 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/llpanelavatar.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llpanelavatar.h') diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index 98fd97f00a..f182660c8e 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -140,6 +140,9 @@ public: bool getStarted() { return mLoadingState != PROFILE_INIT; } bool getIsLoaded() { return mLoadingState == PROFILE_LOADED; } + virtual bool hasUnsavedChanges() { return false; } + virtual void commitUnsavedChanges() {} + private: LLUUID mAvatarId; -- cgit v1.2.3