]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
Fixes and default values in resource edition GUI V7_2_0b1
authorbarate <barate>
Tue, 2 Apr 2013 08:47:54 +0000 (08:47 +0000)
committerbarate <barate>
Tue, 2 Apr 2013 08:47:54 +0000 (08:47 +0000)
src/engine/BL_SALOMEServices.cxx
src/genericgui/JM_EditSalomeResource.cxx

index cbe60e29c2c48c3ece7c9eb76f838bf2bc1387da..3c97ee653f30034af306be1edd0322d49cb0c9ec 100644 (file)
@@ -215,11 +215,13 @@ BL::SALOMEServices::addResource(BL::ResourceDescr & new_resource)
   catch (const SALOME::SALOME_Exception & ex)
   {
     DEBMSG("SALOME Exception in addResource ! " << ex.details.text.in());
+    throw(BL::Exception(ex.details.text.in()));
   }
   catch (const CORBA::SystemException& ex)
   {
     DEBMSG("Receive SALOME System Exception: " << ex);
     DEBMSG("Check SALOME servers...");
+    throw(BL::Exception("SALOME System Exception"));
   }
 }
 
index 74d1f7f32b01b22bac806a07787f8d4f22dab4cb..1f9684970849420a8c15630850c88f3a44b07b20 100644 (file)
@@ -49,10 +49,11 @@ JM::EditSalomeResource::EditSalomeResource(QWidget *parent, BL::SALOMEServices *
   _protocol_line = new QComboBox(this);
   _protocol_line->addItem("ssh");
   _protocol_line->addItem("rsh");
+  _protocol_line->addItem("sh");
   _protocol_line->addItem("srun");
   _protocol_line->addItem("pbsdsh");
   _protocol_line->addItem("blaunch");
-  _protocol_line->setCurrentIndex(-1);
+  _protocol_line->setCurrentIndex(0);
 
   QLabel * componentList_label = new QLabel("Component List:");
   _add_button = new QPushButton("Add");
@@ -127,7 +128,7 @@ JM::EditSalomeResource::EditSalomeResource(QWidget *parent, BL::SALOMEServices *
   _iprotocol_line->addItem("srun");
   _iprotocol_line->addItem("pbsdsh");
   _iprotocol_line->addItem("blaunch");
-  _iprotocol_line->setCurrentIndex(-1);
+  _iprotocol_line->setCurrentIndex(0);
 
   QLabel * batch_label = new QLabel("Batch:");
   _batch_line = new QComboBox(this);
@@ -221,12 +222,14 @@ JM::EditSalomeResource::get_infos()
     _protocol_line->setCurrentIndex(0);
   else if(protocol == "rsh")
     _protocol_line->setCurrentIndex(1);
-  else if(protocol == "srun")
+  else if(protocol == "sh")
     _protocol_line->setCurrentIndex(2);
-  else if(protocol == "pbsdsh")
+  else if(protocol == "srun")
     _protocol_line->setCurrentIndex(3);
-  else if(protocol == "blaunch")
+  else if(protocol == "pbsdsh")
     _protocol_line->setCurrentIndex(4);
+  else if(protocol == "blaunch")
+    _protocol_line->setCurrentIndex(5);
   else
     _protocol_line->setCurrentIndex(-1);
 
@@ -376,8 +379,15 @@ JM::EditSalomeResource::accept()
       resource.hostname != "" &&
       resource.protocol != "")
   {
-    _salome_services->addResource(resource);
-    QDialog::accept();
+    try
+    {
+      _salome_services->addResource(resource);
+      QDialog::accept();
+    }
+    catch (const BL::Exception & ex)
+    {
+      QMessageBox::critical(this, "Error", QString("Cannot add resource: ") + ex.what());
+    }
   }
   else
   {