]> 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:34:00 +0000 (09:34 +0000)
committervsr <vsr@opencascade.com>
Wed, 7 Oct 2009 09:34:00 +0000 (09:34 +0000)
Additional fix

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

index 4cbc35756b618a5acc8d1fc553bf2f0df33e1250..79ca4826483e537b4dc112050ba31d91d8f31e58 100644 (file)
@@ -703,9 +703,8 @@ class DumpStudyFileValidator : public SUIT_FileValidator
 bool DumpStudyFileValidator::canSave(const QString& file)
 {
   QFileInfo fi( file );
-  QString name = fi.fileName(); 
   
-  if ( name.find( QRegExp("[-!?#*&]") ) != -1 || name.find( QRegExp("[0-9]")) == 0 ) {
+  if ( !QRegExp( "[A-Za-z_][A-Za-z0-9_]*" ).exactMatch( fi.baseName( true ) ) ) {
     SUIT_MessageBox::error1 ( parent(),
                              QObject::tr("WRN_WARNING"),
                              QObject::tr("WRN_FILE_NAME_BAD"),
index 70495b402bf7d14cf30ad66b5635f394ca33ddc2..8bb8908d228740c99fa14694c9f8f5b4145a5e24 100644 (file)
@@ -225,7 +225,7 @@ msgid "SalomeApp_Application::WRN_DUMP_STUDY_FAILED"
 msgstr "Dump study failed"
 
 msgid "WRN_FILE_NAME_BAD"
-msgstr "Please, enter a valid file name. The name should not contain any reserved characters or begin with a numeral."
+msgstr "Please, enter valid file name.\nPython file must include only letters, digits and underscores and start from letter or underscore."
 
 msgid "SAVE_POINT_OBJECT_TOOLTIP"
 msgstr "Saved GUI state: %1"