+ QFrame* frame = new QFrame( this );
+ QHBoxLayout* layout = new QHBoxLayout( frame );
+ QLineEdit* v_string = new QLineEdit( frame );
+ v_string->setObjectName( pIt->first.c_str( ) );
+ v_string->setText( pIt->second.second.c_str( ) );
+ QPushButton* v_button = new QPushButton( frame );
+ v_button->setObjectName( ( pIt->first + "_=?btn" ).c_str( ) );
+ v_button->setText( "+" );
+ v_button->connect(
+ v_button, SIGNAL( clicked( ) ),
+ this, SLOT( _dlg_AddUint( ) )
+ );
+ layout->addWidget( v_string );
+ layout->addWidget( v_button );
+ w_input = frame;
+ }
+ break;
+ case Parameters::RealList:
+ {
+ QFrame* frame = new QFrame( this );
+ QHBoxLayout* layout = new QHBoxLayout( frame );
+ QLineEdit* v_string = new QLineEdit( frame );
+ v_string->setObjectName( pIt->first.c_str( ) );
+ v_string->setText( pIt->second.second.c_str( ) );
+ QPushButton* v_button = new QPushButton( frame );
+ v_button->setObjectName( ( pIt->first + "_=?btn" ).c_str( ) );
+ v_button->setText( "+" );
+ v_button->connect(
+ v_button, SIGNAL( clicked( ) ),
+ this, SLOT( _dlg_AddReal( ) )
+ );
+ layout->addWidget( v_string );
+ layout->addWidget( v_button );
+ w_input = frame;
+ }
+ break;
+ case Parameters::OpenFileNameList:
+ {
+ QFrame* frame = new QFrame( this );
+ QHBoxLayout* layout = new QHBoxLayout( frame );
+ QLineEdit* v_string = new QLineEdit( frame );
+ v_string->setObjectName( pIt->first.c_str( ) );
+ v_string->setMaxLength( std::numeric_limits< int >::max( ) );
+ v_string->setText( pIt->second.second.c_str( ) );
+ QPushButton* v_button = new QPushButton( frame );
+ v_button->setObjectName( ( pIt->first + "_=?btn" ).c_str( ) );
+ v_button->setText( "..." );
+ v_button->connect(
+ v_button, SIGNAL( clicked( ) ),
+ this, SLOT( _dlg_OpenMultipleFiles( ) )
+ );
+ layout->addWidget( v_string );
+ layout->addWidget( v_button );
+ w_input = frame;
+ }
+ break;
+ case Parameters::SaveFileNameList:
+ break;
+ case Parameters::PathNameList:
+ break;
+ case Parameters::Choices:
+ {
+ QComboBox* v_choices = new QComboBox( this );
+ v_choices->setObjectName( pIt->first.c_str( ) );
+
+ std::istringstream str0( pIt->second.second );
+ std::string choices;
+ std::getline( str0, choices, '@' );
+ std::istringstream str1( choices );
+ std::string token;
+ int id = 0;
+ while( std::getline( str1, token, '#' ) )
+ v_choices->insertItem( id++, token.c_str( ) );
+ w_input = v_choices;
+ }
+ break;
+ default:
+ w_input = NULL;
+ break;
+ } // hctiws
+
+ // Ok, a representation was created
+ if( w_input != NULL )
+ {
+ QHBoxLayout* new_layout = new QHBoxLayout( );
+ QLabel* label = new QLabel( this );
+ label->setText( QString( pIt->first.c_str( ) ) );
+ new_layout->addWidget( label );
+ new_layout->addWidget( w_input );
+ this->m_ToolsLayout->addLayout( new_layout );
+
+ } // fi
+
+ } // rof
+
+ // Update values
+ this->_addButtons( );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::ParametersQtDialog::
+_dlg_OpenSingleFile( )
+{
+ QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
+ if( btn != NULL )
+ {
+ std::string bName = btn->objectName( ).toStdString( );
+ std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
+ QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
+ if( line != NULL )
+ {
+ std::string param_name = line->objectName( ).toStdString( );
+ if( param_name != "" )
+ {
+ std::string param_value =
+ this->m_Parameters->GetOpenFileName( param_name );
+ if( param_value == "" )
+ param_value = ".";
+ QStringList dialog_filters;
+ std::string extensions =
+ this->m_Parameters->GetAcceptedFileExtensions( param_name );
+ if( extensions != "" )
+ dialog_filters << extensions.c_str( );
+ dialog_filters << "Any file (*)";
+
+ // Show dialog and check if it was accepted
+ QFileDialog dialog( this );
+ dialog.setFileMode( QFileDialog::ExistingFile );
+ dialog.setDirectory( QFileDialog::tr( param_value.c_str( ) ) );
+ dialog.setNameFilters( dialog_filters );
+ dialog.setAcceptMode( QFileDialog::AcceptOpen );
+ if( dialog.exec( ) )
+ line->setText( *( dialog.selectedFiles( ).begin( ) ) );
+
+ } // fi
+
+ } // fi
+
+ } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::ParametersQtDialog::
+_dlg_SaveSingleFile( )
+{
+ QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
+ if( btn != NULL )
+ {
+ std::string bName = btn->objectName( ).toStdString( );
+ std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
+ QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
+ if( line != NULL )
+ {
+ std::string param_name = line->objectName( ).toStdString( );
+ if( param_name != "" )
+ {
+ std::string param_value =
+ this->m_Parameters->GetSaveFileName( param_name );
+ if( param_value == "" )
+ param_value = ".";
+ QStringList dialog_filters;
+ std::string extensions =
+ this->m_Parameters->GetAcceptedFileExtensions( param_name );
+ if( extensions != "" )
+ dialog_filters << extensions.c_str( );
+ dialog_filters << "Any file (*)";
+
+ // Show dialog and check if it was accepted
+ QFileDialog dialog( this );
+ dialog.setFileMode( QFileDialog::AnyFile );
+ dialog.setDirectory( QFileDialog::tr( param_value.c_str( ) ) );
+ dialog.setNameFilters( dialog_filters );
+ dialog.setAcceptMode( QFileDialog::AcceptSave );
+ if( dialog.exec( ) )
+ line->setText( *( dialog.selectedFiles( ).begin( ) ) );
+
+ } // fi
+
+ } // fi
+
+ } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::ParametersQtDialog::
+_dlg_OpenSinglePath( )
+{
+ QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
+ if( btn != NULL )
+ {
+ std::string bName = btn->objectName( ).toStdString( );
+ std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
+ QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
+ if( line != NULL )
+ {
+ std::string param_name = line->objectName( ).toStdString( );
+ if( param_name != "" )
+ {
+ std::string param_value =
+ this->m_Parameters->GetPathName( param_name );
+ if( param_value == "" )
+ param_value = ".";
+
+ // Show dialog and check if it was accepted
+ QFileDialog dialog( this );
+ dialog.setFileMode( QFileDialog::Directory );
+ dialog.setDirectory( QFileDialog::tr( param_value.c_str( ) ) );
+ dialog.setAcceptMode( QFileDialog::AcceptOpen );
+ if( dialog.exec( ) )
+ line->setText( *( dialog.selectedFiles( ).begin( ) ) );
+
+ } // fi
+
+ } // fi
+
+ } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::ParametersQtDialog::
+_dlg_OpenMultipleFiles( )
+{
+ QPushButton* btn = dynamic_cast< QPushButton* >( this->sender( ) );
+ if( btn != NULL )
+ {
+ std::string bName = btn->objectName( ).toStdString( );
+ std::string line_name = bName.substr( 0, bName.find( "_=?btn" ) );
+
+ QLineEdit* line = this->findChild< QLineEdit* >( line_name.c_str( ) );
+ if( line != NULL )
+ {
+ std::string param_name = line->objectName( ).toStdString( );
+ if( param_name != "" )