]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
EnvFile for YACSFile jobs new_launcher_alpha_091119
authorribes <ribes>
Wed, 18 Nov 2009 15:02:43 +0000 (15:02 +0000)
committerribes <ribes>
Wed, 18 Nov 2009 15:02:43 +0000 (15:02 +0000)
src/engine/BL_SALOMEServices.cxx
src/genericgui/BL_CreateJobWizard.cxx
src/genericgui/BL_CreateJobWizard.hxx
src/genericgui/BL_JobsManager_QT.cxx

index 7a053b866797eaad207c0d4185780294b4be469d..4ecb47bfffae440d5d1a94884a495fead5d7201d 100644 (file)
@@ -95,7 +95,6 @@ BL::SALOMEServices::create_job(BL::Job * job)
   {
     job_parameters->job_type = CORBA::string_dup("command");
     job_parameters->command = CORBA::string_dup(job->getCommand().c_str());
-    job_parameters->env_file = CORBA::string_dup(job->getEnvFile().c_str());
   }
   else if (job->getType() == BL::Job::YACS_SCHEMA)
   {
@@ -104,6 +103,7 @@ BL::SALOMEServices::create_job(BL::Job * job)
   }
 
   // Files
+  job_parameters->env_file = CORBA::string_dup(job->getEnvFile().c_str());
   BL::Job::FilesParam files = job->getFilesParameters();
   std::list<std::string>::iterator it;
   int i = 0;
index 6347db1b2c6680483ad6704df80c26d03f1a5345..ad54e2df89c9a78d2d674c8eebc26c4cd025d7a8 100644 (file)
@@ -85,9 +85,10 @@ BL::CreateJobWizard::end(int result)
     // Command Panel
     QString f_command = field("command").toString();
     command = f_command.toStdString();
+    
     QString f_env_file = field("env_file").toString();
     env_file = f_env_file.toStdString();
-    
+
     // Batch Panel
     QString f_batch_directory = field("batch_directory").toString();
     batch_directory = f_batch_directory.toStdString();
@@ -242,11 +243,20 @@ BL::YACSSchemaPage::YACSSchemaPage(QWidget * parent)
   registerField("yacs_file", _yacs_file_text);
   _yacs_file_text->setReadOnly(true);
 
+  QPushButton * command_env_file_button = new QPushButton(tr("Choose an environnement file"));
+  command_env_file_button->show();
+  connect(command_env_file_button, SIGNAL(clicked()), this, SLOT(choose_env_file()));
+  _line_env_file = new QLineEdit(this);
+  registerField("env_file", _line_env_file);
+  _line_env_file->setReadOnly(true);
+
   QVBoxLayout * main_layout = new QVBoxLayout;
   main_layout->addWidget(label);
   QGridLayout *layout = new QGridLayout;
   layout->addWidget(_yacs_file_button, 0, 0);
   layout->addWidget(_yacs_file_text, 0, 1);
+  layout->addWidget(command_env_file_button, 1, 0);
+  layout->addWidget(_line_env_file, 1, 1);
   main_layout->insertLayout(-1, layout);
   setLayout(main_layout);
 };
@@ -282,6 +292,18 @@ BL::YACSSchemaPage::choose_file()
   _yacs_file_text->setReadOnly(true);
 }
 
+void
+BL::YACSSchemaPage::choose_env_file()
+{
+  QString env_file = QFileDialog::getOpenFileName(this,
+                                                     tr("Open environnement file"), "",
+                                                     tr("sh (*.sh);;All Files (*)"));
+  _line_env_file->setReadOnly(false);
+  _line_env_file->setText(env_file);
+  _line_env_file->setReadOnly(true);
+}
+
+
 int 
 BL::YACSSchemaPage::nextId() const
 {
index c2a5022b6af8267959459c14b3fd61630a2436a8..3b36b2cebafe2f0f4da1bc4821ef255ee7616951 100644 (file)
@@ -119,10 +119,12 @@ namespace BL{
 
     public slots:
       void choose_file();
+      void choose_env_file();
 
     private:
       QPushButton * _yacs_file_button;
       QLineEdit * _yacs_file_text;
+      QLineEdit * _line_env_file;
   };
 
   class CommandMainPage: virtual public QWizardPage
index 0684cda489be82d35dd06d558ae84a4c5aef5f1a..bcd1e3342c91ecda4049542a52b92c3361e8650a 100644 (file)
@@ -161,6 +161,7 @@ BL::JobsManager_QT::create_job_wizard()
        // YACS schema job
        new_job->setType(BL::Job::YACS_SCHEMA);
        new_job->setYACSFile(wizard.yacs_file);
+       new_job->setEnvFile(wizard.env_file);
        BL::Job::BatchParam param;
        param.batch_directory = wizard.batch_directory;
        param.maximum_duration = wizard.maximum_duration;