summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewtexture.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2018-06-21 15:49:53 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2018-06-21 15:49:53 +0100
commit9d7b353cbb5c12cd74559a8f3a7365312f95d4d0 (patch)
treeb35c3e3eb0c9c93cea2c01248a3943d5c1277fa7 /indra/newview/llpreviewtexture.cpp
parent8abfd8da4fb222382437f4b547567fabc6f75cf8 (diff)
parentdc07de2f4a4c49d1877bf743b6f0d209392f6eb6 (diff)
merge
Diffstat (limited to 'indra/newview/llpreviewtexture.cpp')
-rw-r--r--indra/newview/llpreviewtexture.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp
index 12bcd89cb0..9d8be4b2fe 100644
--- a/indra/newview/llpreviewtexture.cpp
+++ b/indra/newview/llpreviewtexture.cpp
@@ -46,6 +46,7 @@
#include "lltextureview.h"
#include "llui.h"
#include "llviewerinventory.h"
+#include "llviewermenufile.h" // LLFilePickerReplyThread
#include "llviewertexture.h"
#include "llviewertexturelist.h"
#include "lluictrlfactory.h"
@@ -293,27 +294,27 @@ void LLPreviewTexture::saveAs()
if( mLoadingFullImage )
return;
- LLFilePicker& file_picker = LLFilePicker::instance();
- const LLInventoryItem* item = getItem() ;
- if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_TGAPNG, item ? LLDir::getScrubbedFileName(item->getName()) : LLStringUtil::null) )
- {
- // User canceled or we failed to acquire save file.
- return;
- }
- if(mPreviewToSave)
+ std::string filename = getItem() ? LLDir::getScrubbedFileName(getItem()->getName()) : LLStringUtil::null;
+ (new LLFilePickerReplyThread(boost::bind(&LLPreviewTexture::saveTextureToFile, this, _1), LLFilePicker::FFSAVE_TGAPNG, filename))->getFile();
+}
+
+void LLPreviewTexture::saveTextureToFile(const std::vector<std::string>& filenames)
+{
+ const LLInventoryItem* item = getItem();
+ if (item && mPreviewToSave)
{
mPreviewToSave = FALSE;
LLFloaterReg::showTypedInstance<LLPreviewTexture>("preview_texture", item->getUUID());
}
// remember the user-approved/edited file name.
- mSaveFileName = file_picker.getFirstFile();
+ mSaveFileName = filenames[0];
mLoadingFullImage = TRUE;
getWindow()->incBusyCount();
- mImage->forceToSaveRawImage(0) ;//re-fetch the raw image if the old one is removed.
- mImage->setLoadedCallback( LLPreviewTexture::onFileLoadedForSave,
- 0, TRUE, FALSE, new LLUUID( mItemUUID ), &mCallbackTextureList );
+ mImage->forceToSaveRawImage(0);//re-fetch the raw image if the old one is removed.
+ mImage->setLoadedCallback(LLPreviewTexture::onFileLoadedForSave,
+ 0, TRUE, FALSE, new LLUUID(mItemUUID), &mCallbackTextureList);
}
// virtual