From 5deb1b5c40e9f6333c4e8f60e7f76e63635914f7 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 7 Oct 2009 09:20:34 +0000 Subject: [PATCH] 0020502: EDF 1097 ALL: Load script with a name starting with a number Additional fix --- src/SalomeApp/SalomeApp_Application.cxx | 3 +-- src/SalomeApp/resources/SalomeApp_msg_en.ts | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) 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 -- 2.39.2