9#include "personaleditorwidget.h"
12#include <KLocalizedString>
16#include "dateeditwidget.h"
18#include <KContacts/Addressee>
22PersonalEditorWidget::PersonalEditorWidget(
QWidget *parent)
24 , mBirthdateWidget(new DateEditWidget(DateEditWidget::Birthday, this))
25 , mAnniversaryWidget(new DateEditWidget(DateEditWidget::Anniversary, this))
29 auto label =
new QLabel(
i18nc(
"@label The birthdate of a contact",
"Birthdate:"));
30 mainLayout->addWidget(label, 0, 0);
32 label->setBuddy(mBirthdateWidget);
33 mainLayout->addWidget(mBirthdateWidget, 1, 0);
35 label =
new QLabel(
i18nc(
"@label The wedding anniversary of a contact",
"Anniversary:"));
36 mainLayout->addWidget(label, 0, 1);
38 label->setBuddy(mAnniversaryWidget);
39 mainLayout->addWidget(mAnniversaryWidget, 1, 1);
41 label =
new QLabel(
i18nc(
"@label The partner's name of a contact",
"Partner's name:"));
42 mainLayout->addWidget(label, 0, 2);
44 mPartnerWidget->setPlaceholderText(
i18nc(
"@info:placeholder",
"Add name"));
45 mPartnerWidget->setTrapReturnKey(
true);
46 label->setBuddy(mPartnerWidget);
47 mainLayout->addWidget(mPartnerWidget, 1, 2);
48 mainLayout->setColumnStretch(1, 1);
49 mainLayout->setColumnStretch(0, 1);
50 mainLayout->setColumnStretch(2, 1);
52 mainLayout->setRowStretch(2, 1);
55PersonalEditorWidget::~PersonalEditorWidget() =
default;
66void PersonalEditorWidget::storeContact(KContacts::Addressee &contact)
75void PersonalEditorWidget::setReadOnly(
bool readOnly)
78 mBirthdateWidget->setReadOnly(readOnly);
79 mAnniversaryWidget->setReadOnly(readOnly);
82 mPartnerWidget->setReadOnly(readOnly);
85#include "moc_personaleditorwidget.cpp"
QString i18nc(const char *context, const char *text, const TYPE &arg...)
A widget for editing the display name of a contact.
QString label(StandardShortcut id)