Salome HOME
Bug fix: don't set "Loading" state for MacroNodes in InitialState() function (called...
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_CanvasControlNode.cxx
index a47a1402a980eb135ff7604c31bb2012c50fba76..9a81a1802e0faeca62ebf5554089cc69505db545 100644 (file)
@@ -13,11 +13,12 @@ using namespace std;
 #include "SUPERVGUI_Main.h"
 #include "SUPERVGUI.h"
 #include "SUPERVGUI_Canvas.h"
-#include "SUPERVGUI_ControlNode.h" // access to SelectInlineDlg
 
 #include "QAD_FileDlg.h"
 #include "QAD_Application.h"
 
+#include <qlayout.h>
+
 //=====================================================================
 // Compute node
 //=====================================================================
@@ -367,3 +368,53 @@ SUPERVGUI_CanvasCellEndNode::SUPERVGUI_CanvasCellEndNode( QObject* theParent,
   //set end cell for start cell as pair
   myPairCell->setPairCell(dynamic_cast<SUPERVGUI_CanvasCellNode*>(this));
 }
+
+//-----------------------------------------------------------
+//*************** Select Inline node dialog******************
+// Taken from SUPERVGUI_ControlNode.cxx without change
+//-----------------------------------------------------------
+
+SUPERVGUI_SelectInlineDlg::SUPERVGUI_SelectInlineDlg(SUPERVGUI_Main* theMain)  
+  :QDialog(theMain, 0, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+{
+  setSizeGripEnabled( true );
+  setCaption(tr("TIT_FUNC_PYTHON"));
+  QGridLayout* aMainLayout = new QGridLayout(this, 2, 2, 7, 4);
+
+  QLabel* aLabel = new QLabel("Connect to", this );
+  aMainLayout->addWidget(aLabel, 0, 0);
+
+  myCombo = new QComboBox(this);
+  myCombo->clear(); //for the additional check from GUI side for bug PAL7007
+  SUPERV_Nodes aNodesList = theMain->getDataflow()->Nodes();  
+  int i;
+  for (i = 0; i < aNodesList->INodes.length(); i++) {
+    myCombo->insertItem(QString(aNodesList->INodes[i]->Name()));
+  }
+  for (i = 0; i < aNodesList->LNodes.length(); i++) {
+    myCombo->insertItem(QString(aNodesList->LNodes[i]->Name()));
+  }
+  for (i = 0; i < aNodesList->SNodes.length(); i++) {
+    myCombo->insertItem(QString(aNodesList->SNodes[i]->Name()));
+  }
+  aMainLayout->addWidget(myCombo, 0, 1);
+
+  QGroupBox* aBtnBox = new QGroupBox( this );
+  aBtnBox->setColumnLayout( 0, Qt::Vertical );
+  aBtnBox->layout()->setSpacing( 0 ); aBtnBox->layout()->setMargin( 0 );
+  QHBoxLayout* aBtnLayout = new QHBoxLayout( aBtnBox->layout() );
+  aBtnLayout->setAlignment( Qt::AlignTop );
+  aBtnLayout->setSpacing( 6 ); aBtnLayout->setMargin( 11 );
+  
+  QPushButton* aOKBtn = new QPushButton( tr( "BUT_OK" ), aBtnBox );
+  connect( aOKBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
+  aBtnLayout->addWidget( aOKBtn );
+
+  aBtnLayout->addStretch();
+
+  QPushButton* aCancelBtn = new QPushButton( tr("BUT_CANCEL"), aBtnBox );
+  connect( aCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
+  aBtnLayout->addWidget( aCancelBtn );
+
+  aMainLayout->addMultiCellWidget(aBtnBox, 1, 1, 0, 1);
+}