FIRE-22851: Show texture "Save as" file picker subsequently instead all at once
parent
fa666a29a4
commit
54d8422937
|
|
@ -2677,6 +2677,12 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
|
|||
{
|
||||
LLAppearanceMgr::instance().removeItemsFromAvatar(ids);
|
||||
}
|
||||
// <FS:Ansariel> FIRE-22851: Show texture "Save as" file picker subsequently instead all at once
|
||||
else if (action == "save_as") // "save_as" is only available for textures as of 01/08/2018
|
||||
{
|
||||
LLPreviewTexture::saveMultiple(ids);
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
else
|
||||
{
|
||||
std::set<LLFolderViewItem*>::iterator set_iter;
|
||||
|
|
|
|||
|
|
@ -383,21 +383,32 @@ BOOL LLPreviewTexture::canSaveAs() const
|
|||
// virtual
|
||||
void LLPreviewTexture::saveAs()
|
||||
{
|
||||
// <FS:PP> Allow to use user-defined default save format for textures
|
||||
// <FS:Ansariel> FIRE-22851: Show texture "Save as" file picker subsequently instead all at once
|
||||
// saveAs(LLPreviewTexture::FORMAT_TGA);
|
||||
saveAs(uuid_vec_t());
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
// <FS:Ansariel> FIRE-22851: Show texture "Save as" file picker subsequently instead all at once
|
||||
void LLPreviewTexture::saveAs(uuid_vec_t remaining_ids)
|
||||
{
|
||||
// <FS:PP> Allow to use user-defined default save format for textures
|
||||
if (!gSavedSettings.getBOOL("FSTextureDefaultSaveAsFormat"))
|
||||
{
|
||||
saveAs(LLPreviewTexture::FORMAT_TGA);
|
||||
saveAs(LLPreviewTexture::FORMAT_TGA, remaining_ids);
|
||||
}
|
||||
else
|
||||
{
|
||||
saveAs(LLPreviewTexture::FORMAT_PNG);
|
||||
saveAs(LLPreviewTexture::FORMAT_PNG, remaining_ids);
|
||||
}
|
||||
// </FS:PP>
|
||||
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
void LLPreviewTexture::saveAs(EFileformatType format)
|
||||
// <FS:Ansariel> FIRE-22851: Show texture "Save as" file picker subsequently instead all at once
|
||||
//void LLPreviewTexture::saveAs(EFileformatType format)
|
||||
void LLPreviewTexture::saveAs(EFileformatType format, uuid_vec_t remaining_ids)
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
if (mLoadingFullImage)
|
||||
return;
|
||||
|
|
@ -422,13 +433,13 @@ void LLPreviewTexture::saveAs(EFileformatType format)
|
|||
//std::string filename = getItem() ? LLDir::getScrubbedFileName(getItem()->getName()) : LLStringUtil::null;
|
||||
//(new LLFilePickerReplyThread(boost::bind(&LLPreviewTexture::saveTextureToFile, this, _1), LLFilePicker::FFSAVE_TGAPNG, filename))->getFile();
|
||||
std::string filename = getItem() ? checkFileExtension(LLDir::getScrubbedFileName(getItem()->getName()), format) : LLStringUtil::null;
|
||||
(new LLFilePickerReplyThread(boost::bind(&LLPreviewTexture::saveTextureToFile, this, _1, format, callback), saveFilter, filename))->getFile();
|
||||
(new LLFilePickerReplyThread(boost::bind(&LLPreviewTexture::saveTextureToFile, this, _1, format, callback, remaining_ids), saveFilter, filename))->getFile();
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
// <FS:Ansariel> Undo MAINT-2897 and use our own texture format selection
|
||||
//void LLPreviewTexture::saveTextureToFile(const std::vector<std::string>& filenames)
|
||||
void LLPreviewTexture::saveTextureToFile(const std::vector<std::string>& filenames, EFileformatType format, loaded_callback_func callback)
|
||||
void LLPreviewTexture::saveTextureToFile(const std::vector<std::string>& filenames, EFileformatType format, loaded_callback_func callback, uuid_vec_t remaining_ids)
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
const LLInventoryItem* item = getItem();
|
||||
|
|
@ -452,6 +463,9 @@ void LLPreviewTexture::saveTextureToFile(const std::vector<std::string>& filenam
|
|||
mImage->setLoadedCallback(callback,
|
||||
// </FS:Ansariel>
|
||||
0, TRUE, FALSE, new LLUUID(mItemUUID), &mCallbackTextureList);
|
||||
|
||||
// <FS:Ansariel> FIRE-22851: Show texture "Save as" file picker subsequently instead all at once
|
||||
saveMultiple(remaining_ids);
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
|
@ -1137,3 +1151,24 @@ void LLPreviewTexture::onButtonRefresh()
|
|||
destroy_texture(mImageID);
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
||||
// <FS:Ansariel> FIRE-22851: Show texture "Save as" file picker subsequently instead all at once
|
||||
//static
|
||||
void LLPreviewTexture::saveMultiple(uuid_vec_t ids)
|
||||
{
|
||||
if (ids.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LLUUID next_id = ids.front();
|
||||
ids.erase(ids.begin());
|
||||
|
||||
LLPreviewTexture* preview_texture = LLFloaterReg::getTypedInstance<LLPreviewTexture>("preview_texture", next_id);
|
||||
if (preview_texture)
|
||||
{
|
||||
preview_texture->openToSave();
|
||||
preview_texture->saveAs(ids);
|
||||
}
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
|
|
|||
|
|
@ -55,7 +55,11 @@ public:
|
|||
|
||||
virtual BOOL canSaveAs() const;
|
||||
virtual void saveAs();
|
||||
void saveAs(EFileformatType format);
|
||||
// <FS:Ansariel> FIRE-22851: Show texture "Save as" file picker subsequently instead all at once
|
||||
//void saveAs(EFileformatType format);
|
||||
virtual void saveAs(uuid_vec_t remaining_ids);
|
||||
void saveAs(EFileformatType format, uuid_vec_t remaining_ids = uuid_vec_t());
|
||||
// </FS:Ansariel<
|
||||
|
||||
virtual void loadAsset();
|
||||
virtual EAssetStatus getAssetStatus();
|
||||
|
|
@ -83,7 +87,7 @@ public:
|
|||
|
||||
// <FS:Ansariel> Undo MAINT-2897 and use our own texture format selection
|
||||
//void saveTextureToFile(const std::vector<std::string>& filenames);
|
||||
void saveTextureToFile(const std::vector<std::string>& filenames, EFileformatType format, loaded_callback_func callback);
|
||||
void saveTextureToFile(const std::vector<std::string>& filenames, EFileformatType format, loaded_callback_func callback, uuid_vec_t remaining_ids = uuid_vec_t());
|
||||
// </FS:Ansariel>
|
||||
|
||||
static void onSaveAsBtn(LLUICtrl* ctrl, void* data);
|
||||
|
|
@ -103,6 +107,9 @@ public:
|
|||
// <FS:Ansariel> FIRE-20150: Add refresh button to texture preview
|
||||
void onButtonRefresh();
|
||||
|
||||
// <FS:Ansariel> FIRE-22851: Show texture "Save as" file picker subsequently instead all at once
|
||||
static void saveMultiple(uuid_vec_t ids);
|
||||
|
||||
protected:
|
||||
void init();
|
||||
void populateRatioList();
|
||||
|
|
|
|||
Loading…
Reference in New Issue