]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
0020502: EDF 1097 ALL: Load script with a name starting with a number
authorvsr <vsr@opencascade.com>
Wed, 7 Oct 2009 09:20:34 +0000 (09:20 +0000)
committervsr <vsr@opencascade.com>
Wed, 7 Oct 2009 09:20:34 +0000 (09:20 +0000)
Additional fix

src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/resources/SalomeApp_msg_en.ts

index 01690dd80f29967c76b6cd0a38ed04345adc3c62..cad9a43cb7b5281aee9eaba5bc56bad2ce7040af 100644 (file)
@@ -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") );
index 51e3f870d042e3980a43844d5cfa98b2b4d019ef..0646238f98f29ada8c7c21d572b75537688cabf9 100644 (file)
@@ -26,7 +26,8 @@
     <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>