From 478bdd130ac7330341b24d44b25b7ccfaf3911ff Mon Sep 17 00:00:00 2001 From: Ovidiu Mircescu Date: Thu, 10 Oct 2019 10:56:20 +0200 Subject: [PATCH] Button 'Default parameters'. --- src/gui/QuickConfig.cxx | 11 ++++++++++- src/gui/QuickConfig.hxx | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gui/QuickConfig.cxx b/src/gui/QuickConfig.cxx index 4db989e..dfbf7a4 100644 --- a/src/gui/QuickConfig.cxx +++ b/src/gui/QuickConfig.cxx @@ -39,9 +39,13 @@ QuickConfigWidget::QuickConfigWidget(ydefx::JobParametersProxy& model, connect(resourcesComboBox, SIGNAL(currentIndexChanged( const QString &)), this, SLOT(updateResource( const QString &))); + QPushButton* resetBtn = new QPushButton(tr("Default parameters")); + connect(resetBtn,SIGNAL(clicked()),this, SLOT(resetParams())); + QLabel * resourcesLabel = new QLabel(tr("Computing resource:")); hLayout->addWidget(resourcesLabel); hLayout->addWidget(resourcesComboBox); + hLayout->addWidget(resetBtn); mainLayout->addLayout(hLayout); QLabel *nb_branchesLabel = new QLabel(tr("Number of parallel evaluations:")); @@ -83,7 +87,12 @@ void QuickConfigWidget::updateJobName(const QString& value) void QuickConfigWidget::updateResource(const QString& value) { - _model.configureResource(value.toStdString()); + _model.resource_name(value.toStdString()); +} + +void QuickConfigWidget::resetParams() +{ + _model.configureResource(_model.resource_name()); emit defaultNbBranches(_model.nb_branches()); emit defaultWorkingDir(_model.work_directory().c_str()); emit defaultWcKey(_model.wckey().c_str()); diff --git a/src/gui/QuickConfig.hxx b/src/gui/QuickConfig.hxx index 71ee8af..8dc06eb 100644 --- a/src/gui/QuickConfig.hxx +++ b/src/gui/QuickConfig.hxx @@ -34,6 +34,7 @@ public slots: void updateJobName(const QString& value); void updateResource(const QString& value); void updateNbBranches(int value); + void resetParams(); signals: void defaultNbBranches(int value); -- 2.39.2