From a95f98a494e898a23762ae58499e5ec27c54bb40 Mon Sep 17 00:00:00 2001 From: mzn Date: Wed, 9 Nov 2005 09:37:28 +0000 Subject: [PATCH] Fix for bug IPAL9331 ( 3.0.0(debianex): CRASH after trying to import MED or XLS file in the locked ). --- src/VISUGUI/VISU_msg_en.po | 3 +++ src/VISUGUI/VisuGUI.cxx | 9 ++++++--- src/VISUGUI/VisuGUI_Tools.cxx | 13 ++++++++++++- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/VISUGUI/VISU_msg_en.po b/src/VISUGUI/VISU_msg_en.po index 5598166f..21103895 100644 --- a/src/VISUGUI/VISU_msg_en.po +++ b/src/VISUGUI/VISU_msg_en.po @@ -21,6 +21,9 @@ msgstr "Cancel" msgid "WRN_VISU" msgstr "Post-Pro Warning" +msgid "WRN_VISU_WARNING" +msgstr "Warning" + msgid "INF_DONE" msgstr " done" diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 4bb3a21e..c404df7f 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -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") ); diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index 7dc5ded7..9e45ffb9 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -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 + (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; } -- 2.39.2