From d873e6192a48a312722f4b75ff9d03a854dbe986 Mon Sep 17 00:00:00 2001 From: ribes Date: Wed, 11 May 2011 11:51:46 +0000 Subject: [PATCH] Two small bug fixes --- src/genericgui/BL_CreateJobWizard.cxx | 2 +- src/genericgui/BL_JobsManager_QT.cxx | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/genericgui/BL_CreateJobWizard.cxx b/src/genericgui/BL_CreateJobWizard.cxx index e0d3e97..5099984 100644 --- a/src/genericgui/BL_CreateJobWizard.cxx +++ b/src/genericgui/BL_CreateJobWizard.cxx @@ -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); diff --git a/src/genericgui/BL_JobsManager_QT.cxx b/src/genericgui/BL_JobsManager_QT.cxx index b8c0de8..8eb64d1 100644 --- a/src/genericgui/BL_JobsManager_QT.cxx +++ b/src/genericgui/BL_JobsManager_QT.cxx @@ -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"); -- 2.39.2