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:
Aleric Inglewood
2011-05-10 04:27:57 +02:00
parent 81550aa6de
commit e0b0fa4f58
49 changed files with 1097 additions and 564 deletions

View File

@@ -91,6 +91,7 @@
#include "llinventorybackup.h"
//#include "llcheats.h"
//#include "llnotecardmagic.h"
#include "statemachine/aifilepicker.h"
// </edit>
const std::string NEW_LSL_NAME = "New Script"; // *TODO:Translate? (probably not)
@@ -569,14 +570,19 @@ class LLLoadInvCacheFloater : public inventory_listener_t
{
LLInventoryModel* model = mPtr->getPanel()->getModel();
if(!model) return false;
LLFilePicker& file_picker = LLFilePicker::instance();
if(file_picker.getOpenFile( LLFilePicker::FFLOAD_INVGZ ))
{
std::string file_name = file_picker.getFirstFile();
LLLocalInventory::loadInvCache(file_name);
}
AIFilePicker* filepicker = new AIFilePicker;
filepicker->open(FFLOAD_INVGZ, "", "invgz");
filepicker->run(boost::bind(&LLLoadInvCacheFloater::filepicker_callback, this, filepicker));
return true;
}
void filepicker_callback(AIFilePicker* filepicker)
{
if(filepicker->hasFilename())
{
LLLocalInventory::loadInvCache(filepicker->getFilename());
}
}
};
class LLRefreshInvModel : public inventory_listener_t