10#include "generalinfowidget.h"
11#include "../widgets/imagewidget.h"
12#include "blogfeedwidget.h"
13#include "categorieseditwidget.h"
14#include "mail/maillistwidget.h"
15#include "messageformattingwidget.h"
16#include "messaging/messaginglistwidget.h"
17#include "namewidget.h"
18#include "nicknamewidget.h"
19#include "phone/phonelistwidget.h"
20#include "web/weblistwidget.h"
21#include <KLocalizedString>
22#include <KPluginFactory>
27GeneralInfoWidget::GeneralInfoWidget(
QWidget *parent)
29 , mPhoneListWidget(new PhoneListWidget(this))
30 , mWebListWidget(new WebListWidget(this))
31 , mMessagingListWidget(new MessagingListWidget(this))
32 , mMailListWidget(new MailListWidget(this))
33 , mPhotoWidget(new ImageWidget(ImageWidget::Photo))
34 , mNameWidget(new NameWidget(this))
35 , mNickNameWidget(new NicknameWidget(this))
36 , mBlogFeedWidget(new BlogfeedWidget(this))
37 , mMessageFormattingWidget(new MessageFormattingWidget(this))
44 photoLayout->addWidget(mPhotoWidget);
45 photoLayout->addStretch(1);
54 leftLayout->addWidget(mNameWidget);
57 rightLayout->addWidget(mNickNameWidget);
60 leftLayout->addWidget(mPhoneListWidget);
63 leftLayout->addWidget(mWebListWidget);
66 rightLayout->addWidget(mMessagingListWidget);
69 rightLayout->addWidget(mMailListWidget);
71 auto categoryWidget =
new QWidget(
this);
72 auto categoryWidgetLayout =
new QVBoxLayout(categoryWidget);
73 categoryWidgetLayout->setContentsMargins({});
77 categoryWidgetLayout->addWidget(mCategoriesWidget);
78 leftLayout->addWidget(categoryWidget);
81 rightLayout->addWidget(mBlogFeedWidget);
83 mMessageFormattingWidget->setObjectName(
QLatin1StringView(
"mMessageFormattingWidget"));
84 leftLayout->addWidget(mMessageFormattingWidget);
86 leftLayout->addStretch(1);
87 rightLayout->addStretch(1);
90GeneralInfoWidget::~GeneralInfoWidget() =
default;
92void GeneralInfoWidget::setDisplayType(DisplayNameEditWidget::DisplayType type)
94 mNameWidget->setDisplayType(type);
97DisplayNameEditWidget::DisplayType GeneralInfoWidget::displayType()
const
99 return mNameWidget->displayType();
104 mPhoneListWidget->loadContact(contact);
105 mWebListWidget->loadContact(contact);
106 mMessagingListWidget->loadContact(contact);
107 mMailListWidget->loadContact(contact);
108 mNameWidget->loadContact(contact);
109 mNickNameWidget->loadContact(contact);
110 mBlogFeedWidget->loadContact(contact);
111 mPhotoWidget->loadContact(contact);
112 mCategoriesWidget->loadContact(contact);
113 mMessageFormattingWidget->loadContact(contact);
118 mPhoneListWidget->storeContact(contact);
119 mWebListWidget->storeContact(contact);
120 mMessagingListWidget->storeContact(contact);
121 mMailListWidget->storeContact(contact);
122 mNameWidget->storeContact(contact);
123 mNickNameWidget->storeContact(contact);
124 mBlogFeedWidget->storeContact(contact);
125 mPhotoWidget->storeContact(contact);
126 mCategoriesWidget->storeContact(contact);
127 mMessageFormattingWidget->storeContact(contact);
130void GeneralInfoWidget::setReadOnly(
bool readOnly)
132 mPhoneListWidget->setReadOnly(readOnly);
133 mWebListWidget->setReadOnly(readOnly);
134 mMessagingListWidget->setReadOnly(readOnly);
135 mMailListWidget->setReadOnly(readOnly);
136 mNameWidget->setReadOnly(readOnly);
137 mNickNameWidget->setReadOnly(readOnly);
138 mPhotoWidget->setReadOnly(readOnly);
139 mCategoriesWidget->setReadOnly(readOnly);
140 mMessageFormattingWidget->setReadOnly(readOnly);
141 mBlogFeedWidget->setReadOnly(readOnly);
144#include "moc_generalinfowidget.cpp"
A widget for editing the display name of a contact.
void addLayout(QLayout *layout, int stretch)