]> SALOME platform Git repositories - tools/ydefx.git/commitdiff
Salome HOME
Button 'Default parameters'.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 10 Oct 2019 08:56:20 +0000 (10:56 +0200)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 10 Oct 2019 08:56:20 +0000 (10:56 +0200)
src/gui/QuickConfig.cxx
src/gui/QuickConfig.hxx

index 4db989ee92c76f9d441a8e75ff68145f98d53d0b..dfbf7a401763c31237e1ea5cbbf540ca62dcd722 100644 (file)
@@ -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());
index 71ee8af660a7efc8bbbbeef6e1f0276a574b8046..8dc06eb479e7ca6e1050d6f9461052f3f02669e1 100644 (file)
@@ -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);