summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-02-21 17:53:47 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-02-21 17:53:52 +0200
commitd6c0e40559fa090495b237bbbacf30578ac10aac (patch)
tree33b1b8dbcac847be5c646875b9021b71c2fe989b
parentd6f1ba31da4a40d62fe781419cdd7db9843f6a30 (diff)
SL-19108 Enabled Image changing floater for folders
-rw-r--r--indra/newview/llfloaterchangeitemthumbnail.cpp23
-rw-r--r--indra/newview/llfloaterchangeitemthumbnail.h1
-rw-r--r--indra/newview/llinventorybridge.cpp8
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml16
4 files changed, 43 insertions, 5 deletions
diff --git a/indra/newview/llfloaterchangeitemthumbnail.cpp b/indra/newview/llfloaterchangeitemthumbnail.cpp
index 2187fda7c7..378f5bc132 100644
--- a/indra/newview/llfloaterchangeitemthumbnail.cpp
+++ b/indra/newview/llfloaterchangeitemthumbnail.cpp
@@ -37,6 +37,7 @@
#include "llfloaterreg.h"
#include "llfloatersimplesnapshot.h"
#include "lllineeditor.h"
+#include "llnotificationsutil.h"
#include "lltextbox.h"
#include "lltexturectrl.h"
#include "llthumbnailctrl.h"
@@ -364,10 +365,26 @@ void LLFloaterChangeItemThumbnail::onPasteFromClipboard(void *userdata)
void LLFloaterChangeItemThumbnail::onRemove(void *userdata)
{
LLFloaterChangeItemThumbnail *self = (LLFloaterChangeItemThumbnail*)userdata;
- LLInventoryObject* item = self->getInventoryObject();
- if (item)
+
+ LLSD payload;
+ payload["item_id"] = self->mItemId;
+ payload["object_id"] = self->mTaskId;
+ LLNotificationsUtil::add("DeleteThumbnail", LLSD(), payload, boost::bind(&LLFloaterChangeItemThumbnail::onRemovalConfirmation, _1, _2, self->getHandle()));
+}
+
+// static
+void LLFloaterChangeItemThumbnail::onRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle<LLFloater> handle)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if (option == 0 && !handle.isDead() && !handle.get()->isDead())
{
- item->setThumbnailUUID(LLUUID::null);
+ LLFloaterChangeItemThumbnail* self = (LLFloaterChangeItemThumbnail*)handle.get();
+
+ LLInventoryObject* obj = self->getInventoryObject();
+ if (obj)
+ {
+ obj->setThumbnailUUID(LLUUID::null);
+ }
}
}
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<LLFloater> handle);
void showTexturePicker(const LLUUID &thumbnail_id);
void onTexturePickerCommit(LLUUID id);
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 664ba3e336..986ab88cda 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -881,7 +881,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
LLViewerInventoryItem* inv_item = gInventory.getItem(mUUID);
items.push_back(std::string("thumbnail"));
- if (!inv_item || !inv_item->getPermissions().allowOperationBy(PERM_MODIFY, gAgent.getID()))
+ if (inv_item && !inv_item->getPermissions().allowOperationBy(PERM_MODIFY, gAgent.getID()))
{
disabled_items.push_back(std::string("thumbnail"));
}
@@ -3289,6 +3289,12 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
return;
}
+ else if ("thumbnail" == action)
+ {
+ LLSD data(mUUID);
+ LLFloaterReg::showInstance("change_item_thumbnail", data);
+ return;
+ }
else if ("paste" == action)
{
pasteFromClipboard();
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index d1a99133f0..ceae31967e 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6094,7 +6094,21 @@ Are you sure you want to delete them?
notext="Cancel"
yestext="OK"/>
</notification>
-
+
+ <notification
+ icon="alertmodal.tga"
+ name="DeleteThumbnail"
+ type="alertmodal">
+ <unique/>
+ Delete the image for this item? There is no undo.
+ <tag>confirm</tag>
+ <usetemplate
+ ignoretext="Don't show me this again"
+ name="okcancelignore"
+ notext="Cancel"
+ yestext="Delete"/>
+ </notification>
+
<notification
icon="alertmodal.tga"
name="ConfirmUnlink"