]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
Redesign two wizard pages as UI files with QT designer to facilitate further evolutions
authorbarate <barate>
Tue, 17 Sep 2013 16:25:38 +0000 (16:25 +0000)
committerbarate <barate>
Tue, 17 Sep 2013 16:25:38 +0000 (16:25 +0000)
src/genericgui/BL_CreateJobWizard.cxx
src/genericgui/BL_CreateJobWizard.hxx
src/genericgui/FilesWizardPage.ui [new file with mode: 0644]
src/genericgui/Makefile.am
src/genericgui/ResourceRequirementsWizardPage.ui [new file with mode: 0644]

index 646d253a65cb5c584999e21cff2e59e4d6c59bc6..2152d41ae5ed01168a51340bdad83fc3627a34c8 100644 (file)
@@ -27,6 +27,9 @@
 #include <stdlib.h>
 #include <time.h>
 
+#include <ui_ResourceRequirementsWizardPage.hxx>
+#include <ui_FilesWizardPage.hxx>
+
 #ifdef WNT
 #undef ERROR
 #endif
@@ -72,12 +75,12 @@ BL::CreateJobWizard::CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALO
   _job_name_page = new BL::JobNamePage(this, _jobs_manager);
 
   setPage(Page_JobName, _job_name_page);
-  setPage(Page_BatchParameters, new BL::BatchParametersPage(this, salome_services));
+  setPage(Page_BatchParameters, new BL::BatchParametersPage(this));
 
   // For COORM
   setPage(Page_COORM_BatchParameters, new BL::COORM_BatchParametersPage(this, salome_services));
 
-  setPage(Page_Files, new BL::FilesPage(this));
+  setPage(Page_Files, new BL::FilesPage(this, salome_services));
   setPage(Page_Resource, new BL::ResourcePage(this, salome_services));
   setPage(Page_Conclusion, new BL::ConclusionPage(this));
 
@@ -640,127 +643,30 @@ BL::CommandMainPage::nextId() const
   return BL::CreateJobWizard::Page_Resource;
 }
 
-BL::BatchParametersPage::BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services)
-: QWizardPage(parent)
+BL::BatchParametersPage::BatchParametersPage(QWidget * parent)
+: QWizardPage(parent),
+  ui(new Ui::ResourceRequirementsWizardPage)
 {
-  setTitle("Enter Batch Parameters");
-  resource_choosed = "";
-
-  _salome_services = salome_services;
-
-  QLabel *label = new QLabel("In this step you define the parameters of your job");
-  label->setWordWrap(true);
-  QVBoxLayout * main_layout = new QVBoxLayout;
-  main_layout->addWidget(label);
-
-  // batch_directory
-  QLabel * label_directory = new QLabel("Remote work directory: ");
-  QLineEdit * line_directory = new QLineEdit(this);
-  registerField("batch_directory", line_directory);
-
-  // exected during time
-  QLabel * label_duration = new QLabel("Time limit: ");
-  QSpinBox * spin_duration_hour = new QSpinBox(this);
-  QLabel * label_duration_hour = new QLabel("Hours");
-  spin_duration_hour->setMinimum(0);
-  spin_duration_hour->setMaximum(1000000);
-  registerField("duration_hour", spin_duration_hour);
-  QSpinBox * spin_duration_min = new QSpinBox(this);
-  QLabel * label_duration_min = new QLabel("Minutes");
-  spin_duration_min->setMinimum(0);
-  spin_duration_min->setMaximum(59);
-  registerField("duration_min", spin_duration_min);
-
-  // memory
-  QLabel * label_memory = new QLabel("Memory per node: ");
-  QSpinBox * spin_memory = new QSpinBox(this);
-  spin_memory->setMinimum(0);
-  spin_memory->setMaximum(1000000);
-  registerField("mem_value", spin_memory);
-  QComboBox * combo_memory = new QComboBox(this);
-  combo_memory->addItem("MB");
-  combo_memory->addItem("GB");
-  combo_memory->setCurrentIndex(1);
-  registerField("mem_type", combo_memory);
-
-  // proc
-  QLabel * label_proc = new QLabel("Number of cores: ");
-  QSpinBox * spin_proc = new QSpinBox(this);
-  spin_proc->setMinimum(1);
-  spin_proc->setMaximum(1000000);
-  registerField("proc_value", spin_proc);
-
-  // exclusive
-  QLabel * label_exclusive = new QLabel("Exclusive (do not share nodes with other jobs): ");
-  QCheckBox * check_exclusive = new QCheckBox(this);
-  check_exclusive->setChecked(true);
-  registerField("exclusive", check_exclusive);
-
-  QGridLayout *layout = new QGridLayout;
-  layout->addWidget(label_directory, 0, 0);
-  layout->addWidget(line_directory, 0, 1, 1, -1);
-  layout->addWidget(label_duration, 1, 0);
-  layout->addWidget(spin_duration_hour, 1, 1);
-  layout->addWidget(label_duration_hour, 1, 2);
-  layout->addWidget(spin_duration_min, 1, 3);
-  layout->addWidget(label_duration_min, 1, 4);
-  layout->addWidget(label_memory, 2, 0);
-  layout->addWidget(spin_memory, 2, 1);
-  layout->addWidget(combo_memory, 2, 2);
-  layout->addWidget(label_proc, 3, 0);
-  layout->addWidget(spin_proc, 3, 1);
-  layout->addWidget(label_exclusive, 4, 0);
-  layout->addWidget(check_exclusive, 4, 1);
-
-  main_layout->insertLayout(-1, layout);
-
-  setLayout(main_layout);
+  ui->setupUi(this);
+
+  registerField("duration_hour", ui->spin_duration_hour);
+  registerField("duration_min", ui->spin_duration_min);
+  registerField("mem_value", ui->spin_memory);
+  registerField("mem_type", ui->combo_memory);
+  registerField("proc_value", ui->spin_proc);
+  registerField("exclusive", ui->check_exclusive);
 };
 
 BL::BatchParametersPage::~BatchParametersPage()
