コード例 #1
0
/*!
 * Returns \a true if the scripts is correctly saved into the the given \a fileName. Otherwise,
 * returns \a false.
 *
 * \sa SaveAsScriptFile, SaveScript.
 */
bool CodeEditorWidget::SaveScriptFile( const QString& fileName )
{
	QTextDocument* document = codeEditor->document();

	QFile scriptFile( fileName );
	if( !scriptFile.open( QIODevice::WriteOnly) )
	{
		QMessageBox::warning( this, tr( "Tonatiuh warning" ),
									  tr( "Cannot open file %1." )
									.arg( fileName ) );
		return false;
	}

	QTextStream out( &scriptFile );
	out<<document->toPlainText();

	scriptFile.close();
	document->setModified( false );


	m_currentScritFileName = fileName;
	emit FileSaved( fileName );
	return true;
}
コード例 #2
0
void FileChanged(FILE_INFO *fi, HWND DisplayWindow, const TCHAR* szFileExtension)
{
	FileSaved(fi, TRUE, DisplayWindow, szFileExtension);
}