]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
0002760: External 20786 (Bug) Most recently used
authormgn <mgn@opencascade.com>
Wed, 6 May 2015 11:39:11 +0000 (14:39 +0300)
committermgn <mgn@opencascade.com>
Wed, 6 May 2015 11:39:11 +0000 (14:39 +0300)
src/STD/STD_Application.cxx
src/STD/resources/STD_msg_en.ts

index ec1e7b2ab46be860ef0a9fbfe9e2ead065195677..96ac8dc86f4fad9806aa839ab1fab73dd7af40e8 100755 (executable)
@@ -36,6 +36,7 @@
 #include <QStatusBar>
 #include <QCloseEvent>
 #include <QFileDialog>
+#include <QFileInfo>
 #include <QApplication>
 
 /*!Create and return new instance of STD_Application*/
@@ -321,9 +322,18 @@ void STD_Application::onOpenDoc()
 /*! \retval true, if document was opened successful, else false.*/
 bool STD_Application::onOpenDoc( const QString& aName )
 {
+  bool res = false;
+
+  if ( !QFileInfo( aName ).exists() )
+  {
+    SUIT_MessageBox::critical( desktop(), tr( "ERR_ERROR" ),
+      tr( "MSG_FILE_NOT_EXISTS" ).arg( aName ) );
+    return res;
+  }
+
   QApplication::setOverrideCursor( Qt::WaitCursor );
 
-  bool res = openAction( openChoice( aName ), aName );
+  res = openAction( openChoice( aName ), aName );
   
   QApplication::restoreOverrideCursor();
 
index e619c05e17194cb48d671b6646fa13a0d1c43405..46b4f09842ee9598253f8403bc69c3af808ae669 100644 (file)
@@ -463,5 +463,12 @@ Do you want to save changes?</translation>
         <source>CLOSE_QUESTION</source>
         <translation>Do you want to save study before closing?</translation>
     </message>
+    <message>
+      <source>MSG_FILE_NOT_EXISTS</source>
+      <translation>
+        Most recent file cannot be loaded.
+        File &quot;%1&quot; not exists.
+      </translation>
+    </message>
 </context>
 </TS>