X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FParametersQtDialog.cxx;h=409f4e7288c5f3ff844e7bd46b72cdb1e532276a;hb=1bf710541f1f708f9000096a8d516596bf009d6d;hp=456704b0300f2c1fc8e0613ce8307139737de05b;hpb=c3a83f9e38129c9efd40de5ab09aca14c731f371;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/ParametersQtDialog.cxx b/lib/cpPlugins/Interface/ParametersQtDialog.cxx index 456704b..409f4e7 100644 --- a/lib/cpPlugins/Interface/ParametersQtDialog.cxx +++ b/lib/cpPlugins/Interface/ParametersQtDialog.cxx @@ -65,6 +65,7 @@ int cpPlugins::Interface::ParametersQtDialog:: exec( ) { this->_updateWidgets( ); + this->updateView( ); int ret = this->QDialog::exec( ); if( ret == 1 ) @@ -268,6 +269,26 @@ updateView( ) } // rof } +// ------------------------------------------------------------------------- +void cpPlugins::Interface::ParametersQtDialog:: +_addButtons( ) +{ + // Add buttons + this->m_Buttons = new QDialogButtonBox( + QDialogButtonBox::Ok | QDialogButtonBox::Cancel + ); + this->connect( + this->m_Buttons, SIGNAL( accepted( ) ), this, SLOT( accept( ) ) + ); + this->connect( + this->m_Buttons, SIGNAL( rejected( ) ), this, SLOT( reject( ) ) + ); + this->m_ToolsLayout->addWidget( this->m_Buttons ); + + this->updateView( ); + this->m_WidgetsUpdated = true; +} + // ------------------------------------------------------------------------- void cpPlugins::Interface::ParametersQtDialog:: _updateWidgets( ) @@ -278,7 +299,10 @@ _updateWidgets( ) // Set dialog title auto filter = this->m_Parameters->GetProcessObject( ); std::stringstream title; - title << "Parameters for \"" << filter->GetName( ) << "\""; + title + << "Parameters for an object of class \"" + << filter->GetClassName( ) + << "\""; this->m_Title->setText( title.str( ).c_str( ) ); // Put values @@ -512,21 +536,8 @@ _updateWidgets( ) } // rof - // Add buttons - this->m_Buttons = new QDialogButtonBox( - QDialogButtonBox::Ok | QDialogButtonBox::Cancel - ); - this->connect( - this->m_Buttons, SIGNAL( accepted( ) ), this, SLOT( accept( ) ) - ); - this->connect( - this->m_Buttons, SIGNAL( rejected( ) ), this, SLOT( reject( ) ) - ); - this->m_ToolsLayout->addWidget( this->m_Buttons ); - // Update values - this->updateView( ); - this->m_WidgetsUpdated = true; + this->_addButtons( ); } // -------------------------------------------------------------------------