-{}
-
-void BL::BatchParametersPage::cleanupPage() {}
-
-void
-BL::BatchParametersPage::initializePage()
 {
-  QString f_resource_choosed = field("resource_choosed").toString();
-  if (f_resource_choosed != resource_choosed)
-  {
-    resource_choosed = f_resource_choosed;
-    // If choosed resource has a working_directory set
-    // Generates a default remote working directory
-    BL::ResourceDescr resource_descr = _salome_services->getResourceDescr(resource_choosed.toStdString());
-    QString res_work_dir = resource_descr.working_directory.c_str();
-    if (res_work_dir != "")
-    {
-      time_t rawtime;
-      time(&rawtime);
-      std::string launch_date = ctime(&rawtime);
-      for (int i = 0; i < launch_date.size(); i++)
-        if (launch_date[i] == '/' ||
-            launch_date[i] == '-' ||
-            launch_date[i] == ':' ||
-            launch_date[i] == ' ')
-          launch_date[i] = '_';
-      launch_date.erase(--launch_date.end()); // Last caracter is a \n
-      QString date = launch_date.c_str();
-      setField("batch_directory", res_work_dir + "/" + date);
-    }
-  }
+  delete ui;
 }
 
+void BL::BatchParametersPage::cleanupPage() {}
+
 bool
 BL::BatchParametersPage::validatePage()
 {
-  QString batch_directory = field("batch_directory").toString();
-  if (batch_directory == "")
-  {
-    QMessageBox::warning(NULL, "Batch Directory Error", "Please enter a batch directory");
-    return false;
-  }
-
   int mem = field("mem_value").toInt();
   if (mem == 0)
   {
@@ -893,96 +799,93 @@ BL::COORM_BatchParametersPage::initializePage()
   }
 }
 
