From: vsr Date: Wed, 7 Oct 2009 09:20:34 +0000 (+0000) Subject: 0020502: EDF 1097 ALL: Load script with a name starting with a number X-Git-Tag: V5_1_3rc1~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5deb1b5c40e9f6333c4e8f60e7f76e63635914f7;p=modules%2Fgui.git 0020502: EDF 1097 ALL: Load script with a name starting with a number Additional fix --- diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 01690dd80..cad9a43cb 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -669,8 +669,7 @@ class DumpStudyFileValidator : public SUIT_FileValidator 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") ); diff --git a/src/SalomeApp/resources/SalomeApp_msg_en.ts b/src/SalomeApp/resources/SalomeApp_msg_en.ts index 51e3f870d..0646238f9 100644 --- a/src/SalomeApp/resources/SalomeApp_msg_en.ts +++ b/src/SalomeApp/resources/SalomeApp_msg_en.ts @@ -26,7 +26,8 @@ @default WRN_FILE_NAME_BAD - Please, enter a valid file name. The name should not contain any reserved characters or begin with a numeral. + Please enter correct file name. +Python file must include only letters, digits and underscores and start from letter or underscore. CLOSE_LOCKED_STUDY