X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fgenericgui%2FJM_EditSalomeResource.cxx;h=f0261499101698c100b07d12c442dcf37e8535c2;hb=1775e8747c6902e3e884a52e28bdba895a120e83;hp=bdab699346d49ac7227423eac7e50b821e32899f;hpb=52eb6635e86d2eba11fb4a8027f28bd710725a3b;p=modules%2Fjobmanager.git diff --git a/src/genericgui/JM_EditSalomeResource.cxx b/src/genericgui/JM_EditSalomeResource.cxx index bdab699..f026149 100644 --- a/src/genericgui/JM_EditSalomeResource.cxx +++ b/src/genericgui/JM_EditSalomeResource.cxx @@ -20,6 +20,8 @@ #include "JM_EditSalomeResource.hxx" #include "BL_Traces.hxx" +using namespace std; + JM::EditSalomeResource::EditSalomeResource(QWidget *parent, BL::SALOMEServices * salome_services, const std::string & resource_name) : QDialog(parent) { @@ -127,19 +129,19 @@ JM::EditSalomeResource::EditSalomeResource(QWidget *parent, BL::SALOMEServices * _iprotocol_line->addItem("blaunch"); _iprotocol_line->setCurrentIndex(0); - QLabel * batch_label = new QLabel("Batch:"); + QLabel * batch_label = new QLabel("Batch Manager:"); _batch_line = new QComboBox(this); - _batch_line->addItem("pbs"); - _batch_line->addItem("lsf"); - _batch_line->addItem("sge"); - _batch_line->addItem("ssh"); - _batch_line->addItem("ccc"); - _batch_line->addItem("slurm"); - _batch_line->addItem("ll"); - _batch_line->addItem("vishnu"); - _batch_line->addItem("oar"); - _batch_line->addItem("coorm"); - _batch_line->setCurrentIndex(-1); + _batch_line->addItem("None", "none"); + _batch_line->addItem("CCC", "ccc"); + _batch_line->addItem("LSF", "lsf"); + _batch_line->addItem("SGE", "sge"); + _batch_line->addItem("SLURM", "slurm"); + _batch_line->addItem("VISHNU", "vishnu"); + _batch_line->addItem("CooRM (limited support)", "coorm"); + _batch_line->addItem("LoadLeveler (limited support)", "ll"); + _batch_line->addItem("OAR (limited support)", "oar"); + _batch_line->addItem("PBS (limited support)", "pbs"); + _batch_line->setCurrentIndex(0); QLabel * mpiImpl_label = new QLabel("MPI impl:"); _mpiImpl_line = new QComboBox(this); @@ -240,29 +242,13 @@ JM::EditSalomeResource::get_infos() else _iprotocol_line->setCurrentIndex(-1); - std::string batch = resource_descr.batch.c_str(); - if (batch == "pbs") - _batch_line->setCurrentIndex(0); - else if (batch == "lsf") - _batch_line->setCurrentIndex(1); - else if (batch == "sge") - _batch_line->setCurrentIndex(2); - else if (batch == "ssh_batch") - _batch_line->setCurrentIndex(3); - else if (batch == "ccc") - _batch_line->setCurrentIndex(4); - else if (batch == "slurm") - _batch_line->setCurrentIndex(5); - else if (batch == "ll") - _batch_line->setCurrentIndex(6); - else if (batch == "vishnu") - _batch_line->setCurrentIndex(7); - else if (batch == "oar") - _batch_line->setCurrentIndex(8); - else if (batch == "coorm") - _batch_line->setCurrentIndex(9); - else - _batch_line->setCurrentIndex(-1); + for (int i=0 ; i<_batch_line->count() ; i++) + { + if (_batch_line->itemData(i).toString().toStdString() == resource_descr.batch) + { + _batch_line->setCurrentIndex(i); + } + } std::string mpiImpl = resource_descr.mpiImpl.c_str(); if (mpiImpl == "lam") @@ -344,26 +330,24 @@ JM::EditSalomeResource::accept() BL::ResourceDescr resource; // Text - resource.name = _name_line->text().toStdString(); - resource.hostname = _hostname_line->text().toStdString(); - resource.username = _username_line->text().toStdString(); - resource.applipath = _applipath_line->text().toStdString(); - resource.OS = _os_line->text().toStdString(); - resource.working_directory = _working_directory->text().toStdString(); + resource.name = _name_line->text().trimmed().toStdString(); + resource.hostname = _hostname_line->text().trimmed().toStdString(); + resource.username = _username_line->text().trimmed().toStdString(); + resource.applipath = _applipath_line->text().trimmed().toStdString(); + resource.OS = _os_line->text().trimmed().toStdString(); + resource.working_directory = _working_directory->text().trimmed().toStdString(); resource.can_launch_batch_jobs = (_can_launch_batch_jobs->checkState() == Qt::Checked); resource.can_run_containers = (_can_run_containers->checkState() == Qt::Checked); // Components int count = _componentList->count(); for (int i = 0; i < count; i++) - resource.componentList.push_back(_componentList->item(i)->text().toStdString()); + resource.componentList.push_back(_componentList->item(i)->text().trimmed().toStdString()); // ComboBox resource.protocol = _protocol_line->currentText().toStdString(); resource.iprotocol = _iprotocol_line->currentText().toStdString(); - resource.batch = _batch_line->currentText().toStdString(); - if (resource.batch == "ssh") - resource.batch = "ssh_batch"; + resource.batch = _batch_line->itemData(_batch_line->currentIndex()).toString().toStdString(); resource.mpiImpl = _mpiImpl_line->currentText().toStdString(); // QSpinBox