Index: /Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/include/GWt_sectionToExecute.h
===================================================================
--- /Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/include/GWt_sectionToExecute.h	(revision 395)
+++ /Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/include/GWt_sectionToExecute.h	(revision 396)
@@ -4,13 +4,12 @@
 #include <Wt/WContainerWidget>
 #include <Wt/WComboBox>
-#include <Wt/WLineEdit>
+#include <Wt/WLabel>
+
+class GWt_softwarePanel;
 
 class GWt_sectionToExecute : public Wt::WContainerWidget
 {
     public :
-    GWt_sectionToExecute(Wt::WComboBox*,Wt::WComboBox*,Wt::WComboBox*);
-
-    /** DEPRECATED */
-    GWt_sectionToExecute(Wt::WLineEdit*,Wt::WLineEdit*,Wt::WComboBox*);
+    GWt_sectionToExecute(Wt::WComboBox*,Wt::WComboBox*,Wt::WComboBox*,GWt_softwarePanel* sPanel);
 
     ~GWt_sectionToExecute() {;}
@@ -22,12 +21,4 @@
     inline Wt::WString getLastElementCurrentText() {
         return lastElement->currentText();
-    }
-    
-    inline Wt::WString getFirstElementLineEditCurrentText() {
-        return firstElementLineEdit->text();
-    }
-    
-    inline Wt::WString getLastElementLineEditCurrentText() {
-        return lastElementLineEdit->text();
     }
     
@@ -51,16 +42,27 @@
     void setSoftwareElementCurrentSelection(Wt::WString);
     
-    void setFirstElementLineEditCurrentText(Wt::WString);
-    void setLastElementLineEditCurrentText(Wt::WString);
+    inline void setWarnings(Wt::WString warn){
+        warningsLabel_->setText(warn);
+        manageWarningsAndErrors();
+    }
+
+    inline void setErrors(Wt::WString err){
+        errorsLabel_->setText(err);
+        manageWarningsAndErrors();
+    }
 
     private :
+    
+    void manageWarningsAndErrors();
     Wt::WComboBox*  firstElement;
     Wt::WComboBox*  lastElement;
     Wt::WComboBox* software;
+    GWt_softwarePanel* softwarePanel;
 
-    /** DEPRECATED */
-    Wt::WLineEdit*  firstElementLineEdit;
-    Wt::WLineEdit*  lastElementLineEdit;
+    Wt::WLabel* errorsLabel_;
+    Wt::WLabel* warningsLabel_;
 
+    Wt::WContainerWidget* warningsContainer_;
+    Wt::WContainerWidget* errorsContainer_;
 };
 
Index: /Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_elementLigneFaisceau.cc
===================================================================
--- /Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_elementLigneFaisceau.cc	(revision 395)
+++ /Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_elementLigneFaisceau.cc	(revision 396)
@@ -18,5 +18,4 @@
 #include <Wt/WSignalMapper>
 #include <Wt/WText>
-#include <Wt/WImage>
 #include <Wt/WHBoxLayout>
 #include <Wt/WGridLayout>
Index: /Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc
===================================================================
--- /Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc	(revision 395)
+++ /Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc	(revision 396)
@@ -1,39 +1,96 @@
 #include <Wt/WText>
+#include <Wt/WVBoxLayout>
+#include <Wt/WHBoxLayout>
+#include <Wt/WContainerWidget>
+#include <Wt/WImage>
+
 #include "GWt_sectionToExecute.h"
+#include "GWt_softwarePanel.h"
 
-
-GWt_sectionToExecute::GWt_sectionToExecute(Wt::WComboBox* first,Wt::WComboBox* last,Wt::WComboBox* soft)
+GWt_sectionToExecute::GWt_sectionToExecute(Wt::WComboBox* first,Wt::WComboBox* last,Wt::WComboBox* soft,GWt_softwarePanel* sPanel)
 :WContainerWidget(),
 firstElement(first),
 lastElement(last),
