]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
Fixed for bug PAL7960: calling Editing() in Main was moved "closer" to certain action...
authorasv <asv@opencascade.com>
Mon, 7 Feb 2005 06:27:21 +0000 (06:27 +0000)
committerasv <asv@opencascade.com>
Mon, 7 Feb 2005 06:27:21 +0000 (06:27 +0000)
src/SUPERVGUI/SUPERVGUI_Clipboard.cxx
src/SUPERVGUI/SUPERVGUI_Main.cxx
src/SUPERVGUI/SUPERVGUI_Service.cxx

index d286581b64672b12f7feb6a5729b90916ab0d315..4f20f9fab121634598a34860ddb48da8a0a41822 100644 (file)
@@ -136,9 +136,12 @@ QStringList getAllFunctions( SUPERV::Graph_var dataflow ) {
 void SUPERVGUI_Clipboard::pasteNode() {
   Trace("SUPERVGUI_Main::pasteNode");
   SUPERV::CNode_var aNode = getCopyNode();
-  if ( !CORBA::is_nil( aNode ) ) {
+  SUPERVGUI_Main* aMain = Supervision.getMain();
+  if ( !CORBA::is_nil( aNode ) && aMain ) {
     
-    SUPERV::Graph_var dataflow = Supervision.getMain()->getDataflow();
+    aMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag, why here? -> PAL7960
+
+    SUPERV::Graph_var dataflow = aMain->getDataflow();
 
     switch ( aNode->Kind() ) {
 
@@ -361,7 +364,11 @@ void SUPERVGUI_Clipboard::pasteNode() {
 void SUPERVGUI_Clipboard::pastePort( SUPERVGUI_CanvasNode* node )
 {
   SUPERV::Port_var aPort = getCopyPort();
-  if ( !CORBA::is_nil(aPort) ) {
+  SUPERVGUI_Main* aMain = Supervision.getMain();
+  if ( !CORBA::is_nil(aPort) && aMain ) {
+
+    aMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag, why here? -> PAL7960
+
     SUPERV::INode_var aNode = node->getInlineNode();
     if (!CORBA::is_nil(aNode)) {
       QString aName = aPort->Name();
index 6facd78b49bd46933246273098a907d64c16328d..d69ac8f54435c85d82906b33812430ca52d740de 100644 (file)
@@ -335,14 +335,15 @@ void SUPERVGUI_Main::insertFile() {
     Trace("SUPERVGUI_Main::insertFile");
     if ((SUPERV_isNull(dataflow))) return;
 
-    Editing(); // PAL6170: GUI->Engine: setting "Editing" flag 
-
     QString f = QAD_FileDlg::getFileName(QAD_Application::getDesktop(),
                                         "",
                                         "*.xml",
                                         tr("MSG_GRAPH_INSERT"),
                                         true);
-    if (!f.isEmpty()) {
+    if ( !f.isEmpty() ) { // not Cancel, but "OK" was pressed with valid file name
+      
+      Editing(); // PAL6170: GUI->Engine: setting "Editing" flag, why here? -> see 7960
+
       if (dataflow->Import(f.latin1())) {
        if (myCurrentView == CANVASTABLE) {
          myArray->destroy();
@@ -607,8 +608,7 @@ void SUPERVGUI_Main::addNode() {
       kill();
   }
   
-  Editing(); // PAL6170: GUI->Engine: setting "Editing" flag 
-
+  //Editing(); // PAL6170: GUI->Engine: setting "Editing" flag, commented: PAL7960
   Supervision.getBrowser()->choose();
 }
 
index 2bd81911ea933f8bef28ce9b5e491f244315c5b1..953784f9951db5c1f919afd85d3b60a8eb270af0 100644 (file)
@@ -945,9 +945,13 @@ SUPERVGUI_EditPythonDlg::SUPERVGUI_EditPythonDlg( bool isLoop )
  * PS theEndNode is passed only for Loop and Switch nodes (EndLoop and EndSwitch)
  */ 
 void SUPERVGUI_Service::addNode( SUPERV::CNode_var theNode, SUPERV::INode_var theEndNode, int& theX, int& theY )  {
-  if ( !CORBA::is_nil( theNode ) ) {
+  SUPERVGUI_Main* aMain = Supervision.getMain();
+
+  if ( !CORBA::is_nil( theNode ) && aMain ) {
+
+    aMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag, why here? -> PAL7960
+
     int cx, cy;   //to appear a new node in the top-left corner of the current viewport
-    SUPERVGUI_Main* aMain = Supervision.getMain();
 
     //2.8 point of improvements: Adding node to graph window with taking into account zoom factor
     QWMatrix aWM = aMain->getCanvasView()->worldMatrix();