-BL::FilesPage::FilesPage(BL::CreateJobWizard * parent)
-: QWizardPage(parent)
+BL::FilesPage::FilesPage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services)
+: QWizardPage(parent),
+  ui(new Ui::FilesWizardPage)
 {
-  setTitle("Enter Input and Output Files");
+  ui->setupUi(this);
 
-  QLabel * main_label = new QLabel("In this step you define input and output files of your job");
-  main_label->setWordWrap(true);
+  resource_choosed = "";
+  _salome_services = salome_services;
+
+  connect(ui->add_input_files_button, SIGNAL(clicked()), this, SLOT(choose_input_files()));
+  connect(ui->remove_input_files_button, SIGNAL(clicked()), this, SLOT(remove_input_files()));
+  connect(ui->input_files_list, SIGNAL(itemSelectionChanged()), this, SLOT(input_itemSelectionChanged()));
+  connect(ui->add_output_files_button, SIGNAL(clicked()), this, SLOT(add_output_file()));
+  connect(ui->remove_output_files_button, SIGNAL(clicked()), this, SLOT(remove_output_files()));
+  connect(ui->output_files_list, SIGNAL(itemSelectionChanged()), this, SLOT(output_itemSelectionChanged()));
+  connect(ui->button_choose_result_dir, SIGNAL(clicked()), this, SLOT(choose_local_directory()));
 
-  // input_files
-  QGroupBox * input_group_box = new QGroupBox("Input Files");
-  _input_files_button = new QPushButton("Add input files");
-  _input_files_button->show();
-  connect(_input_files_button, SIGNAL(clicked()), this, SLOT(choose_input_files()));
-  _remove_input_files_button = new QPushButton("Remove input files");
-  _remove_input_files_button->show();
-  _remove_input_files_button->setEnabled(false);
-  connect(_remove_input_files_button, SIGNAL(clicked()), this, SLOT(remove_input_files()));
-  _input_files_list = new QListWidget();
-  _input_files_list->setSelectionMode(QAbstractItemView::MultiSelection);
-  connect(_input_files_list, SIGNAL(itemSelectionChanged()), this, SLOT(input_itemSelectionChanged()));
-
-  QGridLayout * input_box = new QGridLayout;
-  input_box->addWidget(_input_files_button, 0, 0);
-  input_box->addWidget(_remove_input_files_button, 0, 1);
-  input_box->addWidget(_input_files_list, 1, 0, 1, -1);
-  input_group_box->setLayout(input_box);
-
-  // output_files
-  QGroupBox * output_group_box = new QGroupBox("Output Files");
-  _output_files_button = new QPushButton("Add output file");
-  _output_files_button->show();
-  connect(_output_files_button, SIGNAL(clicked()), this, SLOT(add_output_file()));
-  _remove_output_files_button = new QPushButton("Remove output files");
-  _remove_output_files_button->show();
-  _remove_output_files_button->setEnabled(false);
-  connect(_remove_output_files_button, SIGNAL(clicked()), this, SLOT(remove_output_files()));
-  _output_files_list = new QListWidget();
-  _output_files_list->setSelectionMode(QAbstractItemView::MultiSelection);
-  _output_files_list->setEditTriggers(QAbstractItemView::DoubleClicked);
-  connect(_output_files_list, SIGNAL(itemSelectionChanged()), this, SLOT(output_itemSelectionChanged()));
-
-  // Results Directory
-  QPushButton * button_result = new QPushButton("Local Result directory");
-  connect(button_result, SIGNAL(clicked()), this, SLOT(choose_local_directory()));
-  _result_directory = new QLineEdit(this);
+  registerField("batch_directory", ui->line_remote_working_dir);
+  registerField("result_directory", ui->line_result_dir);
 
   // Default result directory is home directory (if we found it)
   // First try -> HOME
 #ifdef WNT
-  _result_directory->setText(getenv("HOME"));
+  ui->line_result_dir->setText(getenv("HOME"));
 #else
   if (getenv("HOME"))
-    _result_directory->setText(getenv("HOME"));
+    ui->line_result_dir->setText(getenv("HOME"));
   else {
     // Second try -> getpwuid
     struct passwd * pass_struct = getpwuid(getuid());
     if (pass_struct)
-      _result_directory->setText(pass_struct->pw_dir);
+      ui->line_result_dir->setText(pass_struct->pw_dir);
   }
 #endif
-  registerField("result_directory", _result_directory);
-
-  QGridLayout * output_box = new QGridLayout;
-  output_box->addWidget(_output_files_button, 0, 0);
-  output_box->addWidget(_remove_output_files_button, 0, 1);
-  output_box->addWidget(_output_files_list, 1, 0, 1, -1);
-  output_box->addWidget(button_result, 2, 0);
-  output_box->addWidget(_result_directory, 2, 1, 1, -1);
-  output_group_box->setLayout(output_box);
-
-  QVBoxLayout * main_layout = new QVBoxLayout;
-  main_layout->addWidget(main_label);
-  main_layout->addWidget(input_group_box);
-  main_layout->addWidget(output_group_box);
-  setLayout(main_layout);
 
-  parent->setFilesList(_input_files_list, _output_files_list);
+  parent->setFilesList(ui->input_files_list, ui->output_files_list);
 };
 
 BL::FilesPage::~FilesPage()
