bool DumpStudyFileValidator::canSave(const QString& file, bool permissions)
{
QFileInfo fi( file );
- QString name = fi.fileName();
- if ( name.indexOf( QRegExp("[-!?#*&]") ) >= 0 || name.indexOf( QRegExp("[0-9]")) == 0 ) {
+ if ( !QRegExp( "[A-Za-z_][A-Za-z0-9_]*" ).exactMatch( fi.completeBaseName() ) ) {
SUIT_MessageBox::critical( parent(),
QObject::tr("WRN_WARNING"),
QObject::tr("WRN_FILE_NAME_BAD") );
<name>@default</name>
<message>
<source>WRN_FILE_NAME_BAD</source>
- <translation>Please, enter a valid file name. The name should not contain any reserved characters or begin with a numeral.</translation>
+ <translation>Please enter correct file name.
+Python file must include only letters, digits and underscores and start from letter or underscore.</translation>
</message>
<message>
<source>CLOSE_LOCKED_STUDY</source>