Use AIFilePicker everywhere.
Also upgrade the file picker filters with the new extensions found in the orginal file picker code of Singularity. Also improve AIFilePicker a bit: added hasFilename() and now deleting the statemachine automatically by default: it's no longer needed to call deleteMe from the callback.
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
#include "llagent.h"
|
||||
#include "llbutton.h"
|
||||
#include "llcombobox.h"
|
||||
#include "llfilepicker.h"
|
||||
#include "statemachine/aifilepicker.h"
|
||||
#include "llimagetga.h"
|
||||
#include "llinventoryview.h"
|
||||
#include "llinventory.h"
|
||||
@@ -380,15 +380,19 @@ void LLPreviewTexture::saveAs()
|
||||
if( mLoadingFullImage )
|
||||
return;
|
||||
|
||||
LLFilePicker& file_picker = LLFilePicker::instance();
|
||||
const LLViewerInventoryItem* item = getItem() ;
|
||||
if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_TGA, item ? LLDir::getScrubbedFileName(item->getName()) : LLStringUtil::null) )
|
||||
{
|
||||
// User canceled or we failed to acquire save file.
|
||||
AIFilePicker* filepicker = new AIFilePicker;
|
||||
filepicker->open(item ? LLDir::getScrubbedFileName(item->getName()) + ".tga" : LLStringUtil::null, FFSAVE_TGA, "", "image");
|
||||
filepicker->run(boost::bind(&LLPreviewTexture::saveAs_continued, this, item, filepicker));
|
||||
}
|
||||
|
||||
void LLPreviewTexture::saveAs_continued(LLViewerInventoryItem const* item, AIFilePicker* filepicker)
|
||||
{
|
||||
if (!filepicker->hasFilename())
|
||||
return;
|
||||
}
|
||||
|
||||
// remember the user-approved/edited file name.
|
||||
mSaveFileName = file_picker.getFirstFile();
|
||||
mSaveFileName = filepicker->getFilename();
|
||||
mLoadingFullImage = TRUE;
|
||||
getWindow()->incBusyCount();
|
||||
mImage->forceToSaveRawImage(0) ;//re-fetch the raw image if the old one is removed.
|
||||
|
||||
Reference in New Issue
Block a user