From: Ovidiu Mircescu Date: Thu, 10 Oct 2019 08:56:20 +0000 (+0200) Subject: Button 'Default parameters'. X-Git-Tag: V9_4_0rc1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=478bdd130ac7330341b24d44b25b7ccfaf3911ff;p=tools%2Fydefx.git Button 'Default parameters'. --- 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);