MAINT-3852 FIXED Use script name in "Save as" dialog.

meow-7.2.2
Mnikolenko ProductEngine 2014-03-25 11:37:19 +02:00
parent 7aa2aeca93
commit bb0515db31
2 changed files with 5 additions and 1 deletions

View File

@ -1191,7 +1191,7 @@ void LLScriptEdCore::onBtnSaveToFile( void* userdata )
if( self->mSaveCallback )
{
LLFilePicker& file_picker = LLFilePicker::instance();
if( file_picker.getSaveFile( LLFilePicker::FFSAVE_SCRIPT ) )
if( file_picker.getSaveFile( LLFilePicker::FFSAVE_SCRIPT, self->mScriptName ) )
{
std::string filename = file_picker.getFirstFile();
std::string scriptText=self->mEditor->getText();
@ -1978,6 +1978,7 @@ void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType
mScriptEd->setScriptText(LLStringExplicit(&buffer[0]), TRUE);
mScriptEd->mEditor->makePristine();
mScriptEd->setScriptName(getItem()->getName());
}

View File

@ -110,6 +110,8 @@ public:
virtual bool hasAccelerators() const { return true; }
void setScriptName(const std::string& name){mScriptName = name;};
private:
void onBtnHelp();
void onBtnDynamicHelp();
@ -132,6 +134,7 @@ protected:
private:
std::string mSampleText;
std::string mScriptName;
LLTextEditor* mEditor;
void (*mLoadCallback)(void* userdata);
void (*mSaveCallback)(void* userdata, BOOL close_after_save);