]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
Fixes for bugs:
authormkr <mkr@opencascade.com>
Thu, 9 Feb 2006 12:57:43 +0000 (12:57 +0000)
committermkr <mkr@opencascade.com>
Thu, 9 Feb 2006 12:57:43 +0000 (12:57 +0000)
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.

src/SUPERVGUI/SUPERVGUI.cxx
src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx
src/SUPERVGUI/SUPERVGUI_CanvasControlNode.h
src/SUPERVGUI/SUPERVGUI_Main.cxx
src/SUPERVGUI/SUPERVGUI_Main.h
src/SUPERVGUI/SUPERV_msg_en.po

index 4f75dfb09c80fcfbc246399f16d9127643861bfb..2442a9678132e3718b2dcb28396e6b0a3b5b889e 100644 (file)
@@ -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 );
index 0ceb073303d8f915604b223db8d7b9edd2f6e754..ca77bd9af8e2960c80979ccbdfa18c4f83577a3f 100644 (file)
@@ -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
 //=====================================================================
index cd43afae635a588f554f1458b5e3cfffa2c829ad..6094841351bde8e2b77915782bbf5b066049bae0 100644 (file)
@@ -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();
 
index 49c4b88b015ebfed807232726cb5355c68aadbac..8b5ceba1aa73ebeb5d464335a9c75d996e4181d4 100644 (file)
@@ -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<STD_Application*>( 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<SUPERVGraph_ViewFrame*>( 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<STD_Application*>( 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<SUPERVGUI_Main*>( 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;
index 146c90f1b07f6851b11e1df8cf2019dd95c4f0d8..cd5496a9ac8bba5bf7647a889fd88b8eebd97a35 100644 (file)
@@ -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);
 
index 95ee79d497184cee3063e2b526ad35f750d059b0..b729f5dc12395f6fb46a57880d2d6b003a057d30 100644 (file)
@@ -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"