]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
Two small bug fixes
authorribes <ribes>
Wed, 11 May 2011 11:51:46 +0000 (11:51 +0000)
committerribes <ribes>
Wed, 11 May 2011 11:51:46 +0000 (11:51 +0000)
src/genericgui/BL_CreateJobWizard.cxx
src/genericgui/BL_JobsManager_QT.cxx

index e0d3e97611dfc3b896ce6fefc8b0a094016a5d9e..5099984399f92b41723a4f7bb39c3004a5153491 100644 (file)
@@ -904,7 +904,7 @@ BL::ResourcePage::ResourcePage(BL::CreateJobWizard * parent, BL::SALOMEServices
   _resource_choosed->setReadOnly(true);
   registerField("resource_choosed", _resource_choosed);
 
-  QLabel * bqLabel = new QLabel("Batch Queue (optional):");
+  QLabel * bqLabel = new QLabel("Batch Queue (could be optional):");
   QLineEdit * _bqLineEdit = new QLineEdit(this);
   registerField("batch_queue", _bqLineEdit);
 
index b8c0de80ab22f3d3dfa5ba5aee23b5b5ce7ea0d0..8eb64d1bd49afe00c5e939c3ab97a556cbc4db9a 100644 (file)
@@ -120,9 +120,26 @@ void
 BL::JobsManager_QT::save_jobs_button()
 {
   DEBTRACE("save_jobs");
-  QString jobs_file = QFileDialog::getSaveFileName(this,
-                                                   tr("Choose an xml jobs file"), "",
-                                                   tr("xml (*.xml);;All Files (*)"));
+  QFileDialog dialog(this, "Save jobs file");
+  QStringList filters;
+  filters << "XML files (*.xml)"
+          << "Any files (*)";
+  dialog.setFileMode(QFileDialog::AnyFile);
+  dialog.setFilters(filters);
+  dialog.selectFilter("(*.xml)");
+  dialog.setDefaultSuffix("xml");
+  dialog.setConfirmOverwrite(true);
+  dialog.setAcceptMode(QFileDialog::AcceptSave);
+  QString jobs_file("");
+  QStringList fileNames;
+  fileNames.clear();
+  if (bool ret = dialog.exec())
+  {
+    DEBTRACE(ret << " " << dialog.confirmOverwrite());
+    fileNames = dialog.selectedFiles();
+    if (!fileNames.isEmpty())
+      jobs_file= fileNames.first();
+  }
   if (jobs_file == "")
   {
     write_normal_text("Save jobs action cancelled\n");