-{}
+{
+  delete ui;
+}
+
+void
+BL::FilesPage::initializePage()
+{
+  QString f_resource_choosed = field("resource_choosed").toString();
+  if (f_resource_choosed != resource_choosed)
+  {
+    resource_choosed = f_resource_choosed;
+    // If choosed resource has a working_directory set
+    // Generates a default remote working directory
+    BL::ResourceDescr resource_descr = _salome_services->getResourceDescr(resource_choosed.toStdString());
+    QString res_work_dir = resource_descr.working_directory.c_str();
+    if (res_work_dir != "")
+    {
+      time_t rawtime;
+      time(&rawtime);
+      std::string launch_date = ctime(&rawtime);
+      for (int i = 0; i < launch_date.size(); i++)
+        if (launch_date[i] == '/' ||
+            launch_date[i] == '-' ||
+            launch_date[i] == ':' ||
+            launch_date[i] == ' ')
+          launch_date[i] = '_';
+      launch_date.erase(--launch_date.end()); // Last caracter is a \n
+      QString date = launch_date.c_str();
+      setField("batch_directory", res_work_dir + "/" + date);
+    }
+  }
+}
 
 bool
 BL::FilesPage::validatePage()
 {
+  QString batch_directory = field("batch_directory").toString();
+  if (batch_directory == "")
+  {
+    QMessageBox::warning(NULL, "Batch Directory Error", "Please enter a batch directory");
+    return false;
+  }
+
   QString result_directory = field("result_directory").toString();
   
-  for (int i = 0; i < _output_files_list->count(); ++i)
+  for (int i = 0; i < ui->output_files_list->count(); ++i)
   {
-    QListWidgetItem * item = _output_files_list->item(i);
+    QListWidgetItem * item = ui->output_files_list->item(i);
     if (item->text() == "TO EDIT!")
     {
       QMessageBox::warning(NULL, "Ouput Files Error", "Some output files are not defined !");
@@ -990,7 +893,7 @@ BL::FilesPage::validatePage()
     }
   }
 
-  if (result_directory == "" && _output_files_list->count() != 0)
+  if (result_directory == "" && ui->output_files_list->count() != 0)
   {
     QMessageBox::warning(NULL, "Result Directory Error", "Please enter a result directory or remove output files");
     return false;
@@ -1007,8 +910,8 @@ BL::FilesPage::choose_input_files()
                                                     tr("All Files (*)"));
   for (int i = 0; i < files.size(); ++i) 
   {
-    if (_input_files_list->findItems(files.at(i), Qt::MatchFixedString).size() == 0)
-      _input_files_list->addItem(files.at(i));
+    if (ui->input_files_list->findItems(files.at(i), Qt::MatchFixedString).size() == 0)
+      ui->input_files_list->addItem(files.at(i));
   }
 }
 
@@ -1021,27 +924,27 @@ BL::FilesPage::choose_local_directory()
                                                  | QFileDialog::DontResolveSymlinks);
 
   if (dir != "")
-    _result_directory->setText(dir);
+    ui->line_result_dir->setText(dir);
 }
 
 void 
 BL::FilesPage::remove_input_files()
 {
-  QList<QListWidgetItem *> list = _input_files_list->selectedItems();
+  QList<QListWidgetItem *> list = ui->input_files_list->selectedItems();
   for (int i = 0; i < list.size(); ++i)
   {
-    int row = _input_files_list->row( list.at(i) );
-    delete _input_files_list->takeItem(row);
+    int row = ui->input_files_list->row( list.at(i) );
+    delete ui->input_files_list->takeItem(row);
   }
 }
 
 void 
 BL::FilesPage::input_itemSelectionChanged()
 {
-  if (_input_files_list->selectedItems().size() > 0)
-    _remove_input_files_button->setEnabled(true);
+  if (ui->input_files_list->selectedItems().size() > 0)
+    ui->remove_input_files_button->setEnabled(true);
   else
-    _remove_input_files_button->setEnabled(false);
+    ui->remove_input_files_button->setEnabled(false);
 }
 
 void
