26 #include <tdeabc/secrecy.h> 27 #include <kcombobox.h> 30 #include "secrecywidget.h" 32 SecrecyWidget::SecrecyWidget( TQWidget *parent, const char *name ) 33 : TQWidget( parent, name ) 35 TQVBoxLayout *layout = new TQVBoxLayout( this, KDialog::marginHint(), 36 KDialog::spacingHint() ); 37 mSecrecyCombo = new KComboBox( this ); 38 layout->addWidget( mSecrecyCombo ); 40 const TDEABC::Secrecy::TypeList list = TDEABC::Secrecy::typeList(); 41 TDEABC::Secrecy::TypeList::ConstIterator it; 42 for ( it = list.begin(); it != list.end(); ++it ) 43 mSecrecyCombo->insertItem( TDEABC::Secrecy::typeLabel( *it ), *it ); 45 connect( mSecrecyCombo, TQ_SIGNAL( activated( const TQString& ) ), 46 TQ_SIGNAL( changed() ) ); 49 SecrecyWidget::~SecrecyWidget() 53 void SecrecyWidget::setReadOnly( bool readOnly ) 55 mSecrecyCombo->setEnabled( !readOnly ); 58 void SecrecyWidget::setSecrecy( const TDEABC::Secrecy &secrecy ) 60 if ( secrecy.type() != TDEABC::Secrecy::Invalid ) 61 mSecrecyCombo->setCurrentItem( secrecy.type() ); 64 TDEABC::Secrecy SecrecyWidget::secrecy() const 66 TDEABC::Secrecy secrecy; 67 secrecy.setType( mSecrecyCombo->currentItem() ); 72 #include "secrecywidget.moc"
|