From ec02220f068c7e7ec61e8c8af7a3c4c96c112172 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 15 Feb 2023 02:19:49 +0200 Subject: SL-19108 WIP Managing inventory thumbnail #1 --- indra/newview/llfloaterchangeitemthumbnail.h | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 indra/newview/llfloaterchangeitemthumbnail.h (limited to 'indra/newview/llfloaterchangeitemthumbnail.h') diff --git a/indra/newview/llfloaterchangeitemthumbnail.h b/indra/newview/llfloaterchangeitemthumbnail.h new file mode 100644 index 0000000000..94792f07b6 --- /dev/null +++ b/indra/newview/llfloaterchangeitemthumbnail.h @@ -0,0 +1,38 @@ +/** + * @file llfloaterchangeitemthumbnail.h + * @brief LLFloaterChangeItemThumbnail class definition + * + * $LicenseInfo:firstyear=2023&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2023, 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_LLFLOATERCHANGEITEMTHUMBNAIL_H +#define LL_LLFLOATERCHANGEITEMTHUMBNAIL_H + +#include "llfloater.h" + +class LLFloaterChangeItemThumbnail : public LLFloater +{ +public: + LLFloaterChangeItemThumbnail(const LLSD& key); + ~LLFloaterChangeItemThumbnail(); +}; +#endif // LL_LLFLOATERCHANGEITEMTHUMBNAIL_H -- cgit v1.2.3 From f2d46651b92d949a63d2b3a5dd774dce6a6752c7 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 15 Feb 2023 23:56:49 +0200 Subject: SL-19108 WIP Managing inventory thumbnail #2 --- indra/newview/llfloaterchangeitemthumbnail.h | 62 +++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterchangeitemthumbnail.h') diff --git a/indra/newview/llfloaterchangeitemthumbnail.h b/indra/newview/llfloaterchangeitemthumbnail.h index 94792f07b6..a219adb6f5 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.h +++ b/indra/newview/llfloaterchangeitemthumbnail.h @@ -28,11 +28,71 @@ #define LL_LLFLOATERCHANGEITEMTHUMBNAIL_H #include "llfloater.h" +#include "llinventoryobserver.h" +#include "llvoinventorylistener.h" -class LLFloaterChangeItemThumbnail : public LLFloater +class LLButton; +class LLIconCtrl; +class LLTextBox; +class LLThumbnailCtrl; +class LLUICtrl; +class LLViewerInventoryItem; + +class LLFloaterChangeItemThumbnail : public LLFloater, public LLInventoryObserver, public LLVOInventoryListener { public: LLFloaterChangeItemThumbnail(const LLSD& key); ~LLFloaterChangeItemThumbnail(); + + BOOL postBuild() override; + void onOpen(const LLSD& key) override; + + void changed(U32 mask) override; + void inventoryChanged(LLViewerObject* object, + LLInventoryObject::object_list_t* inventory, + S32 serial_num, + void* user_data) override; + +private: + + void refreshFromInventory(); + void refreshFromItem(LLViewerInventoryItem* item); + + void startObjectInventoryObserver(); + void stopObjectInventoryObserver(); + + static void onUploadLocal(void*); + static void onUploadSnapshot(void*); + static void onUseTexture(void*); + static void onCopyToClipboard(void*); + static void onPasteFromClipboard(void*); + static void onRemove(void*); + + enum EToolTipState + { + TOOLTIP_NONE, + TOOLTIP_UPLOAD_LOCAL, + TOOLTIP_UPLOAD_SNAPSHOT, + TOOLTIP_USE_TEXTURE, + TOOLTIP_COPY_TO_CLIPBOARD, + TOOLTIP_COPY_FROM_CLIPBOARD, + TOOLTIP_REMOVE, + }; + + void onButtonMouseEnter(LLUICtrl* button, const LLSD& param, EToolTipState state); + void onButtonMouseLeave(LLUICtrl* button, const LLSD& param, EToolTipState state); + + bool mObserverInitialized; + EToolTipState mTooltipState; + LLUUID mItemId; + LLUUID mTaskId; + + LLIconCtrl *mItemTypeIcon; + LLUICtrl *mItemNameText; + LLThumbnailCtrl *mThumbnailCtrl; + LLTextBox *mToolTipTextBox; + LLButton *mCopyToClipboardBtn; + LLButton *mPasteFromClipboardBtn; + LLButton *mRemoveImageBtn; }; #endif // LL_LLFLOATERCHANGEITEMTHUMBNAIL_H -- cgit v1.2.3 From 8fdd6849995748b144b811d2e9585aeb2c56562d Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 17 Feb 2023 18:54:50 +0200 Subject: SL-19108 WIP Managing inventory thumbnail #3 --- indra/newview/llfloaterchangeitemthumbnail.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloaterchangeitemthumbnail.h') diff --git a/indra/newview/llfloaterchangeitemthumbnail.h b/indra/newview/llfloaterchangeitemthumbnail.h index a219adb6f5..340d5cf05e 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.h +++ b/indra/newview/llfloaterchangeitemthumbnail.h @@ -55,12 +55,10 @@ public: private: + LLViewerInventoryItem* getItem(); void refreshFromInventory(); void refreshFromItem(LLViewerInventoryItem* item); - void startObjectInventoryObserver(); - void stopObjectInventoryObserver(); - static void onUploadLocal(void*); static void onUploadSnapshot(void*); static void onUseTexture(void*); @@ -68,6 +66,9 @@ private: static void onPasteFromClipboard(void*); static void onRemove(void*); + void showTexturePicker(const LLUUID &thumbnail_id); + void onTexturePickerCommit(LLUUID id); + enum EToolTipState { TOOLTIP_NONE, @@ -94,5 +95,7 @@ private: LLButton *mCopyToClipboardBtn; LLButton *mPasteFromClipboardBtn; LLButton *mRemoveImageBtn; + + LLHandle mPickerHandle; }; #endif // LL_LLFLOATERCHANGEITEMTHUMBNAIL_H -- cgit v1.2.3 From 6786e43fcb315eb10b5ab4a205163fb424c18bc6 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 21 Feb 2023 00:13:41 +0200 Subject: SL-19108 Managing inventory thumbnail --- indra/newview/llfloaterchangeitemthumbnail.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterchangeitemthumbnail.h') diff --git a/indra/newview/llfloaterchangeitemthumbnail.h b/indra/newview/llfloaterchangeitemthumbnail.h index 340d5cf05e..b3ae0a18f6 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.h +++ b/indra/newview/llfloaterchangeitemthumbnail.h @@ -55,9 +55,9 @@ public: private: - LLViewerInventoryItem* getItem(); + LLInventoryObject* getInventoryObject(); void refreshFromInventory(); - void refreshFromItem(LLViewerInventoryItem* item); + void refreshFromObject(LLInventoryObject* obj); static void onUploadLocal(void*); static void onUploadSnapshot(void*); -- cgit v1.2.3 From d6c0e40559fa090495b237bbbacf30578ac10aac Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 21 Feb 2023 17:53:47 +0200 Subject: SL-19108 Enabled Image changing floater for folders --- indra/newview/llfloaterchangeitemthumbnail.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterchangeitemthumbnail.h') diff --git a/indra/newview/llfloaterchangeitemthumbnail.h b/indra/newview/llfloaterchangeitemthumbnail.h index b3ae0a18f6..e40d649361 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.h +++ b/indra/newview/llfloaterchangeitemthumbnail.h @@ -65,6 +65,7 @@ private: static void onCopyToClipboard(void*); static void onPasteFromClipboard(void*); static void onRemove(void*); + static void onRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle handle); void showTexturePicker(const LLUUID &thumbnail_id); void onTexturePickerCommit(LLUUID id); -- cgit v1.2.3 From 4886682d0458f901fc5b24ed8b58300b93489ac9 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 22 Feb 2023 21:28:04 +0200 Subject: SL-19108 Multi instance snapshot floater --- indra/newview/llfloaterchangeitemthumbnail.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterchangeitemthumbnail.h') diff --git a/indra/newview/llfloaterchangeitemthumbnail.h b/indra/newview/llfloaterchangeitemthumbnail.h index e40d649361..250f895078 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.h +++ b/indra/newview/llfloaterchangeitemthumbnail.h @@ -98,5 +98,6 @@ private: LLButton *mRemoveImageBtn; LLHandle mPickerHandle; + LLHandle mSnapshotHandle; }; #endif // LL_LLFLOATERCHANGEITEMTHUMBNAIL_H -- cgit v1.2.3 From dd656390c3b6cbdfc6e88c8ff3e6a011238b6f6e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 25 Feb 2023 23:08:38 +0200 Subject: SL-19108 Only permit 64 to 256 px images for thumbnails --- indra/newview/llfloaterchangeitemthumbnail.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloaterchangeitemthumbnail.h') diff --git a/indra/newview/llfloaterchangeitemthumbnail.h b/indra/newview/llfloaterchangeitemthumbnail.h index 250f895078..bc85e4be0b 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.h +++ b/indra/newview/llfloaterchangeitemthumbnail.h @@ -67,6 +67,8 @@ private: static void onRemove(void*); static void onRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle handle); + static bool validateAsset(const LLUUID &asset_id); + void showTexturePicker(const LLUUID &thumbnail_id); void onTexturePickerCommit(LLUUID id); -- cgit v1.2.3 From 011ca928ca55b8358962353a8d5aa998212c4214 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 3 Mar 2023 21:30:34 +0200 Subject: SL-19282 Send update to server side --- indra/newview/llfloaterchangeitemthumbnail.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloaterchangeitemthumbnail.h') diff --git a/indra/newview/llfloaterchangeitemthumbnail.h b/indra/newview/llfloaterchangeitemthumbnail.h index bc85e4be0b..50c0c951d4 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.h +++ b/indra/newview/llfloaterchangeitemthumbnail.h @@ -72,6 +72,8 @@ private: void showTexturePicker(const LLUUID &thumbnail_id); void onTexturePickerCommit(LLUUID id); + void setThumbnailId(const LLUUID &new_thumbnail_id); + enum EToolTipState { TOOLTIP_NONE, -- cgit v1.2.3 From 8ed39a469b1b7337855c113f785fb64e66cf3b8f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 29 Mar 2023 21:30:46 +0300 Subject: SL-19504 Allow drag and drop of textures into thumbnail floater --- indra/newview/llfloaterchangeitemthumbnail.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'indra/newview/llfloaterchangeitemthumbnail.h') diff --git a/indra/newview/llfloaterchangeitemthumbnail.h b/indra/newview/llfloaterchangeitemthumbnail.h index 50c0c951d4..18cf2f7a85 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.h +++ b/indra/newview/llfloaterchangeitemthumbnail.h @@ -37,6 +37,7 @@ class LLTextBox; class LLThumbnailCtrl; class LLUICtrl; class LLViewerInventoryItem; +class LLViewerFetchedTexture; class LLFloaterChangeItemThumbnail : public LLFloater, public LLInventoryObserver, public LLVOInventoryListener { @@ -46,6 +47,18 @@ public: BOOL postBuild() override; void onOpen(const LLSD& key) override; + void onFocusReceived() override; + void onMouseEnter(S32 x, S32 y, MASK mask) override; + + BOOL handleDragAndDrop( + S32 x, + S32 y, + MASK mask, + BOOL drop, + EDragAndDropType cargo_type, + void *cargo_data, + EAcceptance *accept, + std::string& tooltip_msg) override; void changed(U32 mask) override; void inventoryChanged(LLViewerObject* object, @@ -67,7 +80,15 @@ private: static void onRemove(void*); static void onRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle handle); + void assignAndValidateAsset(const LLUUID &asset_id); static bool validateAsset(const LLUUID &asset_id); + static void onImageLoaded(BOOL success, + LLViewerFetchedTexture *src_vi, + LLImageRaw* src, + LLImageRaw* aux_src, + S32 discard_level, + BOOL final, + void* userdata); void showTexturePicker(const LLUUID &thumbnail_id); void onTexturePickerCommit(LLUUID id); -- cgit v1.2.3 From 77753a31aba6123696761aeeb2c535768fd1ea12 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 4 Apr 2023 02:08:23 +0300 Subject: SL-19188 Improve legacy gallery thumbnail support --- indra/newview/llfloaterchangeitemthumbnail.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterchangeitemthumbnail.h') diff --git a/indra/newview/llfloaterchangeitemthumbnail.h b/indra/newview/llfloaterchangeitemthumbnail.h index 18cf2f7a85..33bf2ecab5 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.h +++ b/indra/newview/llfloaterchangeitemthumbnail.h @@ -66,6 +66,8 @@ public: S32 serial_num, void* user_data) override; + static bool validateAsset(const LLUUID &asset_id); + private: LLInventoryObject* getInventoryObject(); @@ -80,8 +82,7 @@ private: static void onRemove(void*); static void onRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle handle); - void assignAndValidateAsset(const LLUUID &asset_id); - static bool validateAsset(const LLUUID &asset_id); + void assignAndValidateAsset(const LLUUID &asset_id, bool silent = false); static void onImageLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, @@ -113,6 +114,7 @@ private: EToolTipState mTooltipState; LLUUID mItemId; LLUUID mTaskId; + LLUUID mExpectingAssetId; LLIconCtrl *mItemTypeIcon; LLUICtrl *mItemNameText; -- cgit v1.2.3 From 8c0ad5425f4f7497fcb3973623d8620d7088e28a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 22 May 2023 22:14:58 +0300 Subject: SL-19748 Fix thumbnail not applying if floater was closed too fast --- indra/newview/llfloaterchangeitemthumbnail.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloaterchangeitemthumbnail.h') diff --git a/indra/newview/llfloaterchangeitemthumbnail.h b/indra/newview/llfloaterchangeitemthumbnail.h index 33bf2ecab5..de2a20bf2a 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.h +++ b/indra/newview/llfloaterchangeitemthumbnail.h @@ -95,6 +95,8 @@ private: void onTexturePickerCommit(LLUUID id); void setThumbnailId(const LLUUID &new_thumbnail_id); + static void setThumbnailId(const LLUUID& new_thumbnail_id, const LLUUID& object_id); + static void setThumbnailId(const LLUUID& new_thumbnail_id, const LLUUID& object_id, LLInventoryObject* obj); enum EToolTipState { -- cgit v1.2.3 From 7b9206dfd15ee90fde421525254b0a29d94f1ef2 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 22 Jul 2023 00:22:35 +0300 Subject: SL-20045 Texture picker should apply the exact texture inventory item --- indra/newview/llfloaterchangeitemthumbnail.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterchangeitemthumbnail.h') diff --git a/indra/newview/llfloaterchangeitemthumbnail.h b/indra/newview/llfloaterchangeitemthumbnail.h index de2a20bf2a..02f934337b 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.h +++ b/indra/newview/llfloaterchangeitemthumbnail.h @@ -92,7 +92,7 @@ private: void* userdata); void showTexturePicker(const LLUUID &thumbnail_id); - void onTexturePickerCommit(LLUUID id); + void onTexturePickerCommit(); void setThumbnailId(const LLUUID &new_thumbnail_id); static void setThumbnailId(const LLUUID& new_thumbnail_id, const LLUUID& object_id); -- cgit v1.2.3 From cfb69846f1e8309ed86d4a18eb26a889f6dbaccc Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 9 Sep 2023 00:00:22 +0300 Subject: SL-20261 Allow and resize existing textures as necessary for thumbnails --- indra/newview/llfloaterchangeitemthumbnail.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterchangeitemthumbnail.h') diff --git a/indra/newview/llfloaterchangeitemthumbnail.h b/indra/newview/llfloaterchangeitemthumbnail.h index 02f934337b..a91e9b8ee9 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.h +++ b/indra/newview/llfloaterchangeitemthumbnail.h @@ -83,13 +83,20 @@ private: static void onRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle handle); void assignAndValidateAsset(const LLUUID &asset_id, bool silent = false); - static void onImageLoaded(BOOL success, + static void onImageDataLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); + static void onFullImageLoaded(BOOL success, + LLViewerFetchedTexture* src_vi, + LLImageRaw* src, + LLImageRaw* aux_src, + S32 discard_level, + BOOL final, + void* userdata); void showTexturePicker(const LLUUID &thumbnail_id); void onTexturePickerCommit(); -- cgit v1.2.3