From b1bca449be9d5b2a84c9b1c8cf67fe8e126379f4 Mon Sep 17 00:00:00 2001 From: mpv Date: Tue, 14 Jun 2005 05:45:33 +0000 Subject: [PATCH] Patches from Paul for Debian --- src/SUPERVGUI/SUPERVGUI_Main.cxx | 40 ++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/src/SUPERVGUI/SUPERVGUI_Main.cxx b/src/SUPERVGUI/SUPERVGUI_Main.cxx index 0f8e787..7d48569 100644 --- a/src/SUPERVGUI/SUPERVGUI_Main.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Main.cxx @@ -59,6 +59,23 @@ using namespace std; #include #include +// PAL8065: san -- Safe access to widgets from secondary thread +typedef TVoidMemFunEvent TCanvasArrayEvent; +typedef TVoidMemFunEvent TCanvasEvent; + +class UpdateEvent : public SALOME_Event +{ + public: + UpdateEvent( QAD_Study* study, bool updSel = true ) : myStudy( study ), myUpdateSel( updSel ) {} + virtual void Execute(){ + if ( myStudy ) myStudy->updateObjBrowser( myUpdateSel ); + } + + private: + QAD_Study* myStudy; + bool myUpdateSel; +}; +// PAL8065: san SUPERVGUI_Main::SUPERVGUI_Main(SUPERVGraph_ViewFrame* theParent, QAD_Desktop* theDesktop, SUPERV_Graph theDataFlow ) : SUPERVGraph_View(theParent), @@ -283,14 +300,22 @@ void SUPERVGUI_Main::sync() { t += dataflow->Name(); setCaption(t); + + // PAL8065: san + MESSAGE("WANTED - ProcessVoidEvent( new UpdateEvent( study )) ;"); - study->updateObjBrowser(); if (myCurrentView == CANVASTABLE) { - myArray->sync(); - myArray->update(); + // PAL8065: san + MESSAGE("EXECUTED - ProcessVoidEvent( new TCanvasArrayEvent( myArray, &SUPERVGUI_CanvasArray::sync ) ); "); + ProcessVoidEvent( new TCanvasArrayEvent( myArray, &SUPERVGUI_CanvasArray::sync ) ); + MESSAGE("EXECUTED - ProcessVoidEvent( new TCanvasArrayEvent( myArray, &SUPERVGUI_CanvasArray::update ) ); "); + ProcessVoidEvent( new TCanvasArrayEvent( myArray, &SUPERVGUI_CanvasArray::update ) ); } else { - myCanvas->sync(); - myCanvas->update(); + // PAL8065: san + MESSAGE("EXECUTED - ProcessVoidEvent( new TCanvasEvent( myCanvas, &SUPERVGUI_Canvas::sync ) ); "); + ProcessVoidEvent( new TCanvasEvent( myCanvas, &SUPERVGUI_Canvas::sync ) ); + MESSAGE("EXECUTED - ProcessVoidEvent( new TCanvasEvent( myCanvas, &SUPERVGUI_Canvas::update ) ); "); + ProcessVoidEvent( new TCanvasEvent( myCanvas, &SUPERVGUI_Canvas::update ) ); } } @@ -893,7 +918,7 @@ void SUPERVGUI_Main::addDataflowToStudy() { Supervision.registerGraph(dataflow->getIOR(), this); if ( !myThread->running() ) - study->updateObjBrowser(); + MESSAGE("WANTED - study->updateObjBrowser(); "); } else { MESSAGE( "ERROR: failed to find or create dataflow SObject" ); @@ -1022,7 +1047,7 @@ bool SUPERVGUI_Main::putDataStudy( SUPERV_Port p, const char* inout ) { aBuilder->AbortCommand(); if ( !myThread->running() ) - study->updateObjBrowser(); + MESSAGE("WANTED - study->updateObjBrowser(); "); isIn = false; return true; @@ -1151,6 +1176,7 @@ void SUPERVGUI_Main::startTimer() { } void SUPERVGUI_Main::executionFinished() { + MESSAGE("EXECUTED - getStudy()->updateObjBrowser(); "); getStudy()->updateObjBrowser(); myCanvas->update(); myArray->update(); -- 2.39.2