void
DelegateConfigWrapper::closed( QAbstractButton* b )
{
    QDialogButtonBox* buttons = qobject_cast< QDialogButtonBox* >( sender() );

    if ( buttons->standardButton( b ) == QDialogButtonBox::Help )
        return;

    if ( buttons->standardButton( b ) == QDialogButtonBox::Ok )
    {
        // TODO: probably should be hidden behind testConfig() in cpp accounts
        m_widget->resetErrors();
        m_widget->checkForErrors();
        if( !m_widget->settingsValid() )
        {
            foreach( const QString& error, m_widget->errors() )
            {
                QMessageBox::warning( this, tr( "Config Error" ) , error );
            }

            return;
        }
void
DelegateConfigWrapper::closed( QAbstractButton* b )
{
    // let the config widget live to see another day
    layout()->removeWidget( m_widget );
    m_widget->setParent( 0 );
    m_widget->setVisible( false );

    QDialogButtonBox* buttons = qobject_cast< QDialogButtonBox* >( sender() );
    if ( buttons->standardButton( b ) == QDialogButtonBox::Ok )
        done( QDialog::Accepted );
    else if ( b == m_deleteButton )
    {
        m_deleted = true;
        emit closedWithDelete();
        reject();
    }
    else
        done( QDialog::Rejected );
}