22#include "contacteditorwidget.h"
24#include "addresseditwidget.h"
25#include "categorieseditwidget.h"
26#include "contacteditorpageplugin.h"
27#include "contactmetadata_p.h"
28#include "customfieldseditwidget.h"
29#include "dateeditwidget.h"
30#include "displaynameeditwidget.h"
31#include "emaileditwidget.h"
32#include "freebusyeditwidget.h"
33#include "geoeditwidget.h"
34#include "imagewidget.h"
35#include "imeditwidget.h"
36#include "nameeditwidget.h"
37#include "phoneeditwidget.h"
38#include "soundeditwidget.h"
41#include <kconfiggroup.h>
43#include <klocalizedstring.h>
44#include <kstandarddirs.h>
45#include <ktabwidget.h>
48#include <QtCore/QDirIterator>
49#include <QtCore/QPluginLoader>
55class ContactEditorWidget::Private
59 : mDisplayMode(displayMode), mParent( parent ), mCustomFieldsWidget(0)
64 void initGuiContactTab();
65 void initGuiLocationTab();
66 void initGuiBusinessTab();
67 void initGuiPersonalTab();
68 void initGuiNotesTab();
69 void initGuiCustomFieldsTab();
71 void loadCustomPages();
73 QString loadCustom(
const KABC::Addressee &contact,
const QString &key )
const;
74 void storeCustom( KABC::Addressee &contact,
const QString &key,
const QString &value )
const;
78 KTabWidget *mTabWidget;
82 ImageWidget *mPhotoWidget;
84 KLineEdit *mNickNameWidget;
85 SoundEditWidget *mPronunciationWidget;
89 KLineEdit *mHomepageWidget;
90 KLineEdit *mBlogWidget;
98 KComboBox* mMailPreferFormatting;
99 QCheckBox *mAllowRemoteContent;
105 GeoEditWidget *mCoordinatesWidget;
108 ImageWidget *mLogoWidget;
109 KLineEdit *mOrganizationWidget;
110 KLineEdit *mProfessionWidget;
111 KLineEdit *mTitleWidget;
112 KLineEdit *mDepartmentWidget;
113 KLineEdit *mOfficeWidget;
114 KLineEdit *mManagerWidget;
115 KLineEdit *mAssistantWidget;
118 FreeBusyEditWidget *mFreeBusyWidget;
121 KTextEdit *mNotesWidget;
124 DateEditWidget *mBirthdateWidget;
125 DateEditWidget *mAnniversaryWidget;
128 KLineEdit *mPartnerWidget;
131 CustomFieldsEditWidget *mCustomFieldsWidget;
134 QList<Akonadi::ContactEditorPagePlugin*> mCustomPages;
137void ContactEditorWidget::Private::initGui()
139 QVBoxLayout *layout =
new QVBoxLayout( mParent );
140 layout->setMargin( 0 );
142 mTabWidget =
new KTabWidget( mParent );
143 layout->addWidget( mTabWidget );
146 initGuiLocationTab();
147 initGuiBusinessTab();
148 initGuiPersonalTab();
151 initGuiCustomFieldsTab();
156void ContactEditorWidget::Private::initGuiContactTab()
158 QWidget *widget =
new QWidget;
159 QGridLayout *layout =
new QGridLayout( widget );
161 mTabWidget->addTab( widget, i18nc(
"@title:tab",
"Contact" ) );
163 QGroupBox *nameGroupBox =
new QGroupBox( i18nc(
"@title:group Name related properties of a contact",
"Name" ) );
164 QGroupBox *internetGroupBox =
new QGroupBox( i18nc(
"@title:group",
"Internet" ) );
165 QGroupBox *phonesGroupBox =
new QGroupBox( i18nc(
"@title:group",
"Phones" ) );
167 nameGroupBox->setMinimumSize(320,200);
168 layout->addWidget( nameGroupBox, 0, 0 );
169 layout->addWidget( internetGroupBox, 0, 1 );
170 layout->addWidget( phonesGroupBox, 1, 0, 4, 1 );
172 QGridLayout *nameLayout =
new QGridLayout( nameGroupBox );
173 QGridLayout *internetLayout =
new QGridLayout( internetGroupBox );
174 QGridLayout *phonesLayout =
new QGridLayout( phonesGroupBox );
179 label =
new QLabel( i18nc(
"@label The name of a contact",
"Name:" ) );
180 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
181 nameLayout->addWidget( label, 0, 0 );
184 label->setBuddy( mNameWidget );
185 nameLayout->addWidget( mNameWidget, 0, 1 );
187 mPhotoWidget =
new ImageWidget( ImageWidget::Photo );
188 nameLayout->addWidget( mPhotoWidget, 0, 2, 4, 1 );
190 label =
new QLabel( i18nc(
"@label The display name of a contact",
"Display:" ) );
191 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
192 nameLayout->addWidget( label, 1, 0 );
195 label->setBuddy( mDisplayNameWidget );
196 nameLayout->addWidget( mDisplayNameWidget, 1, 1 );
198 label =
new QLabel( i18nc(
"@label The nickname of a contact",
"Nickname:" ) );
199 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
200 nameLayout->addWidget( label, 2, 0 );
202 mNickNameWidget =
new KLineEdit;
203 mNickNameWidget->setTrapReturnKey(
true);
204 label->setBuddy( mNickNameWidget );
205 nameLayout->addWidget( mNickNameWidget, 2, 1 );
207 label =
new QLabel( i18nc(
"@label The pronunciation of a contact's name",
"Pronunciation:" ) );
208 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
209 nameLayout->addWidget( label, 3, 0 );
211 mPronunciationWidget =
new SoundEditWidget;
212 label->setBuddy( mPronunciationWidget );
213 nameLayout->addWidget( mPronunciationWidget, 3, 1 );
215 nameLayout->setRowStretch( 4, 1 );
218 label =
new QLabel( i18nc(
"@label The email address of a contact",
"Email:" ) );
219 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
220 internetLayout->addWidget( label, 0, 0 );
223 label->setBuddy( mEmailWidget );
224 internetLayout->addWidget( mEmailWidget, 0, 1 );
226 label =
new QLabel( i18nc(
"@label The homepage URL of a contact",
"Homepage:" ) );
227 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
228 internetLayout->addWidget( label, 1, 0 );
230 mHomepageWidget =
new KLineEdit;
231 mHomepageWidget->setTrapReturnKey(
true);
232 label->setBuddy( mHomepageWidget );
233 internetLayout->addWidget( mHomepageWidget, 1, 1 );
235 label =
new QLabel( i18nc(
"@label The blog URL of a contact",
"Blog:" ) );
236 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
237 internetLayout->addWidget( label, 2, 0 );
239 mBlogWidget =
new KLineEdit;
240 mBlogWidget->setTrapReturnKey(
true);
241 label->setBuddy( mBlogWidget );
242 internetLayout->addWidget( mBlogWidget, 2, 1 );
244 label =
new QLabel( i18nc(
"@label The instant messaging address of a contact",
"Messaging:" ) );
245 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
246 internetLayout->addWidget( label, 3, 0 );
249 label->setBuddy( mIMWidget );
250 internetLayout->addWidget( mIMWidget, 3, 1 );
252 internetLayout->setRowStretch( 4, 1 );
256 phonesLayout->addWidget( mPhonesWidget, 0, 0 );
261 QHBoxLayout *categoriesLayout =
new QHBoxLayout;
262 label =
new QLabel( i18nc(
"@label The categories of a contact",
"Categories:" ) );
263 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
266 label->setBuddy( mCategoriesWidget );
268 categoriesLayout->addWidget( label );
269 categoriesLayout->addWidget( mCategoriesWidget );
271 layout->addLayout( categoriesLayout, 1, 1 );
273 QGroupBox *receivedMessageGroupBox =
new QGroupBox( i18n(
"Messages") );
274 layout->addWidget( receivedMessageGroupBox, 2, 1 );
276 QVBoxLayout *vbox =
new QVBoxLayout(receivedMessageGroupBox);
278 QHBoxLayout *mailPreferFormattingLayout =
new QHBoxLayout;
279 label =
new QLabel( i18n(
"Show messages received from this contact as:" ) );
280 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
281 mMailPreferFormatting =
new KComboBox;
282 label->setBuddy( mMailPreferFormatting );
283 QStringList listFormat;
284 listFormat << i18n(
"Default" ) << i18n(
"Plain Text" ) << i18n(
"HTML" );
285 mMailPreferFormatting->addItems( listFormat );
286 mailPreferFormattingLayout->addWidget( label );
287 mailPreferFormattingLayout->addWidget( mMailPreferFormatting );
290 vbox->addLayout( mailPreferFormattingLayout );
292 mAllowRemoteContent =
new QCheckBox( i18n(
"Allow remote content in received HTML messages" ) );
293 vbox->addWidget( mAllowRemoteContent );
295 layout->setRowStretch( 4,1 );
298void ContactEditorWidget::Private::initGuiLocationTab()
300 QWidget *widget =
new QWidget;
301 QHBoxLayout *layout =
new QHBoxLayout( widget );
303 mTabWidget->addTab( widget, i18nc(
"@title:tab",
"Location" ) );
305 QGroupBox *addressesGroupBox =
new QGroupBox( i18nc(
"@title:group",
"Addresses" ) );
306 QGroupBox *coordinatesGroupBox =
new QGroupBox( i18nc(
"@title:group",
"Coordinates" ) );
308 layout->addWidget( addressesGroupBox );
309 layout->addWidget( coordinatesGroupBox );
311 QGridLayout *addressesLayout =
new QGridLayout( addressesGroupBox );
312 QGridLayout *coordinatesLayout =
new QGridLayout( coordinatesGroupBox );
316 mAddressesWidget->setMinimumHeight( 200 );
317 addressesLayout->addWidget( mAddressesWidget, 0, 0 );
318 addressesLayout->setRowStretch( 1, 1 );
321 mCoordinatesWidget =
new GeoEditWidget;
322 coordinatesLayout->addWidget( mCoordinatesWidget, 0, 0 );
323 coordinatesLayout->setRowStretch( 1, 1 );
326void ContactEditorWidget::Private::initGuiBusinessTab()
328 QWidget *widget =
new QWidget;
329 QVBoxLayout *layout =
new QVBoxLayout( widget );
331 mTabWidget->addTab( widget, i18nc(
"@title:tab",
"Business" ) );
333 QGroupBox *generalGroupBox =
new QGroupBox( i18nc(
"@title:group General properties of a contact",
"General" ) );
334 QGroupBox *groupwareGroupBox =
new QGroupBox( i18nc(
"@title:group",
"Groupware" ) );
336 layout->addWidget( generalGroupBox );
337 layout->addWidget( groupwareGroupBox );
339 QGridLayout *generalLayout =
new QGridLayout( generalGroupBox );
340 QGridLayout *groupwareLayout =
new QGridLayout( groupwareGroupBox );
345 mLogoWidget =
new ImageWidget( ImageWidget::Logo );
346 generalLayout->addWidget( mLogoWidget, 0, 2, 6, 1, Qt::AlignTop );
348 label =
new QLabel( i18nc(
"@label The organization of a contact",
"Organization:" ) );
349 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
350 generalLayout->addWidget( label, 0, 0 );
352 mOrganizationWidget =
new KLineEdit;
353 mOrganizationWidget->setTrapReturnKey(
true);
354 label->setBuddy( mOrganizationWidget );
355 generalLayout->addWidget( mOrganizationWidget, 0, 1 );
357 label =
new QLabel( i18nc(
"@label The profession of a contact",
"Profession:" ) );
358 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
359 generalLayout->addWidget( label, 1, 0 );
361 mProfessionWidget =
new KLineEdit;
362 mProfessionWidget->setTrapReturnKey(
true);
363 label->setBuddy( mProfessionWidget );
364 generalLayout->addWidget( mProfessionWidget, 1, 1 );
366 label =
new QLabel( i18nc(
"@label The title of a contact",
"Title:" ) );
367 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
368 generalLayout->addWidget( label, 2, 0 );
370 mTitleWidget =
new KLineEdit;
371 mTitleWidget->setTrapReturnKey(
true);
372 label->setBuddy( mTitleWidget );
373 generalLayout->addWidget( mTitleWidget , 2, 1 );
375 label =
new QLabel( i18nc(
"@label The department of a contact",
"Department:" ) );
376 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
377 generalLayout->addWidget( label, 3, 0 );
379 mDepartmentWidget =
new KLineEdit;
380 mDepartmentWidget->setTrapReturnKey(
true);
381 label->setBuddy( mDepartmentWidget );
382 generalLayout->addWidget( mDepartmentWidget, 3, 1 );
384 label =
new QLabel( i18nc(
"@label The office of a contact",
"Office:" ) );
385 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
386 generalLayout->addWidget( label, 4, 0 );
388 mOfficeWidget =
new KLineEdit;
389 mOfficeWidget->setTrapReturnKey(
true);
390 label->setBuddy( mOfficeWidget );
391 generalLayout->addWidget( mOfficeWidget, 4, 1 );
393 label =
new QLabel( i18nc(
"@label The manager's name of a contact",
"Manager's name:" ) );
394 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
395 generalLayout->addWidget( label, 5, 0 );
397 mManagerWidget =
new KLineEdit;
398 mManagerWidget->setTrapReturnKey(
true);
399 label->setBuddy( mManagerWidget );
400 generalLayout->addWidget( mManagerWidget, 5, 1 );
402 label =
new QLabel( i18nc(
"@label The assistant's name of a contact",
"Assistant's name:" ) );
403 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
404 generalLayout->addWidget( label, 6, 0 );
406 mAssistantWidget =
new KLineEdit;
407 mAssistantWidget->setTrapReturnKey(
true);
408 label->setBuddy( mAssistantWidget );
409 generalLayout->addWidget( mAssistantWidget, 6, 1 );
412 label =
new QLabel( i18nc(
"@label The free/busy information of a contact",
"Free/Busy:" ) );
413 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
414 groupwareLayout->addWidget( label, 0, 0 );
416 mFreeBusyWidget =
new FreeBusyEditWidget;
417 label->setBuddy( mFreeBusyWidget );
418 groupwareLayout->addWidget( mFreeBusyWidget, 0, 1 );
419 groupwareLayout->setRowStretch( 1, 1 );
422void ContactEditorWidget::Private::initGuiPersonalTab()
424 QWidget *widget =
new QWidget;
425 QVBoxLayout *layout =
new QVBoxLayout( widget );
427 mTabWidget->addTab( widget, i18nc(
"@title:tab Personal properties of a contact",
"Personal" ) );
429 QGroupBox *datesGroupBox =
new QGroupBox( i18nc(
"@title:group Date related properties of a contact",
"Dates" ) );
430 QGroupBox *familyGroupBox =
new QGroupBox( i18nc(
"@title:group Family related properties of a contact",
"Family" ) );
432 layout->addWidget( datesGroupBox );
433 layout->addWidget( familyGroupBox );
435 QGridLayout *datesLayout =
new QGridLayout( datesGroupBox );
436 QGridLayout *familyLayout =
new QGridLayout( familyGroupBox );
441 label =
new QLabel( i18nc(
"@label The birthdate of a contact",
"Birthdate:" ) );
442 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
443 datesLayout->addWidget( label, 0, 0 );
445 mBirthdateWidget =
new DateEditWidget( DateEditWidget::Birthday );
446 label->setBuddy( mBirthdateWidget );
447 datesLayout->addWidget( mBirthdateWidget, 0, 1 );
449 label =
new QLabel( i18nc(
"@label The wedding anniversary of a contact",
"Anniversary:" ) );
450 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
451 datesLayout->addWidget( label, 1, 0 );
453 mAnniversaryWidget =
new DateEditWidget( DateEditWidget::Anniversary );
454 label->setBuddy( mAnniversaryWidget );
455 datesLayout->addWidget( mAnniversaryWidget, 1, 1 );
457 datesLayout->setRowStretch( 2, 1 );
458 datesLayout->setColumnStretch( 1, 1 );
461 label =
new QLabel( i18nc(
"@label The partner's name of a contact",
"Partner's name:" ) );
462 label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
463 familyLayout->addWidget( label, 0, 0 );
465 mPartnerWidget =
new KLineEdit;
466 mPartnerWidget->setTrapReturnKey(
true);
467 label->setBuddy( mPartnerWidget );
468 familyLayout->addWidget( mPartnerWidget, 0, 1 );
470 familyLayout->setRowStretch( 1, 1 );
473void ContactEditorWidget::Private::initGuiNotesTab()
475 QWidget *widget =
new QWidget;
476 QVBoxLayout *layout =
new QVBoxLayout( widget );
478 mTabWidget->addTab( widget, i18nc(
"@title:tab",
"Notes" ) );
480 mNotesWidget =
new KTextEdit;
481 mNotesWidget->setAcceptRichText(
false);
482 layout->addWidget( mNotesWidget );
485void ContactEditorWidget::Private::initGuiCustomFieldsTab()
487 QWidget *widget =
new QWidget;
488 QVBoxLayout *layout =
new QVBoxLayout( widget );
490 mTabWidget->addTab( widget, i18nc(
"@title:tab",
"Custom Fields" ) );
492 mCustomFieldsWidget =
new CustomFieldsEditWidget;
493 layout->addWidget( mCustomFieldsWidget );
496void ContactEditorWidget::Private::loadCustomPages()
498 qDeleteAll( mCustomPages );
499 mCustomPages.clear();
501 const QString pluginDirectory = KStandardDirs::locate(
"lib", QLatin1String(
"akonadi/contact/editorpageplugins/" ) );
502 QDirIterator it( pluginDirectory, QDir::Files );
503 while ( it.hasNext() ) {
504 QPluginLoader loader( it.next() );
505 if ( !loader.load() ) {
514 mCustomPages.append( plugin );
518 mTabWidget->addTab( plugin, plugin->title() );
522QString ContactEditorWidget::Private::loadCustom(
const KABC::Addressee &contact,
const QString &key )
const
524 return contact.custom( QLatin1String(
"KADDRESSBOOK" ), key );
527void ContactEditorWidget::Private::storeCustom( KABC::Addressee &contact,
const QString &key,
const QString &value )
const
529 if ( value.isEmpty() ) {
530 contact.removeCustom( QLatin1String(
"KADDRESSBOOK" ), key );
532 contact.insertCustom( QLatin1String(
"KADDRESSBOOK" ), key, value );
537 : d( new Private(
FullMode, this ) )
541 connect( d->mNameWidget, SIGNAL(nameChanged(KABC::Addressee)),
542 d->mDisplayNameWidget, SLOT(changeName(KABC::Addressee)) );
543 connect( d->mOrganizationWidget, SIGNAL(textChanged(QString)),
544 d->mDisplayNameWidget, SLOT(changeOrganization(QString)) );
548 : d( new Private( displayMode, this ) )
552 connect( d->mNameWidget, SIGNAL(nameChanged(KABC::Addressee)),
553 d->mDisplayNameWidget, SLOT(changeName(KABC::Addressee)) );
554 connect( d->mOrganizationWidget, SIGNAL(textChanged(QString)),
555 d->mDisplayNameWidget, SLOT(changeOrganization(QString)) );
566 d->mPhotoWidget->loadContact( contact );
568 d->mDisplayNameWidget->loadContact( contact );
569 d->mNickNameWidget->setText( contact.nickName() );
570 d->mPronunciationWidget->loadContact( contact );
573 d->mEmailWidget->loadContact( contact );
574 d->mHomepageWidget->setUrl( contact.url() );
575 d->mBlogWidget->setText( d->loadCustom( contact, QLatin1String(
"BlogFeed" ) ) );
576 d->mIMWidget->loadContact( contact );
582 d->mCategoriesWidget->loadContact( contact );
584 const QString mailPreferedFormatting = d->loadCustom( contact, QLatin1String(
"MailPreferedFormatting" ) );
585 if ( mailPreferedFormatting.isEmpty() ) {
586 d->mMailPreferFormatting->setCurrentIndex( 0 );
587 }
else if ( mailPreferedFormatting == QLatin1String(
"TEXT" ) ) {
588 d->mMailPreferFormatting->setCurrentIndex( 1 );
589 }
else if ( mailPreferedFormatting == QLatin1String(
"HTML" ) ) {
590 d->mMailPreferFormatting->setCurrentIndex( 2 );
592 d->mMailPreferFormatting->setCurrentIndex( 0 );
595 const QString mailAllowToRemoteContent = d->loadCustom( contact, QLatin1String(
"MailAllowToRemoteContent" ) );
596 d->mAllowRemoteContent->setChecked( mailAllowToRemoteContent == QLatin1String(
"TRUE" ) );
599 d->mAddressesWidget->loadContact( contact );
602 d->mCoordinatesWidget->loadContact( contact );
605 d->mLogoWidget->loadContact( contact );
606 d->mOrganizationWidget->setText( contact.organization() );
607 d->mProfessionWidget->setText( d->loadCustom( contact, QLatin1String(
"X-Profession" ) ) );
608 d->mTitleWidget->setText( contact.title() );
609 d->mDepartmentWidget->setText( contact.department() );
610 d->mOfficeWidget->setText( d->loadCustom( contact, QLatin1String(
"X-Office" ) ) );
611 d->mManagerWidget->setText( d->loadCustom( contact, QLatin1String(
"X-ManagersName" ) ) );
612 d->mAssistantWidget->setText( d->loadCustom( contact, QLatin1String(
"X-AssistantsName" ) ) );
615 d->mFreeBusyWidget->loadContact( contact );
618 d->mNotesWidget->setPlainText( contact.note() );
621 d->mBirthdateWidget->setDate( contact.birthday().date() );
622 d->mAnniversaryWidget->setDate( QDate::fromString( d->loadCustom( contact, QLatin1String(
"X-Anniversary" ) ),
626 d->mPartnerWidget->setText( d->loadCustom( contact, QLatin1String(
"X-SpousesName" ) ) );
633 d->mCustomFieldsWidget->loadContact( contact );
637 plugin->loadContact( contact );
645 d->mPhotoWidget->storeContact( contact );
647 d->mDisplayNameWidget->storeContact( contact );
648 contact.setNickName( d->mNickNameWidget->text().trimmed() );
649 d->mPronunciationWidget->storeContact( contact );
652 d->mEmailWidget->storeContact( contact );
653 contact.setUrl( KUrl( d->mHomepageWidget->text().trimmed() ) );
654 d->storeCustom( contact, QLatin1String(
"BlogFeed" ), d->mBlogWidget->text().trimmed() );
655 d->mIMWidget->storeContact( contact );
661 d->mCategoriesWidget->storeContact( contact );
663 QString mailPreferedFormatting;
664 const int index = d->mMailPreferFormatting->currentIndex();
667 }
else if ( index == 1 ) {
668 mailPreferedFormatting = QLatin1String(
"TEXT" );
669 }
else if ( index == 2 ) {
670 mailPreferedFormatting = QLatin1String(
"HTML" );
672 d->storeCustom( contact, QLatin1String(
"MailPreferedFormatting" ), mailPreferedFormatting );
674 QString mailAllowToRemoteContent;
675 if ( d->mAllowRemoteContent->isChecked() ) {
676 mailAllowToRemoteContent = QLatin1String(
"TRUE" );
678 d->storeCustom( contact, QLatin1String(
"MailAllowToRemoteContent" ), mailAllowToRemoteContent );
681 d->mAddressesWidget->storeContact( contact );
684 d->mCoordinatesWidget->storeContact( contact );
687 d->mLogoWidget->storeContact( contact );
688 contact.setOrganization( d->mOrganizationWidget->text() );
689 d->storeCustom( contact, QLatin1String(
"X-Profession" ), d->mProfessionWidget->text().trimmed() );
690 contact.setTitle( d->mTitleWidget->text().trimmed() );
691 contact.setDepartment( d->mDepartmentWidget->text().trimmed() );
692 d->storeCustom( contact, QLatin1String(
"X-Office" ), d->mOfficeWidget->text().trimmed() );
693 d->storeCustom( contact, QLatin1String(
"X-ManagersName" ), d->mManagerWidget->text().trimmed() );
694 d->storeCustom( contact, QLatin1String(
"X-AssistantsName" ), d->mAssistantWidget->text().trimmed() );
697 d->mFreeBusyWidget->storeContact( contact );
700 contact.setNote( d->mNotesWidget->toPlainText() );
703 QDateTime birthday = QDateTime( d->mBirthdateWidget->date(), QTime(), contact.birthday().timeSpec() );
706 birthday.setTime( QTime() );
708 contact.setBirthday( birthday );
709 d->storeCustom( contact, QLatin1String(
"X-Anniversary" ), d->mAnniversaryWidget->date().toString( Qt::ISODate ) );
712 d->storeCustom( contact, QLatin1String(
"X-SpousesName" ), d->mPartnerWidget->text().trimmed() );
716 d->mCustomFieldsWidget->storeContact( contact );
723 plugin->storeContact( contact );
732 d->mPhotoWidget->setReadOnly( readOnly );
733 d->mDisplayNameWidget->setReadOnly( readOnly );
734 d->mNickNameWidget->setReadOnly( readOnly );
735 d->mPronunciationWidget->setReadOnly( readOnly );
738 d->mEmailWidget->setReadOnly( readOnly );
739 d->mHomepageWidget->setReadOnly( readOnly );
740 d->mBlogWidget->setReadOnly( readOnly );
741 d->mIMWidget->setReadOnly( readOnly );
747 d->mCategoriesWidget->setReadOnly( readOnly );
750 d->mMailPreferFormatting->setEnabled( !readOnly );
751 d->mAllowRemoteContent->setEnabled( !readOnly );
754 d->mAddressesWidget->setReadOnly( readOnly );
757 d->mCoordinatesWidget->setReadOnly( readOnly );
760 d->mLogoWidget->setReadOnly( readOnly );
761 d->mOrganizationWidget->setReadOnly( readOnly );
762 d->mProfessionWidget->setReadOnly( readOnly );
763 d->mTitleWidget->setReadOnly( readOnly );
764 d->mDepartmentWidget->setReadOnly( readOnly );
765 d->mOfficeWidget->setReadOnly( readOnly );
766 d->mManagerWidget->setReadOnly( readOnly );
767 d->mAssistantWidget->setReadOnly( readOnly );
770 d->mFreeBusyWidget->setReadOnly( readOnly );
773 d->mNotesWidget->setReadOnly( readOnly );
776 d->mBirthdateWidget->setReadOnly( readOnly );
777 d->mAnniversaryWidget->setReadOnly( readOnly );
780 d->mPartnerWidget->setReadOnly( readOnly );
784 d->mCustomFieldsWidget->setReadOnly( readOnly );
788 plugin->setReadOnly( readOnly );
The base class for custom ContactEditor page plugins.