summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-06-26 18:39:51 +0300
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-06-26 18:39:51 +0300
commit434f2ee512dc6edf4a6dfbafd7265d121038bf0b (patch)
treea5d4620741be8e40752785a9b9066fd0cb018b1d /indra/newview
parent97daf1ed1cb9b28905ddf8b9caa51b05975e9511 (diff)
SL-19918 "Save as" menu item is missing for textures in Gallery view
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorygallerymenu.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp
index 541fed8172..bca10b9c0e 100644
--- a/indra/newview/llinventorygallerymenu.cpp
+++ b/indra/newview/llinventorygallerymenu.cpp
@@ -42,6 +42,7 @@
#include "llmarketplacefunctions.h"
#include "llmenugl.h"
#include "llnotificationsutil.h"
+#include "llpreviewtexture.h"
#include "lltrans.h"
#include "llviewerfoldertype.h"
#include "llviewerwindow.h"
@@ -269,6 +270,15 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata, const LLU
show_on_map_cb(landmark);
}
}
+ else if ("save_as" == action)
+ {
+ LLPreviewTexture* preview_texture = LLFloaterReg::getTypedInstance<LLPreviewTexture>("preview_texture", selected_id);
+ if (preview_texture)
+ {
+ preview_texture->openToSave();
+ preview_texture->saveAs();
+ }
+ }
}
void LLInventoryGalleryContextMenu::onRename(const LLSD& notification, const LLSD& response)
@@ -620,6 +630,15 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men
}
}
}
+ if(obj->getType() == LLAssetType::AT_TEXTURE)
+ {
+ items.push_back(std::string("Save As"));
+ bool can_copy = selected_item && selected_item->checkPermissionsSet(PERM_ITEM_UNRESTRICTED);
+ if (!can_copy)
+ {
+ disabled_items.push_back(std::string("Save As"));
+ }
+ }
if (is_link)
{
items.push_back(std::string("Find Original"));