From: mkr Date: Thu, 9 Feb 2006 12:57:43 +0000 (+0000) Subject: Fixes for bugs: X-Git-Tag: mergeto_trunk_13Mar06~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d96e878718cde47fca6fa4dd8984fc11f201777c;p=modules%2Fsuperv.git Fixes for bugs: 1) PAL7037 : "Filter Notification" functionality doesn't work. 2) IPAL11547 : Porting: SIGSEGV after close "SUPERVISION" viewer. 3) IPAL11549 : Crash after trying to delete MacroNode. 4) IPAL11550 : Incorrect warning appears for the opened "SUPERVISION" viewer. --- diff --git a/src/SUPERVGUI/SUPERVGUI.cxx b/src/SUPERVGUI/SUPERVGUI.cxx index 4f75dfb..2442a96 100644 --- a/src/SUPERVGUI/SUPERVGUI.cxx +++ b/src/SUPERVGUI/SUPERVGUI.cxx @@ -692,8 +692,8 @@ bool SUPERVGUI::createDataflow( const NEW_DF_MODE mode, bool theInitialDF ) { else myInitialViewFrame = aViewFrame; } - else - registerGraph( f, main ); + // mkr : IPAL11550 : register graph not depend on creation mode + registerGraph( f, main ); main->resizeView( new QResizeEvent( aViewFrame->size(), aViewFrame->size() ) ); aViewFrame->show(); QFileInfo inf( f ); diff --git a/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx b/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx index 0ceb073..ca77bd9 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx +++ b/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx @@ -301,6 +301,29 @@ void SUPERVGUI_CanvasMacroNode::exportDataflow() } } +// mkr : IPAL11549 : before remove Macro Node we have to destroy +// all its opened sub-graphs +void SUPERVGUI_CanvasMacroNode::remove() +{ + SUPERV_Graph aGraph; + if (getEngine()->IsMacro()) { + SUPERV_Graph aMacro = getMacroNode(); + if (aMacro->IsStreamMacro()) + aGraph = aMacro->StreamObjRef(); + else + aGraph = aMacro->FlowObjRef(); + } + if (SUPERV_isNull(aGraph)) { + QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("WARNING"), tr("MSG_NOSUBGRAPH_TO_REMOVE")); + return; + } + else { + getMain()->destroySubGraph(aGraph->Name()); + } + + SUPERVGUI_CanvasNode::remove(); +} + //===================================================================== // Cell node: node for table view //===================================================================== diff --git a/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.h b/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.h index cd43afa..6094841 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.h +++ b/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.h @@ -34,6 +34,7 @@ class SUPERVGUI_CanvasMacroNode : public SUPERVGUI_CanvasComputeNode { virtual QPopupMenu* getPopupMenu(QWidget* theParent); public slots: + virtual void remove(); // mkr : IPAL11549 void openSubGraph(); void exportDataflow(); diff --git a/src/SUPERVGUI/SUPERVGUI_Main.cxx b/src/SUPERVGUI/SUPERVGUI_Main.cxx index 49c4b88..8b5ceba 100644 --- a/src/SUPERVGUI/SUPERVGUI_Main.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Main.cxx @@ -168,7 +168,7 @@ void SUPERVGUI_Main::init(SUIT_Desktop* theDesktop) { sync(); show(); - if ( myLogged && !myLogFileName.isEmpty() && QFile::exists( myLogFileName ) ) { + if ( myLogged && !myLogFileName.isEmpty() /*&& QFile::exists( myLogFileName )*/ ) { // mkr : PAL7037 myLogFile = fopen( myLogFileName.latin1(), "a" ); if ( myLogFile == NULL ) myLogged = false; @@ -194,7 +194,7 @@ SUPERVGUI_Main::~SUPERVGUI_Main() { SUIT_ViewManager* aVM = it.data()->getViewManager(); STD_Application* anApp = dynamic_cast( SUIT_Session::session()->activeApplication() ); if ( anApp ) anApp->removeViewManager(aVM); - if ( aVM ) delete aVM; + //if ( aVM ) delete aVM; // mkr : IPAL11547 } mySubGraphs.clear(); @@ -246,7 +246,7 @@ void SUPERVGUI_Main::filterNotification() { fclose( myLogFile ); } myLogFile = NULL; - if ( myLogged && !myLogFileName.isEmpty() && QFile::exists( myLogFileName ) ) { + if ( myLogged && !myLogFileName.isEmpty() /*&& QFile::exists( myLogFileName )*/ ) { // mkr : PAL7037 myLogFile = fopen( myLogFileName.latin1(), "a" ); if ( myLogFile == NULL ) { myLogged = false; @@ -489,9 +489,9 @@ void SUPERVGUI_Main::openSubGraph(SUPERV_CNode theNode, bool correct) if ( aStudyFrame ) { SUPERVGraph_ViewFrame* aViewFrame = dynamic_cast( aStudyFrame ); if( aViewFrame ) { - /*SUPERVGUI_Main* m = */new SUPERVGUI_Main(aViewFrame, - aSupMod->application()->desktop(),//getDesktop(), - aGraph); + new SUPERVGUI_Main(aViewFrame, + aSupMod->application()->desktop(),//getDesktop(), + aGraph); // connect(aStudyFrame, SIGNAL(sfStudyFrameClosing(QAD_StudyFrame*)), // this, SLOT(onSubGraphClosed(QAD_StudyFrame*))); connect(aSupMod->application()->desktop(), SIGNAL(windowActivated( SUIT_ViewWindow* )), @@ -510,6 +510,18 @@ void SUPERVGUI_Main::openSubGraph(SUPERV_CNode theNode, bool correct) } } +// mkr : IPAL11549 +void SUPERVGUI_Main::destroySubGraph(QString theSubGraphName) +{ + if ( mySubGraphs.contains(theSubGraphName) ) { + SUIT_ViewWindow* aStudyFrame = mySubGraphs[theSubGraphName]; + onSubGraphClosed(aStudyFrame); + SUIT_ViewManager* aVM = aStudyFrame->getViewManager(); + STD_Application* anApp = dynamic_cast( SUIT_Session::session()->activeApplication() ); + if ( anApp ) anApp->removeViewManager(aVM); + } +} + bool SUPERVGUI_Main::eventFilter( QObject* o, QEvent* e) { // workaround to get close event @@ -580,7 +592,9 @@ void SUPERVGUI_Main::onObjectCreatedDeleted() if ( aMainList->count() == 1 ) { SUPERVGUI_Main* aMain = dynamic_cast( aMainList->first() ); if ( aMain ) - if ( !QString(aMain->getDataflow()->getIOR()).compare(getDataflow()->getIOR()) // equal dataflows + if ( !CORBA::is_nil( aMain->getDataflow() ) + && + !QString(aMain->getDataflow()->getIOR()).compare(getDataflow()->getIOR()) // equal dataflows && aMain != this ) // not equal mains aMain->getCanvas()->merge(); @@ -1194,16 +1208,16 @@ void SUPERVGUI_Main::syncNotification() { long counter; char* date; long stamp; - + while (notification->Receive(&graph, &node, &type, &message, &sender, &counter, &date, &stamp)) { -// if (isFiltered(graph, node, type, message, sender, counter, date, stamp)) { + if (isFiltered(graph, node, type, message, sender, counter, date, stamp)) { // mkr : PAL7037 QString mess(""); mess += "NOTIF: "; mess += graph; mess += " / " ; mess += node; mess += " / " ; mess += type; mess += " / " ; mess += message; getMessage()->putMessage(mess.latin1()); -// }; + }; }; } @@ -1213,7 +1227,13 @@ bool SUPERVGUI_Main::isFiltered(char* graph, char* node, char* type, char* me bool b = false; if (strcmp(getDataflow()->Name(), graph) == 0) { SUPERVGUI_CanvasNode* n; - QObjectList* nodes = queryList("SUPERVGUI_CanvasNode"); + QObjectList* nodes; + // mkr : PAL7037 --> + if (myCurrentView == CANVASTABLE) + nodes = myArray->queryList("SUPERVGUI_CanvasNode"); + else + nodes = myCanvas->queryList("SUPERVGUI_CanvasNode"); + // mkr : PAL7037 <-- QObjectListIt i(*nodes); while ((n=(SUPERVGUI_CanvasNode*)i.current()) != 0) { ++i; diff --git a/src/SUPERVGUI/SUPERVGUI_Main.h b/src/SUPERVGUI/SUPERVGUI_Main.h index 146c90f..cd5496a 100644 --- a/src/SUPERVGUI/SUPERVGUI_Main.h +++ b/src/SUPERVGUI/SUPERVGUI_Main.h @@ -64,6 +64,7 @@ class SUPERVGUI_Main: public SUPERVGraph_View { void suspendResume(); //void stopRestart(); void openSubGraph(SUPERV_CNode theNode, bool correct = false); + void destroySubGraph(QString theSubGraphName); // mkr : IPAL11549 bool putDataStudy(SUPERV_Port port, const char* inout); diff --git a/src/SUPERVGUI/SUPERV_msg_en.po b/src/SUPERVGUI/SUPERV_msg_en.po index 95ee79d..b729f5d 100644 --- a/src/SUPERVGUI/SUPERV_msg_en.po +++ b/src/SUPERVGUI/SUPERV_msg_en.po @@ -420,6 +420,9 @@ msgstr "No Supervisor Window Has Been Selected to add new components" msgid "MSG_NOWINDOW_TO_EXPORT" msgstr "No Supervisor Window Has Been Selected to Export a Dataflow" +msgid "MSG_NOSUBGRAPH_TO_REMOVE" +msgstr "There is no sub-graph of this Macro node to remove" + msgid "MSG_CANT_LOAD_SUPERV" msgstr "Cannot Find or Load Supervisor Component"