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/llpanelprofilepicks.h | 234 ++++++++++++++++++++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 indra/newview/llpanelprofilepicks.h (limited to 'indra/newview/llpanelprofilepicks.h') diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h new file mode 100644 index 0000000000..aeaa25bf8b --- /dev/null +++ b/indra/newview/llpanelprofilepicks.h @@ -0,0 +1,234 @@ +/** + * @file llpanelprofilepicks.h + * @brief LLPanelProfilePicks and related class definitions + * + * $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$ + */ + +#ifndef LL_LLPANELPICKS_H +#define LL_LLPANELPICKS_H + +#include "llpanel.h" +#include "lluuid.h" +#include "llavatarpropertiesprocessor.h" +#include "llpanelavatar.h" +#include "llremoteparcelrequest.h" + +class LLTabContainer; +class LLTextureCtrl; +class LLMediaCtrl; +class LLLineEditor; +class LLTextEditor; + + +/** +* Panel for displaying Avatar's picks. +*/ +class LLPanelProfilePicks + : public LLPanelProfileTab +{ +public: + LLPanelProfilePicks(); + /*virtual*/ ~LLPanelProfilePicks(); + + /*virtual*/ BOOL postBuild(); + + /*virtual*/ void onOpen(const LLSD& key); + + void selectPick(const LLUUID& pick_id); + + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + + /*virtual*/ void resetData(); + + /*virtual*/ void updateButtons(); + + /** + * Saves changes. + */ + virtual void apply(); + + /** + * Sends update data request to server. + */ + /*virtual*/ void updateData(); + +private: + void onClickNewBtn(); + void onClickDelete(); + void callbackDeletePick(const LLSD& notification, const LLSD& response); + + bool canAddNewPick(); + bool canDeletePick(); + + LLTabContainer* mTabContainer; + LLUICtrl* mNoItemsLabel; + LLButton* mNewButton; + LLButton* mDeleteButton; + + LLUUID mPickToSelectOnLoad; +}; + + +class LLPanelProfilePick + : public LLPanelProfileTab + , public LLRemoteParcelInfoObserver +{ +public: + + // Creates new panel + static LLPanelProfilePick* create(); + + LLPanelProfilePick(); + + /*virtual*/ ~LLPanelProfilePick(); + + /*virtual*/ BOOL postBuild(); + + void setAvatarId(const LLUUID& avatar_id); + + void setPickId(const LLUUID& id) { mPickId = id; } + virtual LLUUID& getPickId() { return mPickId; } + + virtual void setPickName(const std::string& name); + const std::string getPickName(); + + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + + /** + * Saves changes. + */ + virtual void apply(); + + void updateTabLabel(const std::string& title); + + //This stuff we got from LLRemoteParcelObserver, in the last one we intentionally do nothing + /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); + /*virtual*/ void setParcelID(const LLUUID& parcel_id) { mParcelId = parcel_id; } + /*virtual*/ void setErrorStatus(S32 status, const std::string& reason) {}; + +protected: + + /** + * Sends remote parcel info request to resolve parcel name from its ID. + */ + void sendParcelInfoRequest(); + + /** + * "Location text" is actually the owner name, the original + * name that owner gave the parcel, and the location. + */ + static std::string createLocationText( + const std::string& owner_name, + const std::string& original_name, + const std::string& sim_name, + const LLVector3d& pos_global); + + /** + * Sets snapshot id. + * + * Will mark snapshot control as valid if id is not null. + * Will mark snapshot control as invalid if id is null. If null id is a valid value, + * you have to manually mark snapshot is valid. + */ + virtual void setSnapshotId(const LLUUID& id); + virtual void setPickDesc(const std::string& desc); + virtual void setPickLocation(const std::string& location); + + virtual void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; } + virtual LLVector3d& getPosGlobal() { return mPosGlobal; } + + /** + * Callback for "Map" button, opens Map + */ + void onClickMap(); + + /** + * Callback for "Teleport" button, teleports user to Pick location. + */ + void onClickTeleport(); + + /** + * Enables/disables "Save" button + */ + void enableSaveButton(BOOL enable); + + /** + * Called when snapshot image changes. + */ + void onSnapshotChanged(); + + /** + * Callback for Pick snapshot, name and description changed event. + */ + void onPickChanged(LLUICtrl* ctrl); + + /** + * Resets panel and all cantrols to unedited state + */ + /*virtual*/ void resetDirty(); + + /** + * Returns true if any of Pick properties was changed by user. + */ + /*virtual*/ BOOL isDirty() const; + + /** + * Callback for "Set Location" button click + */ + void onClickSetLocation(); + + /** + * Callback for "Save" button click + */ + void onClickSave(); + + std::string getLocationNotice(); + + /** + * Sends Pick properties to server. + */ + void sendUpdate(); + +protected: + + LLTextureCtrl* mSnapshotCtrl; + LLLineEditor* mPickName; + LLTextEditor* mPickDescription; + LLButton* mSetCurrentLocationButton; + LLButton* mSaveButton; + + LLVector3d mPosGlobal; + LLUUID mParcelId; + LLUUID mPickId; + LLUUID mRequestedId; + + bool mLocationChanged; + bool mNewPick; + bool mIsEditing; + + std::string mCurrentPickDescription; + + void onDescriptionFocusReceived(); +}; + +#endif // LL_LLPANELPICKS_H -- cgit v1.2.3 From 259c5e3ffe101f75775a9e574e5436b434af58c1 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 12 Mar 2022 00:04:18 +0200 Subject: SL-16937 New Profile capability, PUT method #2 --- indra/newview/llpanelprofilepicks.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llpanelprofilepicks.h') diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h index aeaa25bf8b..061f947a28 100644 --- a/indra/newview/llpanelprofilepicks.h +++ b/indra/newview/llpanelprofilepicks.h @@ -57,6 +57,7 @@ public: void selectPick(const LLUUID& pick_id); /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + void processProperties(const LLAvatarPicks* avatar_picks); /*virtual*/ void resetData(); @@ -72,6 +73,8 @@ public: */ /*virtual*/ void updateData(); + friend void request_avatar_properties_coro(std::string cap_url, LLUUID agent_id); + private: void onClickNewBtn(); void onClickDelete(); -- 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/llpanelprofilepicks.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanelprofilepicks.h') diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h index 061f947a28..aa58e46a9f 100644 --- a/indra/newview/llpanelprofilepicks.h +++ b/indra/newview/llpanelprofilepicks.h @@ -61,7 +61,7 @@ public: /*virtual*/ void resetData(); - /*virtual*/ void updateButtons(); + void updateButtons(); /** * Saves changes. -- 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/llpanelprofilepicks.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelprofilepicks.h') diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h index aa58e46a9f..8be3e0285b 100644 --- a/indra/newview/llpanelprofilepicks.h +++ b/indra/newview/llpanelprofilepicks.h @@ -44,7 +44,7 @@ class LLTextEditor; * Panel for displaying Avatar's picks. */ class LLPanelProfilePicks - : public LLPanelProfileTab + : public LLPanelProfilePropertiesPeocessorTab { public: LLPanelProfilePicks(); @@ -93,7 +93,7 @@ private: class LLPanelProfilePick - : public LLPanelProfileTab + : public LLPanelProfilePropertiesPeocessorTab , public LLRemoteParcelInfoObserver { public: -- 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/llpanelprofilepicks.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelprofilepicks.h') diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h index 8be3e0285b..046f13292e 100644 --- a/indra/newview/llpanelprofilepicks.h +++ b/indra/newview/llpanelprofilepicks.h @@ -44,7 +44,7 @@ class LLTextEditor; * Panel for displaying Avatar's picks. */ class LLPanelProfilePicks - : public LLPanelProfilePropertiesPeocessorTab + : public LLPanelProfilePropertiesProcessorTab { public: LLPanelProfilePicks(); @@ -93,7 +93,7 @@ private: class LLPanelProfilePick - : public LLPanelProfilePropertiesPeocessorTab + : public LLPanelProfilePropertiesProcessorTab , public LLRemoteParcelInfoObserver { public: -- 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/llpanelprofilepicks.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelprofilepicks.h') diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h index 046f13292e..e1c424ca24 100644 --- a/indra/newview/llpanelprofilepicks.h +++ b/indra/newview/llpanelprofilepicks.h @@ -2,9 +2,9 @@ * @file llpanelprofilepicks.h * @brief LLPanelProfilePicks and related class definitions * - * $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 @@ -54,6 +54,7 @@ public: /*virtual*/ void onOpen(const LLSD& key); + void createPick(const LLPickData &data); void selectPick(const LLUUID& pick_id); /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); @@ -89,6 +90,7 @@ private: LLButton* mDeleteButton; LLUUID mPickToSelectOnLoad; + std::list mSheduledPickCreation; }; @@ -116,6 +118,7 @@ public: const std::string getPickName(); /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + void processProperties(const LLPickData* pick_data); /** * Saves changes. -- 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/llpanelprofilepicks.h | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'indra/newview/llpanelprofilepicks.h') diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h index e1c424ca24..d5df7b7f12 100644 --- a/indra/newview/llpanelprofilepicks.h +++ b/indra/newview/llpanelprofilepicks.h @@ -50,17 +50,17 @@ public: LLPanelProfilePicks(); /*virtual*/ ~LLPanelProfilePicks(); - /*virtual*/ BOOL postBuild(); + BOOL postBuild() override; - /*virtual*/ void onOpen(const LLSD& key); + void onOpen(const LLSD& key) override; void createPick(const LLPickData &data); void selectPick(const LLUUID& pick_id); - /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + void processProperties(void* data, EAvatarProcessorType type) override; void processProperties(const LLAvatarPicks* avatar_picks); - /*virtual*/ void resetData(); + void resetData() override; void updateButtons(); @@ -72,7 +72,10 @@ public: /** * Sends update data request to server. */ - /*virtual*/ void updateData(); + void updateData() override; + + bool hasUnsavedChanges() override; + void commitUnsavedChanges() override; friend void request_avatar_properties_coro(std::string cap_url, LLUUID agent_id); @@ -107,7 +110,7 @@ public: /*virtual*/ ~LLPanelProfilePick(); - /*virtual*/ BOOL postBuild(); + BOOL postBuild() override; void setAvatarId(const LLUUID& avatar_id); @@ -117,9 +120,14 @@ public: virtual void setPickName(const std::string& name); const std::string getPickName(); - /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + void processProperties(void* data, EAvatarProcessorType type) override; void processProperties(const LLPickData* pick_data); + /** + * Returns true if any of Pick properties was changed by user. + */ + BOOL isDirty() const override; + /** * Saves changes. */ @@ -128,9 +136,9 @@ public: void updateTabLabel(const std::string& title); //This stuff we got from LLRemoteParcelObserver, in the last one we intentionally do nothing - /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); - /*virtual*/ void setParcelID(const LLUUID& parcel_id) { mParcelId = parcel_id; } - /*virtual*/ void setErrorStatus(S32 status, const std::string& reason) {}; + void processParcelInfo(const LLParcelData& parcel_data) override; + void setParcelID(const LLUUID& parcel_id) override { mParcelId = parcel_id; } + void setErrorStatus(S32 status, const std::string& reason) override {}; protected: @@ -191,12 +199,7 @@ protected: /** * Resets panel and all cantrols to unedited state */ - /*virtual*/ void resetDirty(); - - /** - * Returns true if any of Pick properties was changed by user. - */ - /*virtual*/ BOOL isDirty() const; + void resetDirty() override; /** * Callback for "Set Location" button click -- cgit v1.2.3 From 4f92a3222efac36b2355550ed55ca0a2fcb9591d Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 3 Jun 2022 21:24:09 +0300 Subject: SL-15312 Updated picks's layout - better emphasis onto saving - better resize logic - ability to discard changes --- indra/newview/llpanelprofilepicks.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelprofilepicks.h') diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h index d5df7b7f12..fc975604d9 100644 --- a/indra/newview/llpanelprofilepicks.h +++ b/indra/newview/llpanelprofilepicks.h @@ -207,10 +207,15 @@ protected: void onClickSetLocation(); /** - * Callback for "Save" button click + * Callback for "Save" and "Create" button click */ void onClickSave(); + /** + * Callback for "Save" button click + */ + void onClickCancel(); + std::string getLocationNotice(); /** @@ -225,6 +230,8 @@ protected: LLTextEditor* mPickDescription; LLButton* mSetCurrentLocationButton; LLButton* mSaveButton; + LLButton* mCreateButton; + LLButton* mCancelButton; LLVector3d mPosGlobal; LLUUID mParcelId; -- cgit v1.2.3 From 537941a81281bf6586f410e07ee265cf7c2972a0 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 7 Jun 2022 16:53:34 +0300 Subject: SL-15312 Mac build fix --- indra/newview/llpanelprofilepicks.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanelprofilepicks.h') diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h index fc975604d9..8973b37d16 100644 --- a/indra/newview/llpanelprofilepicks.h +++ b/indra/newview/llpanelprofilepicks.h @@ -112,7 +112,7 @@ public: BOOL postBuild() override; - void setAvatarId(const LLUUID& avatar_id); + void setAvatarId(const LLUUID& avatar_id) override; void setPickId(const LLUUID& id) { mPickId = id; } virtual LLUUID& getPickId() { return mPickId; } -- cgit v1.2.3 From dd4156251b0ad18f283d1b79a692c8a4a76c0900 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 10 Aug 2022 17:24:26 +0300 Subject: SL-17924 Don't clear pick's description when clicking on description for the first time --- indra/newview/llpanelprofilepicks.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llpanelprofilepicks.h') diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h index 8973b37d16..f84463cc9b 100644 --- a/indra/newview/llpanelprofilepicks.h +++ b/indra/newview/llpanelprofilepicks.h @@ -242,8 +242,6 @@ protected: bool mNewPick; bool mIsEditing; - std::string mCurrentPickDescription; - void onDescriptionFocusReceived(); }; -- cgit v1.2.3