NamePartWidget::NamePartWidget( const QString &title, const QString &label, QWidget *parent, const char *name ) : QGroupBox( title, parent ) , mTitle( title ) , mLabel( label ) { setObjectName( name ); QHBoxLayout *layout = new QHBoxLayout( this ); layout->setSpacing( KDialog::spacingHint() ); layout->setMargin( KDialog::marginHint() ); mBox = new QListWidget( this ); connect( mBox, SIGNAL( currentItemChanged( QListWidgetItem *, QListWidgetItem * ) ), SLOT( selectionChanged( QListWidgetItem * ) ) ); layout->addWidget( mBox ); KDialogButtonBox *bbox = new KDialogButtonBox( this, Qt::Vertical ); mAddButton = bbox->addButton( i18n( "Add..." ), QDialogButtonBox::ActionRole, this, SLOT( add() ) ); mEditButton = bbox->addButton( i18n( "Edit..." ), QDialogButtonBox::ActionRole, this, SLOT( edit() ) ); mEditButton->setEnabled( false ); mRemoveButton = bbox->addButton( i18n( "Remove" ), QDialogButtonBox::ActionRole, this, SLOT( remove() ) ); mRemoveButton->setEnabled( false ); bbox->layout(); layout->addWidget( bbox ); }