Updated llinventory to something closer to V2's implementation. Mostly just restructuring.
Most the changes are due to InventoryObjectList* changing to LLInventoryObject::object_list_t*, LLInventoryItem::II_FLAGS* changing to LLInventoryItemFlags::II_FLAGS* and also const'ing. Certain perms for certain asset types(callcard&landmarks) have been laxed, as per LL's V2. LLInventoryType now does lookups mostly though new lldictionary class. LLLandmark using boost for callbacks, instead of custom class structure.
This commit is contained in:
@@ -1686,38 +1686,38 @@ void LLPreviewLSL::reshape(S32 width, S32 height, BOOL called_from_parent)
|
||||
gSavedSettings.setRect("PreviewScriptRect", getRect());
|
||||
}
|
||||
}
|
||||
// <edit>
|
||||
// virtual
|
||||
BOOL LLPreviewLSL::canSaveAs() const
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLPreviewLSL::saveAs()
|
||||
{
|
||||
std::string default_filename("untitled.lsl");
|
||||
const LLInventoryItem *item = getItem();
|
||||
if(item)
|
||||
{
|
||||
default_filename = LLDir::getScrubbedFileName(item->getName());
|
||||
}
|
||||
|
||||
LLFilePicker& file_picker = LLFilePicker::instance();
|
||||
if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_LSL, default_filename ) )
|
||||
{
|
||||
// User canceled or we failed to acquire save file.
|
||||
return;
|
||||
}
|
||||
// remember the user-approved/edited file name.
|
||||
std::string filename = file_picker.getFirstFile();
|
||||
|
||||
std::string utf8text = mScriptEd->mEditor->getText();
|
||||
LLFILE* fp = LLFile::fopen(filename, "wb");
|
||||
fputs(utf8text.c_str(), fp);
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
}
|
||||
// <edit>
|
||||
// virtual
|
||||
BOOL LLPreviewLSL::canSaveAs() const
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLPreviewLSL::saveAs()
|
||||
{
|
||||
std::string default_filename("untitled.lsl");
|
||||
const LLInventoryItem *item = getItem();
|
||||
if(item)
|
||||
{
|
||||
default_filename = LLDir::getScrubbedFileName(item->getName());
|
||||
}
|
||||
|
||||
LLFilePicker& file_picker = LLFilePicker::instance();
|
||||
if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_LSL, default_filename ) )
|
||||
{
|
||||
// User canceled or we failed to acquire save file.
|
||||
return;
|
||||
}
|
||||
// remember the user-approved/edited file name.
|
||||
std::string filename = file_picker.getFirstFile();
|
||||
|
||||
std::string utf8text = mScriptEd->mEditor->getText();
|
||||
LLFILE* fp = LLFile::fopen(filename, "wb");
|
||||
fputs(utf8text.c_str(), fp);
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
}
|
||||
// </edit>
|
||||
/// ---------------------------------------------------------------------------
|
||||
/// LLLiveLSLEditor
|
||||
@@ -1962,7 +1962,7 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new)
|
||||
DEFAULT_SCRIPT_NAME,
|
||||
DEFAULT_SCRIPT_DESC,
|
||||
LLSaleInfo::DEFAULT,
|
||||
LLInventoryItem::II_FLAGS_NONE,
|
||||
LLInventoryItemFlags::II_FLAGS_NONE,
|
||||
time_corrected());
|
||||
mAssetStatus = PREVIEW_ASSET_LOADED;
|
||||
}
|
||||
@@ -2637,36 +2637,36 @@ BOOL LLLiveLSLEditor::monoChecked() const
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// <edit>
|
||||
// virtual
|
||||
BOOL LLLiveLSLEditor::canSaveAs() const
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLLiveLSLEditor::saveAs()
|
||||
{
|
||||
std::string default_filename("untitled.lsl");
|
||||
const LLInventoryItem *item = getItem();
|
||||
if(item)
|
||||
{
|
||||
default_filename = LLDir::getScrubbedFileName(item->getName());
|
||||
}
|
||||
|
||||
LLFilePicker& file_picker = LLFilePicker::instance();
|
||||
if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_LSL, default_filename ) )
|
||||
{
|
||||
// User canceled or we failed to acquire save file.
|
||||
return;
|
||||
}
|
||||
// remember the user-approved/edited file name.
|
||||
std::string filename = file_picker.getFirstFile();
|
||||
|
||||
std::string utf8text = mScriptEd->mEditor->getText();
|
||||
LLFILE* fp = LLFile::fopen(filename, "wb");
|
||||
fputs(utf8text.c_str(), fp);
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
}
|
||||
// <edit>
|
||||
// virtual
|
||||
BOOL LLLiveLSLEditor::canSaveAs() const
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLLiveLSLEditor::saveAs()
|
||||
{
|
||||
std::string default_filename("untitled.lsl");
|
||||
const LLInventoryItem *item = getItem();
|
||||
if(item)
|
||||
{
|
||||
default_filename = LLDir::getScrubbedFileName(item->getName());
|
||||
}
|
||||
|
||||
LLFilePicker& file_picker = LLFilePicker::instance();
|
||||
if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_LSL, default_filename ) )
|
||||
{
|
||||
// User canceled or we failed to acquire save file.
|
||||
return;
|
||||
}
|
||||
// remember the user-approved/edited file name.
|
||||
std::string filename = file_picker.getFirstFile();
|
||||
|
||||
std::string utf8text = mScriptEd->mEditor->getText();
|
||||
LLFILE* fp = LLFile::fopen(filename, "wb");
|
||||
fputs(utf8text.c_str(), fp);
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
}
|
||||
// </edit>
|
||||
Reference in New Issue
Block a user