akonadi
20 #include "collectiongeneralpropertiespage_p.h"
22 #include "collection.h"
23 #include "entitydisplayattribute.h"
24 #include "collectionstatistics.h"
25 #include "collectionutils_p.h"
28 #include <klocalizedstring.h>
35 CollectionGeneralPropertiesPage::CollectionGeneralPropertiesPage(QWidget *parent)
38 setObjectName(QLatin1String(
"Akonadi::CollectionGeneralPropertiesPage"));
40 setPageTitle(i18nc(
"@title:tab general properties page",
"General"));
44 void CollectionGeneralPropertiesPage::load(
const Collection &collection)
53 if (displayName.isEmpty()) {
54 ui.nameEdit->setText(collection.name());
56 ui.nameEdit->setText(displayName);
59 #ifndef KDEPIM_MOBILE_UI
60 if (iconName.isEmpty()) {
61 ui.customIcon->setIcon(CollectionUtils::defaultIconName(collection));
63 ui.customIcon->setIcon(iconName);
65 ui.customIconCheckbox->setChecked(!iconName.isEmpty());
68 if (collection.statistics().count() >= 0) {
69 ui.countLabel->setText(i18ncp(
"@label",
"One object",
"%1 objects",
70 collection.statistics().count()));
71 ui.sizeLabel->setText(KGlobal::locale()->formatByteSize(collection.statistics().size()));
77 void CollectionGeneralPropertiesPage::save(
Collection &collection)
83 collection.setName(ui.nameEdit->text());
86 #ifndef KDEPIM_MOBILE_UI
87 if (ui.customIconCheckbox->isChecked()) {
97 #include "moc_collectiongeneralpropertiespage_p.cpp"
Represents a collection of PIM items.
Attribute that stores the properties that are used to display an entity.
QString displayName() const
Returns the name that should be used for display.
@ AddIfMissing
Creates the attribute if it is missing.
A single page in a collection properties dialog.
FreeBusyManager::Singleton.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Jul 28 2020 00:00:00 by
doxygen 1.8.18 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.