<commit_before>/*=========================================================================

  Program:   ORFEO Toolbox
  Language:  C++
  Date:      $Date$
  Version:   $Revision$


  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
  See OTBCopyright.txt for details.


     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#include "otbWrapperQtWidgetParameterBase.h"

namespace otb
{
namespace Wrapper
{

QtWidgetParameterBase::QtWidgetParameterBase(Parameter * param, QtWidgetModel* m)
  : m_Model(m), m_Param(param)
{
}

QtWidgetParameterBase::~QtWidgetParameterBase()
{
}

void QtWidgetParameterBase::CreateWidget()
{
  this->DoCreateWidget();
}

void QtWidgetParameterBase::UpdateGUI()
{
  //
 this->DoUpdateGUI();

 // Emit State of the Parameter to update this paramter checkbox
 bool state = m_Param->GetActive();
 emit ParameterActiveStatus(state);
}



void QtWidgetParameterBase::ParameterChanged(const QString& key)<commit_msg>ENH: checkbox relative to mandatory params must always be checked and inactive (dont emit the signal changing the checkbox if mandatory)<commit_after>/*=========================================================================

  Program:   ORFEO Toolbox
  Language:  C++
  Date:      $Date$
  Version:   $Revision$


  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
  See OTBCopyright.txt for details.


     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#include "otbWrapperQtWidgetParameterBase.h"

namespace otb
{
namespace Wrapper
{

QtWidgetParameterBase::QtWidgetParameterBase(Parameter * param, QtWidgetModel* m)
  : m_Model(m), m_Param(param)
{
}

QtWidgetParameterBase::~QtWidgetParameterBase()
{
}

void QtWidgetParameterBase::CreateWidget()
{
  this->DoCreateWidget();
}

void QtWidgetParameterBase::UpdateGUI()
{
  //
 this->DoUpdateGUI();

 // Emit State of the Parameter to update this paramter checkbox
 if (!m_Param->GetMandatory())
   {
   bool state = m_Param->GetActive();
   emit ParameterActiveStatus(state);
   }
}



void QtWidgetParameterBase::ParameterChanged(const QString& key)
{'fraction_non_alphanumeric': 0.19281811085089773, 'fraction_numerical': 0.0, 'mean_word_length': 5.359801488833747, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '977989', 'n_tokens_mistral': 689, 'n_tokens_neox': 647, 'n_words': 199}