From: vsr Date: Wed, 7 Oct 2009 09:34:00 +0000 (+0000) Subject: 0020502: EDF 1097 ALL: Load script with a name starting with a number X-Git-Tag: V4_1_0_maintainance_FINAL~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2c2721d0b98a193e01bfc8778755cac2632e0e8d;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 4cbc35756..79ca48264 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -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"), diff --git a/src/SalomeApp/resources/SalomeApp_msg_en.po b/src/SalomeApp/resources/SalomeApp_msg_en.po index 70495b402..8bb8908d2 100644 --- a/src/SalomeApp/resources/SalomeApp_msg_en.po +++ b/src/SalomeApp/resources/SalomeApp_msg_en.po @@ -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"