-software(soft)
+software(soft),
+softwarePanel(sPanel)
 {
-    addWidget(new Wt::WText(" fromC : "));
-    addWidget(first);
-    addWidget(new Wt::WText(" toC : "));
-    addWidget(last);
-    addWidget(soft);
+    Wt::WGridLayout* mainContainerLayout = new Wt::WGridLayout();
+    
+    mainContainerLayout->addWidget(new Wt::WText(" from : "),0,0);
+    mainContainerLayout->addWidget(first,0,1);
+    mainContainerLayout->addWidget(new Wt::WText(" to : "),0,2);
+    mainContainerLayout->addWidget(last,0,3);
+    mainContainerLayout->addWidget(soft,0,4);
+
+    // add errors and warning layout
+    warningsContainer_ = new Wt::WContainerWidget();
+    errorsContainer_ = new Wt::WContainerWidget();
+
+    Wt::WContainerWidget* warningsAndErrorsContainer = new Wt::WContainerWidget();
+    Wt::WVBoxLayout* vLayoutContainer = new Wt::WVBoxLayout();
+
+    vLayoutContainer->addWidget(warningsContainer_);
+    vLayoutContainer->addWidget(errorsContainer_);
+    vLayoutContainer->addStretch (100);
+    
+    Wt::WHBoxLayout* hLayoutContainerWarnings = new Wt::WHBoxLayout();
+    Wt::WHBoxLayout* hLayoutContainerErrors = new Wt::WHBoxLayout();
+
+    
+    // fill containers
+    Wt::WImage* imgWarning = new WImage ("/htdocs/warning.png");
+    Wt::WImage* imgError = new WImage ("/htdocs/error.png");
+
+    // resize images
+    imgWarning->resize(20,20);
+    imgError->resize(20,20);
+    
+    warningsLabel_ = new Wt::WLabel("--warnings---");
+    errorsLabel_ = new Wt::WLabel("---errors--");
+
+    hLayoutContainerWarnings->addWidget(imgWarning);
+    hLayoutContainerWarnings->addWidget(warningsLabel_);
+    hLayoutContainerErrors->addWidget(imgError);
+    hLayoutContainerErrors->addWidget(errorsLabel_);
+
+    warningsAndErrorsContainer->addWidget(warningsLabel_);
+    warningsAndErrorsContainer->addWidget(errorsLabel_);
+    
+    
+    // set Layouts
+    warningsContainer_->setLayout(hLayoutContainerWarnings);
+    errorsContainer_->setLayout(hLayoutContainerErrors);
+    
+    warningsAndErrorsContainer->setLayout(vLayoutContainer);
+
+    // add warnings and errors containers
+    mainContainerLayout->addWidget(warningsAndErrorsContainer,0,5,2,1);
+    mainContainerLayout->addWidget(new WLabel("--"),1,1);
+
+    this->setLayout(mainContainerLayout);
+    
+    
+    firstElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
+    lastElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
+    software->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
 }
 
 
-GWt_sectionToExecute::GWt_sectionToExecute(Wt::WLineEdit* first,Wt::WLineEdit* last,Wt::WComboBox* soft)
-:WContainerWidget(),
-firstElementLineEdit(first),
-lastElementLineEdit(last),
-software(soft)
-{;
-    addWidget(new Wt::WText(" fromLE : "));
-    addWidget(first);
-    addWidget(new Wt::WText(" toLE : "));
-    addWidget(last);
-    addWidget(soft);
-}
-
-
-
 void GWt_sectionToExecute::setFirstElementCurrentSelection(Wt::WString txt){
+    for (int a=0; a< firstElement->count(); a++) {
+        if (firstElement->itemText(a) == txt) {
+            firstElement->setCurrentIndex (a);
+            return;
+        }
+    }
 }
 
 void GWt_sectionToExecute::setLastElementCurrentSelection(Wt::WString txt){
+    for (int a=0; a< lastElement->count(); a++) {
+        if (lastElement->itemText(a) == txt) {
+            lastElement->setCurrentIndex (a);
+            return;
+        }
+    }
 }
 
@@ -48,10 +105,15 @@
 
 
-void GWt_sectionToExecute::setFirstElementLineEditCurrentText(Wt::WString txt){
-    firstElementLineEdit->setText(txt);
+void GWt_sectionToExecute::manageWarningsAndErrors(){
+    if (warningsLabel_->text() == "") {
+        warningsContainer_->hide();
+    } else {
+        warningsContainer_->show();
+    }
+    if (errorsLabel_->text() == "") {
+        errorsContainer_->hide();
+    } else {
+        errorsContainer_->show();
+    }
+
 }
-
-void GWt_sectionToExecute::setLastElementLineEditCurrentText(Wt::WString txt){
-    lastElementLineEdit->setText(txt);
-}
-
Index: /Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
===================================================================
--- /Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc	(revision 395)
+++ /Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc	(revision 396)
@@ -128,16 +128,11 @@
   fillComboWithSoftwares(softCombo);
 
-  GWt_sectionToExecute* newSectionOld = new GWt_sectionToExecute(lineFrom, lineTo, softCombo);
-  GWt_sectionToExecute* newSection = new GWt_sectionToExecute(lineFromCombo, lineToCombo, softCombo);
+  GWt_sectionToExecute* newSection = new GWt_sectionToExecute(lineFromCombo, lineToCombo, softCombo,this);
 
   // push back on sections vector
-  sections.push_back(newSectionOld);
   sections.push_back(newSection);
 
   // push back on User interface
-  contenuSections_->addWidget(newSectionOld);
   contenuSections_->addWidget(newSection);
-
-    
 
 }
