diff options
author | maxim_productengine <mnikolenko@productengine.com> | 2018-05-31 14:59:31 +0300 |
---|---|---|
committer | maxim_productengine <mnikolenko@productengine.com> | 2018-05-31 14:59:31 +0300 |
commit | f2113a037c7215d0234652f6ae69c63e8b91df58 (patch) | |
tree | 89ef971c356cd0b1b707b99c1e155d4abcf2d28c /indra/newview/llpreviewtexture.cpp | |
parent | 31bfc7ff47c95a9fc9c23ed101a07c071d07daaa (diff) |
MAINT-8700 Remove obsolete code and update 'Save texture' file dialog
Diffstat (limited to 'indra/newview/llpreviewtexture.cpp')
-rw-r--r-- | indra/newview/llpreviewtexture.cpp | 25 |
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 |