]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for bug IPAL9331 ( 3.0.0(debianex): CRASH after trying to import MED or XLS...
authormzn <mzn@opencascade.com>
Wed, 9 Nov 2005 09:37:28 +0000 (09:37 +0000)
committermzn <mzn@opencascade.com>
Wed, 9 Nov 2005 09:37:28 +0000 (09:37 +0000)
src/VISUGUI/VISU_msg_en.po
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_Tools.cxx

index 5598166fb9af2a00078e7a2e2beab6ef9056e4a7..21103895883abfeda51ddf636766f5217a97a31c 100644 (file)
@@ -21,6 +21,9 @@ msgstr "Cancel"
 msgid "WRN_VISU"
 msgstr "Post-Pro Warning"
 
+msgid "WRN_VISU_WARNING"
+msgstr "Warning"
+
 msgid "INF_DONE"
 msgstr " done"
 
index 4bb3a21ec7cff2ad0859a7310ded261a74f58086..c404df7fe2be89615cdf7dc253196c0c94bfdd1e 100644 (file)
@@ -164,7 +164,8 @@ VisuGUI::
 OnImportFromFile()
 {
   if(MYDEBUG) MESSAGE("VisuGUI::OnImportFromFile()");
-  CheckLock(GetCStudy(GetAppStudy(this)));
+  if ( CheckLock(GetCStudy(GetAppStudy(this))) )
+    return;
   SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
 
   QStringList aFilter;
@@ -219,7 +220,8 @@ OnExploreMEDFile()
 {
   if(MYDEBUG) MESSAGE("VisuGUI::OnExploreMEDFile()");
   _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
-  CheckLock(aStudy);
+  if ( CheckLock(aStudy) )
+    return;
 
   SALOME_MED::MED_Gen_var aGen = GetMEDEngine();
 
@@ -259,7 +261,8 @@ VisuGUI::
 OnImportTableFromFile()
 {
   if(MYDEBUG) MESSAGE("VisuGUI::OnImportTableFromFile()");
-  CheckLock(GetCStudy(GetAppStudy(this)));
+  if ( CheckLock(GetCStudy(GetAppStudy(this))) )
+    return;
 
   QStringList aFilter;
   aFilter.append( tr("FLT_TABLE_FILES") );
index 7dc5ded734063c6ad4f2c55ab3ae03d41776f9d5..9e45ffb9910d70cab2d74c591aa48f476a45de68 100644 (file)
@@ -102,7 +102,18 @@ namespace VISU
   CheckLock( _PTR(Study) theStudy )
   {
     if(IsStudyLocked(theStudy))
-      throw std::runtime_error(QObject::tr("WRN_STUDY_LOCKED").latin1());
+      {
+       SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
+         (SUIT_Session::session()->activeApplication());
+       if (anApp)
+         {
+           SUIT_MessageBox::warn1(anApp->desktop(),
+                                   QObject::tr("WRN_VISU_WARNING"),
+                                   QObject::tr("WRN_STUDY_LOCKED"),
+                                   QObject::tr("BUT_OK"));
+           return true;
+         }
+      }
     return false;
   }