@@ -244,9 +239,8 @@
   string premier = dtmanage_->getLabelFromElementNumero(1);
   if (sections.size() > 0) {
-    sections[0]->setFirstElementLineEditCurrentText(premier);
-//...
-  }
-  
-  Wt::WString currentString =  sections[0]->getLastElementLineEditCurrentText();
+    sections[0]->setFirstElementCurrentSelection(premier);
+  }
+  
+  Wt::WString currentString =  sections[0]->getLastElementCurrentText();
   int current = dtmanage_->getNumeroFromElementLabel(currentString.toUTF8());
   
@@ -257,5 +251,5 @@
     currentString =  dtmanage_->getLabelFromElementNumero(current);
     if (sections.size() > 0) {
-      sections[0]->setLastElementLineEditCurrentText(currentString);
+      sections[0]->setLastElementCurrentSelection(currentString);
 //...
     }
@@ -275,8 +269,8 @@
         }
       
-      sections[a]->setFirstElementLineEditCurrentText(currentString);
-//...
+      sections[a]->setFirstElementCurrentSelection(currentString);
+
       // fin
-      string finString =  sections[a]->getLastElementLineEditCurrentText().toUTF8();
+      string finString =  sections[a]->getLastElementCurrentText().toUTF8();
       
       int numeroFin = dtmanage_->getNumeroFromElementLabel( finString);
@@ -294,4 +288,11 @@
     }
   //  exec_go_->setDisabled(false);
+
+  if (!areDataCoherent()) {
+    exec_go_->disable();
+  } else {
+    exec_go_->enable();
+  }
+
   return true;
 }
@@ -306,38 +307,38 @@
     
   for (int a = 0; a< sections.size(); a++)
