From a657b9b52d2818e2ba5b36ab3c58d0025dcb08e3 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 17 Feb 2024 01:28:42 +0200 Subject: jira-archive-internal#71115 Add Images to Objects in Bulk SL-20725 --- indra/newview/llfloaterchangeitemthumbnail.cpp | 175 ++++++++++++++++++++----- 1 file changed, 140 insertions(+), 35 deletions(-) (limited to 'indra/newview/llfloaterchangeitemthumbnail.cpp') diff --git a/indra/newview/llfloaterchangeitemthumbnail.cpp b/indra/newview/llfloaterchangeitemthumbnail.cpp index 0301627c15..c328c0b8f6 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.cpp +++ b/indra/newview/llfloaterchangeitemthumbnail.cpp @@ -52,26 +52,32 @@ class LLThumbnailImagePicker : public LLFilePickerThread { public: - LLThumbnailImagePicker(const LLUUID &item_id); - LLThumbnailImagePicker(const LLUUID &item_id, const LLUUID &task_id); + LLThumbnailImagePicker(const LLUUID &item_id, LLFloaterSimpleSnapshot::completion_t callback); + LLThumbnailImagePicker(const LLUUID &item_id, const LLUUID &task_id, LLFloaterSimpleSnapshot::completion_t callback); ~LLThumbnailImagePicker(); void notify(const std::vector& filenames) override; private: LLUUID mInventoryId; LLUUID mTaskId; + LLFloaterSimpleSnapshot::completion_t mCallback; }; -LLThumbnailImagePicker::LLThumbnailImagePicker(const LLUUID &item_id) +LLThumbnailImagePicker::LLThumbnailImagePicker(const LLUUID &item_id, + LLFloaterSimpleSnapshot::completion_t callback) : LLFilePickerThread(LLFilePicker::FFLOAD_IMAGE) , mInventoryId(item_id) + , mCallback(callback) { } -LLThumbnailImagePicker::LLThumbnailImagePicker(const LLUUID &item_id, const LLUUID &task_id) +LLThumbnailImagePicker::LLThumbnailImagePicker(const LLUUID &item_id, + const LLUUID &task_id, + LLFloaterSimpleSnapshot::completion_t callback) : LLFilePickerThread(LLFilePicker::FFLOAD_IMAGE) , mInventoryId(item_id) , mTaskId(task_id) + , mCallback(callback) { } @@ -91,7 +97,7 @@ void LLThumbnailImagePicker::notify(const std::vector& filenames) return; } - LLFloaterSimpleSnapshot::uploadThumbnail(file_path, mInventoryId, mTaskId); + LLFloaterSimpleSnapshot::uploadThumbnail(file_path, mInventoryId, mTaskId, mCallback); } LLFloaterChangeItemThumbnail::LLFloaterChangeItemThumbnail(const LLSD& key) @@ -152,18 +158,34 @@ BOOL LLFloaterChangeItemThumbnail::postBuild() void LLFloaterChangeItemThumbnail::onOpen(const LLSD& key) { - if (!key.has("item_id") && !key.isUUID()) + if (!key.has("item_id") && !key.isUUID() && !key.isArray()) { closeFloater(); } - if (key.isUUID()) + + mItemList.clear(); + if (key.isArray()) + { + if (key.size() > 30) + { + // incident avoidance + // Todo: Show notification + closeFloater(); + } + + for (LLSD::array_const_iterator it = key.beginArray(); it != key.endArray(); ++it) + { + mItemList.insert(it->asUUID()); + } + } + else if (key.isUUID()) { - mItemId = key.asUUID(); + mItemList.insert(key.asUUID()); } else { - mItemId = key["item_id"].asUUID(); + mItemList.insert(key["item_id"].asUUID()); mTaskId = key["task_id"].asUUID(); } @@ -221,7 +243,7 @@ void LLFloaterChangeItemThumbnail::changed(U32 mask) { //LLInventoryObserver - if (mTaskId.notNull() || mItemId.isNull()) + if (mTaskId.notNull() || mItemList.size() == 0) { // Task inventory or not set up yet return; @@ -229,13 +251,13 @@ void LLFloaterChangeItemThumbnail::changed(U32 mask) const std::set& mChangedItemIDs = gInventory.getChangedIDs(); std::set::const_iterator it; + const LLUUID expected_id = *mItemList.begin(); for (it = mChangedItemIDs.begin(); it != mChangedItemIDs.end(); it++) { - // set dirty for 'item profile panel' only if changed item is the item for which 'item profile panel' is shown (STORM-288) - if (*it == mItemId) + // check if there's a change we're interested in. + if (*it == expected_id) { - // if there's a change we're interested in. if ((mask & (LLInventoryObserver::LABEL | LLInventoryObserver::INTERNAL | LLInventoryObserver::REMOVE)) != 0) { refreshFromInventory(); @@ -255,6 +277,12 @@ void LLFloaterChangeItemThumbnail::inventoryChanged(LLViewerObject* object, LLInventoryObject* LLFloaterChangeItemThumbnail::getInventoryObject() { + if (mItemList.size() == 0) + { + return NULL; + } + + const LLUUID item_id = *mItemList.begin(); LLInventoryObject* obj = NULL; if (mTaskId.isNull()) { @@ -265,7 +293,7 @@ LLInventoryObject* LLFloaterChangeItemThumbnail::getInventoryObject() mObserverInitialized = true; } - obj = gInventory.getObject(mItemId); + obj = gInventory.getObject(item_id); } else { @@ -278,7 +306,7 @@ LLInventoryObject* LLFloaterChangeItemThumbnail::getInventoryObject() mObserverInitialized = false; } - obj = object->getInventoryObject(mItemId); + obj = object->getInventoryObject(item_id); } } return obj; @@ -357,7 +385,7 @@ void LLFloaterChangeItemThumbnail::refreshFromObject(LLInventoryObject* obj) LLInventoryModel::item_array_t items; // Not LLIsOfAssetType, because we allow links LLIsOutfitTextureType f; - gInventory.getDirectDescendentsOf(mItemId, cats, items, f); + gInventory.getDirectDescendentsOf(*mItemList.begin(), cats, items, f); if (1 == items.size()) { @@ -401,7 +429,16 @@ void LLFloaterChangeItemThumbnail::onUploadLocal(void *userdata) { LLFloaterChangeItemThumbnail *self = (LLFloaterChangeItemThumbnail*)userdata; - (new LLThumbnailImagePicker(self->mItemId, self->mTaskId))->getFile(); + LLUUID task_id = self->mTaskId; + uuid_set_t inventory_ids = self->mItemList; + (new LLThumbnailImagePicker( + *self->mItemList.begin(), + self->mTaskId, + [inventory_ids, task_id](const LLUUID& asset_id) + { + onUploadComplete(asset_id, task_id, inventory_ids); + } + ))->getFile(); LLFloater* floaterp = self->mPickerHandle.get(); if (floaterp) @@ -428,7 +465,7 @@ void LLFloaterChangeItemThumbnail::onUploadSnapshot(void *userdata) else { LLSD key; - key["item_id"] = self->mItemId; + key["item_id"] = *self->mItemList.begin(); key["task_id"] = self->mTaskId; LLFloaterSimpleSnapshot* snapshot_floater = (LLFloaterSimpleSnapshot*)LLFloaterReg::showInstance("simple_snapshot", key, true); if (snapshot_floater) @@ -436,6 +473,13 @@ void LLFloaterChangeItemThumbnail::onUploadSnapshot(void *userdata) self->addDependentFloater(snapshot_floater); self->mSnapshotHandle = snapshot_floater->getHandle(); snapshot_floater->setOwner(self); + LLUUID task_id = self->mTaskId; + uuid_set_t inventory_ids = self->mItemList; + snapshot_floater->setComplectionCallback( + [inventory_ids, task_id](const LLUUID& asset_id) + { + onUploadComplete(asset_id, task_id, inventory_ids); + }); } } @@ -532,7 +576,7 @@ void LLFloaterChangeItemThumbnail::onRemove(void *userdata) LLFloaterChangeItemThumbnail *self = (LLFloaterChangeItemThumbnail*)userdata; LLSD payload; - payload["item_id"] = self->mItemId; + payload["item_id"] = *self->mItemList.begin(); payload["object_id"] = self->mTaskId; LLNotificationsUtil::add("DeleteThumbnail", LLSD(), payload, boost::bind(&LLFloaterChangeItemThumbnail::onRemovalConfirmation, _1, _2, self->getHandle())); } @@ -551,7 +595,8 @@ void LLFloaterChangeItemThumbnail::onRemovalConfirmation(const LLSD& notificatio struct ImageLoadedData { LLUUID mThumbnailId; - LLUUID mObjectId; + LLUUID mTaskId; + uuid_set_t mItemIds; LLHandle mFloaterHandle; bool mSilent; // Keep image reference to prevent deletion on timeout @@ -581,7 +626,8 @@ void LLFloaterChangeItemThumbnail::assignAndValidateAsset(const LLUUID &asset_id mExpectingAssetId = asset_id; } ImageLoadedData *data = new ImageLoadedData(); - data->mObjectId = mItemId; + data->mTaskId = mTaskId; + data->mItemIds = mItemList; data->mThumbnailId = asset_id; data->mFloaterHandle = getHandle(); data->mSilent = silent; @@ -663,10 +709,13 @@ void LLFloaterChangeItemThumbnail::onImageDataLoaded( if (success) { - // Update the item, set it even if floater is dead + // Update items, set thumnails even if floater is dead if (validateAsset(data->mThumbnailId)) { - setThumbnailId(data->mThumbnailId, data->mObjectId); + for (const LLUUID& id : data->mItemIds) + { + setThumbnailId(data->mThumbnailId, data->mTaskId, id); + } } else if (!data->mSilent) { @@ -716,11 +765,22 @@ void LLFloaterChangeItemThumbnail::onFullImageLoaded( } else if (src_vi->getFullWidth() > LLFloaterSimpleSnapshot::THUMBNAIL_SNAPSHOT_DIM_MAX) { - LLFloaterSimpleSnapshot::uploadThumbnail(src, data->mObjectId, LLUUID::null); + LLUUID task_id = data->mTaskId; + uuid_set_t inventory_ids = data->mItemIds; + LLFloaterSimpleSnapshot::uploadThumbnail(src, + *data->mItemIds.begin(), + task_id, + [inventory_ids, task_id](const LLUUID& asset_id) + { + onUploadComplete(asset_id, task_id, inventory_ids); + }); } else { - setThumbnailId(data->mThumbnailId, data->mObjectId); + for (const LLUUID& id : data->mItemIds) + { + setThumbnailId(data->mThumbnailId, data->mTaskId, id); + } } } @@ -837,19 +897,33 @@ void LLFloaterChangeItemThumbnail::onTexturePickerCommit() && (texturep->getCachedRawImageLevel() == 0 || texturep->getRawImageLevel() == 0) && (texturep->isCachedRawImageReady() || texturep->isRawImageValid())) { + LLUUID task_id = mTaskId; + uuid_set_t inventory_ids = mItemList; + LLFloaterSimpleSnapshot::completion_t callback = + [inventory_ids, task_id](const LLUUID& asset_id) + { + onUploadComplete(asset_id, task_id, inventory_ids); + }; if (texturep->isRawImageValid()) { - LLFloaterSimpleSnapshot::uploadThumbnail(texturep->getRawImage(), mItemId, mTaskId); + LLFloaterSimpleSnapshot::uploadThumbnail(texturep->getRawImage(), + *mItemList.begin(), + mTaskId, + callback); } else { - LLFloaterSimpleSnapshot::uploadThumbnail(texturep->getCachedRawImage(), mItemId, mTaskId); + LLFloaterSimpleSnapshot::uploadThumbnail(texturep->getCachedRawImage(), + *mItemList.begin(), + mTaskId, + callback); } } else { ImageLoadedData* data = new ImageLoadedData(); - data->mObjectId = mItemId; + data->mTaskId = mTaskId; + data->mItemIds = mItemList; data->mThumbnailId = asset_id; data->mFloaterHandle = getHandle(); data->mSilent = false; @@ -873,6 +947,29 @@ void LLFloaterChangeItemThumbnail::onTexturePickerCommit() } } +//static +void LLFloaterChangeItemThumbnail::onUploadComplete(const LLUUID& asset_id, const LLUUID& task_id, const uuid_set_t& inventory_ids) +{ + if (asset_id.isNull()) + { + // failure + return; + } + uuid_set_t::iterator iter = inventory_ids.begin(); + uuid_set_t::iterator end = inventory_ids.end(); + if (iter == end) + { + LL_WARNS() << "Received empty item list!" << LL_ENDL; + } + else + { + iter++; // first element was set by upload + for (; iter != end; iter++) + { + setThumbnailId(asset_id, task_id, *iter); + } + } +} void LLFloaterChangeItemThumbnail::setThumbnailId(const LLUUID &new_thumbnail_id) { @@ -888,20 +985,28 @@ void LLFloaterChangeItemThumbnail::setThumbnailId(const LLUUID &new_thumbnail_id return; } - setThumbnailId(new_thumbnail_id, mItemId, obj); + for (const LLUUID &id : mItemList) + { + setThumbnailId(new_thumbnail_id, id, obj); + } } -void LLFloaterChangeItemThumbnail::setThumbnailId(const LLUUID& new_thumbnail_id, const LLUUID& object_id) +void LLFloaterChangeItemThumbnail::setThumbnailId(const LLUUID& new_thumbnail_id, const LLUUID& task_id, const LLUUID& inv_obj_id) { - LLInventoryObject* obj = gInventory.getObject(object_id); + if (task_id.notNull()) + { + LL_WARNS() << "Not supported" << LL_ENDL; + return; + } + LLInventoryObject* obj = gInventory.getObject(inv_obj_id); if (!obj) { return; } - setThumbnailId(new_thumbnail_id, object_id, obj); + setThumbnailId(new_thumbnail_id, inv_obj_id, obj); } -void LLFloaterChangeItemThumbnail::setThumbnailId(const LLUUID& new_thumbnail_id, const LLUUID& object_id, LLInventoryObject* obj) +void LLFloaterChangeItemThumbnail::setThumbnailId(const LLUUID& new_thumbnail_id, const LLUUID& inv_obj_id, LLInventoryObject* obj) { if (obj->getThumbnailUUID() != new_thumbnail_id) { @@ -919,12 +1024,12 @@ void LLFloaterChangeItemThumbnail::setThumbnailId(const LLUUID& new_thumbnail_id LLViewerInventoryCategory* view_folder = dynamic_cast(obj); if (view_folder) { - update_inventory_category(object_id, updates, NULL); + update_inventory_category(inv_obj_id, updates, NULL); } LLViewerInventoryItem* view_item = dynamic_cast(obj); if (view_item) { - update_inventory_item(object_id, updates, NULL); + update_inventory_item(inv_obj_id, updates, NULL); } } } -- cgit v1.2.3 From 11ded7b9a2451b711534f10187cd0d72628d9da0 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 20 Feb 2024 01:13:58 +0200 Subject: jira-archive-internal#71115 Add Images to Objects in Bulk #2 UI integration --- indra/newview/llfloaterchangeitemthumbnail.cpp | 101 +++++++++++++++++++++---- 1 file changed, 85 insertions(+), 16 deletions(-) (limited to 'indra/newview/llfloaterchangeitemthumbnail.cpp') diff --git a/indra/newview/llfloaterchangeitemthumbnail.cpp b/indra/newview/llfloaterchangeitemthumbnail.cpp index c328c0b8f6..cfdd7aa834 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.cpp +++ b/indra/newview/llfloaterchangeitemthumbnail.cpp @@ -103,6 +103,7 @@ void LLThumbnailImagePicker::notify(const std::vector& filenames) LLFloaterChangeItemThumbnail::LLFloaterChangeItemThumbnail(const LLSD& key) : LLFloater(key) , mObserverInitialized(false) + , mMultipleThumbnails(false) , mTooltipState(TOOLTIP_NONE) { } @@ -119,9 +120,11 @@ BOOL LLFloaterChangeItemThumbnail::postBuild() mItemTypeIcon = getChild("item_type_icon"); mThumbnailCtrl = getChild("item_thumbnail"); mToolTipTextBox = getChild("tooltip_text"); + mMultipleTextBox = getChild("multiple_lbl"); LLSD tooltip_text; mToolTipTextBox->setValue(tooltip_text); + mMultipleTextBox->setVisible(FALSE); LLButton *upload_local = getChild("upload_local"); upload_local->setClickedCallback(onUploadLocal, (void*)this); @@ -163,20 +166,33 @@ void LLFloaterChangeItemThumbnail::onOpen(const LLSD& key) closeFloater(); } - mItemList.clear(); + mMultipleThumbnails = false; if (key.isArray()) { - if (key.size() > 30) + if (key.size() > 50) { // incident avoidance - // Todo: Show notification + LLNotificationsUtil::add("ThumbnailSelectionTooLarge"); closeFloater(); } + LLUUID image_id; for (LLSD::array_const_iterator it = key.beginArray(); it != key.endArray(); ++it) { - mItemList.insert(it->asUUID()); + LLInventoryObject* obj = gInventory.getObject(it->asUUID()); + if (obj) + { + if (mItemList.empty()) + { + image_id = obj->getThumbnailUUID(); + } + mItemList.insert(it->asUUID()); + if (image_id != obj->getThumbnailUUID()) + { + mMultipleThumbnails = true; + } + } } } else if (key.isUUID()) @@ -189,6 +205,11 @@ void LLFloaterChangeItemThumbnail::onOpen(const LLSD& key) mTaskId = key["task_id"].asUUID(); } + if (mItemList.size() == 0) + { + closeFloater(); + } + refreshFromInventory(); } @@ -412,12 +433,44 @@ void LLFloaterChangeItemThumbnail::refreshFromObject(LLInventoryObject* obj) mRemoveImageBtn->setEnabled(thumbnail_id.notNull()); } } - mItemTypeIcon->setImage(icon_img); - mItemNameText->setValue(obj->getName()); + if (mItemList.size() == 1) + { + mItemTypeIcon->setImage(icon_img); + mItemTypeIcon->setVisible(TRUE); + mMultipleTextBox->setVisible(FALSE); + mItemNameText->setValue(obj->getName()); + mItemNameText->setToolTip(std::string()); + } + else + { + mItemTypeIcon->setVisible(FALSE); + mMultipleTextBox->setVisible(mMultipleThumbnails); + mItemNameText->setValue(getString("multiple_item_names")); + + // Display first five names as a tooltip + const S32 ITEMS_TO_SHOW = 5; + std::string items_str; + uuid_set_t::iterator iter = mItemList.begin(); + uuid_set_t::iterator end = mItemList.end(); + for (S32 i = 0; (iter != end) && (i < ITEMS_TO_SHOW); iter++, i++) + { + LLInventoryObject* pobj = gInventory.getObject(*iter); + if (pobj) + { + items_str += pobj->getName(); + items_str += '\n'; + } + } + if (mItemList.size() > ITEMS_TO_SHOW) + { + items_str += "..."; + } + mItemNameText->setToolTip(items_str); + } mThumbnailCtrl->setValue(thumbnail_id); - mCopyToClipboardBtn->setEnabled(thumbnail_id.notNull()); + mCopyToClipboardBtn->setEnabled(thumbnail_id.notNull() && !mMultipleThumbnails); mPasteFromClipboardBtn->setEnabled(LLClipboard::instance().hasContents()); // todo: some elements might not support setting thumbnails @@ -431,12 +484,13 @@ void LLFloaterChangeItemThumbnail::onUploadLocal(void *userdata) LLUUID task_id = self->mTaskId; uuid_set_t inventory_ids = self->mItemList; + LLHandle handle = self->getHandle(); (new LLThumbnailImagePicker( *self->mItemList.begin(), self->mTaskId, - [inventory_ids, task_id](const LLUUID& asset_id) + [inventory_ids, task_id, handle](const LLUUID& asset_id) { - onUploadComplete(asset_id, task_id, inventory_ids); + onUploadComplete(asset_id, task_id, inventory_ids, handle); } ))->getFile(); @@ -475,10 +529,11 @@ void LLFloaterChangeItemThumbnail::onUploadSnapshot(void *userdata) snapshot_floater->setOwner(self); LLUUID task_id = self->mTaskId; uuid_set_t inventory_ids = self->mItemList; + LLHandle handle = self->getHandle(); snapshot_floater->setComplectionCallback( - [inventory_ids, task_id](const LLUUID& asset_id) + [inventory_ids, task_id, handle](const LLUUID& asset_id) { - onUploadComplete(asset_id, task_id, inventory_ids); + onUploadComplete(asset_id, task_id, inventory_ids, handle); }); } } @@ -767,12 +822,13 @@ void LLFloaterChangeItemThumbnail::onFullImageLoaded( { LLUUID task_id = data->mTaskId; uuid_set_t inventory_ids = data->mItemIds; + LLHandle handle = data->mFloaterHandle; LLFloaterSimpleSnapshot::uploadThumbnail(src, *data->mItemIds.begin(), task_id, - [inventory_ids, task_id](const LLUUID& asset_id) + [inventory_ids, task_id, handle](const LLUUID& asset_id) { - onUploadComplete(asset_id, task_id, inventory_ids); + onUploadComplete(asset_id, task_id, inventory_ids, handle); }); } else @@ -899,10 +955,11 @@ void LLFloaterChangeItemThumbnail::onTexturePickerCommit() { LLUUID task_id = mTaskId; uuid_set_t inventory_ids = mItemList; + LLHandle handle = getHandle(); LLFloaterSimpleSnapshot::completion_t callback = - [inventory_ids, task_id](const LLUUID& asset_id) + [inventory_ids, task_id, handle](const LLUUID& asset_id) { - onUploadComplete(asset_id, task_id, inventory_ids); + onUploadComplete(asset_id, task_id, inventory_ids, handle); }; if (texturep->isRawImageValid()) { @@ -948,7 +1005,10 @@ void LLFloaterChangeItemThumbnail::onTexturePickerCommit() } //static -void LLFloaterChangeItemThumbnail::onUploadComplete(const LLUUID& asset_id, const LLUUID& task_id, const uuid_set_t& inventory_ids) +void LLFloaterChangeItemThumbnail::onUploadComplete(const LLUUID& asset_id, + const LLUUID& task_id, + const uuid_set_t& inventory_ids, + LLHandle handle) { if (asset_id.isNull()) { @@ -969,6 +1029,15 @@ void LLFloaterChangeItemThumbnail::onUploadComplete(const LLUUID& asset_id, cons setThumbnailId(asset_id, task_id, *iter); } } + if (!handle.isDead()) + { + LLFloaterChangeItemThumbnail* floater = (LLFloaterChangeItemThumbnail*)handle.get(); + if (floater) + { + floater->mMultipleThumbnails = false; + floater->mMultipleTextBox->setVisible(FALSE); + } + } } void LLFloaterChangeItemThumbnail::setThumbnailId(const LLUUID &new_thumbnail_id) -- cgit v1.2.3 From a5261a5fa8fad810ecb5c260d92c3e771822bf58 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 20 Feb 2024 23:46:23 +0100 Subject: Convert BOOL to bool in llui --- indra/newview/llfloaterchangeitemthumbnail.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfloaterchangeitemthumbnail.cpp') diff --git a/indra/newview/llfloaterchangeitemthumbnail.cpp b/indra/newview/llfloaterchangeitemthumbnail.cpp index cfdd7aa834..ca27739bd5 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.cpp +++ b/indra/newview/llfloaterchangeitemthumbnail.cpp @@ -114,7 +114,7 @@ LLFloaterChangeItemThumbnail::~LLFloaterChangeItemThumbnail() removeVOInventoryListener(); } -BOOL LLFloaterChangeItemThumbnail::postBuild() +bool LLFloaterChangeItemThumbnail::postBuild() { mItemNameText = getChild("item_name"); mItemTypeIcon = getChild("item_type_icon"); @@ -223,11 +223,11 @@ void LLFloaterChangeItemThumbnail::onMouseEnter(S32 x, S32 y, MASK mask) mPasteFromClipboardBtn->setEnabled(LLClipboard::instance().hasContents()); } -BOOL LLFloaterChangeItemThumbnail::handleDragAndDrop( +bool LLFloaterChangeItemThumbnail::handleDragAndDrop( S32 x, S32 y, MASK mask, - BOOL drop, + bool drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, @@ -257,7 +257,7 @@ BOOL LLFloaterChangeItemThumbnail::handleDragAndDrop( LL_DEBUGS("UserInput") << "dragAndDrop handled by LLFloaterChangeItemThumbnail " << getKey() << LL_ENDL; - return TRUE; + return true; } void LLFloaterChangeItemThumbnail::changed(U32 mask) -- cgit v1.2.3 From 60d3dd98a44230c21803c1606552ee098ed9fa7c Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 21 Feb 2024 21:05:14 +0100 Subject: Convert remaining BOOL to bool --- indra/newview/llfloaterchangeitemthumbnail.cpp | 44 +++++++++++++------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'indra/newview/llfloaterchangeitemthumbnail.cpp') diff --git a/indra/newview/llfloaterchangeitemthumbnail.cpp b/indra/newview/llfloaterchangeitemthumbnail.cpp index ca27739bd5..a119210a9f 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.cpp +++ b/indra/newview/llfloaterchangeitemthumbnail.cpp @@ -124,7 +124,7 @@ bool LLFloaterChangeItemThumbnail::postBuild() LLSD tooltip_text; mToolTipTextBox->setValue(tooltip_text); - mMultipleTextBox->setVisible(FALSE); + mMultipleTextBox->setVisible(false); LLButton *upload_local = getChild("upload_local"); upload_local->setClickedCallback(onUploadLocal, (void*)this); @@ -386,7 +386,7 @@ void LLFloaterChangeItemThumbnail::refreshFromObject(LLInventoryObject* obj) { setTitle(getString("title_item_thumbnail")); - icon_img = LLInventoryIcon::getIcon(item->getType(), item->getInventoryType(), item->getFlags(), FALSE); + icon_img = LLInventoryIcon::getIcon(item->getType(), item->getInventoryType(), item->getFlags(), false); mRemoveImageBtn->setEnabled(thumbnail_id.notNull() && ((item->getActualType() != LLAssetType::AT_TEXTURE) || (item->getAssetUUID() != thumbnail_id))); } else @@ -436,14 +436,14 @@ void LLFloaterChangeItemThumbnail::refreshFromObject(LLInventoryObject* obj) if (mItemList.size() == 1) { mItemTypeIcon->setImage(icon_img); - mItemTypeIcon->setVisible(TRUE); - mMultipleTextBox->setVisible(FALSE); + mItemTypeIcon->setVisible(true); + mMultipleTextBox->setVisible(false); mItemNameText->setValue(obj->getName()); mItemNameText->setToolTip(std::string()); } else { - mItemTypeIcon->setVisible(FALSE); + mItemTypeIcon->setVisible(false); mMultipleTextBox->setVisible(mMultipleThumbnails); mItemNameText->setValue(getString("multiple_item_names")); @@ -690,11 +690,11 @@ void LLFloaterChangeItemThumbnail::assignAndValidateAsset(const LLUUID &asset_id texturep->setLoadedCallback(onImageDataLoaded, MAX_DISCARD_LEVEL, // Don't need full image, just size data - FALSE, - FALSE, + false, + false, (void*)data, NULL, - FALSE); + false); } else { @@ -748,12 +748,12 @@ bool LLFloaterChangeItemThumbnail::validateAsset(const LLUUID &asset_id) //static void LLFloaterChangeItemThumbnail::onImageDataLoaded( - BOOL success, + bool success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, - BOOL final, + bool final, void* userdata) { if (!userdata) return; @@ -794,12 +794,12 @@ void LLFloaterChangeItemThumbnail::onImageDataLoaded( //static void LLFloaterChangeItemThumbnail::onFullImageLoaded( - BOOL success, + bool success, LLViewerFetchedTexture* src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, - BOOL final, + bool final, void* userdata) { if (!userdata) return; @@ -861,12 +861,12 @@ void LLFloaterChangeItemThumbnail::showTexturePicker(const LLUUID &thumbnail_id) thumbnail_id, thumbnail_id, thumbnail_id, - FALSE, - TRUE, + false, + true, "SELECT PHOTO", PERM_NONE, PERM_NONE, - FALSE, + false, NULL); mPickerHandle = floaterp->getHandle(); @@ -885,8 +885,8 @@ void LLFloaterChangeItemThumbnail::showTexturePicker(const LLUUID &thumbnail_id) } ); - texture_floaterp->setLocalTextureEnabled(FALSE); - texture_floaterp->setBakeTextureEnabled(FALSE); + texture_floaterp->setLocalTextureEnabled(false); + texture_floaterp->setBakeTextureEnabled(false); texture_floaterp->setCanApplyImmediately(false); texture_floaterp->setCanApply(false, true, false /*Hide 'preview disabled'*/); texture_floaterp->setMinDimentionsLimits(LLFloaterSimpleSnapshot::THUMBNAIL_SNAPSHOT_DIM_MIN); @@ -896,7 +896,7 @@ void LLFloaterChangeItemThumbnail::showTexturePicker(const LLUUID &thumbnail_id) floaterp->openFloater(); } - floaterp->setFocus(TRUE); + floaterp->setFocus(true); } void LLFloaterChangeItemThumbnail::onTexturePickerCommit() @@ -990,11 +990,11 @@ void LLFloaterChangeItemThumbnail::onTexturePickerCommit() texturep->setMinDiscardLevel(0); texturep->setLoadedCallback(onFullImageLoaded, 0, // Need best quality - TRUE, - FALSE, + true, + false, (void*)data, NULL, - FALSE); + false); texturep->forceToSaveRawImage(0); } return; @@ -1035,7 +1035,7 @@ void LLFloaterChangeItemThumbnail::onUploadComplete(const LLUUID& asset_id, if (floater) { floater->mMultipleThumbnails = false; - floater->mMultipleTextBox->setVisible(FALSE); + floater->mMultipleTextBox->setVisible(false); } } } -- cgit v1.2.3 From c95b4bf3ea2b681d6d05468b07e60fedb71fa2cf Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Mon, 10 Jun 2024 20:42:42 +0300 Subject: Post-merge - trim trailing whitespace --- indra/newview/llfloaterchangeitemthumbnail.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview/llfloaterchangeitemthumbnail.cpp') diff --git a/indra/newview/llfloaterchangeitemthumbnail.cpp b/indra/newview/llfloaterchangeitemthumbnail.cpp index 3a9612a354..3e2e7cb7a3 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.cpp +++ b/indra/newview/llfloaterchangeitemthumbnail.cpp @@ -1,25 +1,25 @@ -/** +/** * @file llfloaterchangeitemthumbnail.cpp * @brief LLFloaterChangeItemThumbnail class implementation * * $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$ */ @@ -96,7 +96,7 @@ void LLThumbnailImagePicker::notify(const std::vector& filenames) { return; } - + LLFloaterSimpleSnapshot::uploadThumbnail(file_path, mInventoryId, mTaskId, mCallback); } @@ -636,7 +636,7 @@ void LLFloaterChangeItemThumbnail::onRemove(void *userdata) LLNotificationsUtil::add("DeleteThumbnail", LLSD(), payload, boost::bind(&LLFloaterChangeItemThumbnail::onRemovalConfirmation, _1, _2, self->getHandle())); } -// static +// static void LLFloaterChangeItemThumbnail::onRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle handle) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); -- cgit v1.2.3