Salome HOME
Feature #86: The hierarchy in the Object Browser (T 19).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_CalculationDlg.cxx
index 76c0a83d071d33b2eb886a79c36a080127366f4c..42ba2cbf9f7c76f1ecea73970530269d3e36d58d 100644 (file)
@@ -77,6 +77,8 @@ void HYDROGUI_CalculationDlg::reset()
 {
   myObjectName->clear();
   myGeomObjects->clear();
+  myPolylineName->clear();
+  myAvailableGeomObjects->clear();
 }
 
 QWizardPage* HYDROGUI_CalculationDlg::createObjectsPage() {
@@ -92,6 +94,8 @@ QWizardPage* HYDROGUI_CalculationDlg::createObjectsPage() {
   connect( myValidator, SIGNAL( alreadyExists( QString ) ), SLOT( onAlreadyExists( QString ) ) );
 
   myPolylineName = new QComboBox( aPage );
+  connect( myPolylineName, SIGNAL( activated( const QString & ) ), 
+    SIGNAL( boundarySelected( const QString & ) ) );
 
   myGeomObjects = new QListWidget( aPage );
   myGeomObjects->setSelectionMode( QListWidget::SingleSelection );
@@ -348,6 +352,23 @@ void HYDROGUI_CalculationDlg::excludeGeomObjects( const QStringList& theObjects
   }
 }
 
+void HYDROGUI_CalculationDlg::setBoundary( const QString& theObjName )
+{
+  bool isBlocked = myPolylineName->blockSignals( true );
+  myPolylineName->setCurrentIndex( myPolylineName->findText( theObjName ) );
+  myPolylineName->blockSignals( isBlocked );
+}
+
+void HYDROGUI_CalculationDlg::setPolylineNames( const QStringList& theObjects, const QStringList& theObjectsEntries )
+{
+  myPolylineName->clear();
+  myPolylineName->addItem( "", "" ); // No boundary item
+
+  for ( int i = 0, n = theObjects.length(); i < n; ++i )
+  {
+    myPolylineName->addItem( theObjects.at( i ), theObjectsEntries.at( i ) );
+  }
+}
 void HYDROGUI_CalculationDlg::setAllGeomObjects( const QStringList& theObjects, const QStringList& theObjectsEntries )
 {
   myAvailableGeomObjects->clear();