From 8106dfbe22b18724ac21c1811427ae3e930fe768 Mon Sep 17 00:00:00 2001 From: prascle Date: Mon, 2 Feb 2004 21:18:13 +0000 Subject: [PATCH] PR: allow interactive and batch mode on Visu: different behavior for Mutex --- src/SALOMEGUI/QAD_Desktop.cxx | 6 ++++++ src/SALOMEGUI/SALOMEGUI_VisuMutex.cxx | 3 +++ src/SALOMEGUI/SALOMEGUI_VisuMutex.hxx | 3 ++- src/Session/SALOME_Session_i.cxx | 3 +++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/SALOMEGUI/QAD_Desktop.cxx b/src/SALOMEGUI/QAD_Desktop.cxx index 2c9111917..d003e66ff 100644 --- a/src/SALOMEGUI/QAD_Desktop.cxx +++ b/src/SALOMEGUI/QAD_Desktop.cxx @@ -71,6 +71,7 @@ using namespace std; #include "SALOMEGUI_CloseDlg.h" #include "SALOMEGUI_ActivateComponentDlg.h" +#include "SALOMEGUI_VisuMutex.hxx" // QT Includes #include @@ -1673,6 +1674,11 @@ bool QAD_Desktop::loadComponentData( const QString& compName ) } Engines::Component_var comp ; + if ( compName.compare("VISU") == 0 ) + { + VISU::Mutex::callFromGUI = 1; + } + if ( compName.compare("SUPERV") == 0 ) { comp = getEngine( "SuperVisionContainer", compName) ; } diff --git a/src/SALOMEGUI/SALOMEGUI_VisuMutex.cxx b/src/SALOMEGUI/SALOMEGUI_VisuMutex.cxx index 2ee92fcb8..3f90ff087 100644 --- a/src/SALOMEGUI/SALOMEGUI_VisuMutex.cxx +++ b/src/SALOMEGUI/SALOMEGUI_VisuMutex.cxx @@ -9,9 +9,12 @@ namespace VISU { static int mySCnt = 0; static int myQCnt = 0; + //static QMutex localMutex; //static QMutex localSMutex; + int VISU::Mutex::callFromGUI; + Mutex::Mutex(QMutex* theMutex, QApplication* theQApp, int theDelay) : myQApp(theQApp), myDelay(theDelay), myMutex(theMutex) { diff --git a/src/SALOMEGUI/SALOMEGUI_VisuMutex.hxx b/src/SALOMEGUI/SALOMEGUI_VisuMutex.hxx index 425b81af0..fd9710643 100644 --- a/src/SALOMEGUI/SALOMEGUI_VisuMutex.hxx +++ b/src/SALOMEGUI/SALOMEGUI_VisuMutex.hxx @@ -7,13 +7,14 @@ namespace VISU { - + class Mutex { QMutex* myMutex; QApplication* myQApp; int isQAppLocked, isSessionLocked, myDelay; public: + static int callFromGUI; Mutex(QMutex* theMutex, QApplication* theQApp, int theDelay = 0); ~Mutex(); }; diff --git a/src/Session/SALOME_Session_i.cxx b/src/Session/SALOME_Session_i.cxx index ba179e763..e267e55d1 100644 --- a/src/Session/SALOME_Session_i.cxx +++ b/src/Session/SALOME_Session_i.cxx @@ -33,6 +33,8 @@ using namespace std; #include "SALOME_NamingService.hxx" #include "SALOME_Session_QThread.hxx" +#include "SALOMEGUI_VisuMutex.hxx" + #include "QAD_Application.h" #include "QAD_Desktop.h" #include @@ -57,6 +59,7 @@ SALOME_Session_i::SALOME_Session_i(int argc, char ** argv, CORBA::ORB_ptr orb, P _runningStudies= 0 ; _orb = CORBA::ORB::_duplicate(orb) ; _poa = PortableServer::POA::_duplicate(poa) ; + VISU::Mutex::callFromGUI = 0; MESSAGE("constructor end"); } -- 2.39.2