@@ -1049,27 +952,27 @@ BL::FilesPage::add_output_file()
 {
   QListWidgetItem * new_item = new QListWidgetItem("TO EDIT!");
   new_item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEditable|Qt::ItemIsUserCheckable|Qt::ItemIsEnabled);
-  _output_files_list->addItem(new_item);
+  ui->output_files_list->addItem(new_item);
 }
 
 void 
 BL::FilesPage::remove_output_files()
 {
-  QList<QListWidgetItem *> list = _output_files_list->selectedItems();
+  QList<QListWidgetItem *> list = ui->output_files_list->selectedItems();
   for (int i = 0; i < list.size(); ++i)
   {
-    int row = _output_files_list->row( list.at(i) );
-    delete _output_files_list->takeItem(row);
+    int row = ui->output_files_list->row( list.at(i) );
+    delete ui->output_files_list->takeItem(row);
   }
 }
 
 void 
 BL::FilesPage::output_itemSelectionChanged()
 {
-  if (_output_files_list->selectedItems().size() > 0)
-    _remove_output_files_button->setEnabled(true);
+  if (ui->output_files_list->selectedItems().size() > 0)
+    ui->remove_output_files_button->setEnabled(true);
   else
-    _remove_output_files_button->setEnabled(false);
+    ui->remove_output_files_button->setEnabled(false);
 }
 
 int 
index cbdcdbe2d0a1959ae524b11cfff2ee271adda3d1..b1f5c67d581d79376d0faca0da696f469d074a9a 100644 (file)
 #include <string>
 #include <list>
 
