27 #include <tdelocale.h>
31 #include "addresseeeditorwidget.h"
32 #include "simpleaddresseeeditor.h"
34 #include "addresseeeditorextension.h"
36 AddresseeEditorExtension::AddresseeEditorExtension( KAB::Core *core, TQWidget *parent, const char *name )
37 : KAB::ExtensionWidget( core, parent, name )
39 TQVBoxLayout *layout = new TQVBoxLayout( this );
41 if ( KABPrefs::instance()->editorType() == KABPrefs::SimpleEditor )
42 mAddresseeEditor = new SimpleAddresseeEditor( this );
44 mAddresseeEditor = new AddresseeEditorWidget( this );
46 layout->addWidget( mAddresseeEditor );
49 AddresseeEditorExtension::~AddresseeEditorExtension()
53 void AddresseeEditorExtension::contactsSelectionChanged()
55 const TDEABC::Addressee::List selectedAddressees = selectedContacts();
56 TDEABC::Addressee::List modifiedAddress;
57 if ( mAddresseeEditor->dirty() ) {
58 mAddresseeEditor->save();
59 addressees.append( mAddresseeEditor->addressee() );
60 modifiedAddress = addressees;
61 TQTimer::singleShot(0, this, TQ_SLOT(emitModifiedAddresses()));
64 mAddresseeEditor->setAddressee( selectedAddressees[ 0 ] );
67 void AddresseeEditorExtension::emitModifiedAddresses()
69 emit modified( addressees );
72 TQString AddresseeEditorExtension::title() const
74 return i18n( "Contact Editor" );
77 TQString AddresseeEditorExtension::identifier() const
79 return "contact_editor";
82 #include "addresseeeditorextension.moc"
|