-    {
-      string debString = sections[a]->getFirstElementLineEditCurrentText().toUTF8();
-      string finString = sections[a]->getLastElementLineEditCurrentText().toUTF8();
-      
-      int debut = pspa_->getBeamLine()->getAbstractElementIndexFromLabel(debString)+1; // FIXME : Should NOT be +1
-        int fin = pspa_->getBeamLine()->getAbstractElementIndexFromLabel(finString)+1; // FIXME : Should NOT be +1
-
-      nomDeLogiciel prog = nomDeLogiciel ( sections[a]->getSoftwareCurrentText().toUTF8());
-      dtmanage_->addSectionToExecute(pspa_->getBeamLine()->getAbstractElement(debut),
-                                     debut,
-                                     pspa_->getBeamLine()->getAbstractElement(fin),
-                                     fin,
-                                     dtmanage_->createSoftwareConnexion(prog));
-        
-      // check sections
-      for (int i=debut-1; i<fin; i++) {
-	if (pspa_->getBeamLine()) {
-	  if (pspa_->getBeamLine()->getAbstractElement(i)) {
-	    trivaluedBool tb = pspa_->getBeamLine()->getAbstractElement(i)->setSoftware(prog.getString());
-	    if (tb  == TBoolError ) {
-	      diagnostic += pspa_->getBeamLine()->getAbstractElement(i)->getNomdElement().getElementName() + " is not allowed with "+ prog.getString()+"\n ";
-	      caMarche = false;
-	      tbResume = tb;
-	    } else if ( tb == TBoolIgnore ) {
-	      diagnostic += pspa_->getBeamLine()->getAbstractElement(i)->getNomdElement().getElementName() + " will be ignored by  "+ prog.getString()+"\n ";
-	      if ( tbResume != TBoolError ) tbResume = tb;
-	    } else {
-	      pspa_->getBeamLine()->update(i);
-	    }
-	  }
-	}
+  {
+    string debString = sections[a]->getFirstElementCurrentText().toUTF8();
+    string finString = sections[a]->getLastElementCurrentText().toUTF8();
+    
+    int debut = pspa_->getBeamLine()->getAbstractElementIndexFromLabel(debString)+1; // FIXME : Should NOT be +1
+    int fin = pspa_->getBeamLine()->getAbstractElementIndexFromLabel(finString)+1; // FIXME : Should NOT be +1
+    
+    nomDeLogiciel prog = nomDeLogiciel ( sections[a]->getSoftwareCurrentText().toUTF8());
+    dtmanage_->addSectionToExecute(pspa_->getBeamLine()->getAbstractElement(debut),
+                                   debut,
+                                   pspa_->getBeamLine()->getAbstractElement(fin),
+                                   fin,
+                                   dtmanage_->createSoftwareConnexion(prog));
+    
+    // check sections
+    for (int i=debut-1; i<fin; i++) {
+      if (pspa_->getBeamLine()) {
+        if (pspa_->getBeamLine()->getAbstractElement(i)) {
+          trivaluedBool tb = pspa_->getBeamLine()->getAbstractElement(i)->setSoftware(prog.getString());
+          if (tb  == TBoolError ) {
+            diagnostic += pspa_->getBeamLine()->getAbstractElement(i)->getNomdElement().getElementName() + " is not allowed with "+ prog.getString()+"\n ";
+            caMarche = false;
+            tbResume = tb;
+          } else if ( tb == TBoolIgnore ) {
+            diagnostic += pspa_->getBeamLine()->getAbstractElement(i)->getNomdElement().getElementName() + " will be ignored by  "+ prog.getString()+"\n ";
+            if ( tbResume != TBoolError ) tbResume = tb;
+          } else {
+            pspa_->getBeamLine()->update(i);
+          }
+        }
       }
     }
-
+  }
+  
   if ( tbResume == TBoolError ) {
     GWt_dialog calculDialog("PSPA check execute : ERROR", diagnostic , GWt_dialog::Error,true,true);
@@ -375,14 +376,17 @@
     fillComboWithElements(sections[a]->getLastElement());
   }
-  
-  string premierText, dernierText;
-  if ( dtmanage_->getJobListSize() > 0 )
-  {
-    premierText = dtmanage_->getLabelFromElementNumero(1);
-      dernierText = dtmanage_->getLabelFromElementNumero( dtmanage_->getBeamLineSize() );
-      sections[0]->setFirstElementLineEditCurrentText(premierText);
-      sections[0]->setLastElementLineEditCurrentText(dernierText);
-//...
-    }
+  if (sections.size() == 0) {
+    return;
+  }
+  // the first element will always be the first element of the beamLine
+  sections[0]->getFirstElement()->setCurrentIndex(0);
+  
+  // the last element will always be the last element of the beamLine
+  sections[sections.size()-1]->getLastElement()->setCurrentIndex(sections[sections.size()-1]->getLastElement()->count());
+
+  // set default values
+
+  // update
+  updateSectionSelection();
 }
 
@@ -401,14 +405,11 @@
 {
 
-  if ( !updateSectionSelection() ) return;
-
-
-    if (!areDataCoherent()) {
-      //    GWt_dialog warningDialog("PSPA : verification des sections", " donnees incoherentes !", GWt_dialog::Error,true,true);
-      //    warningDialog.exec();
-      //    exec_go_->setDisabled(true);
+  if (!areDataCoherent()) {
+    //    GWt_dialog warningDialog("PSPA : verification des sections", " donnees incoherentes !", GWt_dialog::Error,true,true);
+    //    warningDialog.exec();
+    //    exec_go_->setDisabled(true);
     return;
-    }
-
+  }
+  
   GWt_console* console = NULL;
   if (static_cast<GWt_console*> (wApp->findWidget ("console"))) {
@@ -437,4 +438,7 @@
 void GWt_softwarePanel::fillComboWithElements(Wt::WComboBox* cBox) {
   if (cBox == NULL) return;
+
+  // get the last item selected
+  WString selectedString = cBox->currentText ();
   cBox->clear();
 
@@ -445,4 +449,10 @@
     }
   }
+  
+  for (int a=0; a<cBox->count(); a++) {
+    if (cBox->itemText (a) == selectedString) {
+      cBox->setCurrentIndex(a);
+    }
+  }
 }
 