+namespace Ui {
+  class ResourceRequirementsWizardPage;
+  class FilesWizardPage;
+}
+
 namespace BL{
 
   class JobsManager_QT;
@@ -149,17 +154,15 @@ namespace BL{
     Q_OBJECT
 
     public:
-      BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
+      BatchParametersPage(QWidget * parent);
       virtual ~BatchParametersPage();
 
       virtual bool validatePage();
       virtual int nextId() const;
       virtual void cleanupPage();
-      virtual void initializePage();
 
     private:
-      BL::SALOMEServices * _salome_services;
-      QString resource_choosed;
+      Ui::ResourceRequirementsWizardPage * ui;
   };
 
   // For COORM
@@ -190,9 +193,10 @@ namespace BL{
     Q_OBJECT
 
     public:
-      FilesPage(BL::CreateJobWizard * parent);
+      FilesPage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
       virtual ~FilesPage();
 
+      virtual void initializePage();
       virtual int nextId() const;
       virtual bool validatePage();
       virtual void cleanupPage() {}
@@ -208,14 +212,9 @@ namespace BL{
       void output_itemSelectionChanged();
 
     private:
-      QPushButton * _input_files_button;
-      QPushButton * _remove_input_files_button;
-      QListWidget * _input_files_list;
-      QLineEdit * _result_directory;
-
-      QPushButton * _output_files_button;
-      QPushButton * _remove_output_files_button;
-      QListWidget * _output_files_list;
+      Ui::FilesWizardPage * ui;
+      BL::SALOMEServices * _salome_services;
+      QString resource_choosed;
   };
 
   class ResourcePage: public QWizardPage
diff --git a/src/genericgui/FilesWizardPage.ui b/src/genericgui/FilesWizardPage.ui
new file mode 100644 (file)
index 0000000..fa76f59
--- /dev/null
@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>FilesWizardPage</class>
+ <widget class="QWizardPage" name="FilesWizardPage">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>602</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>WizardPage</string>
+  </property>
+  <property name="title">
+   <string>Files and Directories</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_5">
+   <item>
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string>Input Files</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <item>
+       <widget class="QListWidget" name="input_files_list">
+        <property name="selectionMode">
+         <enum>QAbstractItemView::MultiSelection</enum>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <layout class="QVBoxLayout" name="verticalLayout">
+        <item>
+         <spacer name="verticalSpacer">
+          <property name="orientation">
+           <enum>Qt::Vertical</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>20</width>
+            <height>40</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item>
+         <widget class="QPushButton" name="add_input_files_button">
+          <property name="text">
+           <string>+</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QPushButton" name="remove_input_files_button">
+          <property name="enabled">
+           <bool>false</bool>
+          </property>
+          <property name="text">
+           <string>-</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="verticalSpacer_2">
+          <property name="orientation">
+           <enum>Qt::Vertical</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>20</width>
+            <height>40</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_2">
+     <property name="title">
+      <string>Output Files</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_2">
+      <item>
+       <widget class="QListWidget" name="output_files_list">
+        <property name="selectionMode">
+         <enum>QAbstractItemView::MultiSelection</enum>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <layout class="QVBoxLayout" name="verticalLayout_2">
+        <item>
+         <spacer name="verticalSpacer_3">
+          <property name="orientation">
+           <enum>Qt::Vertical</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>20</width>
+            <height>40</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item>
+         <widget class="QPushButton" name="add_output_files_button">
+          <property name="text">
+           <string>+</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QPushButton" name="remove_output_files_button">
+          <property name="enabled">
+           <bool>false</bool>
+          </property>
+          <property name="text">
+           <string>-</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="verticalSpacer_4">
+          <property name="orientation">
+           <enum>Qt::Vertical</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>20</width>
+            <height>40</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_3">
+     <property name="title">
+      <string>Directories</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_4">
+      <item>
+       <layout class="QVBoxLayout" name="verticalLayout_4">
+        <item>
+         <widget class="QLabel" name="label">
+          <property name="text">
+           <string>Remote Working Directory:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLabel" name="label_2">
+          <property name="text">
+           <string>Local Result Directory:</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QVBoxLayout" name="verticalLayout_3">
+        <item>
+         <widget class="QLineEdit" name="line_remote_working_dir"/>
+        </item>
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_3">
+          <item>
+           <widget class="QLineEdit" name="line_result_dir"/>
+          </item>
+          <item>
+           <widget class="QPushButton" name="button_choose_result_dir">
+            <property name="text">
+             <string>...</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
index ba91fd298c15dfd4732cf276a2239095dab03866..666f79b0bbce4cefa211b90395c58febe869ff25 100644 (file)
@@ -41,7 +41,15 @@ MOC_FILES =                          BL_GenericGui_moc.cxx BL_JobsTable_moc.cxx
                                     BL_Summary_moc.cxx JM_ResourceCatalog_moc.cxx \
                                     JM_SalomeResource_moc.cxx JM_EditSalomeResource_moc.cxx
 
-nodist_libBL_GenericGui_la_SOURCES = $(MOC_FILES)
+UIC_FILES = ui_ResourceRequirementsWizardPage.hxx \
+            ui_FilesWizardPage.hxx
+
+nodist_libBL_GenericGui_la_SOURCES = $(MOC_FILES) $(UIC_FILES)
+
+BUILT_SOURCES = $(MOC_FILES) $(UIC_FILES)
+
+# extra distributed files
+EXTRA_DIST = $(UIC_FILES:ui_%.hxx=%.ui)
 
 libBL_GenericGui_la_CXXFLAGS = $(qt4_cppflags) \
                               -I$(top_srcdir)/src/bases \
@@ -65,8 +73,12 @@ SUFFIXES = .hxx _moc.cxx .qrc _qrc.cxx
 .qrc_qrc.cxx :
        $(QT_RCC) -name $(*F)  $< -o $@
 
+# qt forms files generation (uic)
+ui_%.hxx: %.ui
+       $(QT_UIC) -o $@ $<
+
 clean-local-qt :
-       rm -f *_moc.cxx *_qrc.cxx ui_*.h
+       rm -f *_moc.cxx *_qrc.cxx ui_*.hxx
 
 clean-local: clean-local-qt
 
diff --git a/src/genericgui/ResourceRequirementsWizardPage.ui b/src/genericgui/ResourceRequirementsWizardPage.ui
new file mode 100644 (file)
index 0000000..bca7c53
--- /dev/null
@@ -0,0 +1,315 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ResourceRequirementsWizardPage</class>
+ <widget class="QWizardPage" name="ResourceRequirementsWizardPage">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>512</width>
+    <height>325</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>WizardPage</string>
+  </property>
+  <property name="title">
+   <string>Resource Requirements and Limits</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_6">
+   <item>
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string>Computing Resources</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout">
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout">
+        <item>
+         <widget class="QLabel" name="label">
+          <property name="text">
+           <string>Number of cores:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="spin_proc">
+          <property name="minimum">
+           <number>1</number>
+          </property>
+          <property name="maximum">
+           <number>1000000000</number>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="check_exclusive">
+        <property name="text">
+         <string>Exclusive (do not share nodes with other jobs)</string>
+        </property>
+        <property name="checked">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_2">
+     <property name="title">
+      <string>Time</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_3">
+      <item>
+       <layout class="QVBoxLayout" name="verticalLayout_3">
+        <item>
+         <widget class="QLabel" name="label_2">
+          <property name="text">
+           <string>Time limit:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="verticalSpacer">
+          <property name="orientation">
+           <enum>Qt::Vertical</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>20</width>
+            <height>40</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QVBoxLayout" name="verticalLayout_2">
+        <item>
+         <widget class="QRadioButton" name="radioButton">
+          <property name="enabled">
+           <bool>false</bool>
+          </property>
+          <property name="text">
+           <string>Default</string>
+          </property>
+          <attribute name="buttonGroup">
+           <string notr="true">timeButtonGroup</string>
+          </attribute>
+         </widget>
+        </item>
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_2">
+          <item>
+           <widget class="QRadioButton" name="radioButton_2">
+            <property name="text">
+             <string/>
+            </property>
+            <property name="checked">
+             <bool>true</bool>
+            </property>
+            <attribute name="buttonGroup">
+             <string notr="true">timeButtonGroup</string>
+            </attribute>
+           </widget>
+          </item>
+          <item>
+           <widget class="QSpinBox" name="spin_duration_hour">
+            <property name="minimum">
+             <number>0</number>
+            </property>
+            <property name="maximum">
+             <number>1000000000</number>
+            </property>
+            <property name="value">
+             <number>0</number>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLabel" name="label_3">
+            <property name="text">
+             <string>Hour(s)</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QSpinBox" name="spin_duration_min">
+            <property name="minimum">
+             <number>0</number>
+            </property>
+            <property name="maximum">
+             <number>59</number>
+            </property>
+            <property name="value">
+             <number>10</number>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QLabel" name="label_4">
+            <property name="text">
+             <string>Minute(s)</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <spacer name="verticalSpacer_3">
+          <property name="orientation">
+           <enum>Qt::Vertical</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>20</width>
+            <height>40</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_3">
+     <property name="title">
+      <string>Memory</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_5">
+      <item>
+       <layout class="QVBoxLayout" name="verticalLayout_5">
+        <item>
+         <widget class="QLabel" name="label_5">
+          <property name="text">
+           <string>Memory limit / required:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="verticalSpacer_2">
+          <property name="orientation">
+           <enum>Qt::Vertical</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>20</width>
+            <height>40</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QVBoxLayout" name="verticalLayout_4">
+        <item>
+         <widget class="QRadioButton" name="radioButton_3">
+          <property name="enabled">
+           <bool>false</bool>
+          </property>
+          <property name="text">
+           <string>Default</string>
+          </property>
+          <attribute name="buttonGroup">
+           <string notr="true">memoryButtonGroup</string>
+          </attribute>
+         </widget>
+        </item>
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_4">
+          <item>
+           <widget class="QRadioButton" name="radioButton_4">
+            <property name="text">
+             <string/>
+            </property>
+            <property name="checked">
+             <bool>true</bool>
+            </property>
+            <attribute name="buttonGroup">
+             <string notr="true">memoryButtonGroup</string>
+            </attribute>
+           </widget>
+          </item>
+          <item>
+           <widget class="QSpinBox" name="spin_memory">
+            <property name="minimum">
+             <number>1</number>
+            </property>
+            <property name="maximum">
+             <number>1000000000</number>
+            </property>
+            <property name="value">
+             <number>1</number>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QComboBox" name="combo_memory">
+            <property name="currentIndex">
+             <number>1</number>
+            </property>
+            <item>
+             <property name="text">
+              <string>MB</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>GB</string>
+             </property>
+            </item>
+           </widget>
+          </item>
+          <item>
+           <widget class="QComboBox" name="comboBox_2">
+            <property name="enabled">
+             <bool>false</bool>
+            </property>
+            <item>
+             <property name="text">
+              <string>per node</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>per core</string>
+             </property>
+            </item>
+           </widget>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <spacer name="verticalSpacer_4">
+          <property name="orientation">
+           <enum>Qt::Vertical</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>20</width>
+            <height>40</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+ <buttongroups>
+  <buttongroup name="memoryButtonGroup"/>
+  <buttongroup name="timeButtonGroup"/>
+ </buttongroups>
+</ui>