From e1fc0c15a97b725eae69bc77e21d2399768b681a Mon Sep 17 00:00:00 2001 From: ribes Date: Fri, 22 Jan 2010 16:02:33 +0000 Subject: [PATCH] - Bug in files list - Improvement of Job Wizard --- src/genericgui/BL_CreateJobWizard.cxx | 25 +++++++++++++++++++------ src/genericgui/BL_CreateJobWizard.hxx | 2 ++ src/genericgui/BL_JobTab.cxx | 2 ++ 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/genericgui/BL_CreateJobWizard.cxx b/src/genericgui/BL_CreateJobWizard.cxx index 189b419..eed2df2 100644 --- a/src/genericgui/BL_CreateJobWizard.cxx +++ b/src/genericgui/BL_CreateJobWizard.cxx @@ -420,7 +420,7 @@ BL::BatchParametersPage::BatchParametersPage(QWidget * parent) main_layout->addWidget(label); // batch_directory - QLabel * label_directory = new QLabel("Batch directory: "); + QLabel * label_directory = new QLabel("Remote work directory: "); QLineEdit * line_directory = new QLineEdit(this); registerField("batch_directory", line_directory); @@ -554,16 +554,17 @@ BL::FilesPage::FilesPage(BL::CreateJobWizard * parent) connect(_output_files_list, SIGNAL(itemSelectionChanged()), this, SLOT(output_itemSelectionChanged())); // Results Directory - QLabel * label_result_directory = new QLabel("Result directory: "); - QLineEdit * result_directory = new QLineEdit(this); - registerField("result_directory", result_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("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(label_result_directory, 2, 0); - output_box->addWidget(result_directory, 2, 1, 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; @@ -621,6 +622,18 @@ BL::FilesPage::choose_input_files() } } +void +BL::FilesPage::choose_local_directory() +{ + QString dir = QFileDialog::getExistingDirectory(this, tr("Choose local result directory"), + "", + QFileDialog::ShowDirsOnly + | QFileDialog::DontResolveSymlinks); + + if (dir != "") + _result_directory->setText(dir); +} + void BL::FilesPage::remove_input_files() { diff --git a/src/genericgui/BL_CreateJobWizard.hxx b/src/genericgui/BL_CreateJobWizard.hxx index 609c1eb..76ede8e 100644 --- a/src/genericgui/BL_CreateJobWizard.hxx +++ b/src/genericgui/BL_CreateJobWizard.hxx @@ -141,6 +141,7 @@ namespace BL{ void choose_input_files(); void remove_input_files(); void input_itemSelectionChanged(); + void choose_local_directory(); void add_output_file(); void remove_output_files(); @@ -150,6 +151,7 @@ namespace BL{ 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; diff --git a/src/genericgui/BL_JobTab.cxx b/src/genericgui/BL_JobTab.cxx index 5c8cab4..f73de58 100644 --- a/src/genericgui/BL_JobTab.cxx +++ b/src/genericgui/BL_JobTab.cxx @@ -192,6 +192,8 @@ BL::JobTab::job_selected(const QModelIndex & index) _job_em_label_value->setText(QString(batch_params.expected_memory.c_str())); _job_nop_label_value->setText(QVariant(batch_params.nb_proc).toString()); + _input_files_list->clear(); + _output_files_list->clear(); std::list::iterator it; for (it = files_params.input_files_list.begin(); it != files_params.input_files_list.end(); it++) { -- 2.39.2